Skip to content

DLPX-72158 create script to more easily update grub configuration #478

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

Merged

Conversation

prakashsurya
Copy link
Contributor

@prakashsurya prakashsurya commented Apr 30, 2024

Problem

Updating the bootloader on an appliance requires a series of commands to be run, which is easy to forget.

Solution

Add a script to the appliance to make it easy to update the bootloader as needed, with a single command.

Testing

  • System Configuration
$ zpool list
NAME        SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
domain0     148G   279M   148G        -         -     4%     0%  1.00x    ONLINE  -
old_rpool  69.5G  21.6G  47.9G        -         -      -    31%  1.00x    ONLINE  /old_rpool
rpool      69.5G  23.1G  46.4G        -         -      -    33%  1.00x    ONLINE  -
$ zfs list -r old_rpool/ROOT
NAME                                  USED  AVAIL  REFER  MOUNTPOINT
old_rpool/ROOT                       15.1G  45.8G    64K  none
old_rpool/ROOT/delphix.d427tUL       15.1G  45.8G    64K  none
old_rpool/ROOT/delphix.d427tUL/data   568M  45.8G   567M  legacy
old_rpool/ROOT/delphix.d427tUL/home    57K  45.8G    57K  legacy
old_rpool/ROOT/delphix.d427tUL/log   60.4M  45.8G  56.0M  legacy
old_rpool/ROOT/delphix.d427tUL/root  14.5G  45.8G  9.58G  /old_rpool
  • Recover
$ sudo ./update-appliance-bootloader recover old_rpool delphix.d427tUL
Installing for i386-pc platform.
Installation finished. No error reported.
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Sourcing file `/etc/default/grub.d/kdump-tools.cfg'
Sourcing file `/etc/default/grub.d/override.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.15.0-1048-dx2023112215-3a78f9e6a-oracle
Found initrd image: /boot/initrd.img-5.15.0-1048-dx2023112215-3a78f9e6a-oracle
Found linux image: /boot/vmlinuz-5.15.0-1041-dx2023090706-5083803f2-oracle
Found initrd image: /boot/initrd.img-5.15.0-1041-dx2023090706-5083803f2-oracle
done
  • Update
$ sudo ./update-appliance-bootloader update
Installing for i386-pc platform.
Installation finished. No error reported.
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Sourcing file `/etc/default/grub.d/kdump-tools.cfg'
Sourcing file `/etc/default/grub.d/override.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.15.0-1048-dx2023112215-3a78f9e6a-oracle
Found initrd image: /boot/initrd.img-5.15.0-1048-dx2023112215-3a78f9e6a-oracle
Found linux image: /boot/vmlinuz-5.15.0-1041-dx2023090706-5083803f2-oracle
Found initrd image: /boot/initrd.img-5.15.0-1041-dx2023090706-5083803f2-oracle
done

@prakashsurya prakashsurya force-pushed the dlpx/pr/prakashsurya/6db64a33-d737-4565-9622-ffb069a54210 branch from e0bb5fc to 698a8ef Compare April 30, 2024 17:29
@prakashsurya prakashsurya force-pushed the dlpx/pr/prakashsurya/6db64a33-d737-4565-9622-ffb069a54210 branch from 698a8ef to 80d4e80 Compare April 30, 2024 17:37
@prakashsurya prakashsurya marked this pull request as ready for review April 30, 2024 17:45
@prakashsurya prakashsurya enabled auto-merge (squash) April 30, 2024 17:52
@prakashsurya prakashsurya force-pushed the dlpx/pr/prakashsurya/6db64a33-d737-4565-9622-ffb069a54210 branch from 2ce2881 to 72a61b2 Compare April 30, 2024 18:31
@prakashsurya prakashsurya force-pushed the dlpx/pr/prakashsurya/6db64a33-d737-4565-9622-ffb069a54210 branch from 72a61b2 to 87692b1 Compare May 1, 2024 17:54
Copy link
Contributor

@sumedhbala-delphix sumedhbala-delphix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add debugging to the install step?

Copy link
Contributor

@grwilson grwilson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be used by the upgrade scripts?

@prakashsurya
Copy link
Contributor Author

Should this be used by the upgrade scripts?

possibly.. I think we definitely could.. as is, this script doesn't support not-in-place upgrades, but that could likely be added (or removed, since we never do not-in-place upgrades)..

the problem, though, is the script only exists for "new" versions (after we land it), so in order to eliminate the duplicated code between here, and upgrade, we'd need to wait for the "min version" to be a version containing this script..

I'm not opposed to having some version conditional.. e.g. "if running version with script; use script; otherwise run commands".. or just waiting till "min version" is adequate, and then always use the script..

regardless, that work would be in appliance-build's repository/scripts, and we'd need to land this change first..

if you feel strongly, I can land this change, and then look into the changes needed to consume it via upgrade..

@prakashsurya prakashsurya merged commit eed4c31 into develop May 14, 2024
14 of 15 checks passed
@prakashsurya prakashsurya deleted the dlpx/pr/prakashsurya/6db64a33-d737-4565-9622-ffb069a54210 branch May 14, 2024 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants