You are not logged in.

#1 2014-06-20 10:45:07

jvenant
Member
Registered: 2014-06-20
Posts: 9

[SOLVED] Generate kernel image for multiple computers

Hi,

I have an USB3 SSD drive with an archlinux on it.
It allow me to boot on my prefered work environment from almost any computer.

It works like a charm.... most of the time ^_^
I'm just facing one issue :

When I build a new kernel image using mkinitcpio from my desktop (through a pacman upgrade for example),
I can't boot anymore from my laptop. The boot fail on the usb partition detection. Waiting for it...
If I build the kernel image from my laptop, I can boot everywhere

I suspect an usb driver compatibility issue...

I'm not very comfortable with mkinitcpio. I usually just let the magic happen.

So I have 2 questions :
How a kernel image differ from one computer to an other and how mkinicpio determine those differences.
Can I configure mkinitcpio to build the kernel image like the laptop image. Even if I build it from my desktop

Thank you very much.

Last edited by jvenant (2014-06-20 16:39:06)

Offline

#2 2014-06-20 11:00:30

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,456
Website

Re: [SOLVED] Generate kernel image for multiple computers

https://wiki.archlinux.org/index.php/Mkinitcpio#HOOKS

Check what hooks are used for each computer, then add them to mkinitcpio.conf.  Or just remove autodetect.

You may also want to edit your title to be more descriptive of your actual question. (edit: thanks, this title is much better)


Mod note: moving to N.C.

Last edited by Trilby (2014-06-20 15:08:57)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2014-06-20 12:58:42

jvenant
Member
Registered: 2014-06-20
Posts: 9

Re: [SOLVED] Generate kernel image for multiple computers

Thank you for your quick answer.


Trilby wrote:

https://wiki.archlinux.org/index.php/Mkinitcpio#HOOKS

Check what hooks are used for each computer, then add them to mkinitcpio.conf.  Or just remove autodetect.
.

I use the same mkinitcpio.conf on all my computers

MODULES=""
BINARIES=""
FILES=""
HOOKS="base udev autodetect modconf block filesystems keyboard fsck"

autodetect create a whitelist of modules based on the computer hardware (good lead thank you). It allows to limit initramfs size.

  • Is it OK to just remove autodetect ? This is equivalent to use the fallback image isn't it ?

  • Is a modules whitelist a good kernel image improvement. Should I try to keep it or is it mainly useless with today computers ?

  • Do I have a way to get the autodetect hook whitelist ?

  • Do I have a way to use my own whitelist to generate kernel image ?

Last edited by jvenant (2014-06-20 13:01:54)

Offline

#4 2014-06-20 13:25:53

stevenhoneyman
Member
From: England
Registered: 2014-05-25
Posts: 241

Re: [SOLVED] Generate kernel image for multiple computers

Forget the hooks - autodetect will be removing anything not in use by "block" (I'd guess you have USB3 on desktop, but not on laptop?)

Try adding these modules as a start (might be a bit out of date, just taken from my notes)

usbcore usb_storage ohci_hcd ehci_hcd uhci_hcd xhci_hcd sd_mod scsi_mod ahci vfat

Offline

#5 2014-06-20 15:11:24

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,456
Website

Re: [SOLVED] Generate kernel image for multiple computers

Yes it is definitely ok to just remove autodetect.  In fact you can test whether this would be sufficient: try to boot the "fallback image" on the computer that doesn't currently boot.  If that works, you have your answer.  The difference between the regular image and the fallback image is that 'autodetect' is ignored used for the fallback.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#6 2014-06-20 16:38:49

jvenant
Member
Registered: 2014-06-20
Posts: 9

Re: [SOLVED] Generate kernel image for multiple computers

Many thanks to both of you.

Both solutions work : adding modules and booting using fallback image.

I think I'm going to use the modules solution for my "normal" kernel image because boot time seems to be a little bit shorter using this solution. But it may be subjective...?
And any way I will still be able to test the fallback solution in case of a very uncomprehending computer ^_^

In fact, in my case, xhci_hcd module was enough.

So, as a final point, I would say that my approach now is

  • To have a "normal" kernel image "reasonably" generic.

  • I now know that I can use the fallback image if I have difficulties booting on a specific device

  • Any way, to use all the available hardware features of a device, it's better to build a specific kernel image. So I will build kernel images for my most often used devices

Last edited by jvenant (2014-06-20 17:21:50)

Offline

Board footer

Powered by FluxBB