23.11.2019 2:21, Istvan Gabor пишет:
Hello:
I would like to make an initrd image in openSUSE Leap 15.1 that has root=LABEL=... and resume=LABEL=... kernel command line options instead of root=UUID= and resume=UUID= .
When I run mkinitrd it runs as:
# mkinitrd Creating initrd: /boot/initrd-4.12.14-lp151.28.13-default dracut: Executing: /usr/bin/dracut --logfile /var/log/YaST2/mkinitrd.log --force /boot/initrd-4.12.14-lp151.28.13-default 4.12.14-lp151.28.13-default ... dracut: *** Store current command line parameters *** dracut: Stored kernel commandline: dracut: resume=UUID=ca1f9a2d-468f-4718-b993-d7041556be8c dracut: root=UUID=c6a2aa57-1ff2-4ebd-a1fb-e56cf4b3a4b9 rootfstype=ext4 rootflags=rw,relatime,data=ordered dracut: *** Creating image file '/boot/initrd-4.12.14-lp151.28.13-default' *** dracut: *** Creating initramfs image file '/boot/initrd-4.12.14-lp151.28.13-default' done ***
According to dracut man page I can customize kernel command line options with --kernel-cmdline option to dracut.
Based on the above I ran dracut as:
# /usr/bin/dracut --kernel-cmdline "root=LABEL=L151-KDE3-ext resume=LABEL=swap-OSL" --logfile /var/log/YaST2/mkinitrd.log --force /boot/initrd-4.12.14-lp151.28.13-default 4.12.14-lp151.28.13-default dracut: Executing: /usr/bin/dracut --kernel-cmdline "root=LABEL=L151-KDE3-ext resume=LABEL=swap-OSL" --logfile /var/log/YaST2/mkinitrd.log --force /boot/initrd-4.12.14-lp151.28.13-default 4.12.14-lp151.28.13-default ... dracut: *** Store current command line parameters *** dracut: Stored kernel commandline: dracut: root=LABEL=L151-KDE3-ext resume=LABEL=swap-OSL dracut: resume=UUID=ca1f9a2d-468f-4718-b993-d7041556be8c dracut: root=UUID=c6a2aa57-1ff2-4ebd-a1fb-e56cf4b3a4b9 rootfstype=ext4 rootflags=rw,relatime,data=ordered dracut: *** Creating image file '/boot/initrd-4.12.14-lp151.28.13-default' *** dracut: *** Creating initramfs image file '/boot/initrd-4.12.14-lp151.28.13-default' done ***
It seems that dracut recognizes and applies --kernel-cmdline option values but then overwrites them by the system default values, at least that is how I interpret dracut output messages.
dracut does not overwrite anything because it does not interpret content of --kernel-cmdline option at all - it simply stores it verbatim. Another cmdline options come from dracut module that is responsible for root block device preparation, and this module is not aware that you tread on its territory.
What do I do wrong and how could I set only root=LABEL=L151-KDE3-ext and resume=LABEL=swap-OSL kernel command line options in the initrd image?
If you insist you must store them in initrd (as opposed to specifying on kernel command line) you could use --no-hostonly-cmdline which will skip storing auto-generated kernel command line. But keep in mind, this applies to *all* dracut modules. It will also no more add rootfstype & Co, so it is up to you to add *complete* correct kernel command line, not just the options you want to change. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org