You are not logged in.

#1 2013-08-11 22:11:52

12eason
Banned
Registered: 2010-07-20
Posts: 103

[Solved] Multiple kernels, same /boot

The Arch Installation media allows a choice between both 32bit and 64bit kernels. Is it possible to configure Arch to do this on a full install?

Last edited by 12eason (2013-08-12 15:47:02)

Offline

#2 2013-08-11 22:22:46

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [Solved] Multiple kernels, same /boot

Do you want to use 32-bit kernel with 64-bit system or vice versa?
https://bbs.archlinux.org/viewtopic.php?id=159193


Edit: There's also https://bbs.archlinux.org/viewtopic.php?id=139684

Last edited by karol (2013-08-11 22:30:15)

Offline

#3 2013-08-11 23:10:14

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] Multiple kernels, same /boot

The 64-bit kernel should be fully capable of running a 32-bit userspace.  But a 32-bit kernel requires a 32-bit userspace.  So if you are thinking about installing i686 at all, you will need to install those matching packages.  But if you have a 64-bit machine you can certainly install a 32-bit userspace and use either.  But this is not something that is supported.  It will require that you modify the two kernel packages in order to make them not conflict.  There will be conflicts in both the package data as well as the kernel files themselves.  Both packages will provide you with /boot/vmlinuz-linux.  So you will need to definitely have something that renames those files on install according to what particular kernel they are.

Honestly, I don't really see this as worth the effort.  Maybe you should explain what you are trying to achieve and why and then people can help you find a solution to your problem.  But your question is far too vague as it is now.

Offline

#4 2013-08-12 02:46:35

xoma
Member
Registered: 2013-08-10
Posts: 17

Re: [Solved] Multiple kernels, same /boot

I don't see a purpose in it either.  However if you need full support for 32 bit applications on your 64 bit arch you could try making a chroot.

https://wiki.archlinux.org/index.php/In … _in_Arch64

Offline

#5 2013-08-12 03:56:15

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] Multiple kernels, same /boot

Unless you have some special requirements, typically [multilib] is enough.

Offline

#6 2013-08-12 13:33:03

12eason
Banned
Registered: 2010-07-20
Posts: 103

Re: [Solved] Multiple kernels, same /boot

Thanks for replies, perhaps I should have been a bit more specific though. I boot my computer from a /boot partition on a USB drive. My computer is 64bit, and that's all I need from it. However I would also like to install Arch on the USB drive that contains /boot, so I can access my encfs encrypted files when I'm out and about. The problem is that the USB drive should really be 32bit, because I may not be able to use it with a 64bit machine. I could install two /boot partitions and then chainload the other to get the 32 bit kernel, but I'd like to be able to keep it all on one /boot partition and simply select the correct kernel and root from grub.

Offline

#7 2013-08-12 13:46:45

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: [Solved] Multiple kernels, same /boot

I have multiple Arch installs sharing /boot. You just need to rename your kernels and initrams. An update script I wrote handles the kernel renaming. For the initrams, I modify /etc/mkinitcpio.d/linux.preset:

ALL_config="/etc/mkinitcpio.conf"
ALL_kver="/boot/vmlinuz-linux"

PRESETS=('default')

default_image="/boot/caddywhompus.img"

That takes care of the initial mkinitcpio run after the kernel is installed. I also have /etc/mkinitcpio.d/caddy.preset for after the kernel rename, if I need to regenerate initramfs manually:

ALL_config="/etc/mkinitcpio.conf"
ALL_kver="/boot/vmlinuz-caddywhompus"

PRESETS=('default')

default_image="/boot/caddywhompus.img"

This is just for one install. The other has its own set of preset files.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#8 2013-08-12 13:50:32

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [Solved] Multiple kernels, same /boot

@alphaniner
Are some of your systems 32-bit and some 64-bit?

Offline

#9 2013-08-12 13:52:54

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: [Solved] Multiple kernels, same /boot

No, both 64 bit. I don't think it should matter, though. Am I wrong?


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#10 2013-08-12 15:06:04

12eason
Banned
Registered: 2010-07-20
Posts: 103

Re: [Solved] Multiple kernels, same /boot

alphaniner wrote:

..

That looks like it would do the job for the initramfs, thanks. I wonder if it's possible to get mkinitcpio to rename the kernel automatically, or maybe configure pacman to do it?

Last edited by 12eason (2013-08-12 15:06:41)

Offline

#11 2013-08-12 15:18:30

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] Multiple kernels, same /boot

I use UEFI, and for UEFI, the spec indicates the the ESP be set up in a certain way.  It is not required, but I do it just to please the hint of OCD inside me.  So the kernels and initramfs' are kept in a location that is not where pacman puts them.  Instead, the Arch Linux stuff gets put in /boot/EFI/arch (or /boot/efi/EFI/arch if you mount the ESP at /boot/efi).

So to put my initramfs in the proper location I use the method outlined by Alphaniner above.  But for the kernels, I use a systemd.path that has a "PathExistsGlob=/boot/vmlinuz-*".  This in turn runs a oneshot systemd.service that will move my kernel to where i want it to go and appends ".efi" to the name so that it can be recognized as an efi application by all bootloaders and boot managers.

You can check out the UEFI Bootloaders wiki page for a more in depth explanation of this.  There is also another option outlined there that uses a incron, as well as one that uses a mkinitcio hook.  Presumably, when the work on pacman hooks is complete, we will have a much nicer way to handle this.

Offline

#12 2013-08-12 15:26:49

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,574

Re: [Solved] Multiple kernels, same /boot

I have a USB install that works something like you're talking about. 32-bit userspace, and I choose between booting a 32 bit or 64 bit kernel. The key is that you need to have separate partitions/subvolumes for the modules and mount the correct one to /usr/lib/modules in the initramfs.

Offline

#13 2013-08-12 15:27:42

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [Solved] Multiple kernels, same /boot

12eason wrote:

I wonder if it's possible to get mkinitcpio to rename the kernel automatically, or maybe configure pacman to do it?

What do you mean by rename automatically?
You can have multiple presets, like /etc/mkinitcpio.d/caddy.preset alphaniner uses.

Offline

#14 2013-08-12 15:45:54

12eason
Banned
Registered: 2010-07-20
Posts: 103

Re: [Solved] Multiple kernels, same /boot

WonderWoofy wrote:

UEFI Bootloaders wiki page

That is perfect, thanks. Seems I can use systemd to move kernel and initramfs in /boot/x86_64/ folder on my machine, and move the 32 bit kernel to /boot/i686 from the usb drive.

Last edited by 12eason (2013-08-12 15:46:06)

Offline

Board footer

Powered by FluxBB