Gentoo Archives: gentoo-user

From: David Haller <gentoo@×××××××.de>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: kernel choices for booting gentoo as guest in vbox vm
Date: Thu, 01 Feb 2018 16:41:22
Message-Id: 20180201161226.whlcjbdexreyk3yd@grusum.endjinn.de
In Reply to: [gentoo-user] Re: kernel choices for booting gentoo as guest in vbox vm by Harry Putnam
1 Hello,
2
3 On Thu, 01 Feb 2018, Harry Putnam wrote:
4 >I did get a screenshot but it is very limited showing only a couple
5 >dozen lines of the boot messages. (attached at the end.)
6
7 Still helps: device 8,65 is /dev/sde1. Check on that ;) E.g. in the
8 fstab inside the initrd ... And keeping the initrd up-to-date is one
9 thing genkernel makes easy BTW ;)
10
11 Check your bootloader config! Check your initrd. Check your fstab (and
12 regenerate your initrd if changes concern the root- or resume-device).
13
14 >I've never used genkernel, but from what I understand it builds
15 >everything + the kitchen sink.. so should get the right drivers
16 >hopefully.
17
18 Actually no, you can quite easily configure it to just the tedious
19 work.
20
21 Currently I use this:
22
23 1. install new kernel sources (in my case vanilla-sources)
24 2. copy over old config from last source tree, /boot/, /proc/config.gz
25 whatever
26 3. run 'make oldconfig'
27 4. optionally note down some new options and then checkup on them using
28 'make menuconfig' and searching for the noted options
29 it's this step I want to be able to do why I configured genkernel as
30 I did (see below)
31 5. run 'genkernel --kerneldir=. all', but note config below!
32 6. check /boot/ and /boot/grub*/ if all went right
33 7. recompile neccessary out-of-tree drivers like e.g.
34 x11-drivers/nvidia
35 8. done
36
37 If I just reconfigure, I start at step 4, change the localversion too
38 in menuconfig. If something breaks, I run 'make clean', save config
39 and run 'make mrproper' restore config, etc.
40
41 ==== delcomments /etc/genkernel.conf ====[1]
42 OLDCONFIG="no"
43 MENUCONFIG="no"
44 CLEAN="no"
45 MRPROPER="no"
46 MOUNTBOOT="yes"
47 SYMLINK="yes"
48 SAVE_CONFIG="yes"
49 USECOLOR="yes"
50 LVM="no"
51 LUKS="no"
52 GPG="no"
53 DMRAID="no"
54 BUSYBOX="yes"
55 MDADM="no"
56 MULTIPATH="no"
57 ISCSI="no"
58 E2FSPROGS="yes"
59 ZFS="no"
60 BTRFS="no"
61 FIRMWARE="no"
62 FIRMWARE_DIR="/lib/firmware"
63 FIRMWARE_FILES=""
64 DISKLABEL="yes"
65 BOOTLOADER="grub"
66 SPLASH="no"
67 DOKEYMAPAUTO="no"
68 KEYMAP="0"
69 GK_SHARE="${GK_SHARE:-/usr/share/genkernel}"
70 CACHE_DIR="/var/cache/genkernel"
71 DISTDIR="${GK_SHARE}/distfiles"
72 LOGFILE="/var/log/genkernel.log"
73 LOGLEVEL=5
74 DEFAULT_KERNEL_SOURCE="/usr/src/linux"
75 BUSYBOX_APPLETS="[ ash sh mount uname echo cut cat mdev switch_root findfs umount unxz xz cpio fsck fdisk halt insmod less lzop makedevs modinfo modprobe reboot"
76 RAMDISKMODULES="0"
77 COMPRESS_INITRD="yes"
78 COMPRESS_INITRD_TYPE="gzip"
79 WRAP_INITRD=no
80 ====
81
82 Of course you must adapt the options for your needs, esp. those for
83 the initrd if you boot from e.g. a md-device and some such.
84
85 I don't actually use the generated initrd, but having them in /boot
86 with less that 3MB in my case is ok and might come in handy when
87 something fails.
88
89 For me, this has worked nicely the last years. Esp. generating the
90 grub1 entries and handling the symlinks to the current and last
91 kernel, initrd and System.map works flawlessly[2].
92
93 HTH,
94 -dnh
95
96 [1] delcomments does just that, omit shell-style comments and empty
97 lines
98 ====
99 #!/bin/sed -f
100 /^[[:space:]]*#/d
101 /^[[:space:]]*$/d
102 ====
103
104 [2] ok, if you manually prune versions from the middle, you'll need to
105 set the .old symlinks back to an older version (or the current?),
106 haven't checked that yet, but setting it to the previous remaining
107 version works nicely.
108
109 I still haven't checked too, if you could have this setup:
110
111 ====
112 [options omitted]
113
114 title=Gentoo current kernel
115 root (hd0,1)
116 kernel /boot/kernel OPTIONS...
117 [initrd /boot/initramfs]
118
119 title=Gentoo old kernel
120 root (hd0,1)
121 kernel /boot/kernel.old OPTIONS...
122 [initrd /boot/initramfs.old]
123
124 ### <<=== HERE
125
126 title=Gentoo Linux (4.15.0-dnh1)
127 root (hd0,1)
128 kernel /boot/kernel-genkernel-x86_64-4.15.0-dnh1 OPTIONS...
129 [initrd /boot/initramfs-genkernel-x86_64-4.15.0-dnh1]
130
131 title=Gentoo Linux (4.14.15-dnh1)
132 root (hd0,1)
133 kernel /boot/kernel-genkernel-x86_64-4.14.15-dnh1 OPTIONS...
134 [initrd /boot/initramfs-genkernel-x86_64-4.14.15-dnh1]
135 ...
136 ====
137
138 and that new versioned entries would be put at the "HERE" or at the top.
139
140 I marked the 'initrd' stuff as optional with the [], as I don't use
141 an initrd.
142
143 And maybe some other boot options (e.g. for another distro or Winders)
144 sprinkled in at some location.
145
146 Anyway, generally genkernel is a great help and occasionally
147 pruning/reordering entries in the grub1 /boot/grub/menu.lst is easy,
148 just delete/move stuff around with $EDITOR :)
149
150 I never understood why grub2 chucked out the major advantage grub1 had
151 over lilo: not needing to re-install the boot-sector / stage1 of the
152 bootloader after every change to the config... Beats me still today.
153 Which is why I continue to use grub1, which can do all I need (and
154 more) just nicely. Thank you very much.
155
156 --
157 Too bloated to crash, it can only bounce gently into the limits set by
158 the laws of physics and stop, wobbling slightly. -- unknown

Replies

Subject Author
[gentoo-user] Re: kernel choices for booting gentoo as guest in vbox vm Harry Putnam <reader@×××××××.com>