New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleaned up how KERNEL_FILE is set (issues 1851 and 1983) #1985
Cleaned up how KERNEL_FILE is set (issues 1851 and 1983) #1985
Conversation
…x-ia64/300_create_bootimg.sh
Ouch! It seems there is no verification when actually copying $KERNEL_FILE KERNEL_FILE="/qqqq/QQQQ" # Show to the user what will actually be used as kernel in the recovery system: LogPrint "Using '$KERNEL_FILE' as kernel in the recovery system" and "rear -D mkrescue" blindly succeeds and in its log I get + source /root/rear.github.master/usr/share/rear/output/ISO/Linux-i386/800_create_isofs.sh ... ++ echo '2018-11-28 16:38:10.177417576 Copying kernel and initrd' 2018-11-28 16:38:10.177417576 Copying kernel and initrd ++ cp -pL -v /qqqq/QQQQ /tmp/rear.btMb4OpRSu51xUT/tmp/isofs/isolinux/kernel cp: cannot stat '/qqqq/QQQQ': No such file or directory ++ cp -v /tmp/rear.btMb4OpRSu51xUT/tmp/initrd.cgz /tmp/rear.btMb4OpRSu51xUT/tmp/isofs/isolinux/initrd.cgz '/tmp/rear.btMb4OpRSu51xUT/tmp/initrd.cgz' -> '/tmp/rear.btMb4OpRSu51xUT/tmp/isofs/isolinux/initrd.cgz' I will fix that too... |
…or messages in output/ISO/Linux-ia64/300_create_bootimg.sh
Now it fails as it should: # usr/sbin/rear -D mkrescue ... Using '/qqqq/QQQQ' as kernel in the recovery system ... ERROR: Failed to copy KERNEL_FILE '/qqqq/QQQQ' Some latest log messages since the last called script 800_create_isofs.sh: 2018-11-28 16:56:25.174949019 Including output/ISO/Linux-i386/800_create_isofs.sh 2018-11-28 16:56:25.175956312 Entering debugscripts mode via 'set -x'. 2018-11-28 16:56:25.181098853 Copying kernel and initrd cp: cannot stat '/qqqq/QQQQ': No such file or directory Aborting due to an error, check /root/rear.github.master/var/log/rear/rear-g243.log for details |
Hello @jsmeix, I've found some other files where kernel is copied without further checking of the operation success:
Maybe we could add to usr/share/rear/prep/GNU/Linux/400_guess_kernel.sh check if KERNEL_FILE contains a real kernel.
? V.
|
There is leftover symlink /usr/share/rear/pack/Linux-ia64, still pointing to deleted directory (Linux-i386) . V. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've successfully tested this PR on following systems:
- SLES12 SP2
- Fedora release 26
- Centos 6.9
Apart from minor details submitted earlier in this PR communication, I think this is OK to merge.
V.
@gozora I know about the missing things but yesterday it was too late |
…issing and use aligned error messages in those cases
…ied KERNEL_FILE does not exist or is a broken symlink
…ns the word kernel (ingnore case) and show a WARNING in this case when KERNEL_FILE was specified by the user i.e. the user can enforce to use a file as kernel where the file command output does not contain the word kernel
@gdha |
Hopefully it is "fixed / solved / done" - if not I will of course fix regressions. |
Thanks @jsmeix! V. |
Using the # file /boot/vmlinu* /boot/vmlinux-4.12.14-lp150.12.22-default.gz: gzip compressed data, was "vmlinux-4.12.14-lp150.12.22-default", last modified: Sat Oct 13 14:55:30 2018, max compression, from Unix /boot/vmlinux-4.12.14-lp150.12.25-default.gz: gzip compressed data, was "vmlinux-4.12.14-lp150.12.25-default", last modified: Fri Nov 2 07:20:36 2018, max compression, from Unix /boot/vmlinuz: symbolic link to vmlinuz-4.12.14-lp150.12.25-default /boot/vmlinuz-4.12.14-lp150.12.22-default: Linux/x86 Kernel, Setup Version 0x20d, bzImage, Version 4.12.14-lp150.12.22-default (geeko@buildhost) #1 SMP Sat Oct 13 05:05:16 UTC 2018 (09415e8), RO-rootFS, swap_dev 0x6, Normal VGA /boot/vmlinuz-4.12.14-lp150.12.25-default: Linux/x86 Kernel, Setup Version 0x20d, bzImage, Version 4.12.14-lp150.12.25-default (geeko@buildhost) #1 SMP Thu Nov 1 06:14:23 UTC 2018 (3fcf457), RO-rootFS, swap_dev 0x6, Normal VGA # file -z /boot/vmlinu* /boot/vmlinux-4.12.14-lp150.12.22-default.gz: ELF 64-bit LSB executable, x86-64, version 1 (SYSV) (gzip compressed data, was "vmlinux-4.12.14-lp150.12.22-default", last modified: Sat Oct 13 14:55:30 2018, max compression, from Unix) /boot/vmlinux-4.12.14-lp150.12.25-default.gz: ELF 64-bit LSB executable, x86-64, version 1 (SYSV) (gzip compressed data, was "vmlinux-4.12.14-lp150.12.25-default", last modified: Fri Nov 2 07:20:36 2018, max compression, from Unix) /boot/vmlinuz: symbolic link to vmlinuz-4.12.14-lp150.12.25-default /boot/vmlinuz-4.12.14-lp150.12.22-default: Linux/x86 Kernel, Setup Version 0x20d, bzImage, Version 4.12.14-lp150.12.22-default (geeko@buildhost) #1 SMP Sat Oct 13 05:05:16 UTC 2018 (09415e8), RO-rootFS, swap_dev 0x6, Normal VGA /boot/vmlinuz-4.12.14-lp150.12.25-default: Linux/x86 Kernel, Setup Version 0x20d, bzImage, Version 4.12.14-lp150.12.25-default (geeko@buildhost) #1 SMP Thu Nov 1 06:14:23 UTC 2018 (3fcf457), RO-rootFS, swap_dev 0x6, Normal VGA I have the same on my old SLES11 system: # file /boot/vmlinu* /boot/vmlinux-3.0.101-108.21-pae.gz: gzip compressed data, from Unix, max compression /boot/vmlinuz: symbolic link to `vmlinuz-3.0.101-108.21-pae' /boot/vmlinuz-3.0.101-108.21-pae: Linux/x86 Kernel, Setup Version 0x20b, bzImage, Version 3.0.101, RO-rootFS, swap_dev 0x3, Normal VGA # file -z /boot/vmlinu* /boot/vmlinux-3.0.101-108.21-pae.gz: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV) (gzip compressed data, from Unix, max compression) /boot/vmlinuz: symbolic link to `vmlinuz-3.0.101-108.21-pae' /boot/vmlinuz-3.0.101-108.21-pae: Linux/x86 Kernel, Setup Version 0x20b, bzImage, Version 3.0.101, RO-rootFS, swap_dev 0x3, Normal VGA |
…ess_kernel_issue_1985 Removed file command usage in 400_guess_kernel.sh because it is not reliably working to test if a file is actually a kernel, see #1985 (comment)
With #1988 merged |
hello @jsmeix V. |
I don't know if a If KERNEL_FILE="/boot/vmlinux-4.12.14-lp150.12.25-default instead of his actually bootable kernel KERNEL_FILE="/boot/vmlinuz-4.12.14-lp150.12.25-default and/or to avoid that somehow accidentally a |
I'd say, leave the code without V. |
Oh, please, let us just shout a little nice WARNING at the user ;-) I agree with your #1985 (comment) Have a nice weekend! |
Type: Minor Bug Fix and Cleanup
Impact: Normal
Reference to related issue (URL):
The various 300_copy_kernel.sh scripts should be cleaned up #1851
and
Moved 400_guess_kernel.sh to earlier stage #1983
How was this pull request tested?
On my openSUSE Leap 15.0 (SLES12-like) system
the "rear -D mkrescue" debug log looks good
but I have only the simple initial case
KERNEL_FILE="/boot/vmlinuz-$KERNEL_VERSION"
in the new prep/GNU/Linux/400_guess_kernel.sh
Brief description of the changes in this pull request:
see
The various 300_copy_kernel.sh scripts should be cleaned up #1851 (comment)
and
Moved 400_guess_kernel.sh to earlier stage #1983 (comment)
In particular this pull request includes (and therefore obsoletes)
#1983
i.e. usr/share/rear/pack/GNU/Linux/400_guess_kernel.sh
is moved to usr/share/rear/prep/GNU/Linux/400_guess_kernel.sh
@gozora @gdha
I would much appreciate it if you could test whether or not the
changes in this pull request cause regressions on your systems.
Many thanks in advance!