Skip to content
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

Linux command line parameters are not copied to upgrade initramfs #118

Closed
AloisMahdal opened this issue Apr 2, 2019 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@AloisMahdal
Copy link
Contributor

Actual behavior

Linux command line parameters added before calling leapp upgrade don't affect upgrade process initramfs.

To Reproduce
Steps to reproduce the behavior

  1. Add some parameters to Linux command line (GRUB_CMDLINE in /etc/default/grub)
  2. install leapp
  3. leapp upgrade --debug
  4. reboot
  5. observe Linux command line

Expected behavior

The parameters added above should be present in the upgrade command line.

System information (please complete the following information):

leapp-0.5.0-1.201904011532Z.d0a3c9a.master.el7_6.noarch
leapp-repository-0.5.0-1.201904011554Z.11ac42d.master.el7_6.noarch
@AloisMahdal AloisMahdal added the bug Something isn't working label Apr 2, 2019
@bocekm
Copy link
Member

bocekm commented Apr 8, 2019

For creating a new grub entry for rebooting into our initramfs, we use grubby with the --copy-default option:
https://github.com/oamg/leapp-repository/blob/master/repos/system_upgrade/el7toel8/actors/addupgradebootentry/libraries/library.py#L18
This option takes whatever the current default boot entry has for kernel arguments and adds them for the new boot entry too.

I did a test:

  1. I added a new kernel argument rd.debug=0 by:

    1. editing GRUB_CMDLINE_LINUX in /etc/default/grub
    2. and then by propagating this change to the boot partition using grub2-mkconfig -o /boot/grub2/grub.cfg. You can find that this is necessary to do in https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/sec-customizing_the_grub_2_configuration_file.
  2. I ran leapp upgrade and the new boot entry for 'RHEL Upgrade Initramfs' has the rd.debug=0 among the kernel arguments.

    Click to see a snippet of the generated _/boot/grub2/grub.cfg_:
     menuentry 'RHEL Upgrade Initramfs' --class red --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-957.el7.x86_64-advanced-3199373c-4210-4068-a5c5-6346e2c3a246' {
             load_video
             set gfxpayload=keep
             insmod gzio
             insmod part_msdos
             insmod xfs
             set root='hd0,msdos1'
             if [ x$feature_platform_search_hint = xy ]; then
             search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1'  3199373c-4210-4068-a5c5-6346e2c3a246
             else
             search --no-floppy --fs-uuid --set=root 3199373c-4210-4068-a5c5-6346e2c3a246
             fi
             linux16 /boot/vmlinuz-upgrade.x86_64 root=UUID=3199373c-4210-4068-a5c5-6346e2c3a246 ro console=tty0 console=ttyS0,115200 crashkernel=auto net.ifnames=0 rhgb quiet rd.debug=1 debug enforcing=0 rd.plymouth=0 plymouth.enable=0
             initrd16 /boot/initramfs-upgrade.x86_64.img
     }
     menuentry 'Red Hat Enterprise Linux Server (3.10.0-957.el7.x86_64) 7.6 (Maipo)' --class red --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-957.el7.x86_64-advanced-3199373c-4210-4068-a5c5-6346e2c3a246' {
             load_video
             set gfxpayload=keep
             insmod gzio
             insmod part_msdos
             insmod xfs
             set root='hd0,msdos1'
             if [ x$feature_platform_search_hint = xy ]; then
             search --no-floppy --fs-uuid --set=root --hint='hd0,msdos1'  3199373c-4210-4068-a5c5-6346e2c3a246
             else
             search --no-floppy --fs-uuid --set=root 3199373c-4210-4068-a5c5-6346e2c3a246
             fi
             linux16 /boot/vmlinuz-3.10.0-957.el7.x86_64 root=UUID=3199373c-4210-4068-a5c5-6346e2c3a246 ro console=tty0 console=ttyS0,115200 crashkernel=auto net.ifnames=0 rhgb quiet rd.debug=1
             initrd16 /boot/initramfs-3.10.0-957.el7.x86_64.img
    

@bocekm bocekm closed this as completed Apr 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants