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

kexec-select-boot: Find a way to not search whole partition #447

Open
paulmenzel opened this issue Sep 8, 2018 · 5 comments
Open

kexec-select-boot: Find a way to not search whole partition #447

paulmenzel opened this issue Sep 8, 2018 · 5 comments

Comments

@paulmenzel
Copy link
Contributor

With devices, where /boot is not on a separate partition, but also on the / partition, the find call takes a very long time.

  for i in `find $bootdir -name "$config"`; do
          kexec-parse-boot "$bootdir" "$i" >> $option_file
  done

Passing -b /boot/boot does not work, as the Linux image is only searched in /boot.

No idea, what an elegant solution would be. Maybe the path to /boot/grub (/boot/boot/grub) should be made configurable?

@rminnich
Copy link

rminnich commented Sep 8, 2018

how long is long? What is the media? is this an intrinsic issue with traversing the file system or is find slow?

@paulmenzel
Copy link
Contributor Author

paulmenzel commented Sep 8, 2018 via email

@flammit
Copy link
Collaborator

flammit commented Sep 8, 2018

Thanks @paulmenzel! The searching was set to be quite permissive because of the wide variation of boot config files on install/live distro ISOs. Agree though that on the fixed media devices we can be much more selective and assume grub/freedesktop style paths

@merge
Copy link
Contributor

merge commented Sep 25, 2018

while finding boot options is slow in this case, it's more extreme when it comes to hashing. hashing the whole system is not desired in this case.

@Thrilleratplay
Copy link
Contributor

/boot is assumed to be the boot partition. It is not the most elegant but what about where ever kexec-select-boot passes in /boot replace it with a variable and check if there

bootdir= "/boot"
if [ -d "/boot/boot/" ]; then
  bootdir= "/boot/boot"
fi
kexec-select-boot -m -b "$bootdir" -c "grub.cfg"

There a few places where checking for the specific boot directory would be useful like the oem factory reset where all files in are run through sha256sum

https://github.com/osresearch/heads/blob/master/initrd/bin/oem-factory-reset#L122

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants