summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /sys-boot/lilo
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'sys-boot/lilo')
-rw-r--r--sys-boot/lilo/Manifest6
-rw-r--r--sys-boot/lilo/files/lilo-22.8-correct-usage-info.patch12
-rw-r--r--sys-boot/lilo/files/lilo-22.8-makefile.patch42
-rw-r--r--sys-boot/lilo/files/lilo-22.8-nodevmapper.patch13
-rw-r--r--sys-boot/lilo/files/lilo-22.8-novga.patch11
-rw-r--r--sys-boot/lilo/files/lilo-23.0-make.patch103
-rw-r--r--sys-boot/lilo/files/lilo-24.0-novga.patch12
-rw-r--r--sys-boot/lilo/files/lilo-24.1-novga.patch12
-rw-r--r--sys-boot/lilo/files/lilo.conf73
-rw-r--r--sys-boot/lilo/lilo-22.8-r2.ebuild180
-rw-r--r--sys-boot/lilo/lilo-23.2-r1.ebuild173
-rw-r--r--sys-boot/lilo/lilo-23.2-r2.ebuild181
-rw-r--r--sys-boot/lilo/lilo-24.0-r1.ebuild176
-rw-r--r--sys-boot/lilo/lilo-24.0.ebuild176
-rw-r--r--sys-boot/lilo/lilo-24.1.ebuild183
-rw-r--r--sys-boot/lilo/metadata.xml14
16 files changed, 1367 insertions, 0 deletions
diff --git a/sys-boot/lilo/Manifest b/sys-boot/lilo/Manifest
new file mode 100644
index 000000000000..33437615cdb6
--- /dev/null
+++ b/sys-boot/lilo/Manifest
@@ -0,0 +1,6 @@
+DIST dolilo-0.5.tar.bz2 3777 SHA256 9b6994ec6416cdfb0205665a58dc2e6a1d6e36272a3cab94315daea1c55605f1 SHA512 6bfd0181d922f01903c8c0cdc67fc087c74091d7ffec0ddfb263c18b3a2247fcfbd201995f1724f26f4eb21b91147f209fd7ed485a05c6b9e9f583ea2456baa9 WHIRLPOOL 4cae4563097b646aa4d689861793712dc44d6a32db850842c88556f32e59765ad5d6c7594c7a157d063503c9e70473774448f6692ba72b7c53c057c038ed3960
+DIST dolilo-0.6.tar.bz2 3817 SHA256 01293874aea4cfa935d3f22fd52c8f4956e4a85b39a878df1255098825f2840e SHA512 1b59ea5f2e2ac52d62635c9f7d5fb5b2aff6757e6ea6c0950480d8a11832b872115907abe6d8fb3fa5436e2e8971d9a1dda103dc6a15db6fc310c8f4730ab936 WHIRLPOOL 7a24cf7bf4b476967a5d4ba2234ce3256ff9311744be020ef25e6227f8e86098aac89706d23df30d3f0212aa3fe313c0460d1709990b21029d93517b77f61e4e
+DIST lilo-22.8.src.tar.gz 437555 SHA256 bad5907c212c0b2b15de5e852787a1ad2129a702f113b26345eec1c917c4edcb SHA512 b8a22c73b5f6a0c7ddde7c7af6511f9e85d43bae98603bfa0656dfa0685018b3ed713cfd9932bfac33017b83f807c66a3e25d78a16ea9a15bbfddd0e806714cc WHIRLPOOL 712fdf98b28e0ac717c0667fb5d4d7e734d963f0c4b3997d690c543d8d505ad3e6449933a854a8c1ce008d5c7f1b40a013398d36455fa433498f2583677f2d7c
+DIST lilo-23.2.tar.gz 580758 SHA256 0245e300494c0700411d518ffd81a15a00450face7922fb3b08cec7d16984030 SHA512 fe6789d3643751128afcb2c9761623329e84ab05ec84d75d6b13eff991d10a6671617b65f4ab5ef414a6ca4bc530bcf33b96ddeee3f5dce78bb69b8db740f9c5 WHIRLPOOL f12c44fc48ba74a57ed83174b44966a4330ad3a96714bf52afea6e4d1c4a01c2881d447e563c0b363f602fa0e15d6012633734fb962cf2adba4ec62c7481519a
+DIST lilo-24.0.tar.gz 768631 SHA256 3d40c0af1d60a0adbe3696cd6cb8d7e892694351ff225371d871b6b479d82152 SHA512 4158a0f7ab085da063938df2bc77356f9536aa78208a902561f9e61ec478fb17f204f68407f6809638aea9d2e0c88ffc701548291c1635ab40f5b18a7be6bae7 WHIRLPOOL 598e915ddb08b3b8383fb08a1b3dbb75f9340fbb052c4ceed88309274c33b8a5965502a95b99997aba7af2d3ec9da737c13b85784afd8f371ad96b69942069a2
+DIST lilo-24.1.tar.gz 773223 SHA256 a15280edacb8bca31b9163d65e61270b8c06cb9ffea74374a3a42164a13d4532 SHA512 d1375cac9654fcb3934e7e5e0533e126ff8700a48154eb5019cf62e4b89f14d2ce7a17b6324795d9b60b37ab7656bfb2c9467f6e9d3540095f5c294579e83883 WHIRLPOOL 6534b9494cce30c56f0ec700eb8288ebfdfb9e07ed631958e3f34d03d4fb42de372237dab5d07a8b8ef1c3da49b427d3777be14de9abca339dcd184fce550ab0
diff --git a/sys-boot/lilo/files/lilo-22.8-correct-usage-info.patch b/sys-boot/lilo/files/lilo-22.8-correct-usage-info.patch
new file mode 100644
index 000000000000..87ea4b20ce9e
--- /dev/null
+++ b/sys-boot/lilo/files/lilo-22.8-correct-usage-info.patch
@@ -0,0 +1,12 @@
+--- a/lilo.c
++++ b/lilo.c
+@@ -548,7 +548,8 @@
+ fprintf(errstd,"%7s%s -T help \t\t\tlist additional options\n", "", name);
+ fprintf(errstd,"%7s%s -X\t\t\t\tinternal compile-time options\n", "", name);
+ #endif /* !__MSDOS__ */
+- fprintf(errstd,"%7s%s -V [ -v ]\t\t\tversion information\n\n","",name);
++ fprintf(errstd,"%7s%s -V\t\t\t\tversion information\n","",name);
++ fprintf(errstd,"%7s%s -v\t\t\t\tverbose mode\n\n","",name);
+ exit(1);
+ }
+
diff --git a/sys-boot/lilo/files/lilo-22.8-makefile.patch b/sys-boot/lilo/files/lilo-22.8-makefile.patch
new file mode 100644
index 000000000000..d2a34bbded1d
--- /dev/null
+++ b/sys-boot/lilo/files/lilo-22.8-makefile.patch
@@ -0,0 +1,42 @@
+--- a/Makefile
++++ b/Makefile
+@@ -69,18 +69,7 @@
+ -DMDPRAID -DDEVMAPPER
+
+
+-# set the following if you wish LILO.COM to be installed
+-DOS_DIR=/dosC/boot
+-#
+-# select one of the following to place the man pages in the right place
+-#MAN_DIR=`if [ -z "$(whereis lilo | grep 'lilo.8')" ]; then \
+-# whereis lilo | sed -e "sX.* /usrX/usrX" -e "sX/man8/lilo.8.*XX" ; \
+-# elif [ -f /usr/bin/manpath ]; then \
+-# manpath | sed "s/:.*//"; else echo /usr/man; fi`
+-#
+-MAN_DIR=`if [ -f /usr/bin/manpath ]; then \
+- manpath | sed "s/:.*//"; else echo /usr/share/man; fi`
+-#MAN_DIR=/usr/share/man
++MAN_DIR=/usr/share/man
+
+ # set the compiler optimization level
+
+@@ -165,10 +154,7 @@
+ #
+ # everything needed to run, just short of installation
+ #
+-all: lilo bootsect.b diag1.img # OBSOLETE: $(BOOTS) edit dparam.com activate
+- if [ -x /usr/bin/bcc -o -x /usr/local/bin/bcc ]; then \
+- make diagnostic; \
+- make dosexe; fi
++all: lilo
+
+ #
+ # everything above plus the statically linked version
+@@ -452,7 +438,6 @@
+ rm -f $$ROOT$(BOOT_DIR)/boot.b; fi
+ cp mkrescue $$ROOT$(SBIN_DIR)
+ cp lilo $$ROOT$(SBIN_DIR)
+- strip $$ROOT$(SBIN_DIR)/lilo
+ cp keytab-lilo.pl $$ROOT$(USRSBIN_DIR)
+ cp manPages/lilo.8 $$ROOT$(MAN_DIR)/man8
+ cp manPages/mkrescue.8 $$ROOT$(MAN_DIR)/man8
diff --git a/sys-boot/lilo/files/lilo-22.8-nodevmapper.patch b/sys-boot/lilo/files/lilo-22.8-nodevmapper.patch
new file mode 100644
index 000000000000..f81cbfe92ef5
--- /dev/null
+++ b/sys-boot/lilo/files/lilo-22.8-nodevmapper.patch
@@ -0,0 +1,13 @@
+--- Makefile~ 2007-04-28 22:04:23.000000000 +0200
++++ Makefile 2007-04-28 22:21:46.000000000 +0200
+@@ -91,8 +91,8 @@
+ sed 's/-D/-DLCF_/g'`
+ LILO=-DLILO=0xbb920890
+ KVER=`if [ -f /usr/include/linux/version.h ]; then echo -DHAS_VERSION_H; fi`
+-HDM=`if [ -f /usr/include/libdevmapper.h ]; then echo -DHAS_LIBDEVMAPPER_H; fi`
+-DEVMAPPER=`if [ -f /usr/include/libdevmapper.h ]; then echo "-ldevmapper"; fi`
++HDM=
++DEVMAPPER=
+
+ TMP=_TmP_
+
diff --git a/sys-boot/lilo/files/lilo-22.8-novga.patch b/sys-boot/lilo/files/lilo-22.8-novga.patch
new file mode 100644
index 000000000000..939998fe9d4e
--- /dev/null
+++ b/sys-boot/lilo/files/lilo-22.8-novga.patch
@@ -0,0 +1,11 @@
+--- a/Makefile
++++ b/Makefile
+@@ -66,7 +66,7 @@
+
+ CONFIG=-DBDATA -DDSECS=3 -DEVMS -DIGNORECASE -DLVM -DNOKEYBOARD -DONE_SHOT \
+ -DPASS160 -DREISERFS -DREWRITE_TABLE -DSOLO_CHAIN -DVERSION -DVIRTUAL \
+- -DMDPRAID -DDEVMAPPER
++ -DMDPRAID -DDEVMAPPER -DNOVGA
+
+
+ MAN_DIR=/usr/share/man
diff --git a/sys-boot/lilo/files/lilo-23.0-make.patch b/sys-boot/lilo/files/lilo-23.0-make.patch
new file mode 100644
index 000000000000..00b15c52ca07
--- /dev/null
+++ b/sys-boot/lilo/files/lilo-23.0-make.patch
@@ -0,0 +1,103 @@
+--- a/Makefile 2010-06-18 19:17:48.000000000 +0200
++++ b/Makefile 2010-07-20 02:00:18.000000000 +0200
+@@ -26,19 +26,19 @@
+ # everything needed to run, just short of installation
+ #
+ all: test
+- make -C src all
++ $(MAKE) -C src all
+
+ #
+ # everything above plus the statically linked version
+ #
+ alles: test
+- make -C src alles
++ $(MAKE) -C src alles
+
+ #
+ # documentation files
+ #
+ docs:
+- make -C doc all
++ $(MAKE) -C doc all
+
+ #
+ # if you have the 'bcc' compiler, then you can make the diagnostics, too
+@@ -55,23 +55,23 @@
+ @echo before you proceed from this point.
+ @echo "Press <Enter> to continue, <^C> to abort ..."
+ @read
+- @make -C src floppy1
++ @$(MAKE) -C src floppy1
+ @echo Done.
+ @echo
+ @echo Remove the floppy from the drive. Label it "\"1.6\""
+ @echo "Press <Enter> to continue, <^C> to abort ..."
+ @read
+- @make -C src floppy2
++ @$(MAKE) -C src floppy2
+ @echo Done.
+ @echo
+ @echo Remove the floppy from the drive. Label it "\"2.4\""
+ @echo
+
+ diagnostic: test
+- make -C src diagnostic
++ $(MAKE) -C src diagnostic
+
+ dosexe: test
+- make -C dos lilo
++ $(MAKE) -C dos lilo
+
+ #
+ # test for compilers & utilities
+@@ -85,33 +85,33 @@
+ # shorthand install, if one knows that one has the 'bcc' compiler
+ #
+ ins:
+- make -C src ins
++ $(MAKE) -C src ins
+
+ #
+ # normal install, but doesn't make the diagnostic binaries
+ #
+ install: all
+- make -C src install
+- make -C man install
+- make -C dos install
+- make -C src insobs
++ $(MAKE) -C src install
++ $(MAKE) -C man install
++ $(MAKE) -C dos install
++ $(MAKE) -C src insobs
+
+ tidy:
+- make -C src tidy
+- make -C diagnose tidy
+- make -C dos tidy
+- make -C doc tidy
++ $(MAKE) -C src tidy
++ $(MAKE) -C diagnose tidy
++ $(MAKE) -C dos tidy
++ $(MAKE) -C doc tidy
+
+ clean: tidy
+ rm -f test.img
+- make -C src clean
+- make -C diagnose clean
+- make -C dos clean
++ $(MAKE) -C src clean
++ $(MAKE) -C diagnose clean
++ $(MAKE) -C dos clean
+
+ spotless: distclean
+ distclean: clean
+- make -C src distclean
+- make -C diagnose distclean
+- make -C dos distclean
+- make -C doc clean
++ $(MAKE) -C src distclean
++ $(MAKE) -C diagnose distclean
++ $(MAKE) -C dos distclean
++ $(MAKE) -C doc clean
+
diff --git a/sys-boot/lilo/files/lilo-24.0-novga.patch b/sys-boot/lilo/files/lilo-24.0-novga.patch
new file mode 100644
index 000000000000..ebb06b486818
--- /dev/null
+++ b/sys-boot/lilo/files/lilo-24.0-novga.patch
@@ -0,0 +1,12 @@
+diff -ur lilo-23.2/make.vars lilo-23.2.new/make.vars
+--- lilo-23.2/make.vars 2013-01-18 11:33:02.438628138 -0600
++++ lilo-23.2.new/make.vars 2013-01-18 11:34:03.960697091 -0600
+@@ -71,7 +71,7 @@
+
+ CONFIG=-DBDATA -DDSECS=3 -DEVMS -DIGNORECASE -DLVM -DNOKEYBOARD -DONE_SHOT \
+ -DPASS160 -DREISERFS -DREWRITE_TABLE -DSOLO_CHAIN -DVERSION -DVIRTUAL \
+- -DMDPRAID -DDEVMAPPER
++ -DMDPRAID -DDEVMAPPER -DNOVGA
+
+ # set the following if you wish LILO.COM to be installed
+ DOS_DIR=/dosC/boot
diff --git a/sys-boot/lilo/files/lilo-24.1-novga.patch b/sys-boot/lilo/files/lilo-24.1-novga.patch
new file mode 100644
index 000000000000..512fac694fdb
--- /dev/null
+++ b/sys-boot/lilo/files/lilo-24.1-novga.patch
@@ -0,0 +1,12 @@
+diff -uNr lilo-24.1.ORIG/make.vars lilo-24.1/make.vars
+--- lilo-24.1.ORIG/make.vars 2015-01-22 10:36:54.656904227 +0000
++++ lilo-24.1/make.vars 2015-01-22 10:37:16.516903935 +0000
+@@ -71,7 +71,7 @@
+
+ CONFIG=-DBDATA -DDSECS=3 -DEVMS -DIGNORECASE -DLVM -DNOKEYBOARD -DONE_SHOT \
+ -DPASS160 -DREISERFS -DREWRITE_TABLE -DSOLO_CHAIN -DVERSION -DVIRTUAL \
+- -DMDPRAID -DDEVMAPPER
++ -DMDPRAID -DDEVMAPPER -DNOVGA
+
+ # set the following if you wish LILO.COM to be installed
+ DOS_DIR=/dosC/boot
diff --git a/sys-boot/lilo/files/lilo.conf b/sys-boot/lilo/files/lilo.conf
new file mode 100644
index 000000000000..1c0c48acc19a
--- /dev/null
+++ b/sys-boot/lilo/files/lilo.conf
@@ -0,0 +1,73 @@
+# $Id$
+# Author: Ultanium
+
+#
+# Start LILO global section
+#
+
+# Faster, but won't work on all systems:
+#compact
+# Should work for most systems, and do not have the sector limit:
+lba32
+# If lba32 do not work, use linear:
+#linear
+
+# MBR to install LILO to:
+boot = /dev/hda
+map = /boot/.map
+
+# If you are having problems booting from a hardware raid-array
+# or have a unusual setup, try this:
+#disk=/dev/ataraid/disc0/disc bios=0x80 # see this as the first BIOS disk
+#disk=/dev/sda bios=0x81 # see this as the second BIOS disk
+#disk=/dev/hda bios=0x82 # see this as the third BIOS disk
+
+# Here you can select the secondary loader to install. A few
+# examples is:
+#
+# boot-text.b
+# boot-menu.b
+# boot-bmp.b
+#
+install = /boot/boot-menu.b # Note that for lilo-22.5.5 or later you
+ # do not need boot-{text,menu,bmp}.b in
+ # /boot, as they are linked into the lilo
+ # binary.
+
+menu-scheme=Wb
+prompt
+# If you always want to see the prompt with a 15 second timeout:
+#timeout=150
+delay = 50
+# Normal VGA console
+vga = normal
+# VESA console with size 1024x768x16:
+#vga = 791
+
+#
+# End LILO global section
+#
+
+#
+# Linux bootable partition config begins
+#
+image = /boot/bzImage
+ root = /dev/hda3
+ #root = /devices/discs/disc0/part3
+ label = Gentoo
+ read-only # read-only for checking
+#
+# Linux bootable partition config ends
+#
+
+#
+# DOS bootable partition config begins
+#
+other = /dev/hda1
+ #other = /devices/discs/disc0/part1
+ label = Windows
+ table = /dev/hda
+#
+# DOS bootable partition config ends
+#
+
diff --git a/sys-boot/lilo/lilo-22.8-r2.ebuild b/sys-boot/lilo/lilo-22.8-r2.ebuild
new file mode 100644
index 000000000000..6c835c13771a
--- /dev/null
+++ b/sys-boot/lilo/lilo-22.8-r2.ebuild
@@ -0,0 +1,180 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DOLILO_V="0.5"
+IUSE="static minimal pxeserial device-mapper"
+
+DESCRIPTION="Standard Linux boot loader"
+HOMEPAGE="http://lilo.go.dyndns.org/pub/linux/lilo/"
+DOLILO_TAR="dolilo-${DOLILO_V}.tar.bz2"
+MY_P=${P}.src
+
+SRC_URI="http://home.san.rr.com/johninsd/pub/linux/lilo/${MY_P}.tar.gz
+ ftp://metalab.unc.edu/pub/Linux/system/boot/lilo/${MY_P}.tar.gz
+ ftp://metalab.unc.edu/pub/Linux/system/boot/lilo/obsolete/${MY_P}.tar.gz
+ mirror://gentoo/${DOLILO_TAR}"
+
+SLOT="0"
+LICENSE="BSD GPL-2"
+KEYWORDS="-* amd64 x86"
+
+DEPEND=">=sys-devel/bin86-0.15.5"
+RDEPEND="device-mapper? ( >=sys-fs/lvm2-2.02.45 )"
+
+src_unpack() {
+ unpack ${MY_P}.tar.gz
+
+ cd "${S}"
+
+ # Correctly document commandline options -v and -V, bug #43554
+ epatch "${FILESDIR}/${P}-correct-usage-info.patch"
+ # Install manpages to correct location, do not rely on incorrect manpath output, bug #117135
+ # Do not strip the main binary, it upsets portage, bug #140210
+ # Do not install diag1.img, bug #149887
+ epatch "${FILESDIR}/${P}-makefile.patch"
+
+ # 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 && epatch "${FILESDIR}/${P}-novga.patch"
+ use device-mapper || epatch "${FILESDIR}/${P}-nodevmapper.patch"
+
+ unpack ${DOLILO_TAR}
+}
+
+src_compile() {
+ # lilo needs this. bug #140209
+ export LC_ALL=C
+
+ # hardened automatic PIC plus PIE building should be suppressed
+ # because of assembler instructions that cannot be compiled PIC
+ HARDENED_CFLAGS="`test-flags-CC -fno-pic -nopie`"
+
+ # we explicitly prevent the custom CFLAGS for stability reasons
+ if use static; then
+ emake CC="$(tc-getCC) ${HARDENED_CFLAGS}" lilo.static || die
+ mv lilo.static lilo || die
+ else
+ emake CC="$(tc-getCC) ${HARDENED_CFLAGS}" lilo || die
+ fi
+}
+
+src_install() {
+ keepdir /boot
+ make ROOT="${D}" install || die
+
+ if use !minimal; then
+ into /
+ dosbin "${S}"/dolilo/dolilo
+
+ into /usr
+ dosbin keytab-lilo.pl
+
+ insinto /etc
+ newins "${FILESDIR}"/lilo.conf lilo.conf.example
+
+ newconfd "${S}"/dolilo/dolilo.conf.d dolilo.example
+
+ doman manPages/*.[5-8]
+ dodoc CHANGES INCOMPAT README*
+ docinto samples ; dodoc sample/*
+ fi
+}
+
+# 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
+ einfon "Checking for LILO ..."
+
+ if [ "$(whoami)" != "root" ]
+ then
+ echo; echo
+ eerror "Only root can check for LILO!"
+ return 1
+ fi
+
+ if [ -z "${rootpart}" ]
+ then
+ echo; echo
+ eerror "Could not determine root partition!"
+ return 1
+ fi
+
+ if [ ! -f /etc/lilo.conf -o ! -x /sbin/lilo ]
+ then
+ echo " No"
+ 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
+ echo; echo
+ ewarn "Yes, but I couldn't find a LILO signature on ${bootpart}"
+ ewarn "Check your /etc/lilo.conf, or run /sbin/lilo by hand."
+ return 1
+ fi
+
+ echo " Yes, on ${bootpart}"
+
+ 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 [ "${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
+ echo
+ ewarn "Running /sbin/dolilo failed! Please check what the problem is"
+ ewarn "before your next reboot."
+
+ ebeep 5
+ epause 5
+ 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 then"
+ einfo "that when asked, edit /etc/conf.d/dolilo to harness it's full potential."
+ ebeep 5
+ epause 3
+ echo
+ fi
+}
diff --git a/sys-boot/lilo/lilo-23.2-r1.ebuild b/sys-boot/lilo/lilo-23.2-r1.ebuild
new file mode 100644
index 000000000000..84e2073d093e
--- /dev/null
+++ b/sys-boot/lilo/lilo-23.2-r1.ebuild
@@ -0,0 +1,173 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DOLILO_V="0.5"
+IUSE="static minimal pxeserial device-mapper"
+
+DESCRIPTION="Standard Linux boot loader"
+HOMEPAGE="https://alioth.debian.org/projects/lilo/"
+
+DOLILO_TAR="dolilo-${DOLILO_V}.tar.bz2"
+SRC_URI="
+ http://lilo.alioth.debian.org/ftp/sources/${P}.tar.gz
+ mirror://gentoo/${DOLILO_TAR}
+"
+
+SLOT="0"
+LICENSE="BSD GPL-2"
+KEYWORDS="-* ~amd64 ~x86"
+
+DEPEND=">=sys-devel/bin86-0.15.5"
+RDEPEND="device-mapper? ( >=sys-fs/lvm2-2.02.45 )"
+
+src_prepare() {
+ # 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 && epatch "${FILESDIR}/${PN}-22.8-novga.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_compile() {
+ # lilo needs this. bug #140209
+ export LC_ALL=C
+
+ # hardened automatic PIC plus PIE building should be suppressed
+ # because of assembler instructions that cannot be compiled PIC
+ HARDENED_CFLAGS="`test-flags-CC -fno-pic -nopie`"
+
+ # we explicitly prevent the custom CFLAGS for stability reasons
+ if use static; then
+ emake CC="$(tc-getCC) ${LDFLAGS} ${HARDENED_CFLAGS}" alles || die
+ else
+ emake CC="$(tc-getCC) ${LDFLAGS} ${HARDENED_CFLAGS}" all || die
+ fi
+}
+
+src_install() {
+ keepdir /boot
+ emake DESTDIR="${D}" install || die
+
+ if use !minimal; then
+ into /
+ dosbin "${WORKDIR}"/dolilo/dolilo || die
+
+ into /usr
+ dosbin keytab-lilo.pl || die
+
+ insinto /etc
+ newins "${FILESDIR}"/lilo.conf lilo.conf.example || die
+
+ newconfd "${WORKDIR}"/dolilo/dolilo.conf.d dolilo.example || die
+
+ dodoc CHANGELOG* readme/README.* readme/INCOMPAT README
+ docinto samples ; dodoc sample/*
+ fi
+}
+
+# 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
+ einfon "Checking for LILO ..."
+
+ if [ "$(whoami)" != "root" ]
+ then
+ echo; echo
+ eerror "Only root can check for LILO!"
+ return 1
+ fi
+
+ if [ -z "${rootpart}" ]
+ then
+ echo; echo
+ eerror "Could not determine root partition!"
+ return 1
+ fi
+
+ if [ ! -f /etc/lilo.conf -o ! -x /sbin/lilo ]
+ then
+ echo " No"
+ 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
+ echo; echo
+ ewarn "Yes, but I couldn't find a LILO signature on ${bootpart}"
+ ewarn "Check your /etc/lilo.conf, or run /sbin/lilo by hand."
+ return 1
+ fi
+
+ echo " Yes, on ${bootpart}"
+
+ 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 [ "${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
+ echo
+ ewarn "Running /sbin/dolilo failed! Please check what the problem is"
+ ewarn "before your next reboot."
+
+ ebeep 5
+ epause 5
+ 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 then"
+ einfo "that when asked, edit /etc/conf.d/dolilo to harness it's full potential."
+ ebeep 5
+ epause 3
+ echo
+ fi
+}
diff --git a/sys-boot/lilo/lilo-23.2-r2.ebuild b/sys-boot/lilo/lilo-23.2-r2.ebuild
new file mode 100644
index 000000000000..469ccdc086c5
--- /dev/null
+++ b/sys-boot/lilo/lilo-23.2-r2.ebuild
@@ -0,0 +1,181 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="2"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DOLILO_V="0.5"
+IUSE="static minimal pxeserial device-mapper"
+
+DESCRIPTION="Standard Linux boot loader"
+HOMEPAGE="https://alioth.debian.org/projects/lilo/"
+
+DOLILO_TAR="dolilo-${DOLILO_V}.tar.bz2"
+SRC_URI="
+ http://lilo.alioth.debian.org/ftp/sources/${P}.tar.gz
+ mirror://gentoo/${DOLILO_TAR}
+"
+
+SLOT="0"
+LICENSE="BSD GPL-2"
+KEYWORDS="-* amd64 x86"
+
+DEPEND=">=sys-devel/bin86-0.15.5"
+RDEPEND="device-mapper? ( >=sys-fs/lvm2-2.02.45 )"
+
+src_prepare() {
+ # 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 && epatch "${FILESDIR}/${PN}-22.8-novga.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
+
+ # hardened automatic PIC plus PIE building should be suppressed
+ # because of assembler instructions that cannot be compiled PIC
+ HARDENED_CFLAGS=$(test-flags-CC -fno-pic -nopie)
+
+ # 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} ${HARDENED_CFLAGS}" ${target} || die
+}
+
+src_install() {
+ keepdir /boot
+ emake DESTDIR="${D}" install || die
+
+ if use !minimal; then
+ into /
+ dosbin "${WORKDIR}"/dolilo/dolilo || die
+
+ into /usr
+ dosbin keytab-lilo.pl || die
+
+ insinto /etc
+ newins "${FILESDIR}"/lilo.conf lilo.conf.example || die
+
+ newconfd "${WORKDIR}"/dolilo/dolilo.conf.d dolilo.example || die
+
+ dodoc CHANGELOG* readme/README.* readme/INCOMPAT README
+ docinto samples ; dodoc sample/*
+ fi
+}
+
+# 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
+ einfon "Checking for LILO ..."
+
+ if [ "$(whoami)" != "root" ]
+ then
+ echo; echo
+ eerror "Only root can check for LILO!"
+ return 1
+ fi
+
+ if [ -z "${rootpart}" ]
+ then
+ echo; echo
+ eerror "Could not determine root partition!"
+ return 1
+ fi
+
+ if [ ! -f /etc/lilo.conf -o ! -x /sbin/lilo ]
+ then
+ echo " No"
+ 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
+ echo; echo
+ ewarn "Yes, but I couldn't find a LILO signature on ${bootpart}"
+ ewarn "Check your /etc/lilo.conf, or run /sbin/lilo by hand."
+ return 1
+ fi
+
+ echo " Yes, on ${bootpart}"
+
+ 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 [ "${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
+ echo
+ ewarn "Running /sbin/dolilo failed! Please check what the problem is"
+ ewarn "before your next reboot."
+
+ ebeep 5
+ epause 5
+ 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 then"
+ einfo "that when asked, edit /etc/conf.d/dolilo to harness it's full potential."
+ ebeep 5
+ epause 3
+ echo
+ fi
+}
diff --git a/sys-boot/lilo/lilo-24.0-r1.ebuild b/sys-boot/lilo/lilo-24.0-r1.ebuild
new file mode 100644
index 000000000000..352e913e3097
--- /dev/null
+++ b/sys-boot/lilo/lilo-24.0-r1.ebuild
@@ -0,0 +1,176 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DOLILO_V="0.6"
+IUSE="static minimal pxeserial device-mapper"
+
+DESCRIPTION="Standard Linux boot loader"
+HOMEPAGE="https://alioth.debian.org/projects/lilo/"
+
+DOLILO_TAR="dolilo-${DOLILO_V}.tar.bz2"
+SRC_URI="
+ http://lilo.alioth.debian.org/ftp/sources/${P}.tar.gz
+ mirror://gentoo/${DOLILO_TAR}
+"
+
+SLOT="0"
+LICENSE="BSD GPL-2"
+KEYWORDS="-* amd64 x86"
+
+DEPEND=">=sys-devel/bin86-0.15.5"
+RDEPEND="device-mapper? ( >=sys-fs/lvm2-2.02.45 )"
+
+src_prepare() {
+ # 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 && epatch "${FILESDIR}/${P}-novga.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
+
+ # hardened automatic PIC plus PIE building should be suppressed
+ # because of assembler instructions that cannot be compiled PIC
+ HARDENED_CFLAGS=$(test-flags-CC -fno-pic -nopie)
+
+ # 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} ${HARDENED_CFLAGS}" ${target} || die
+}
+
+src_install() {
+ keepdir /boot
+ emake DESTDIR="${D}" install || die
+
+ if use !minimal; then
+ into /
+ dosbin "${WORKDIR}"/dolilo/dolilo || die
+
+ into /usr
+ dosbin keytab-lilo.pl || die
+
+ insinto /etc
+ newins "${FILESDIR}"/lilo.conf lilo.conf.example || die
+
+ newconfd "${WORKDIR}"/dolilo/dolilo.conf.d dolilo.example || die
+
+ dodoc CHANGELOG* readme/README.* readme/INCOMPAT README
+ docinto samples ; dodoc sample/*
+ fi
+}
+
+# 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
+ einfon "Checking for LILO ..."
+
+ if [ "$(whoami)" != "root" ]
+ then
+ echo; echo
+ eerror "Only root can check for LILO!"
+ return 1
+ fi
+
+ if [ -z "${rootpart}" ]
+ then
+ echo; echo
+ eerror "Could not determine root partition!"
+ return 1
+ fi
+
+ if [ ! -f /etc/lilo.conf -o ! -x /sbin/lilo ]
+ then
+ echo " No"
+ 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
+ echo; echo
+ ewarn "Yes, but I couldn't find a LILO signature on ${bootpart}"
+ ewarn "Check your /etc/lilo.conf, or run /sbin/lilo by hand."
+ return 1
+ fi
+
+ echo " Yes, on ${bootpart}"
+
+ 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 [ "${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
+ echo
+ eerror "Running /sbin/dolilo failed! Please check what the problem is"
+ eerror "before your next reboot."
+ 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 then"
+ einfo "that when asked, edit /etc/conf.d/dolilo to harness it's full potential."
+ echo
+ fi
+}
diff --git a/sys-boot/lilo/lilo-24.0.ebuild b/sys-boot/lilo/lilo-24.0.ebuild
new file mode 100644
index 000000000000..013415a6f5f5
--- /dev/null
+++ b/sys-boot/lilo/lilo-24.0.ebuild
@@ -0,0 +1,176 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DOLILO_V="0.5"
+IUSE="static minimal pxeserial device-mapper"
+
+DESCRIPTION="Standard Linux boot loader"
+HOMEPAGE="https://alioth.debian.org/projects/lilo/"
+
+DOLILO_TAR="dolilo-${DOLILO_V}.tar.bz2"
+SRC_URI="
+ http://lilo.alioth.debian.org/ftp/sources/${P}.tar.gz
+ mirror://gentoo/${DOLILO_TAR}
+"
+
+SLOT="0"
+LICENSE="BSD GPL-2"
+KEYWORDS="-* amd64 x86"
+
+DEPEND=">=sys-devel/bin86-0.15.5"
+RDEPEND="device-mapper? ( >=sys-fs/lvm2-2.02.45 )"
+
+src_prepare() {
+ # 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 && epatch "${FILESDIR}/${P}-novga.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
+
+ # hardened automatic PIC plus PIE building should be suppressed
+ # because of assembler instructions that cannot be compiled PIC
+ HARDENED_CFLAGS=$(test-flags-CC -fno-pic -nopie)
+
+ # 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} ${HARDENED_CFLAGS}" ${target} || die
+}
+
+src_install() {
+ keepdir /boot
+ emake DESTDIR="${D}" install || die
+
+ if use !minimal; then
+ into /
+ dosbin "${WORKDIR}"/dolilo/dolilo || die
+
+ into /usr
+ dosbin keytab-lilo.pl || die
+
+ insinto /etc
+ newins "${FILESDIR}"/lilo.conf lilo.conf.example || die
+
+ newconfd "${WORKDIR}"/dolilo/dolilo.conf.d dolilo.example || die
+
+ dodoc CHANGELOG* readme/README.* readme/INCOMPAT README
+ docinto samples ; dodoc sample/*
+ fi
+}
+
+# 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
+ einfon "Checking for LILO ..."
+
+ if [ "$(whoami)" != "root" ]
+ then
+ echo; echo
+ eerror "Only root can check for LILO!"
+ return 1
+ fi
+
+ if [ -z "${rootpart}" ]
+ then
+ echo; echo
+ eerror "Could not determine root partition!"
+ return 1
+ fi
+
+ if [ ! -f /etc/lilo.conf -o ! -x /sbin/lilo ]
+ then
+ echo " No"
+ 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
+ echo; echo
+ ewarn "Yes, but I couldn't find a LILO signature on ${bootpart}"
+ ewarn "Check your /etc/lilo.conf, or run /sbin/lilo by hand."
+ return 1
+ fi
+
+ echo " Yes, on ${bootpart}"
+
+ 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 [ "${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
+ echo
+ eerror "Running /sbin/dolilo failed! Please check what the problem is"
+ eerror "before your next reboot."
+ 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 then"
+ einfo "that when asked, edit /etc/conf.d/dolilo to harness it's full potential."
+ echo
+ fi
+}
diff --git a/sys-boot/lilo/lilo-24.1.ebuild b/sys-boot/lilo/lilo-24.1.ebuild
new file mode 100644
index 000000000000..844ce391706b
--- /dev/null
+++ b/sys-boot/lilo/lilo-24.1.ebuild
@@ -0,0 +1,183 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DOLILO_V="0.6"
+IUSE="static minimal pxeserial device-mapper"
+
+DESCRIPTION="Standard Linux boot loader"
+HOMEPAGE="https://alioth.debian.org/projects/lilo/"
+
+DOLILO_TAR="dolilo-${DOLILO_V}.tar.bz2"
+SRC_URI="
+ http://lilo.alioth.debian.org/ftp/sources/${P}.tar.gz
+ mirror://gentoo/${DOLILO_TAR}
+"
+
+SLOT="0"
+LICENSE="BSD GPL-2"
+KEYWORDS="-* ~amd64 ~x86"
+
+DEPEND=">=sys-devel/bin86-0.15.5"
+RDEPEND="device-mapper? ( >=sys-fs/lvm2-2.02.45 )"
+
+src_prepare() {
+ # 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 && epatch "${FILESDIR}/${P}-novga.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
+
+ # hardened automatic PIC plus PIE building should be suppressed
+ # because of assembler instructions that cannot be compiled PIC
+ HARDENED_CFLAGS=$(test-flags-CC -fno-pic -nopie)
+
+ # 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} ${HARDENED_CFLAGS}" ${target} || die
+}
+
+src_install() {
+ keepdir /boot
+ emake DESTDIR="${D}" install || die
+
+ if use !minimal; then
+ into /
+ dosbin "${WORKDIR}"/dolilo/dolilo || die
+
+ into /usr
+ dosbin keytab-lilo.pl || die
+
+ insinto /etc
+ newins "${FILESDIR}"/lilo.conf lilo.conf.example || die
+
+ newconfd "${WORKDIR}"/dolilo/dolilo.conf.d dolilo.example || die
+
+ dodoc CHANGELOG* readme/README.* readme/INCOMPAT README
+ docinto samples ; dodoc sample/*
+ fi
+}
+
+# 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 [ "${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
+}
diff --git a/sys-boot/lilo/metadata.xml b/sys-boot/lilo/metadata.xml
new file mode 100644
index 000000000000..256d2496217f
--- /dev/null
+++ b/sys-boot/lilo/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>base-system</herd>
+<maintainer>
+ <email>chainsaw@gentoo.org</email>
+ <name>Tony Vroon</name>
+</maintainer>
+<use>
+ <flag name='device-mapper'>Enable support for device-mapper from <pkg>sys-fs/lvm2</pkg></flag>
+ <flag name='minimal'>Do not install the dolilo helper script</flag>
+ <flag name='pxeserial'>Avoid character echo on PXE serial console</flag>
+</use>
+</pkgmetadata>