forked from pool/s390-tools
Accepting request 877835 from Base:System
- Added s390-tools-sles15sp3-zipl-fix-4k-scsi-ipl.patch (bsc#1183039) IPL is not working when bootloader is installed on a SCSI disk with 4k physical blocksize without using a devicemapper target. - Added s390-tools-sles15sp3-remove-no-pie-link-arguments.patch so that we can build on systems with binutils 2.36 and higher. Without this, the build fails because that version of the ld command doesn't recognize "-no-pie" an acceptable argument. - Updated the mkdump.pl script to make the name of the temporary configuration file in /tmp/ unpredictable. (bsc#1182876) - Updated detach_disks.sh to not use predictable temporary file names. (bsc#1182777, CVE-2021-25316) - Made for the following changes for bsc#1182816: * Updated s390-tools-sles15sp3-Format-devices-in-parallel.patch to change all instances of the progress bar from printing "#" to printing the process number of the DASD volume being formatted. * Updated s390-tools-sles15sp3-Implement-Y-yast_mode.patch to print out the numbder of cylinders in a device, as was done in the prior versions of this patch, but was missed when modifying it for SLES15 SP3. * Added s390-tools-sles15sp3-check-return-code-from-util_file_read_l.patch because otherwise a warning message from dasdfmt is being generated that could interfere with YaST properly processing the progress of the formatting process. OBS-URL: https://build.opensuse.org/request/show/877835 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/s390-tools?expand=0&rev=37
This commit is contained in:
commit
7298355cb2
@ -1,11 +1,10 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
COOKIE=$(mcookie)
|
DASDFILE=/tmp/dasd.list.$(mcookie)
|
||||||
DASDFILE=/tmp/dasd.list.${COOKIE}
|
DETFILE=/tmp/detach.disks.$(mcookie)
|
||||||
DETFILE=/tmp/detach.disks.${COOKIE}
|
KEEPFILE=/tmp/keep.disks.$(mcookie)
|
||||||
KEEPFILE=/tmp/keep.disks.${COOKIE}
|
NICFILE=/tmp/nic.list.$(mcookie)
|
||||||
NICFILE=/tmp/nic.list.${COOKIE}
|
FAILFILE=/tmp/error.$(mcookie)
|
||||||
FAILFILE=/tmp/error.${COOKIE}
|
|
||||||
|
|
||||||
function expand_RANGE(){
|
function expand_RANGE(){
|
||||||
local RANGE=${1}
|
local RANGE=${1}
|
||||||
|
@ -43,7 +43,7 @@ my $UDEVADM = "/sbin/udevadm";
|
|||||||
my $ZGETDUMP = "/sbin/zgetdump";
|
my $ZGETDUMP = "/sbin/zgetdump";
|
||||||
|
|
||||||
# temporary DASD device configuration file for Zipl
|
# temporary DASD device configuration file for Zipl
|
||||||
my $MDPATH = "/tmp/mvdump.conf";
|
my $MDPATH = "/tmp/mvdump.conf.".`mcookie`;
|
||||||
# zFCP dump dir, without a leading '/'
|
# zFCP dump dir, without a leading '/'
|
||||||
my $ZFCP_DUMP_DIR = "mydumps";
|
my $ZFCP_DUMP_DIR = "mydumps";
|
||||||
|
|
||||||
@ -386,11 +386,9 @@ sub setup_dasddump
|
|||||||
prepare_dasd(@devices);
|
prepare_dasd(@devices);
|
||||||
|
|
||||||
# create zipl device configuration file
|
# create zipl device configuration file
|
||||||
my $md_path = "/tmp/mvdump.conf";
|
|
||||||
|
|
||||||
# don't create files in debug mode
|
# don't create files in debug mode
|
||||||
unless ($OPT_DEBUG) {
|
unless ($OPT_DEBUG) {
|
||||||
open(my $file, ">", $md_path) or exit_with("Unable to access $md_path: $!.", 15);
|
open(my $file, ">", $MDPATH) or exit_with("Unable to access $MDPATH: $!.", 15);
|
||||||
for my $device (@devices) {
|
for my $device (@devices) {
|
||||||
print{$file}("${device}1\n");
|
print{$file}("${device}1\n");
|
||||||
}
|
}
|
||||||
@ -398,7 +396,7 @@ sub setup_dasddump
|
|||||||
}
|
}
|
||||||
|
|
||||||
print("Creating dump record.\n");
|
print("Creating dump record.\n");
|
||||||
run_cmd("${ZIPL} -V -n -M $md_path");
|
run_cmd("${ZIPL} -V -n -M $MDPATH");
|
||||||
|
|
||||||
cleanup();
|
cleanup();
|
||||||
}
|
}
|
||||||
|
@ -101,6 +101,15 @@ index e7fc501..07c674b 100644
|
|||||||
for (i = barlength + 1; i <= 33; i++)
|
for (i = barlength + 1; i <= 33; i++)
|
||||||
printf("-");
|
printf("-");
|
||||||
printf("|%3d%%", p_new);
|
printf("|%3d%%", p_new);
|
||||||
|
@@ -311,7 +318,7 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
if (g.print_hashmarks && (cyl / g.hashstep - hashcount) != 0) {
|
||||||
|
- printf("#");
|
||||||
|
+ printf("%d|", g.procnum);
|
||||||
|
fflush(stdout);
|
||||||
|
hashcount++;
|
||||||
|
}
|
||||||
@@ -1560,7 +1568,11 @@
|
@@ -1560,7 +1568,11 @@
|
||||||
char *reqsize_param_str = NULL;
|
char *reqsize_param_str = NULL;
|
||||||
char *hashstep_str = NULL;
|
char *hashstep_str = NULL;
|
||||||
|
@ -104,6 +104,15 @@ index 6dd28fa..5b6023a 100644
|
|||||||
printf("ok\n");
|
printf("ok\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1548,6 +1556,8 @@
|
||||||
|
error("%s", str);
|
||||||
|
|
||||||
|
set_geo(&cylinders, &heads);
|
||||||
|
+ if (g.yast_mode)
|
||||||
|
+ printf("%d\n", cylinders);
|
||||||
|
set_label(&vlabel, &format_params, cylinders);
|
||||||
|
|
||||||
|
if (g.check)
|
||||||
@@ -1693,6 +1701,10 @@ int main(int argc, char *argv[])
|
@@ -1693,6 +1701,10 @@ int main(int argc, char *argv[])
|
||||||
case OPT_NODISCARD:
|
case OPT_NODISCARD:
|
||||||
g.no_discard = 1;
|
g.no_discard = 1;
|
||||||
|
@ -0,0 +1,12 @@
|
|||||||
|
--- a/libdasd/dasd_sys.c 2020-10-28 10:31:59.000000000 -0400
|
||||||
|
+++ b/libdasd/dasd_sys.c 2021-02-27 17:41:04.937023501 -0500
|
||||||
|
@@ -218,7 +218,8 @@
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
path = util_path_sysfs("bus/ccw/devices/%s/host_access_count", busid);
|
||||||
|
- util_file_read_l(&value, 10, path);
|
||||||
|
+ if (util_file_read_l(&value, 10, path) == -1)
|
||||||
|
+ value=0;
|
||||||
|
free(path);
|
||||||
|
|
||||||
|
return value;
|
13
s390-tools-sles15sp3-remove-no-pie-link-arguments.patch
Normal file
13
s390-tools-sles15sp3-remove-no-pie-link-arguments.patch
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
--- s390-tools-2.15.1/common.mak 2020-10-28 10:31:59.000000000 -0400
|
||||||
|
+++ s390-tools-2.15.1/common.mak 2021-03-01 11:16:20.285597140 -0500
|
||||||
|
@@ -224,8 +224,8 @@
|
||||||
|
|
||||||
|
ifneq ($(shell $(CC_SILENT) -dumpspecs 2>/dev/null | grep -e '[^f]no-pie'),)
|
||||||
|
NO_PIE_CFLAGS := -fno-pie
|
||||||
|
- NO_PIE_LINKFLAGS := -no-pie
|
||||||
|
- NO_PIE_LDFLAGS := -no-pie
|
||||||
|
+ NO_PIE_LINKFLAGS :=
|
||||||
|
+ NO_PIE_LDFLAGS :=
|
||||||
|
else
|
||||||
|
NO_PIE_CFLAGS :=
|
||||||
|
NO_PIE_LINKFLAGS :=
|
64
s390-tools-sles15sp3-zipl-fix-4k-scsi-ipl.patch
Normal file
64
s390-tools-sles15sp3-zipl-fix-4k-scsi-ipl.patch
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
Subject: [PATCH] [BZ 191696] zipl: fix reading 4k disk's geometry
|
||||||
|
From: Stefan Haberland <sth@linux.ibm.com>
|
||||||
|
|
||||||
|
Description: zipl: fix IPL on 4K SCSI disks
|
||||||
|
Symptom: IPL is not working when bootloader is installed
|
||||||
|
on a SCSI disk with 4k physical blocksize without using
|
||||||
|
a devicemapper target.
|
||||||
|
Problem: The getgeo ioctl that is used reports the partition
|
||||||
|
start in multiple of 512 byte sectors but the blocksize
|
||||||
|
that is used is the physical blocksize of 4k and
|
||||||
|
therefore the calculated partition start does not
|
||||||
|
match. For device mapper targets the zipl-helper script
|
||||||
|
is used that adjusts the partition start correctly to
|
||||||
|
the physical blocksize.
|
||||||
|
Solution: Adjust the partition start depending on the physical
|
||||||
|
blocksize.
|
||||||
|
Reproduction: Use zipl to install a bootloader on a SCSI disk with 4k
|
||||||
|
physical blocksize and without usage of a device mapper
|
||||||
|
target.
|
||||||
|
Upstream-ID: 4a3957fab5696cc410c5b495956859a424e3552a
|
||||||
|
Problem-ID: 191696
|
||||||
|
|
||||||
|
Upstream-Description:
|
||||||
|
|
||||||
|
zipl: fix reading 4k disk's geometry
|
||||||
|
|
||||||
|
On 4k SCSI disks zipl stores wrong values to 'scsi_mbr.program_table_pointer',
|
||||||
|
which makes system unbootable.
|
||||||
|
This happens in 'zipl/src/disk.c:656':
|
||||||
|
|
||||||
|
```
|
||||||
|
/* Convert file system block to physical */
|
||||||
|
*physical = mapped * phy_per_fs + subblock;
|
||||||
|
/* Add partition start */
|
||||||
|
*physical += info->geo.start;
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
So 'hd_geometry.start' should be adjusted before being used.
|
||||||
|
|
||||||
|
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1918723
|
||||||
|
Closes: https://github.com/ibm-s390-linux/s390-tools/pull/107
|
||||||
|
Signed-off-by: Nikita Dubrovskii <nikita@linux.ibm.com>
|
||||||
|
Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
|
||||||
|
Signed-off-by: Jan Hoeppner <hoeppner@linux.ibm.com>
|
||||||
|
|
||||||
|
|
||||||
|
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
|
||||||
|
---
|
||||||
|
zipl/src/disk.c | 3 +++
|
||||||
|
1 file changed, 3 insertions(+)
|
||||||
|
|
||||||
|
--- a/zipl/src/disk.c
|
||||||
|
+++ b/zipl/src/disk.c
|
||||||
|
@@ -444,6 +444,9 @@ type_determined:
|
||||||
|
}
|
||||||
|
/* Convert device size to size in physical blocks */
|
||||||
|
data->phy_blocks = devsize / (data->phy_block_size / 512);
|
||||||
|
+ /* Adjust start on SCSI according to block_size. device-mapper devices are skipped */
|
||||||
|
+ if (data->type == disk_type_scsi && target->targetbase == NULL)
|
||||||
|
+ data->geo.start = data->geo.start / (data->phy_block_size / 512);
|
||||||
|
if (data->partnum != 0)
|
||||||
|
data->partition = stats.st_rdev;
|
||||||
|
/* Try to get device name */
|
@ -1,3 +1,34 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Mar 8 20:52:57 UTC 2021 - Mark Post <mpost@suse.com>
|
||||||
|
|
||||||
|
- Added s390-tools-sles15sp3-zipl-fix-4k-scsi-ipl.patch (bsc#1183039)
|
||||||
|
IPL is not working when bootloader is installed on a SCSI disk
|
||||||
|
with 4k physical blocksize without using a devicemapper target.
|
||||||
|
- Added s390-tools-sles15sp3-remove-no-pie-link-arguments.patch so
|
||||||
|
that we can build on systems with binutils 2.36 and higher. Without
|
||||||
|
this, the build fails because that version of the ld command
|
||||||
|
doesn't recognize "-no-pie" an acceptable argument.
|
||||||
|
- Updated the mkdump.pl script to make the name of the temporary
|
||||||
|
configuration file in /tmp/ unpredictable. (bsc#1182876)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Sat Feb 27 23:07:46 UTC 2021 - Mark Post <mpost@suse.com>
|
||||||
|
|
||||||
|
- Updated detach_disks.sh to not use predictable temporary file
|
||||||
|
names. (bsc#1182777, CVE-2021-25316)
|
||||||
|
- Made for the following changes for bsc#1182816:
|
||||||
|
* Updated s390-tools-sles15sp3-Format-devices-in-parallel.patch to
|
||||||
|
change all instances of the progress bar from printing "#" to
|
||||||
|
printing the process number of the DASD volume being formatted.
|
||||||
|
* Updated s390-tools-sles15sp3-Implement-Y-yast_mode.patch to print
|
||||||
|
out the numbder of cylinders in a device, as was done in the
|
||||||
|
prior versions of this patch, but was missed when modifying it
|
||||||
|
for SLES15 SP3.
|
||||||
|
* Added s390-tools-sles15sp3-check-return-code-from-util_file_read_l.patch
|
||||||
|
because otherwise a warning message from dasdfmt is being generated
|
||||||
|
that could interfere with YaST properly processing the progress
|
||||||
|
of the formatting process.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Wed Feb 17 20:47:26 UTC 2021 - Mark Post <mpost@suse.com>
|
Wed Feb 17 20:47:26 UTC 2021 - Mark Post <mpost@suse.com>
|
||||||
|
|
||||||
|
@ -98,6 +98,7 @@ Patch8: s390-tools-sles15sp3-02-genprotimg-fix-two-memory-leaks.patch
|
|||||||
Patch9: s390-tools-sles15sp3-03-genprotimg-require-argument-for-ramdisk-and-parmfile.patch
|
Patch9: s390-tools-sles15sp3-03-genprotimg-require-argument-for-ramdisk-and-parmfile.patch
|
||||||
Patch10: s390-tools-sles15sp3-04-genprotimg-add-host-key-document-verification-suppor.patch
|
Patch10: s390-tools-sles15sp3-04-genprotimg-add-host-key-document-verification-suppor.patch
|
||||||
Patch11: s390-tools-sles15sp3-zkey-Fix-APQN-property-names.patch
|
Patch11: s390-tools-sles15sp3-zkey-Fix-APQN-property-names.patch
|
||||||
|
Patch12: s390-tools-sles15sp3-zipl-fix-4k-scsi-ipl.patch
|
||||||
|
|
||||||
# SUSE patches
|
# SUSE patches
|
||||||
Patch900: s390-tools-sles12-zipl_boot_msg.patch
|
Patch900: s390-tools-sles12-zipl_boot_msg.patch
|
||||||
@ -112,6 +113,8 @@ Patch908: s390-tools-sles15sp3-dasdfmt-retry-BIODASDINFO-if-device-is-busy
|
|||||||
Patch909: 59-dasd.rules-wait_for.patch
|
Patch909: 59-dasd.rules-wait_for.patch
|
||||||
Patch910: s390-tools-sles12-fdasd-skip-partition-check-and-BLKRRPART-ioctl.patch
|
Patch910: s390-tools-sles12-fdasd-skip-partition-check-and-BLKRRPART-ioctl.patch
|
||||||
Patch911: s390-tools-sles15sp1-11-zdev-Do-not-call-zipl-on-initrd-update.patch
|
Patch911: s390-tools-sles15sp1-11-zdev-Do-not-call-zipl-on-initrd-update.patch
|
||||||
|
Patch912: s390-tools-sles15sp3-check-return-code-from-util_file_read_l.patch
|
||||||
|
Patch913: s390-tools-sles15sp3-remove-no-pie-link-arguments.patch
|
||||||
|
|
||||||
BuildRequires: curl-devel
|
BuildRequires: curl-devel
|
||||||
BuildRequires: dracut
|
BuildRequires: dracut
|
||||||
|
Loading…
x
Reference in New Issue
Block a user