LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 12-03-2016, 06:47 PM   #1
Luridis
Member
 
Registered: Mar 2014
Location: Texas
Distribution: LFS 9.0 Custom, Merged Usr, Linux 4.19.x
Posts: 616

Rep: Reputation: 167Reputation: 167
Looking for detailed Grub2 instructions...


Nevermind. I figured it out. Grub2 is a poorly documented pain in the buns. It would help if they explained about the grub-core. Not to mention having a configure switch to build the core for multiple BIOS types on x86.

i.e. --include-platforms=i386-pc,i386-efi,x86_64-efi

...and those resultant builds would appear in /usr/lib/grub

Last edited by Luridis; 12-12-2016 at 03:37 PM.
 
Old 12-10-2016, 11:16 AM   #2
luvr
Member
 
Registered: May 2005
Location: Boom - The Home Town of Tomorrowland, Belgium
Distribution: Slackware, Xubuntu
Posts: 459
Blog Entries: 2

Rep: Reputation: 194Reputation: 194
Any idea what you would want to try?
I'd be interested to hear if you find anything that works (or that perhaps does not work, and what's wrong with it).
 
Old 12-10-2016, 11:31 AM   #3
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
$ sudo grub-install /dev/...

$ sudo update-grub

It gets most of the grub.cfg right. In arch the initrd only has the intel microcode and not the initrd image to boot by default, so manually edit to include both. In debian if you rsync an install to a new partition you'll likely need to edit the UUID in the grub.cfg manually as well. Rinse and repeat every time the kernel updates or something changes that runs update-grub. Various chainloading grub (configfile) to grub, and "c" command mode or "e" to edit a menu item to jump hurdles.

There was an effort to rewrite grub called burg (grub backwards). Although a terrible name that's impossible to google. Various plop / btmgr loaders as well as lilo if grub blows too much. And refind if your 32 bit UEFI boots a 64 bit distro. Just some existing options. Although most make grub look modern in comparison. Baring other board types that only allow uboot.

https://www.gnu.org/software/grub/gr...mentation.html
 
Old 12-10-2016, 12:21 PM   #4
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,615
Blog Entries: 19

Rep: Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460Reputation: 4460
I use lilo, which is easy if you have Crux on the same machine. If you don't you will need to get source code and Pkgfile scripts for lilo and bin86 from the Crux core repository.
 
Old 12-12-2016, 03:29 PM   #5
Luridis
Member
 
Registered: Mar 2014
Location: Texas
Distribution: LFS 9.0 Custom, Merged Usr, Linux 4.19.x
Posts: 616

Original Poster
Rep: Reputation: 167Reputation: 167
Quote:
Originally Posted by Shadow_7 View Post
$ sudo grub-install /dev/...

$ sudo update-grub

It gets most of the grub.cfg right. In arch the initrd...
Grub config isn't the problem and grub-update wouldn't effect a livecd/usb anyway. The problem is the bootloader itself. To create a multi-start grub rescue you need the grub-core built for multiple environments. If you use the LFS build instructions it will only build for the platform you're on. That's fine if you built on an int 13H machine (read: BIOS booting MBR) and were planning on using the disk only for other BIOS booting machines. But, what if you're running on an UEFI 64 machine and you need to make a rescue disk for a BIOS machine, or a EFI386 machine? You're SOL because a BIOS booting machine needs an eltorito noemu bootloader installed on the CD/DVD/USB.

Live distro's get around this by creating multi-start CD/DVDs, etc. The image contains eltorito noemu, and EFI platform bootloaders. The Grub instructions don't explain how to do this. I finally figured it out, but it was a pain. I can explain it here if anyone is interested, but I'm not going to unless someone speaks and asks for it. Because, that whole process is lengthy.

Edit: There's a reason so many distros recommend efibootmgr for efi systems. Build grub2 wrong, or be missing a specific kernel module when executing grub-install on an efi system and it will fail. :/

Last edited by Luridis; 12-12-2016 at 03:44 PM.
 
Old 12-12-2016, 03:37 PM   #6
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,149

Rep: Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264
Somebody did write a tutorial at one point:
http://www.linuxquestions.org/linux/...2_introduction
 
Old 12-12-2016, 03:46 PM   #7
Luridis
Member
 
Registered: Mar 2014
Location: Texas
Distribution: LFS 9.0 Custom, Merged Usr, Linux 4.19.x
Posts: 616

Original Poster
Rep: Reputation: 167Reputation: 167
Quote:
Originally Posted by smallpond View Post
Somebody did write a tutorial at one point:
http://www.linuxquestions.org/linux/...2_introduction
One of a million that has absolutely nothing to do with the subject at hand: grub as a live distro bootloader for multiple BIOS types. I know how to write a grub.cfg.
 
Old 12-12-2016, 03:48 PM   #8
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,368

Rep: Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591
depending on if issuing grub-install from bios or efi: "grub-install --target=x86-64.efi" if issuing from bios or "grub-install --target=i386-pci" if issuing from efi. to install to the other format. For efi will have to copy the grubx64.efi to /boot/efi/EFI/BOOT/bootx64.efi
 
Old 12-12-2016, 03:52 PM   #9
Luridis
Member
 
Registered: Mar 2014
Location: Texas
Distribution: LFS 9.0 Custom, Merged Usr, Linux 4.19.x
Posts: 616

Original Poster
Rep: Reputation: 167Reputation: 167
Quote:
Originally Posted by colorpurple21859 View Post
depending on if issuing grub-install from bios or efi: "grub-install --target=x86-64.efi" if issuing from bios or "grub-install --target=i386-pci" if issuing from efi. to install to the other format. For efi will have to copy the grubx64.efi to /boot/efi/EFI/BOOT/bootx64.efi
grub-install --target=x86_64-efi will not work if you didn't not either build on that platform or didn't compile and additional grub-core for it. You'll know if it's there or not by looking at /usr/lib/grub. A directory will be listed there for each platform grub has a built bootloader for. Check your slackware distro. They did it correctly and there should be multiple platform directories in there.

Last edited by Luridis; 12-12-2016 at 03:53 PM.
 
Old 12-12-2016, 10:08 PM   #10
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,368

Rep: Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591Reputation: 1591
yes your right, I went back and re-read your post, I was using slackware, where that does work, and ubuntu which allows installing both platforms.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple, detailed instructions to wipe free space please. PeterJD Linux - Newbie 19 05-05-2010 11:08 AM
Need Detailed Instructions On How To Customise Fbpanel Mark7 Linux - Desktop 0 02-06-2008 01:49 PM
detailed instructions for getting HPg85xi to work through USB lazarys Linux - Newbie 5 05-05-2006 03:03 PM
Complete Linux Newbie, Need Detailed Instructions For Problems srparke Linspire/Freespire 8 03-19-2005 01:08 AM
Detailed instructions on loading win xp on a redhat 9 box?? ashwin_cse Red Hat 1 12-02-2004 02:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 07:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration