Gentoo Archives: gentoo-user

From: Michael <confabulate@××××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Dual booting with Windows 10
Date: Thu, 27 May 2021 11:01:49
Message-Id: 2032349.OBFZWjSADL@lenovo.localdomain
In Reply to: Re: [gentoo-user] Dual booting with Windows 10 by Peter Humphrey
1 On Thursday, 27 May 2021 09:22:33 BST Peter Humphrey wrote:
2 > On Wednesday, 26 May 2021 14:49:01 BST Michael wrote:
3 > > On Tuesday, 25 May 2021 16:23:01 BST Peter Humphrey wrote:
4 > > > Thanks for the offer, Michael, but let me clear a few things up first.
5 > > >
6 > > > 1. I don't use symlinks in /boot.
7 > >
8 > > This allows a simpler single boot partition (ESP) & filesystem set up
9 > > (VFAT).
10 >
11 > How do symlinks work on a FAT32 partition?
12
13 They don't. Hence binary Linux distributions' boot files are typically spread
14 over two partitions, ESP and /. Distributions which deploy symlinks of
15 vmlinuz, vmlinuz.old and initrd.gz, initrd.gz.old, plus all the kernel files
16 they point to, have these stored on the OS / partition under /boot/. The OS /
17 partition is invariably formatted with a filesystem which supports symlinks,
18 e.g. ext4.
19
20 The 3rd party boot manager's efi image is stored instead on the ESP, in a
21 subdirectory under mountpoint /boot/efi.
22
23 When a distribution's kernel update/install scripts are run, the latest kernel
24 images are copied to /boot/ and the vmlinuz and initrd.gz symlinks are
25 replaced accordingly.
26
27 The boot manager's efi image under /boot/efi does not change, unless it has a
28 new version installed.
29
30
31 > --->8
32 >
33 > > > I followed the installation handbook, boot-loader section, to create a
34 > > > UEFI
35 > > > boot entry. I followed the syntax precisely, with several variations at
36 > > > various attempts. In every case, the UEFI BIOS listed the new entry but
37 > > > couldn't execute it.
38 > >
39 > > This should work to launch your systemd-boot:
40 > >
41 > > efibootmgr --create --disk /dev/nvme0n1 --part 1 --label "systemd-boot" --
42 > > loader "\EFI\Boot\bootx64.efi"
43 >
44 > It didn't, but ...
45
46 Hmm ... if neither "\EFI\systemd\systemd-bootx64.efi", nor the fallback image
47 "\EFI\Boot\bootx64.efi" allowed you to boot Gentoo, then I suspect this was
48 because something was amiss with the systemd-boot configuration. The UEFI
49 firmware would be able to load and run either of the above files (one is a
50 copy of the other). Thereafter, it would be up to the systemd-boot image to
51 manage the boot process and load whatever you had pointed it to and it had
52 managed to find.
53
54 Of course, this assumes the systemd-boot entry was above the Microsoft boot
55 manager entry in the UEFI boot menu list. Running 'efibootmgr' or going into
56 the UEFI menu at start up would confirm the list order as far as the MoBo
57 firmware is concerned.
58
59
60 > > This would also work, if vmlinuz-5.10.27-gentoo, config-5.10.27-gentoo,
61 > > and
62 > > System.map-5.10.27-gentoo are stored on the ESP under the EFI/ directory,
63 >
64 > > e.g. in EFI/Linux/, to launch your current kernel directly:
65 >
66 > That's the point I was missing - where those three files live. I had them at
67 > the root of the FS, as implied by the installation wiki.
68
69 Right, the installation handbook is trying to cover all bases and the
70 permutations of partition table types, partitions, fs formats and mountpoints
71 are large.
72
73 The idea of using vmlinuz symlinks at the root of /boot is to simplify/script
74 the installation of a new kernel. The boot manager just needs to be
75 configured to boot vmlinuz and vmlinuz old and this does not change. What
76 does change is the kernel image these symlinks point to. Keeping kernel
77 images on the OS / partition means the ESP itself can be quite small too,
78 since only the boot manager efi image and a fallback image need to be stored
79 on it.
80
81 The systemd-boot specification expects devs to drop their kernels within a
82 suitably named subdirectory within the EFI directory, which is why systemd-
83 boot is averse to a small size ESP.
84
85
86 > --->8
87 >
88 > > 2. Use some other better suited 3rd party boot manager (not systemd-boot).
89 > > The principle is broadly the same as your present setup. Each boot
90 > > manager
91 > > has its own idiosyncrasies and commands of choice. GRUB is quite
92 > > automated, although you can overwrite its grub.conf menu and decline
93 > > using
94 > > update-grub, or grub-mkconfig to generate it. Then again, why would you
95 > > select such a heavily automated and complicated piece of software, only to
96 > > bypass the very functionality its devs wanted to offer? Contrastingly,
97 > > syslinux is very simple and lightweight, but you have to manually
98 > > configure
99 > > its also very simple boot menu.
100 >
101 > I don't want to start on about grub. I washed my hands of it a few years
102 > ago, after struggling to set it up to offer a choice including a kernel
103 > with three run-level options: default, no X and no network.
104
105 Heh! I've always felt GRUB2, as opposed to GRUB-legacy, was trying to solve a
106 problem I never had. ;-)
107
108 That said, GRUB2 offers minimal hassle when used with vanilla configurations.
109
110
111 > > PS. The UEFI firmware will scan more than a single VFAT partition marked
112 > > as ESP type, but as far as I know this will only work if the ESP is on
113 > > the first disk - I haven't tried it.
114 >
115 > That may be Wol's answer.
116 >
117 > Thanks again for all the work you've put into this, Michael.
118
119 You're welcome. :-)
120
121 I found choosing a tool which is a best fit for the user requirements is
122 usually easier than trying to bend a less suitable tool to do what you desire.
123 If a boot menu at *each* start up is a must, have you given syslinux any
124 consideration? It is simpler to configure and probably more flexible than
125 systemd-boot.

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] Dual booting with Windows 10 Peter Humphrey <peter@××××××××××××.uk>