View previous topic :: View next topic |
Author |
Message |
DaggyStyle Watchman
Joined: 22 Mar 2006 Posts: 5909
|
Posted: Tue Jan 22, 2019 8:58 pm Post subject: migration from grub legacy to grub2 [solved] |
|
|
Greetings,
I'm in the process of migrating my system from grub legacy to grub2.
in grub legacy I had a script doing this after the kernel was compiled:
- make ${JOBS} modules_install
- mount /boot/
- cp arch/x86/boot/bzImage /boot/kernel64-${FULL_NEW_KERNEL_VERSION}.img
- OLD_KERNEL="$(sed -n "${GRUB_CFG_ENTRY_LINE_START}p" /boot/grub/grub.conf | awk '{print $4}')"
- NEW_ENTRY="$(cat /boot/grub/grub.conf | sed -n "${GRUB_CFG_ENTRY_LINE_START},$((${GRUB_CFG_ENTRY_LINE_START}+${GRUB_CFG_ENTRY_LENGTH}))p" | sed ':a;N;$!ba;s/\n/\\n/g' | sed "s/${OLD_KERNEL}/${FULL_NEW_KERNEL_VERSION}/g")"
- sed -i \"${GRUB_CFG_ENTRY_LINE_START} i ${NEW_ENTRY}\" /boot/grub/grub.conf
- n -sf /boot/kernel64-${FULL_NEW_KERNEL_VERSION}.img /boot/kernel64-rescue.img
this resulted in a bootable image with custom initrd. with grub2 I need to use grub-mkconfig -o /boot/grub/grub.cfg, my problem is getting the above to work.
I assume I cannot use the cp method and I'd should use the make install, if that so, how can I instruct grub2 to use my initrd?
Thanks. _________________ Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
Last edited by DaggyStyle on Fri Jan 25, 2019 7:08 am; edited 1 time in total |
|
Back to top |
|
|
Tony0945 Watchman
Joined: 25 Jul 2006 Posts: 5127 Location: Illinois, USA
|
Posted: Tue Jan 22, 2019 9:56 pm Post subject: Re: migration from grub legacy to grub2 |
|
|
DaggyStyle wrote: | I'm in the process of migrating my system from grub legacy to grub2.. |
Why? Just because it's not in the tree anymore doesn't mean you can't keep it. Your present install is not affected. Unless you really want grub2 features, don't bother. |
|
Back to top |
|
|
DaggyStyle Watchman
Joined: 22 Mar 2006 Posts: 5909
|
Posted: Wed Jan 23, 2019 8:34 am Post subject: Re: migration from grub legacy to grub2 |
|
|
Tony0945 wrote: | DaggyStyle wrote: | I'm in the process of migrating my system from grub legacy to grub2.. |
Why? Just because it's not in the tree anymore doesn't mean you can't keep it. Your present install is not affected. Unless you really want grub2 features, don't bother. |
I transferred my existing installation from one machine to another, in the process I need to reinstall gentoo and I'd like to migrate to efi.
the main problem is that fat32 doesn't supports links, so I cannot create a link with the proper formatting for grub. _________________ Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein |
|
Back to top |
|
|
DaggyStyle Watchman
Joined: 22 Mar 2006 Posts: 5909
|
|
Back to top |
|
|
Phoenix591 Guru
Joined: 17 Sep 2007 Posts: 487
|
Posted: Thu Jan 24, 2019 10:26 am Post subject: |
|
|
Correct, with efistub no boot loader is needed, just the BIOS (efi firmware) executing the kernel. The arguments and initrd set by either compiling in the kernel itself a default command line (under processor type and features->, built in kernel command line, something like root=LABEL=Gentoo dobtrfs initrd=\intel-uc.img initrd=\initrd-current do note efi path notations use \ rather than / ), or when creating the boot entry with efibootmgr (anything in quotes after the -u or --unicode is passed to the kernel), and letting the BIOS (efi firmware) handle displaying any alternative boot options (ie press f12 to display the menu).
https://wiki.gentoo.org/wiki/GRUB2 and https://wiki.gentoo.org/wiki/GRUB2_Migration are the two most relevant grub 2 articles for getting started and migrating to grub 2 if you havn't found it yet (no experience with it personally)
Imo, it comes down to taste, if you need/want many boot choices, and if your efi firmware is quirky or not: Some efi firmware can have strange bugs and other quirks, my own, for instance, ignores the efi system partition on my second hard drive, and can natively read ntfs partitions ( that was handy for creating and using windows 10 installation usb stick), others refuse to acknowledge efi executables other than the default ( efi partition/EFI/BOOT/BOOTX64.EFI ). If you're satisfied with the visual appearance of your efi firmware's boot menu and can work within any quirks of your own board's efi firmware, you can go bare bones with efistub. If not, Grub (2), rEFInd, both provide the traditional boot loader experience with theme-able menus etc ( with systemd-boot providing a more bare bones menu option) |
|
Back to top |
|
|
DaggyStyle Watchman
Joined: 22 Mar 2006 Posts: 5909
|
Posted: Fri Jan 25, 2019 7:08 am Post subject: |
|
|
thought so, I've went the grub2 path, now I only need to get it to boot.
Thanks. _________________ Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|