Gentoo Archives: gentoo-commits

From: "Tony Vroon (chainsaw)" <chainsaw@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-boot/lilo: ChangeLog lilo-24.0-r1.ebuild
Date: Tue, 02 Sep 2014 11:51:48
Message-Id: 20140902115144.683FC4841@oystercatcher.gentoo.org
1 chainsaw 14/09/02 11:51:44
2
3 Modified: ChangeLog
4 Added: lilo-24.0-r1.ebuild
5 Log:
6 Fixing up dolilo for changed kernel build processes resulting in a duplicate label and thus a defective configuration file. Also copes with /dev/ram0 for initramfs boots.
7
8 (Portage version: 2.2.12/cvs/Linux x86_64, signed Manifest commit with key 0xB5058F9A)
9
10 Revision Changes Path
11 1.80 sys-boot/lilo/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-boot/lilo/ChangeLog?rev=1.80&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-boot/lilo/ChangeLog?rev=1.80&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-boot/lilo/ChangeLog?r1=1.79&r2=1.80
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/sys-boot/lilo/ChangeLog,v
20 retrieving revision 1.79
21 retrieving revision 1.80
22 diff -u -r1.79 -r1.80
23 --- ChangeLog 12 Jul 2014 15:02:32 -0000 1.79
24 +++ ChangeLog 2 Sep 2014 11:51:44 -0000 1.80
25 @@ -1,6 +1,13 @@
26 # ChangeLog for sys-boot/lilo
27 # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/sys-boot/lilo/ChangeLog,v 1.79 2014/07/12 15:02:32 zlogene Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/sys-boot/lilo/ChangeLog,v 1.80 2014/09/02 11:51:44 chainsaw Exp $
30 +
31 +*lilo-24.0-r1 (02 Sep 2014)
32 +
33 + 02 Sep 2014; Tony Vroon <chainsaw@g.o> +lilo-24.0-r1.ebuild:
34 + Fixing up dolilo for changed kernel build processes resulting in a duplicate
35 + label and thus a defective configuration file. Also copes with /dev/ram0 for
36 + initramfs boots.
37
38 12 Jul 2014; Mikle Kolyada <zlogene@g.o> lilo-24.0.ebuild:
39 amd64 stable wrt bug #503058
40
41
42
43 1.1 sys-boot/lilo/lilo-24.0-r1.ebuild
44
45 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-boot/lilo/lilo-24.0-r1.ebuild?rev=1.1&view=markup
46 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-boot/lilo/lilo-24.0-r1.ebuild?rev=1.1&content-type=text/plain
47
48 Index: lilo-24.0-r1.ebuild
49 ===================================================================
50 # Copyright 1999-2014 Gentoo Foundation
51 # Distributed under the terms of the GNU General Public License v2
52 # $Header: /var/cvsroot/gentoo-x86/sys-boot/lilo/lilo-24.0-r1.ebuild,v 1.1 2014/09/02 11:51:44 chainsaw Exp $
53
54 EAPI="5"
55
56 inherit eutils flag-o-matic toolchain-funcs
57
58 DOLILO_V="0.6"
59 IUSE="static minimal pxeserial device-mapper"
60
61 DESCRIPTION="Standard Linux boot loader"
62 HOMEPAGE="https://alioth.debian.org/projects/lilo/"
63
64 DOLILO_TAR="dolilo-${DOLILO_V}.tar.bz2"
65 SRC_URI="
66 http://lilo.alioth.debian.org/ftp/sources/${P}.tar.gz
67 mirror://gentoo/${DOLILO_TAR}
68 "
69
70 SLOT="0"
71 LICENSE="BSD GPL-2"
72 KEYWORDS="-* ~amd64 ~x86"
73
74 DEPEND=">=sys-devel/bin86-0.15.5"
75 RDEPEND="device-mapper? ( >=sys-fs/lvm2-2.02.45 )"
76
77 src_prepare() {
78 # this patch is needed when booting PXE and the device you're using
79 # emulates vga console via serial console.
80 # 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.
81 use pxeserial && epatch "${FILESDIR}/${P}-novga.patch"
82
83 # Do not strip and have parallel make
84 # FIXME: images/Makefile does weird stuff
85 sed -i Makefile src/Makefile \
86 -e '/strip/d;s|^ make| $(MAKE)|g' \
87 -e '/images install/d' \
88 -e '/images all/d' \
89 || die "sed strip failed"
90 }
91
92 src_configure() {
93 if ! use device-mapper; then
94 sed -i make.vars -e 's|-DDEVMAPPER||g' || die
95 fi
96 }
97
98 src_compile() {
99 # lilo needs this. bug #140209
100 export LC_ALL=C
101
102 # hardened automatic PIC plus PIE building should be suppressed
103 # because of assembler instructions that cannot be compiled PIC
104 HARDENED_CFLAGS=$(test-flags-CC -fno-pic -nopie)
105
106 # we explicitly prevent the custom CFLAGS for stability reasons
107 if use static; then
108 local target=alles
109 else
110 local target=all
111 fi
112
113 emake CC="$(tc-getCC) ${LDFLAGS} ${HARDENED_CFLAGS}" ${target} || die
114 }
115
116 src_install() {
117 keepdir /boot
118 emake DESTDIR="${D}" install || die
119
120 if use !minimal; then
121 into /
122 dosbin "${WORKDIR}"/dolilo/dolilo || die
123
124 into /usr
125 dosbin keytab-lilo.pl || die
126
127 insinto /etc
128 newins "${FILESDIR}"/lilo.conf lilo.conf.example || die
129
130 newconfd "${WORKDIR}"/dolilo/dolilo.conf.d dolilo.example || die
131
132 dodoc CHANGELOG* readme/README.* readme/INCOMPAT README
133 docinto samples ; dodoc sample/*
134 fi
135 }
136
137 # Check whether LILO is installed
138 # This function is from /usr/sbin/mkboot from debianutils, with copyright:
139 #
140 # Debian GNU/Linux
141 # Copyright 1996-1997 Guy Maor <maor@××××××.org>
142 #
143 # Modified for Gentoo for use with the lilo ebuild by:
144 # Martin Schlemmer <azarah@g.o> (16 Mar 2003)
145 #
146 lilocheck() {
147 local bootpart=
148 local rootpart="$(mount | grep -v "tmpfs" | grep -v "rootfs" | grep "on / " | cut -f1 -d " ")"
149
150 echo
151 einfon "Checking for LILO ..."
152
153 if [ "$(whoami)" != "root" ]
154 then
155 echo; echo
156 eerror "Only root can check for LILO!"
157 return 1
158 fi
159
160 if [ -z "${rootpart}" ]
161 then
162 echo; echo
163 eerror "Could not determine root partition!"
164 return 1
165 fi
166
167 if [ ! -f /etc/lilo.conf -o ! -x /sbin/lilo ]
168 then
169 echo " No"
170 return 1
171 fi
172
173 bootpart="$(sed -n "s:^boot[ ]*=[ ]*\(.*\)[ ]*:\1:p" /etc/lilo.conf)"
174
175 if [ -z "${bootpart}" ]
176 then
177 # lilo defaults to current root when 'boot=' is not present
178 bootpart="${rootpart}"
179 fi
180
181 if ! dd if=${bootpart} ibs=16 count=1 2>&- | grep -q 'LILO'
182 then
183 echo; echo
184 ewarn "Yes, but I couldn't find a LILO signature on ${bootpart}"
185 ewarn "Check your /etc/lilo.conf, or run /sbin/lilo by hand."
186 return 1
187 fi
188
189 echo " Yes, on ${bootpart}"
190
191 return 0
192 }
193
194 pkg_postinst() {
195 if [ ! -e "${ROOT}/boot/boot.b" -a ! -L "${ROOT}/boot/boot.b" ]
196 then
197 [ -f "${ROOT}/boot/boot-menu.b" ] && \
198 ln -snf boot-menu.b "${ROOT}/boot/boot.b"
199 fi
200
201 if [ "${ROOT}" = "/" ] && use !minimal;
202 then
203 if lilocheck
204 then
205 einfo "Running DOLILO to complete the install ..."
206 # do not redirect to /dev/null because it may display some input
207 # prompt
208 /sbin/dolilo
209 if [ "$?" -ne 0 ]
210 then
211 echo
212 eerror "Running /sbin/dolilo failed! Please check what the problem is"
213 eerror "before your next reboot."
214 fi
215 fi
216 echo
217 fi
218 if use !minimal; then
219 echo
220 einfo "Issue 'dolilo' instead of 'lilo' to have a friendly wrapper that"
221 einfo "handles mounting and unmounting /boot for you. It can do more then"
222 einfo "that when asked, edit /etc/conf.d/dolilo to harness it's full potential."
223 echo
224 fi
225 }