Jump to content











Photo
- - - - -

kexec-loader rewrite


  • This topic is locked This topic is locked
37 replies to this topic

#1 solemnwarning

solemnwarning

    Member

  • Members
  • 73 posts
  •  
    United Kingdom

Posted 05 February 2009 - 03:44 PM

I have rewritten kexec-loader to try and fix it's crap stability, which was a result of several large design changes after the initial implementation, when I tried rewriting the VFS code to use the new mount style it just died. Anyway, here's a beta, I'll release sometime over the next few days, after the docs have been rewritten.

If you press enter in the shell with an empty line it crashes (irony!), this will be fixed in the next image.

rewrite-r478.img.gz

If you need extra modules, the v1.6.2 modules are compatible, any comments?

#2 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 05 February 2009 - 03:48 PM

Cross-linking with "old" release related threads, here:
http://www.boot-land...?showtopic=4636
and here:
http://www.boot-land...?showtopic=6709

etc., etc.

:cheers:

jaclaz

#3 mr_

mr_

    Frequent Member

  • Members
  • 355 posts
  •  
    Germany

Posted 05 February 2009 - 04:05 PM

solemnwarning,
did you receive my e-mail about the iso version?

#4 solemnwarning

solemnwarning

    Member

  • Members
  • 73 posts
  •  
    United Kingdom

Posted 05 February 2009 - 04:13 PM

solemnwarning,
did you receive my e-mail about the iso version?


Yeah, I forgot to respond. I'm not planning on supporting ISOs anytime soon, since them being read-only would make configuring it more tedious, you can fit any sane combination of modules on a floppy anyway.

I doubt I will ever support network booting, if you want to boot from a server, PXE is a better choice.

#5 solemnwarning

solemnwarning

    Member

  • Members
  • 73 posts
  •  
    United Kingdom

Posted 06 February 2009 - 08:37 PM

These notes may also explain a bit more about the rewrite:

notes.txt

#6 mr_

mr_

    Frequent Member

  • Members
  • 355 posts
  •  
    Germany

Posted 08 February 2009 - 12:37 AM

Sorry, I don't understand how to translate my default grub menu.cfg into kexec-loader style. Some more exampels could help me.

This is from the orignal grub menu.cfg:
title		Ubuntu 8.04.2, kernel 2.6.24-23-generic

root		(hd0,2)

kernel		/boot/vmlinuz-2.6.24-23-generic root=UUID=2bbadde7-2464-4276-ae55-a1c5079c3e12 ro quiet splash

initrd		/boot/initrd.img-2.6.24-23-generic

quiet

Here is my device list: http://img25.imagesh...08012114og7.png

I've tested so many combinations....
# i did set label ubuntu after the screenshot has been made, it's detected

title Ubuntu 8.04.2, kernel 2.6.24-23-generic - root LABEL

root LABEL=ubuntu

kernel /boot/vmlinuz-2.6.24-23-generic root=UUID=2bbadde7-2464-4276-ae55-a1c5079c3e12 ro quiet splash

initrd /boot/initrd.img-2.6.24-23-generic



title Ubuntu 8.04.2, kernel 2.6.24-23-generic - root uuid

root UUID=2bbadde7-2464-4276-ae55-a1c5079c3e12

kernel /boot/vmlinuz-2.6.24-23-generic root=UUID=2bbadde7-2464-4276-ae55-a1c5079c3e12 ro quiet splash

initrd /boot/initrd.img-2.6.24-23-generic



title Ubuntu 8.04.2, kernel 2.6.24-23-generic - sda3

root /dev/sda3

kernel /boot/vmlinuz-2.6.24-23-generic root=UUID=2bbadde7-2464-4276-ae55-a1c5079c3e12 ro quiet splash

initrd /boot/initrd.img-2.6.24-23-generic
also root (hd0,3), root (sda0,3), etc...

Test environment: VMware and a USB HDD.

I need some help with the configuration files or I must miss something else.

#7 Icecube

Icecube

    Gold Member

  • Team Reboot
  • 1063 posts
  •  
    Belgium

Posted 08 February 2009 - 12:46 AM

I didn't test it, but I think you must use the following:
[codebox]title Ubuntu 8.04.2, kernel 2.6.24-23-generic - root LABEL root LABEL=ubuntu kernel /boot/vmlinuz-2.6.24-23-generic initrd /boot/initrd.img-2.6.24-23-generic cmdline root=UUID=2bbadde7-2464-4276-ae55-a1c5079c3e12 ro quiet splash title Ubuntu 8.04.2, kernel 2.6.24-23-generic - root uuid root UUID=2bbadde7-2464-4276-ae55-a1c5079c3e12 kernel /boot/vmlinuz-2.6.24-23-generic initrd /boot/initrd.img-2.6.24-23-generic cmdline root=UUID=2bbadde7-2464-4276-ae55-a1c5079c3e12 ro quiet splash title Ubuntu 8.04.2, kernel 2.6.24-23-generic - sda3 root /dev/sda3 kernel /boot/vmlinuz-2.6.24-23-generic initrd /boot/initrd.img-2.6.24-23-generic cmdline root=UUID=2bbadde7-2464-4276-ae55-a1c5079c3e12 ro quiet splash[/codebox] If you read: [url="http://www.solemnwarning.net/notes.txt"]http://www.solemnwarning.net/notes.txt[/url] [code]cmdline <text> Set kernel command line[/code]

#8 mr_

mr_

    Frequent Member

  • Members
  • 355 posts
  •  
    Germany

Posted 08 February 2009 - 12:52 AM

Still same error.

#9 solemnwarning

solemnwarning

    Member

  • Members
  • 73 posts
  •  
    United Kingdom

Posted 08 February 2009 - 01:21 AM

What error? Is there anything related in the debug console? (tty3)

#10 mr_

mr_

    Frequent Member

  • Members
  • 355 posts
  •  
    Germany

Posted 08 February 2009 - 01:26 AM

Ok, that was stupid by me, I must somehow forgotten to paste it.

- Error mounting LABEL=ubuntu: No such device (Missing module?)
- Error mounting UUIDL=.........: No such device (Missing module?)
- Error mounting /dev/sda3: No such device (Missing module?)

#11 solemnwarning

solemnwarning

    Member

  • Members
  • 73 posts
  •  
    United Kingdom

Posted 08 February 2009 - 02:00 AM

Stupid question, have you actually typed UUIDL= in your config for that second one or is it a horrible bug that'll take my ages to fix?

As far as the error, have you added all required device/filesystem modules? The base kernel only supports USB, PC floppy and FAT

#12 mr_

mr_

    Frequent Member

  • Members
  • 355 posts
  •  
    Germany

Posted 08 February 2009 - 02:50 AM

Oh well, I presumed ext3 support is hardcoded into the kernel.

However, I got now the UUID example and the /dev/sda3 example working. Just label is not working.

"prof" for label: http://img18.imagesh...08034434oi2.png

title Ubuntu 8.04.2, kernel 2.6.24-23-generic - root LABEL

root LABEL=ubuntu

kernel /boot/vmlinuz-2.6.24-23-generic

initrd /boot/initrd.img-2.6.24-23-generic

cmdline root=UUID=2bbadde7-2464-4276-ae55-a1c5079c3e12 ro quiet splash

It's not very important for me as Ubuntu likes to use uuid anyway, just wanted to report it. But if it's a serious problem I guess someone else might report it.

#13 solemnwarning

solemnwarning

    Member

  • Members
  • 73 posts
  •  
    United Kingdom

Posted 08 February 2009 - 02:56 AM

What label is shown if you list disks inside kexec-loader? What error do you get when attempting to use root LABEL=ubuntu?

#14 mr_

mr_

    Frequent Member

  • Members
  • 355 posts
  •  
    Germany

Posted 08 February 2009 - 03:14 AM

