diff options
Diffstat (limited to 'sys-boot/lilo')
-rw-r--r-- | sys-boot/lilo/Manifest | 1 | ||||
-rw-r--r-- | sys-boot/lilo/lilo-24.2-r2.ebuild | 200 |
2 files changed, 201 insertions, 0 deletions
diff --git a/sys-boot/lilo/Manifest b/sys-boot/lilo/Manifest index 681ad2d8e090..1f08d9a0bbc0 100644 --- a/sys-boot/lilo/Manifest +++ b/sys-boot/lilo/Manifest @@ -6,4 +6,5 @@ AUX lilo.conf 1613 BLAKE2B 0d1f1a67f270e6d0cfac6d6dbdd7468bee3405b455ab20d9095c3 DIST dolilo-0.6.tar.bz2 3817 BLAKE2B 35c41f5eac8e02d4381db517a9b230d037da184f9ae409bc76307e689ad6b82928ea3794db54c3137afe6c770db86ba0cde78c33d89e775ddea464905070bfd6 SHA512 1b59ea5f2e2ac52d62635c9f7d5fb5b2aff6757e6ea6c0950480d8a11832b872115907abe6d8fb3fa5436e2e8971d9a1dda103dc6a15db6fc310c8f4730ab936 DIST lilo-24.2.tar.gz 777400 BLAKE2B 71c74235d5df10eed65b67dc1ce2af21163651c752d799da419077025304abf9352535a70f3fb60d086609d8a1c25bf394e29453c338ab022cb2be3cb21af75f SHA512 4437cae21345f483194a5dc95f686f3f3cb2beec78faae3fba959db25eae29fe2c56732e055c05f1d101682c5d442cdc9561fae8074f61f5537dde0413204c54 EBUILD lilo-24.2-r1.ebuild 4574 BLAKE2B 450148d9e105be2ab67dd07a8016fa4cc6780cc416d8f011538c1a7f14eab48a7328bb7b4c23e9798844fed0f5efab1dae90059c1f5c90d3be1634b79cd49d03 SHA512 f4d277a3f38082b0a593d1d6b303a48bf3acec857f7c47c3e8bd1ef8cbdcec6c4a676dc8c1561d8661e32a09f441ee2c20122df9360b03f3aec48f1bd900fb5f +EBUILD lilo-24.2-r2.ebuild 5236 BLAKE2B a930f7d0d605432fc9e853082516ecb114c66213876b51e9e6752a2e44718107baab48cd006f952fc04d8c44762785a70398f42249d4dbbe34837cdc0b5e8a4b SHA512 e2a6ee00931961649bcb8d3755eb99b5468eb19767993bf568bea168228e192da76be2b99fe64d4654c9af49ac78d69aef3249d6bf27d8af7e163da52d771737 MISC metadata.xml 475 BLAKE2B e197c079a1bc1a024d6a9a1b1195459bbaeafd92a901d71c1f13f21d9e50d56fa330d40af270c0b6f6242d09efa46e4a2e859731bae18c0f0d7d9babcf2ce94a SHA512 c5928a78231fd60410ee2ff2468bf775f9077cd45d2bd5939ae3e0d92d05fa2bdfabdba362f4ec9e004429243e843a4ae6289be1506c4412a0a29218f2992ea5 diff --git a/sys-boot/lilo/lilo-24.2-r2.ebuild b/sys-boot/lilo/lilo-24.2-r2.ebuild new file mode 100644 index 000000000000..f61d2fc53f41 --- /dev/null +++ b/sys-boot/lilo/lilo-24.2-r2.ebuild @@ -0,0 +1,200 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit optfeature toolchain-funcs + +DOLILO_V="0.6" + +DESCRIPTION="LInux LOader, the original Linux bootloader" +HOMEPAGE="https://www.joonet.de/lilo/" + +DOLILO_TAR="dolilo-${DOLILO_V}.tar.bz2" +SRC_URI=" + https://www.joonet.de/lilo/ftp/sources/${P}.tar.gz + mirror://gentoo/${DOLILO_TAR} +" + +LICENSE="BSD GPL-2" +SLOT="0" +KEYWORDS="-* ~amd64 ~x86" + +IUSE="static minimal pxeserial device-mapper" + +DEPEND=">=sys-devel/bin86-0.15.5" +RDEPEND="device-mapper? ( >=sys-fs/lvm2-2.02.45 )" + +# Bootloaders should not be using arbitrary CFLAGS without good reason. A bootloader +# is typically only executed once to boot the system, and it should work the first time. +QA_FLAGS_IGNORED="/sbin/lilo" + +src_prepare() { + default + + # this patch is needed when booting PXE and the device you're using + # emulates vga console via serial console. + # IE.. B.B.o.o.o.o.t.t.i.i.n.n.g.g....l.l.i.i.n.n.u.u.x.x and stair stepping. + use pxeserial && eapply "${FILESDIR}/${PN}-24.1-novga.patch" + + eapply "${FILESDIR}/${PN}-24.2-add-nvme-support.patch" + eapply "${FILESDIR}/${PN}-24.x-fix-gcc-10.patch" + eapply "${FILESDIR}/${PN}-24.x-check-for-__GLIBC__.patch" + + # Do not strip and have parallel make + # FIXME: images/Makefile does weird stuff + sed -i Makefile src/Makefile \ + -e '/strip/d;s|^ make| $(MAKE)|g' \ + -e '/images install/d' \ + -e '/images all/d' \ + || die "sed strip failed" +} + +src_configure() { + if ! use device-mapper; then + sed -i make.vars -e 's|-DDEVMAPPER||g' || die + fi +} + +src_compile() { + # lilo needs this. bug #140209 + export LC_ALL=C + + # we explicitly prevent the custom CFLAGS for stability reasons + if use static; then + local target=alles + else + local target=all + fi + + emake CC="$(tc-getCC) ${LDFLAGS}" ${target} +} + +src_install() { + emake DESTDIR="${ED}" install + + if use !minimal; then + into / + dosbin "${WORKDIR}"/dolilo/dolilo + + into /usr + dosbin keytab-lilo.pl + + insinto /etc + newins "${FILESDIR}"/lilo.conf lilo.conf.example + + newconfd "${WORKDIR}"/dolilo/dolilo.conf.d dolilo.example + + dodoc CHANGELOG* readme/README.* readme/INCOMPAT README + docinto samples ; dodoc sample/* + fi + + # This we don't use + rm -r "${ED}/etc/initramfs" || die + # This should be in /usr/lib and it should have the .install suffix + dodir /usr/lib/kernel + for dir in postinst.d postrm.d; do + mv "${ED}/etc/kernel/${dir}" "${ED}/usr/lib/kernel/${dir}" || die + mv "${ED}/usr/lib/kernel/${dir}/zz-runlilo" "${ED}/usr/lib/kernel/${dir}/90-runlilo.install" || die + done + # Insert wrapper for systemd's kernel-install + exeinto /usr/lib/kernel/install.d + newexe - 90-runlilo.install <<-EOF + #!/bin/sh + if [ "\${1}" = "add" ]; then + exec "\$(dirname \${0})/../postinst.d/90-runlilo.install" + elif [ "\${1}" = "remove" ]; then + exec "\$(dirname \${0})/../postrm.d/90-runlilo.install" + fi + EOF +} + +# Check whether LILO is installed +# This function is from /usr/sbin/mkboot from debianutils, with copyright: +# +# Debian GNU/Linux +# Copyright 1996-1997 Guy Maor <maor@debian.org> +# +# Modified for Gentoo for use with the lilo ebuild by: +# Martin Schlemmer <azarah@gentoo.org> (16 Mar 2003) +# +lilocheck() { + local bootpart= + local rootpart="$(mount | grep -v "tmpfs" | grep -v "rootfs" | grep "on / " | cut -f1 -d " ")" + + echo + ebegin "Checking whether LILO can be safely updated" + + if [ "$(whoami)" != "root" ]; then + eend 1 + eerror "Only root can check for LILO" + return 1 + fi + + if [ -z "${rootpart}" ]; then + eend 1 + eerror "Could not determine root partition" + return 1 + fi + + if [ ! -f /etc/lilo.conf -o ! -x /sbin/lilo ]; then + eend 1 + eerror "No LILO configuration in place" + return 1 + fi + + bootpart="$(sed -n "s:^boot[ ]*=[ ]*\(.*\)[ ]*:\1:p" /etc/lilo.conf)" + + if [ -z "${bootpart}" ]; then + # lilo defaults to current root when 'boot=' is not present + bootpart="${rootpart}" + fi + + if ! dd if=${bootpart} ibs=16 count=1 2>&- | grep -q 'LILO'; then + eend 1 + eerror "No LILO signature on ${bootpart}" + ewarn "Check your /etc/lilo.conf, or run /sbin/lilo by hand." + return 1 + fi + + if grep -q "^[[:space:]]*password[[:space:]]*=[[:space:]]*\"\"" /etc/lilo.conf; then + eend 1 + eerror "Interactive password entry configured" + ewarn "Run /sbin/lilo -p by hand." + return 1 + fi + + einfo "LILO on ${bootpart} is safe to update" + eend 0 + return 0 +} + +pkg_postinst() { + if [ ! -e "${ROOT}/boot/boot.b" -a ! -L "${ROOT}/boot/boot.b" ]; then + [ -f "${ROOT}/boot/boot-menu.b" ] && \ + ln -snf boot-menu.b "${ROOT}/boot/boot.b" + fi + + if [[ -z "${ROOT}" ]] && use !minimal; then + if lilocheck; then + einfo "Running DOLILO to complete the install" + # do not redirect to /dev/null because it may display some input + # prompt + /sbin/dolilo + if [ "$?" -ne 0 ]; then + eerror "You must manually configure and run LILO" + fi + fi + echo + fi + if use !minimal; then + echo + einfo "Issue 'dolilo' instead of 'lilo' to have a friendly wrapper that" + einfo "handles mounting and unmounting /boot for you. It can do more, " + einfo "edit /etc/conf.d/dolilo to harness its full potential." + echo + fi + + optfeature "automatically updating lilo's configuration on each kernel installation" \ + sys-kernel/installkernel +} |