blog about departure from TC
[web/gag.com] / bdale / blog / posts / elilo_in_Debian.mdwn
1 In a recent work-related conversation, Matthew Wilcox pointed out that EFI
2 partitions are mountable on Linux and many distributions keep ia64 system
3 partitions mounted at /boot/efi by default, but Debian does not.  Since that 
4 behavior is mostly my fault, I recounted the history by way of explaining why
5 it worked that way... and on suggestion from Martin Pool am repeating it here
6 to document all this for posterity.
7
8 When we were making ia64 bootstrap decisions, the default bootloader
9 on i386 was lilo, and the closest example to what we needed for ia64 in 
10 Debian was powerpc.  This is because systems using EFI only understand FAT
11 partitions by default, and thus need a FAT partition somewhere that the 
12 firmware can read from... often the first partition on the first disk.  The 
13 Debian model for handling such things at the time seemed to be to craft a 
14 command to hook from kernel package postinst scripts that did the heavy 
15 lifting in association with a config file.   What went on behind the curtain 
16 wasn't something to bother the user with on an average day if you could avoid
17 it cleanly.
18
19 Some bootloaders know how to read a config file from /boot directly, and we
20 started out thinking we'd use elilo that way, but it was hard to match up 
21 paths/naming in EFI to what they would look like under Linux.  It was also
22 clear to me that most ia64 systems were going to have large system partitions
23 so there'd be plenty of space.  So we
24 punted and copy the elilo executable, config file, and any kernels or initrd
25 files referenced in the config to the system partition.
26
27 I also thought the default location other distributions had chosen for 
28 mounting the EFI partition once the kernel was up, /boot/efi, 
29 was pretty ugly, but I couldn't think of anything better.  The problem is 
30 that the standard says you need an 
31 \efi\"whatever" directory as the root of your content in the system partition,
32 so mounting the 
33 partition at /boot/efi yields paths like /boot/efi/efi/debian.  Some 
34 distributions didn't adhere to the standard at first, and so didn't see 
35 the ugliness until they started to comply... but I was on a team at HP making 
36 disk partitioning and content decisions that caused me to be very aware of 
37 these details.
38
39 Putting that all together, I decided there wasn't any point in having the EFI
40 partition mounted by default... anyone who cared and wanted it mounted 
41 could just add a line to /etc/fstab to put it wherever they wanted.  If 
42 I were doing it again today, I'd have an entry in /fstab marked noauto 
43 delivered during system installation.  I haven't cared enough to tackle 
44 that change, though. 
45
46 Sadly, there's one detail of the current implementation that can get in 
47 the way of complete happiness.  The Debian-specific 'elilo' script that 
48 runs in user space to manage the EFI 
49 boot partition contents based on the content of /etc/elilo.conf expects to 
50 have to mount the EFI partition, and exits with a complaint if the partition
51 is already mounted.  For typical users, this script only gets called during
52 installation and from kernel package postinsts, and the actual elilo
53 bootloader remains oblivious to all this.  If other distros have picked up
54 the Debian script, I'm not aware of it.  So, you're no worse off
55 mounting the EFI partition in Debian than with some other distro, you
56 just get treated poorly if you try to use our elilo script while the 
57 partition is mounted.  
58
59 Clearly, we could handle this better.  If someone wants to offer up a patch 
60 to the elilo script that asks the user if it's OK to scribble
61 in the already-mounted partition instead of doing a mount / scribble /
62 unmount cycle in the presence of an existing mount, I'll be happy to
63 include it in the Debian elilo package.
64
65 Meanwhile, a lot of us have switched from lilo to grub on our i386 systems, 
66 and I'd love for my ia64 systems to work more like my grub-equipped 
67 systems.  But making a substantive change like teaching elilo to know 
68 where /boot is 
69 so that it can read a config file from there and do things more like grub, 
70 without symlinks, etc, has several issues.  We'd need to get the right set of 
71 file systems supported from EFI/elilo, we'd need to address the naming issues,
72 and we would require either user intervention on upgrade, or some clever 
73 automatic parsing and rewriting of the relevant config files.  
74
75 I can think of other things that would be more rewarding to work on, 
76 so don't anyone hold their breath...
77
78 [[!tag tags/debian]]