Skip to main content
Welcome guest. | Register | Login | Post

EasyLFS Bootloader

23 replies [Last post]
Offline
Joined: 2006-03-28

Okay, since the other thread is getting pretty full I continue here.
tbuitenh suggested offering an option to enable not installing Lilo, since currently it is installed to MBR.

I think an option would be offering a 3-way-option, probably defaulting to the current behavior, installing Lilo to the MBR of the hard-drive.
The options would be installing to MBR, to the partition-bootsector or not at all (which would result in the installation not being bootable without help).
As far as I understand a partition has to be marked active to be bootable. I just tried this in one of my images and, by using fdisk to do so, killed that installation.
Right now I'm copying another install and will try it with parted.
So far I don't know if installing Lilo to the partition-bootsector will work with encrypted partitions and LVM. My previous try was with an encrypted partition and afterwards the LUKS-header was gone, which might be a result of changing this flag, or of using fdisk. I suspect the latter at this time.
Anyway, my next try will be with LVM, installing it to the partition that holds the LVM, since installing it to the logical volume wouldn't make much sense, the BIOS can't access it anyway.

tbuitenh's picture
Offline
Joined: 2005-12-21
A 2-way option (install

A 2-way option (install lilo to MBR, or don't install lilo) should be good enough, someone who doesn't want his MBR modified will usually already have grub or lilo either in the MBR or in the bootsector of another partition, which makes getting into EasyLFS trivial.

Another easy way to get around the problem is this:
First show the automatically generated lilo configuration, then ask the user if he wants to:
i - install lilo immediately
e - edit the lilo configuration, then go back to this menu. The user is expected to know what he's doing with LVM and LUKS.
c - cancel installation of lilo

You can't automate every possible case for everyone, sometimes it's best to get out of the way and let users solve their own problems.

Offline
Joined: 2006-03-28
Okay, I made some

Okay, I made some changes.
Lilo will now be installed to the partition bootsector, this even makes it a little easier for me in terms of scripting.
Also there is an option to disable writing the bootloader, which makes it a little easier for me in terms of housekeeping because a have a copy of this file which I use in the installations for the LiveCD where the line which writes the bootloader is commented out. ;-)
To enable booting from the partition instead from the harddisk I have to set the boot-flag. This doesn't seem to work for LVM- and encrypted partitions, but these need a separate partition for /boot anyway. So, if a partition for /boot is specified this will be set bootable and the bootloader will be written to that partition. Otherwise it will be written to the root-partition.

Anyway, does anybody see the need to add an option for the original behaviour, writing the bootloader to the MBR?

Offline
Joined: 2006-03-28
Well, offering funky menus

Well, offering funky menus would be cool, but it's not that easy to script.
I think I really have to get back to some C-coding and maybe make a few nice ncurses-interfaces for a couple of things.
Anyway, the bootloader-installation has been adjusted as described above (write the loader to partition, with the option not to write it at all) and I guess it should work, though I haven't had the time to test it yet (compiling EasyLFS during lunchtime just doesn't work), but will do during the next couple of days.

tbuitenh's picture
Offline
Joined: 2005-12-21
Great, that looks like a

Great, that looks like a perfect simple solution.

I guess writing to the MBR would be needed in case something is wrong with the MBR, but then a sane person would use a rescue CD, not EasyLFS.

Also, I think if one installs windows after EasyLFS, that will write something to the MBR causing windows to be booted instead of anything else. The easy solution then is to install GAG from windows.

Offline
Joined: 2006-03-28
I'll have to make another

I'll have to make another change to the bootloader-installation.
I've learned that XFS does not support writing the bootloader into the partition's bootrecord, since that is also used by the filesystem. Doing so would destroy the filesystem.

So I will offer a 3-way-option, so the user can choose if the bootloader will be installed in the MBR, the partition's bootrecord (which will be default) or not at all.
In addition I'll add a check at the beginning of the installation which will alert the user if he chooses installation into the partition's bootrecord and XFS as filesystem.
I have a similar check for an encrypted root-fs, where it alerts the user if no partition for /boot is specified. So I will use the same script for that, and possibly other checks which might be added later.

libervisco's picture
Offline
Joined: 2006-05-04
I've installed EasyLFS and

I've installed EasyLFS and I enabled the bootloader in the install configuration. Since this apparently didn't install anything to the MBR (and I see above it is deliberate) I'm wondering how to boot from it. Excuse my ignorance, I don't remember ever booting a distro with a bootloader residing on a boot partition. It was always either grub or lilo in the MBR.