It's working now. Either I didn't wait long enough until USB was detected or a bad char in config file I guess.

#15 mr_

mr_

    Frequent Member

  • Members
  • 355 posts
  •  
    Germany

Posted 08 February 2009 - 03:50 AM

After the floppy version works so well I am trying to create a bootable CD for those computers without USB bootable BIOS and without a working floppy, but CD.

I thought using grub4dos floppy emulation will not work because the kernel is not using BIOS to read the modules on the floppy disk?

So I did copy the structure of the floppy and made a new folder, additionally I did put all the modules into the modules subdirectory. I used isolinux and mkisofs to create the a bootable iso. It books ok, until...

Searching for bootdisk...
Press a key to abort

Well, I think I will not be able to create a booatble iso without learning the Linux boot process, without hacking and without compiling from source?

#16 solemnwarning

solemnwarning

    Member

  • Members
  • 73 posts
  •  
    United Kingdom

Posted 08 February 2009 - 11:37 AM

You will need to compile a kernel with CD and ISO support, the modules are no use since you need to be able to mount the CD to load the modules :poke:
Once you've done that, kexec-loader searches for a disk with the volume name 'kexecloader' to use as the boot disk

#17 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 08 February 2009 - 12:52 PM

You will need to compile a kernel with CD and ISO support, the modules are no use since you need to be able to mount the CD to load the modules :poke:
Once you've done that, kexec-loader searches for a disk with the volume name 'kexecloader' to use as the boot disk

If I may :poke:, won't it be a nice feature of kexec-loader to have a number of kernels, each with different "levels" (or filesystems understood) to choose among?

I mean, most users of the board are not familiar enough with Linux to compile themselves a kernel, it is probable that they will either:
  • try nonetheless and fail, then we will have requests for help/fixes and the like
  • "abandon" kexec-loader, being it too complex to make it working

:poke:

jaclaz

#18 solemnwarning

solemnwarning

    Member

  • Members
  • 73 posts
  •  
    United Kingdom

Posted 08 February 2009 - 01:50 PM

I may build more kernels in the future, or possibly write a script to download/build Linux...

#19 mr_

mr_

    Frequent Member

  • Members
  • 355 posts
  •  
    Germany

Posted 08 February 2009 - 03:20 PM

The following in the codebox is all working.
title Ubuntu 8.04.2, kernel 2.6.24-23-generic - root uuid

root UUID=2bbadde7-2464-4276-ae55-a1c5079c3e12

kernel /boot/vmlinuz-2.6.24-23-generic

initrd /boot/initrd.img-2.6.24-23-generic

cmdline root=UUID=2bbadde7-2464-4276-ae55-a1c5079c3e12 ro quiet splash



title Ubuntu 8.04.2, kernel 2.6.24-23-generic - root LABEL

root LABEL=ubuntu

kernel /boot/vmlinuz-2.6.24-23-generic

initrd /boot/initrd.img-2.6.24-23-generic

cmdline root=UUID=2bbadde7-2464-4276-ae55-a1c5079c3e12 ro quiet splash



title Ubuntu 8.04.2, kernel 2.6.24-23-generic - sda3

root /dev/sda3

kernel /boot/vmlinuz-2.6.24-23-generic

initrd /boot/initrd.img-2.6.24-23-generic

cmdline root=UUID=2bbadde7-2464-4276-ae55-a1c5079c3e12 ro quiet splash

For a USB-HDD with Ubuntu (using /boot/grub) I am using
grub-path &#40;sda3&#41;/boot/grub

Error mounting GRUB device: Unknown device

When I type disks I first see only fd0, some seconds later I see fd0 and sda and even some seconds later I see fd0, sda, sda1, sda2 and so on (everything). I think the error mounting GRUB device error is because the kernel works nonblocking and asynchronous and needs a while until he recognized everything.

In console grub-device is not supported. What can I do to make it to work?

I may build more kernels in the future, or possibly write a script to download/build Linux...

That would be great...

