Peter Humphrey wrote:
> On Wednesday, 14 September 2022 23:09:59 BST Neil Bothwick wrote:
>> On Wed, 14 Sep 2022 16:50:45 +0100, Peter Humphrey wrote:
>>> I'm thinking of separating /usr onto its own partition so that I can
>>> have it mounted read-only except while updating it. I'd prefer not to
>>> have to make an init thingy, not having needed one up to now. Besides,
>>> some machines have things like early-ucode or amd-uc.
>> Most of this has already been answered, except for your final point. You
>> can load more than one initrd at boot, so you can still apply microcode
>> updates. For example, with systemd-boot
>>
>> title        Desktop
>> version      5.15.59-gentoo
>> linux        /vmlinuz-5.15.59-gentoo
>> options      root=LABEL=blah blah
>> initrd       /amd-uc.img
>> initrd       /initramfs-5.15.59-gentoo.img
>>
>> I use dracut to create the initrd, which is so straighforward even Dale
>> can't break it ;-)
> :)
>
> That seems to be the way to go then - even dinosaurs die out in the end. 
> Perhaps Dale will show us the command he referred to.
>
> Thank you all for your help.
>


As I said, I do all mine by hand.  I don't use make install etc.  After
I build my kernel, I copy it and name it something like this, from /boot.


root@fireball / # ls -al /boot/kernel*
-rw-r--r-- 1 root root 11638944 Nov 30  2021 /boot/kernel-5.10.46-2
-rw-r--r-- 1 root root 11863664 Feb 18  2022 /boot/kernel-5.14.15-2
-rw-r--r-- 1 root root 11881040 Aug  6 18:00 /boot/kernel-5.14.15-3
-rw-r--r-- 1 root root 12128016 Jun 30 20:00 /boot/kernel-5.18.7-1
-rw-r--r-- 1 root root 11167744 Nov 30  2021 /boot/kernel-5.6.7-1
root@fireball / #

I basically put the version and at times a dash number on the end. 
Sometimes "-1" may work but I add a driver or something and the next is
-2, the next -3 etc.  For -3 above, I added a driver for a new network
card as a example.  Sometimes I clean out older dashed versions.  Point
is, it needs to start with kernel and go from there.  You may have a
different way of naming them.  I think grub just looks for it to start
with kernel. 

Once I get that done, I then build the init thingy.  This is Neil's
command that he posted.  From my understanding, the kernel symlink needs
to point to the correct kernel version. 

dracut --kver=$(cat include/config/kernel.release)

That gives a init thingy with a somewhat generic name.  I then rename it
to match the kernel, looks something like this from /boot.


root@fireball / # ls -al /boot/initramfs*
-rw------- 1 root root 9310818 Nov 30  2021 /boot/initramfs-5.10.46-2.img
-rw------- 1 root root 9093386 Nov 13  2021 /boot/initramfs-5.14.15-2.img
-rw------- 1 root root 9485412 Aug  6 18:01 /boot/initramfs-5.14.15-3.img
-rw------- 1 root root 9117155 Jun 30 22:57 /boot/initramfs-5.18.7-1.img
-rw------- 1 root root 9310789 Nov 30  2021 /boot/initramfs-5.6.7-1.img
root@fireball / #

Once you get the two things to match, kernel and initramfs, then when
you update grub, it will match them together and create the needed
entries.  I think at one point, I had one init for each kernel version
without the dash part.  I can't recall how I did that tho.  To update
grub, I use this command. 


grub-mkconfig -o /boot/grub2/grub.cfg

I actually put it in a file in /root and just run it.  I just named it
grub-update.  That way I don't have to remember the option part. ;-) 
When it runs, just make sure it sees the kernel and a matching
initramfs.  It usually lists them in order. 

I don't update kernels that often.  If you do it more often, others will
have more automated ways to do things.  They may use make install and
other things that makes it a lot faster.  I do it this way because it is
not something I have to do often and I always get a good result.  Plus,
I keep the ones I know work well. 

It's been a while but I think Neil may have a more automated process. 
Heck, if he shares his step by step, I may convert.  LOL 

I don't think I left anything out.  :/

Dale

:-)  :-) 

Reply via email to