I tried adding it to my existing grub from Ubuntu and overwriting MBR with that, but trying to boot via that entry resulted in a kernel panic. I believe it's missing an initrd.

Thank you.

Offline
Joined: 2006-03-28
EasyLFS doesn't work with

EasyLFS doesn't work with an InitRD, it's uses an InitRamFs, which actually is nearly the same, but included into the kernel-image. InitRamFs is the successor of InitRD.

I don't know much about Grub since I never used it. I know my notebook starts with Grub since it comes with Fedora.
When the kernel was compiled, did you choose the correct drivers for your (S/P)ATA-controller? If so, did you set them to be compiled into the kernel or as modules?
Currently it is necessary that these are compiled into the kernel, otherwise the InitRamFs probably won't be able to find your root-partition.
If you didn't select them, or selected them to be compiled as modules, you don't need to re-install.
You can just mount the partition and chroot into the mount-point. That way you should be able to recompile the kernel and then try booting it again.

libervisco's picture
Offline
Joined: 2006-05-04
Well I had a bit of a

Well I had a bit of a mishap with kernel compilation step. I was in it and accidentally exited so the install just continued asking some kernel support related questions and compiled a default kernel with that I suppose.

So yeah I'll recompile it then. Smiling

Thanks for a quick response.

libervisco's picture
Offline
Joined: 2006-05-04
I just tried to compile it

I just tried to compile it but after configuration and running make I get a strange error:

scripts/kconfig/conf -s arch/x86_64/Kconfig
  CHK     include/linux/version.h
  CHK     include/linux/utsrelease.h
  CC      arch/x86_64/kernel/asm-offsets.s