Well, maybe it's a question, who does support most devices? It's not a bootloader, it's the linux kernel itself.

In order to support as much as possible devices, why not make a generic kernel with full driver support?

I doubt I will ever support network booting, if you want to boot from a server, PXE is a better choice.

I don't agree with PXE. PXE is extremely limited, mostly for intenral LAN cards. For things like booting from USB WLAN + WPA2 over SSL connection from remote server it's not working, fancy boot devices can be only booted with the full kernel.

#20 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 08 February 2009 - 03:54 PM

In order to support as much as possible devices, why not make a generic kernel with full driver support?

Because it would grow in size, that's why I suggested several different "levels", from the most basic to the most complete, in order to cover "all the range" of possible users, from minimalists to universalists. :poke:

jaclaz

#21 mr_

mr_

    Frequent Member

  • Members
  • 355 posts
  •  
    Germany

Posted 08 February 2009 - 04:10 PM

that's why I suggested several different "levels", from the most basic to the most complete, in order to cover "all the range" of possible users, from minimalists to universalists. :poke:

Sure this is optimal, but it creates a maintenance hell. To much builds needed for a every new version.

That's why I suggest to keep it simple, a floppy version and a full version.

Because it would grow in size,

As there is no magic involved the optimal state kexec-loader could reach is to boot from any BIOS supported boot medium and to chainboot any media supported by the linux kernel.

The question is which BIOS supported boot medium make sense to support?
- floppy (low size)
- harddisk (full grown kernel, no space problem)
- USB (full grownn kernel no problem and 1 GB USB pendrives are cheap)
- SCSI (full gorn kernel, no space problem)
- CD / DVD (full gorn kernel, no space problem)
- cardreader (well, also mostly USB) (full gorn kernel, no space problem as 1 GB cards are also cheap)
- zip (full gorn kernel, no space problem)
- network / internet (full gorn kernel, no space problem)

Still a valid argument is speed, a full blown kernel needs longer to boot then a stripped down. For my boot devices (CD / DVD) it doesn't take long to boot a full blown linux kernel (Live CD), the long taking part are init and gui.

#22 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 08 February 2009 - 04:14 PM

A "stripped down" and a "full bown" version seems to me like a good compromise. :poke:

People wanting "intermediate" builds may well work their way to build them. :poke:

jaclaz

#23 solemnwarning

solemnwarning

    Member

  • Members
  • 73 posts
  •  
    United Kingdom

Posted 08 February 2009 - 04:15 PM

In console grub-device is not supported. What can I do to make it to work?

I don't agree with PXE. PXE is extremely limited, mostly for intenral LAN cards. For things like booting from USB WLAN + WPA2 over SSL connection from remote server it's not working, fancy boot devices can be only booted with the full kernel.


You could tell me what you think grub-device is, I've never heard of it :poke:

WIFI, SSL, WPA?! AAAAH! RUN! THE WIFI DEMON IS HERE! WE'RE ALL GONNA DIE!!!

I think building a toolchain is more difficult than a kernel, I'm currently trying to write a script which generates an uClibc toolchain for kexec-loader instead of relying on the user creating one, so far I've managed to build binutils, I might get GCC to compile by tonight...

EDIT: The past few releases have initramfs's available on the download page, which can be linked into a kernel without needing to build a toolchain.

#24 mr_

mr_

    Frequent Member

  • Members
  • 355 posts
  •  
    Germany

Posted 08 February 2009 - 04:28 PM

You could tell me what you think grub-device is, I've never heard of it :poke:

Will answer later.

EDIT: The past few releases have initramfs's available on the download page, which can be linked into a kernel without needing to build a toolchain.

What are them supposed to do with? Can them be abused to put further modules inside?

#25 solemnwarning

solemnwarning

    Member

  • Members
  • 73 posts
  •  
    United Kingdom

Posted 08 February 2009 - 04:31 PM

You can just build a normal Linux kernel and set the initramfs path to that archive, instead of needing to build a toolchain and compile kexec-loader too




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users