From a444a46387483758bb8d75cf16d48db6b7876cff Mon Sep 17 00:00:00 2001 From: Max Rees Date: Sat, 11 Jul 2020 00:49:43 -0500 Subject: user/lilo: move trigger to easy-boot.d; adjust initramfs name --- user/lilo/APKBUILD | 12 ++++-- user/lilo/initramfs.patch | 81 +++++++++++++++++++++++++++++++++++++++++ user/lilo/lilo.easy-boot | 93 +++++++++++++++++++++++++++++++++++++++++++++++ user/lilo/lilo.trigger | 93 ----------------------------------------------- 4 files changed, 183 insertions(+), 96 deletions(-) create mode 100644 user/lilo/initramfs.patch create mode 100644 user/lilo/lilo.easy-boot delete mode 100644 user/lilo/lilo.trigger (limited to 'user/lilo') diff --git a/user/lilo/APKBUILD b/user/lilo/APKBUILD index 606b633b3..6282c211c 100644 --- a/user/lilo/APKBUILD +++ b/user/lilo/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Max Rees pkgname=lilo pkgver=24.2 -pkgrel=0 +pkgrel=1 pkgdesc="Minimal BIOS bootloader for x86 systems" url="https://www.joonet.de/lilo/" arch="pmmx x86 x86_64" @@ -10,13 +10,14 @@ license="BSD-3-Clause AND GPL-2.0+ AND Public-Domain" depends="perl" makedepends="dev86 linux-headers lvm2-dev sharutils" subpackages="$pkgname-doc" -triggers="$pkgname.trigger=/boot" source="https://www.joonet.de/lilo/ftp/sources/lilo-$pkgver.tar.gz adelie.patch cflags.patch + initramfs.patch musl.patch partuuid.patch lilo.conf.template + lilo.easy-boot " build() { @@ -41,11 +42,16 @@ package() { "$pkgdir"/etc/lilo/lilo.conf.template mv "$pkgdir"/etc/lilo/lilo.conf_example \ "$pkgdir"/etc/lilo/lilo.conf.example + + install -Dm755 "$srcdir"/lilo.easy-boot \ + "$pkgdir"/etc/easy-boot.d/50-lilo } sha512sums="4437cae21345f483194a5dc95f686f3f3cb2beec78faae3fba959db25eae29fe2c56732e055c05f1d101682c5d442cdc9561fae8074f61f5537dde0413204c54 lilo-24.2.tar.gz cf8dab563e88cc7b280f5740c3b0f25049b9ce27c77a67e7b0c55dc21a158f8b2998f0c7743f11bcc4ae893697e6b6cc56054a40919899bf2d6d79b4e1a59190 adelie.patch ed1ffb03dbbbf6fe6974d045005f72b3657d470cd3f3556d582e09a38836090c3e75a684a1dcfbe7ade91e5ada3706b712ae7111460df85454518a746c60bde4 cflags.patch +98e26319a747e6cc7e9d7c695d20e511ef9d196dfc312403c7171380e75edbbdec6af39c0f1670956bcd7ec9ff203505c4001962c767f651b730da31830ed35f initramfs.patch 1c1ce61d2d7c88c1ba66e1415b36edb6743f46a50857b5bcd2b6b28a0711e4de3f0a75c352a5997bc9b5d50b0754c49a3f69b736e07a6e389c02da004289c64f musl.patch 3962bf30a866f31fa5263618210d61ac5663117cac1d5a52a5e14f3665ff8edfd628c80807591f3da5f2e6908b8c0af9b19fac32f6ab90e6c4755bf79cb34d5a partuuid.patch -489f57d29ee6607fb7040a33655bc369a510290804ae11686e02ba91d6cd3401175fa93d8d74da6058f03126b924004d28d5145ec5df70be4d04acba112c5729 lilo.conf.template" +489f57d29ee6607fb7040a33655bc369a510290804ae11686e02ba91d6cd3401175fa93d8d74da6058f03126b924004d28d5145ec5df70be4d04acba112c5729 lilo.conf.template +cdf4ea20a678cc01149c06556fe6b3b9b70a91aad7e44ffb7728b677297de8f68d4a5037aa44414bd606c838621fc9191c5ad45f909538b852c1f770b4fcb2e4 lilo.easy-boot" diff --git a/user/lilo/initramfs.patch b/user/lilo/initramfs.patch new file mode 100644 index 000000000..f6aca7f75 --- /dev/null +++ b/user/lilo/initramfs.patch @@ -0,0 +1,81 @@ +Adjust expected initrd name to match what dracut produces. + +--- lilo-24.2/scripts/liloconfig 2015-11-21 18:00:21.000000000 -0600 ++++ lilo-24.2/scripts/liloconfig 2020-07-11 00:35:13.400130230 -0500 +@@ -618,8 +618,8 @@ sub write_image_config { + foreach $image (@vmlinuz) { + # search for kernel initrd file + chomp $image; +- $initrd = $image; +- $initrd =~ s/vmlinuz/initrd\.img/; ++ $initrd = $image . ".img"; ++ $initrd =~ s/vmlinuz/initramfs/; + $initrd2 = $initrd; + $initrd2 =~ s/\.img//; + $nr2 = $nr + 1; +@@ -694,8 +694,8 @@ sub write_imagelinks_config { + foreach $image (@vmlinuz) { + # search for kernel initrd file + chomp $image; +- $initrd = $image; +- $initrd =~ s/vmlinuz/initrd\.img/; ++ $initrd = $image . ".img"; ++ $initrd =~ s/vmlinuz/initramfs/; + $nr2 = $nr + 1; + + print MYFH_NEW 'image = ' . $image . "\n"; +@@ -837,7 +837,7 @@ Lines in the configuration file /etc/lil + # restricted + # alias = 1 + # optional +- initrd = /boot/initrd.img-3.17-trunk-686 ++ initrd = /boot/initramfs-3.17-trunk-686.img + + image = /boot/vmlinuz-3.14-trunk-686 + label = "Linux Old" +@@ -847,7 +847,7 @@ Lines in the configuration file /etc/lil + # restricted + # alias = 2 + # optional +- initrd = /boot/initrd.img-3.14-trunk-686 ++ initrd = /boot/initramfs-3.14-trunk-686.img + + =head1 COPYRIGHT and LICENSE + +--- lilo-24.2/man/liloconfig.8 2015-11-21 17:25:48.000000000 -0600 ++++ lilo-24.2/man/liloconfig.8 2020-07-11 00:45:57.850132663 -0500 +@@ -140,7 +140,7 @@ Lines in the configuration file /etc/lil + \& # restricted + \& # alias = 1 + \& # optional +-\& initrd = /boot/initrd.img\-3.17\-trunk\-686 ++\& initrd = /boot/initramfs\-3.17\-trunk\-686.img + \& + \& image = /boot/vmlinuz\-3.14\-trunk\-686 + \& label = "Linux Old" +@@ -150,7 +150,7 @@ Lines in the configuration file /etc/lil + \& # restricted + \& # alias = 2 + \& # optional +-\& initrd = /boot/initrd.img\-3.14\-trunk\-686 ++\& initrd = /boot/initramfs\-3.14\-trunk\-686.img + .Ve + .SH "COPYRIGHT and LICENSE" + .IX Header "COPYRIGHT and LICENSE" +--- lilo-24.2/man/lilo.conf.5 2013-06-07 14:17:39.000000000 -0500 ++++ lilo-24.2/man/lilo.conf.5 2020-07-11 00:44:59.650132443 -0500 +@@ -47,12 +47,12 @@ menu-title=" John's Computer " + ### bootable kernel images ### + image=/boot/vmlinuz-2.6.29-1-i386 + label=try +- initrd=/boot/initrd.img-2.6.29-1-i386 ++ initrd=/boot/initramfs-2.6.29-1-i386.img + image=/boot/vmlinuz-2.4.33-1-i386 + label=2.4.33 + image=/tamu/vmlinuz + label=tamu +- initrd=/tamu/initrd.img ++ initrd=/tamu/initramfs.img + root=/dev/hdb2 + vga=ask + # diff --git a/user/lilo/lilo.easy-boot b/user/lilo/lilo.easy-boot new file mode 100644 index 000000000..0f5a802a2 --- /dev/null +++ b/user/lilo/lilo.easy-boot @@ -0,0 +1,93 @@ +#!/bin/sh -e +conf=/etc/lilo/lilo.conf + +# Check whether LILO is installed +# This function is from /usr/sbin/mkboot from debianutils, with copyright: +# +# Debian GNU/Linux +# Copyright 1996-1997 Guy Maor +# +# Modified for Gentoo for use with the lilo ebuild by: +# Martin Schlemmer (16 Mar 2003) +# +# Modified for Adélie for use with the lilo APKBUILD by: +# Max Rees (19 Mar 2020) +lilocheck() { + if ! [ -e "$conf" ]; then + cat >&2 <<-EOF + * + * Could not find '$conf'! + * + EOF + exit 1 + fi + + if grep -q "^[[:space:]]*password[[:space:]]*=[[:space:]]*\"\"" \ + "$conf"; then + cat >&2 <<-EOF + * + * You have requested interactive LILO password setup. + * Run "lilo -p" by hand. + * + EOF + return 1 + fi + + bootpart="$(sed -n "s:^boot[ ]*=[ ]*\(.*\)[ ]*:\1:p" "$conf")" + if ! [ -b "$bootpart" ]; then + cat >&2 <<-EOF + * + * Could not find '$bootpart'! + * + EOF + exit 1 + fi + + if ! dd if="$bootpart" ibs=16 count=1 2>/dev/null | grep -q LILO; then + cat >&2 <<-EOF + * + * No LILO signature found on '$bootpart'. + * You must run 'lilo' yourself. + * + EOF + return 1 + fi +} + +if ! [ -e /etc/fstab ]; then + cat >&2 <<-EOF + * + * You are missing an /etc/fstab file, so liloconfig + * cannot determine the root filesystem. Skipping + * automatic configuration. + * + EOF + exit 0 +fi + +if [ -e "$conf" ] && [ "$conf" -nt "$conf.template" ]; then + cat >&2 <<-EOF + * + * You appear to have manually edited '$conf'. + * LILO configuration will not be automatically regenerated. + * + EOF + exit 0 +fi + +cat >&2 <<-EOF +* +* Running liloconfig... +* +EOF +liloconfig -f "$conf" +touch -r "$conf.template" "$conf" + +if lilocheck; then + cat >&2 <<-EOF + * + * Running lilo... + * + EOF + lilo -C "$conf" +fi diff --git a/user/lilo/lilo.trigger b/user/lilo/lilo.trigger deleted file mode 100644 index 0f5a802a2..000000000 --- a/user/lilo/lilo.trigger +++ /dev/null @@ -1,93 +0,0 @@ -#!/bin/sh -e -conf=/etc/lilo/lilo.conf - -# Check whether LILO is installed -# This function is from /usr/sbin/mkboot from debianutils, with copyright: -# -# Debian GNU/Linux -# Copyright 1996-1997 Guy Maor -# -# Modified for Gentoo for use with the lilo ebuild by: -# Martin Schlemmer (16 Mar 2003) -# -# Modified for Adélie for use with the lilo APKBUILD by: -# Max Rees (19 Mar 2020) -lilocheck() { - if ! [ -e "$conf" ]; then - cat >&2 <<-EOF - * - * Could not find '$conf'! - * - EOF - exit 1 - fi - - if grep -q "^[[:space:]]*password[[:space:]]*=[[:space:]]*\"\"" \ - "$conf"; then - cat >&2 <<-EOF - * - * You have requested interactive LILO password setup. - * Run "lilo -p" by hand. - * - EOF - return 1 - fi - - bootpart="$(sed -n "s:^boot[ ]*=[ ]*\(.*\)[ ]*:\1:p" "$conf")" - if ! [ -b "$bootpart" ]; then - cat >&2 <<-EOF - * - * Could not find '$bootpart'! - * - EOF - exit 1 - fi - - if ! dd if="$bootpart" ibs=16 count=1 2>/dev/null | grep -q LILO; then - cat >&2 <<-EOF - * - * No LILO signature found on '$bootpart'. - * You must run 'lilo' yourself. - * - EOF - return 1 - fi -} - -if ! [ -e /etc/fstab ]; then - cat >&2 <<-EOF - * - * You are missing an /etc/fstab file, so liloconfig - * cannot determine the root filesystem. Skipping - * automatic configuration. - * - EOF - exit 0 -fi - -if [ -e "$conf" ] && [ "$conf" -nt "$conf.template" ]; then - cat >&2 <<-EOF - * - * You appear to have manually edited '$conf'. - * LILO configuration will not be automatically regenerated. - * - EOF - exit 0 -fi - -cat >&2 <<-EOF -* -* Running liloconfig... -* -EOF -liloconfig -f "$conf" -touch -r "$conf.template" "$conf" - -if lilocheck; then - cat >&2 <<-EOF - * - * Running lilo... - * - EOF - lilo -C "$conf" -fi -- cgit v1.2.3-60-g2f50