arch/x86_64/kernel/asm-offsets.c:1: error: code model `kernel' not supported in the 32 bit mode
arch/x86_64/kernel/asm-offsets.c:1: sorry, unimplemented: 64-bit mode not compiled in
make[1]: *** [arch/x86_64/kernel/asm-offsets.s] Error 1
make: *** [prepare0] Error 2

This is a 64bit machine and I'm chrooted from 64bit Ubuntu. Since EasyLFS was compiled it should also be compiled for 64bit including the kernel so I'm not sure what's wrong..

Offline
Joined: 2006-03-28
The problem here is that

The problem here is that EasyLFS is actually still 32-bit. 32-bit binaries can only produce a 32-bit system, running on a 64-bit system doesn't change that.
You could pass ARCH=i386 to make and make menuconfig, that way you get the config for the "correct" architecture. And since it'll be built with the tools within the chroot, which are 32-bit, you'll get an image that should be fit for the system.
Another way would be booting the LiveCD, mounting the partition and chrooting into it.

libervisco's picture
Offline
Joined: 2006-05-04
Alright, I'll try that.

Alright, I'll try that. Thank you.

I really need to get some sleep now though. Smiling Cya later.

libervisco's picture
Offline
Joined: 2006-05-04
When running make (after

When running make (after make menuconfig) chrooted from EasyLFS CD (or with ARCH=i386) it runs fine, but when I ran make modules_install && make install it stops with this:

if [ -r System.map -a -x /sbin/depmod ]; then /sbin/depmod -ae -F System.map  2.6.22.1; fi
sh /usr/src/linux-2.6.22.1/arch/i386/boot/install.sh 2.6.22.1 arch/i386/boot/bzImage System.map "/boot"
Fatal: raid_setup: stat("/dev/hda8")
make[1]: *** [install] Error 1
make: *** [install] Error 2

I searched around a bit and came to this, then bound my local /dev, /sys and /proc but it didn't work. But it is 64bit after all... I guess I would need to do this from inside of EasyLFS?

Offline
Joined: 2006-03-28
This should work when

This should work when you're booting the LiveCD, since that's 32-bit.
Don't know if it works on a 64-bit host, as your Ubuntu is.

Also I have actually no idea what make install does for the kernel.
I just copy over the files arch/i386/boot/bzImage and System.map and then reinstall Lilo.
And also your error-message looks like something Lilo could spit out.

libervisco's picture
Offline
Joined: 2006-05-04
I booted into the livecd,

I booted into the livecd, bound the /dev, /sys and /proc to mounted couterparts and ran kernel install successfully.

However I'm still having trouble booting and I wonder if this has something to do with that I'm trying to use GRUB to boot EasyLFS instead of lilo. IMO this should not present a problem though..

After a few tries this is the GRUB entry I've came up with that got me farthest:

title EasyLFS
root hd(0,7)
kernel /vmlinuz root="/dev/hda9"

/dev/hda9 is my EasyLFS root and /dev/hda8 is my EasyLFS boot where vmlinuz is. I think this should work, but.. it doesn't.

I am getting this, related to NFS (and I really don't care nor want a network file system so this, to me as a noob, is quite confusing).

Root-NFS: No NFS server available, giving up.
VFS: Unable to mount root fs via NFS, trying floppy.
NFS: Insert root floppy and press ENTER
VFS: Cannot open root device "hda9" or unknown-block (2,0)
Please append a correct "root=" boot option, here are the available partitions:

It doesn't list any partitions though, but just complains about not being able to open a root device again.

I really don't seem to have much luck with EasyLFS. I'm doing it just to test it out, but as things stand now I can't imagine myself using this system for anything other than, perhaps at some point, a base for a more user friendly distro, if that desire to make a "Perfect OS" ever comes back again... (cause I seem to be quite cozy on Ubuntu by now).

Offline
Joined: 2006-03-28
This is something I haven't

This is something I haven't seen before.
It's quite surprising it wants to get / from NFS.

Maybe you might want to try again a bit later with the next test-version. Maybe there's something messy with the one you have.
I could upload a version for you tonight I guess, if you like even the 64-bit version.

Booting EasyLFS with Grub is no problem, I tried it before and it worked fine. Didn't try it with a seperate boot-partition. But I don't think it should be a big deal.

libervisco's picture
Offline
Joined: 2006-05-04
Might be that I installed

Might be that I installed the NFS support and now it's somehow interfering. It's weird.

Anyway, there's no rush about uploading. Whenever it's convenient.

Cheers

Offline
Joined: 2006-03-28
The "new" image is

The "new" image is uploading. Should be ready in about 10-15 minutes from now.
It's actually not the latest one, but the latest EasyLFS64-image, 0.3.7. For the 32-bit-version I already have 0.3.8, but it's mostly the same. I actually don't even remember what's the exact differences.

During bootup it's quite likely that setting the clock might fail (though this "problem" should have existed before already), this is because I actually forgot to enable RTC-support in the kernel.
But that's going to be fixed for the next images, and of course should be no problem at all in 0.4.

Interestingly enough this problem does not seem to exist in EasyLFS32, although there also that kernel-option is not used.
Well, I'll add it for both, then I should be on the safe side.

Done. MD5-Sum is: 70de6a078cfa0e72d046a8c68395a625

libervisco's picture
Offline
Joined: 2006-05-04
Cool, thanks. Gonna try

Cool, thanks. Gonna try downloading that tonight (if my ISP behaves, they're apparently working on doubling our speeds and hence disrupting the service occasionally).

Cheers

libervisco's picture
Offline
Joined: 2006-05-04
Tried 64bit 0.3.7 and

Tried 64bit 0.3.7 and installation was initially smooth, however hit a snag sometime after the kernel compilation. I didn't configure anything in it this time and just left it on current defaults. I thought I can run it later. However it eventually stopped with this:

/usr/include/gnu/stubs.h:7:27:gnu/stubs-32.h: No such file or directory.
make: *** [reloc.o] Error 1
cp: cannot stat 'memtest.bin': No such file or directory.
error installing memtest86+ 1.70
error entering chroot environment

Heh me and EasyLFS can't get to a green branch apparently. Sticking out tongue

Offline
Joined: 2006-03-28
Crap. It seems you found a

Crap. It seems you found a problem I didn't hit yet, since I usually install without MemTest86+. So it seems that there's still something that needs to be done for x86_64.
You can simply edit /mnt/easylfs/lfs-install/lfs_config.sh and deactivate installation of it and resume installation. Then it should work, given that you didn't also select something else I didn't test yet. ;-)
Was already a bit of work to fix Newt for x86_64 so that PartImage can be installed, but that works now.

libervisco's picture
Offline
Joined: 2006-05-04
Oh, ok then Btw, if I

Oh, ok then Smiling

Btw, if I remember correctly I think you said earlier that it is possible to install the kernel which loaded on livecd without the need to configure. Is that what we get when just exiting the configuration window and resuming with the kernel compilation as is?

Thanks

Offline
Joined: 2006-03-28
Well, I canceled that for

Well, I canceled that for the new version. I do some pre-configuring, but the driver for the HD-controller still needs to be selected. But that's basically it. And the right CPU should be selected, though that is not necessary.

libervisco's picture