Gentoo Archives: gentoo-user

From: Dale <rdalek1967@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Dracut and how to specify names
Date: Sat, 04 Jan 2020 11:40:47
Message-Id: 5ebfdb49-6790-b82f-9cf3-3a12d57d1b82@gmail.com
In Reply to: Re: [gentoo-user] Dracut and how to specify names by Rich Freeman
1 Rich Freeman wrote:
2 > On Fri, Jan 3, 2020 at 5:57 AM Dale <rdalek1967@×××××.com> wrote:
3 >> Can you post a ls -al /boot for both kernels and images? That way I can
4 >> see how it names them when doing it your way. If I can make sense of
5 >> it, I may try doing it that way. Thing is, it'll change eventually
6 >> too. lol
7 > I use the standard kernel names:
8 >
9 > config-4.19.92
10 > initramfs-4.19.92.img
11 > System.map-4.19.92
12 > vmlinuz-4.19.92
13 > /lib/modules/4.19.92
14 >
15 > I create the initramfs using:
16 > dracut "" 4.19.92
17 >
18 > Dracut is going to need the path to the modules more than anything
19 > else, so I suspect it will work if you substitute 4.19.92 with
20 > whatever the path of your modules directory is, within /lib/modules.
21 >
22 > Also, could you actually post the command lines you're using? You
23 > posted 4 fairly long emails elaborating on how everything isn't
24 > working right, and I don't think you actually posted a single dracut
25 > command line. When something isn't working right it is usually best
26 > to start with what you're actually doing, along with what is happening
27 > and what you expected to happen. You mainly covered the last bit of
28 > those three but left out most of the first two.
29 >
30 > I actually use a script to do my kernel updates - this is intended
31 > mainly for bumps and isn't entirely suitable when I need to change
32 > things, in which case I usually just build manually following the same
33 > steps:
34 > #!/bin/bash
35 > cd /usr/src/linux || exit
36 > git pull || exit
37 > rm -rf /var/tmp/linux || exit
38 > export KBUILD_OUTPUT=/var/tmp/linux
39 > make O=/var/tmp/linux oldconfig || exit
40 > nice -n20 make O=/var/tmp/linux -j12 -l20 || exit
41 > make O=/var/tmp/linux modules_install || exit
42 > make O=/var/tmp/linux install || exit
43 > emerge @module-rebuild || exit
44 > NEWVER=$(make --no-print-directory kernelversion) || exit
45 > dracut "" $NEWVER || exit
46 > grub-mkconfig -o /boot/grub/grub.cfg
47 >
48 > (This does all the building in /var/tmp and leaves me with a clean
49 > kernel source directory. That is actually the upstream-recommended
50 > way but it does create the issue that if any package that builds
51 > kernel modules gets updated it will fail. I usually just delay
52 > updating these packages until I do my next kernel update, but I can
53 > just run this script again to re-create /var/tmp/linux with the
54 > necessary files to build further modules. Note that you need a few GB
55 > in /var/tmp for this to work, and this script doesn't clean up - I
56 > usually want that directory left for any module updating, and it gets
57 > cleared on reboot anyway which usually follows a kernel update. This
58 > works great on tmpfs if you have the space.
59 >
60 > Note also that I'm using upstream stable vanilla sources - I checkout
61 > a longterm branch which is what is getting pulled at the start. This
62 > should work with gentoo sources as well if you just tweak the start.
63 > I like to maintain more control over what kernel I'm following as I
64 > tend to use out-of-tree modules like zfs, or experimental ones like
65 > btrfs, or newer CPUs like Ryzen - for one reason or another just
66 > following random stable releases is problematic.)
67 >
68
69
70 Those names make sense but I wonder if I could add sequence numbers on
71 the end.  Most of the time, -1 works since I use oldconfig a lot.  On
72 occasion tho, I'll have a -2, like this time, or even a -3.  I don't get
73 that far as often as I used to tho.
74
75 The reason I didn't include a command that was tried, I had so many of
76 them that I tried and they were spread over several different tabs in
77 konsole.  I tried changing names of kernels, including locations and no
78 telling what else.  If I posted them, even I wouldn't be able to make
79 much sense of it. I'm sure no one else could if I couldn't.  I fiddled
80 with that for hours.  I don't like going back to a older version since
81 eventually it will be gone but I did in this case.  Still, I need to
82 figure out the new one since I will have to use it later on. 
83
84 I use gentoo-sources.  I update sometimes but given that I don't reboot
85 much, it may take a long while to test a kernel.  I've had times where I
86 build a kernel but later do a newer one and end up never using other
87 updated kernels.  I use uprecords to tell me what kernels I've used and
88 for how long. I keep two or three known and well tested kernels around
89 just in case.  Others I delete if /boot starts taking up to much space. 
90 I start by removing older kernels that have never been used, then older
91 kernels and work my way up until I'm left with three or so.  I also make
92 sure my video drivers will work with updated kernels as well.  Sometimes
93 the newest ones don't.  I have older cards as a general rule.
94
95 I'm going to play with this some more another day.  Health issues has me
96 staying off this thing a bit. 
97
98 Dale
99
100 :-)  :-)

Replies

Subject Author
Re: [gentoo-user] Dracut and how to specify names Neil Bothwick <neil@××××××××××.uk>