1 |
vapier 10/10/03 21:25:30 |
2 |
|
3 |
Modified: ChangeLog |
4 |
Added: baselayout-1.12.14-r1.ebuild |
5 |
Log: |
6 |
Fix infinite recursion with ip invocation #339013 by Krzysztof Olędzki. |
7 |
|
8 |
(Portage version: 2.2_rc86/cvs/Linux x86_64) |
9 |
|
10 |
Revision Changes Path |
11 |
1.481 sys-apps/baselayout/ChangeLog |
12 |
|
13 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/baselayout/ChangeLog?rev=1.481&view=markup |
14 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/baselayout/ChangeLog?rev=1.481&content-type=text/plain |
15 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/baselayout/ChangeLog?r1=1.480&r2=1.481 |
16 |
|
17 |
Index: ChangeLog |
18 |
=================================================================== |
19 |
RCS file: /var/cvsroot/gentoo-x86/sys-apps/baselayout/ChangeLog,v |
20 |
retrieving revision 1.480 |
21 |
retrieving revision 1.481 |
22 |
diff -u -r1.480 -r1.481 |
23 |
--- ChangeLog 26 Sep 2010 22:21:17 -0000 1.480 |
24 |
+++ ChangeLog 3 Oct 2010 21:25:30 -0000 1.481 |
25 |
@@ -1,10 +1,16 @@ |
26 |
# ChangeLog for sys-apps/baselayout |
27 |
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 |
28 |
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/baselayout/ChangeLog,v 1.480 2010/09/26 22:21:17 vapier Exp $ |
29 |
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/baselayout/ChangeLog,v 1.481 2010/10/03 21:25:30 vapier Exp $ |
30 |
|
31 |
# See the rc-scripts ChangeLog in subversion for release info: |
32 |
# http://sources.gentoo.org/viewcvs.py/*checkout*/baselayout/trunk/ChangeLog |
33 |
|
34 |
+*baselayout-1.12.14-r1 (03 Oct 2010) |
35 |
+ |
36 |
+ 03 Oct 2010; Mike Frysinger <vapier@g.o> |
37 |
+ +baselayout-1.12.14-r1.ebuild, +files/baselayout-1.12.14-iproute.patch: |
38 |
+ Fix infinite recursion with ip invocation #339013 by Krzysztof Olędzki. |
39 |
+ |
40 |
*baselayout-1.12.14 (26 Sep 2010) |
41 |
|
42 |
26 Sep 2010; Mike Frysinger <vapier@g.o> |
43 |
|
44 |
|
45 |
|
46 |
1.1 sys-apps/baselayout/baselayout-1.12.14-r1.ebuild |
47 |
|
48 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/baselayout/baselayout-1.12.14-r1.ebuild?rev=1.1&view=markup |
49 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/baselayout/baselayout-1.12.14-r1.ebuild?rev=1.1&content-type=text/plain |
50 |
|
51 |
Index: baselayout-1.12.14-r1.ebuild |
52 |
=================================================================== |
53 |
# Copyright 1999-2010 Gentoo Foundation |
54 |
# Distributed under the terms of the GNU General Public License v2 |
55 |
# $Header: /var/cvsroot/gentoo-x86/sys-apps/baselayout/baselayout-1.12.14-r1.ebuild,v 1.1 2010/10/03 21:25:30 vapier Exp $ |
56 |
|
57 |
inherit flag-o-matic eutils toolchain-funcs multilib |
58 |
|
59 |
DESCRIPTION="Filesystem baselayout and init scripts" |
60 |
HOMEPAGE="http://www.gentoo.org/" |
61 |
SRC_URI="mirror://gentoo/${P}.tar.bz2 |
62 |
http://dev.gentoo.org/~uberlord/baselayout/${P}.tar.bz2 |
63 |
http://dev.gentoo.org/~azarah/baselayout/${P}.tar.bz2 |
64 |
http://dev.gentoo.org/~vapier/dist/${P}.tar.bz2" |
65 |
|
66 |
LICENSE="GPL-2" |
67 |
SLOT="0" |
68 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" |
69 |
IUSE="bootstrap build static unicode" |
70 |
|
71 |
# This version of baselayout needs gawk in /bin, but as we do not have |
72 |
# a c++ compiler during bootstrap, we cannot depend on it if "bootstrap" |
73 |
# or "build" are in USE. |
74 |
# We need to block old dhcpcd versions as they are no longer in system |
75 |
# but may not be in users world file either. See bug #143885 |
76 |
RDEPEND="virtual/init |
77 |
!build? ( !bootstrap? ( |
78 |
|| ( >=sys-apps/coreutils-6.10-r1 sys-apps/mktemp ) |
79 |
>=sys-libs/readline-5.0-r1 |
80 |
>=app-shells/bash-3.1_p7 |
81 |
>=sys-apps/coreutils-5.2.1 |
82 |
>=sys-apps/findutils-4.2.18 |
83 |
) ) |
84 |
!<net-misc/dhcpcd-2.0.0" |
85 |
DEPEND="virtual/os-headers |
86 |
>=sys-apps/portage-2.0.51" |
87 |
PDEPEND="!build? ( !bootstrap? ( >=sys-apps/module-init-tools-3.2.2-r3 ) )" |
88 |
|
89 |
src_unpack() { |
90 |
unpack ${A} |
91 |
cd "${S}" |
92 |
|
93 |
# Setup unicode defaults for silly unicode users |
94 |
if use unicode ; then |
95 |
sed -i -e '/^UNICODE=/s:no:yes:' etc/rc.conf |
96 |
fi |
97 |
|
98 |
# Tweak arch-specific details |
99 |
cd "${S}" |
100 |
|
101 |
epatch "${FILESDIR}"/${P}-iproute.patch #339013 |
102 |
|
103 |
case $(tc-arch) in |
104 |
sparc) |
105 |
# Disable interactive boot on sparc due to stty calls, #104067 |
106 |
sed -i -e '/^RC_INTERACTIVE=/s:yes:no:' etc/conf.d/rc || die |
107 |
;; |
108 |
esac |
109 |
|
110 |
# Use correct path to filefuncs.so on multilib systems |
111 |
sed -i -e "s:/lib/rcscripts:/$(get_libdir)/rcscripts:" \ |
112 |
src/awk/cachedepends.awk sbin/functions.sh || die |
113 |
} |
114 |
|
115 |
src_compile() { |
116 |
local libdir="lib" |
117 |
|
118 |
use static && append-ldflags -static |
119 |
|
120 |
[[ ${SYMLINK_LIB} == "yes" ]] && libdir=$(get_abi_LIBDIR "${DEFAULT_ABI}") |
121 |
|
122 |
make -C "${S}"/src \ |
123 |
CC="$(tc-getCC)" \ |
124 |
LD="$(tc-getCC) ${LDFLAGS}" \ |
125 |
CFLAGS="${CFLAGS}" \ |
126 |
LIBDIR="${libdir}" || die |
127 |
} |
128 |
|
129 |
# ${PATH} should include where to get MAKEDEV when calling this |
130 |
# function |
131 |
create_dev_nodes() { |
132 |
case $(tc-arch) in |
133 |
# amd64 must use generic-i386 because amd64/x86_64 does not have |
134 |
# a generic option at this time, and the default 'generic' ends |
135 |
# up erroring out, because MAKEDEV internally doesn't know what |
136 |
# to use |
137 |
arm*) suffix=-arm ;; |
138 |
alpha) suffix=-alpha ;; |
139 |
amd64) suffix=-i386 ;; |
140 |
hppa) suffix=-hppa ;; |
141 |
ia64) suffix=-ia64 ;; |
142 |
m68k) suffix=-m68k ;; |
143 |
mips*) suffix=-mips ;; |
144 |
ppc*) suffix=-powerpc ;; |
145 |
s390*) suffix=-s390 ;; |
146 |
sh*) suffix=-sh ;; |
147 |
sparc*) suffix=-sparc ;; |
148 |
x86) suffix=-i386 ;; |
149 |
esac |
150 |
|
151 |
einfo "Using generic${suffix} to make $(tc-arch) device nodes..." |
152 |
MAKEDEV generic${suffix} |
153 |
MAKEDEV sg scd rtc hde hdf hdg hdh input audio video |
154 |
} |
155 |
|
156 |
# This is a temporary workaround until bug 9849 is completely solved |
157 |
# in portage. We need to create the directories so they're available |
158 |
# during src_install, but when src_install is finished, call unkdir |
159 |
# to remove any empty directories instead of leaving them around. |
160 |
kdir() { |
161 |
typeset -a args |
162 |
typeset d |
163 |
|
164 |
# Create the directories for the remainder of src_install, and |
165 |
# remember how to create the directories later. |
166 |
for d in "$@"; do |
167 |
if [[ $d == /* ]]; then |
168 |
install -d "${args[@]}" "${D}/${d}" |
169 |
cat >> "${D}/usr/share/baselayout/mkdirs.sh" <<EOF |
170 |
if [ ! -d "\${ROOT}/${d}" ] ; then \\ |
171 |
install -d ${args[@]} "\${ROOT}/${d}" 2>/dev/null \\ |
172 |
|| ewarn " can't create ${d}" |
173 |
touch "\${ROOT}/${d}/.keep" 2>/dev/null \\ |
174 |
|| ewarn " can't create ${d}/.keep" |
175 |
fi |
176 |
EOF |
177 |
else |
178 |
args=("${args[@]}" "${d}") |
179 |
fi |
180 |
done |
181 |
} |
182 |
|
183 |
# Continued from kdir above... This function removes any empty |
184 |
# directories as a temporary workaround for bug 9849. The directories |
185 |
# (and .keep files) are re-created in pkg_postinst, which means they |
186 |
# aren't listed in CONTENTS, unfortunately. |
187 |
unkdir() { |
188 |
einfo "Running unkdir to workaround bug 9849" |
189 |
find "${D}" -depth -type d -exec rmdir {} \; 2>/dev/null |
190 |
if [[ $? == 127 ]]; then |
191 |
ewarn "Problem running unkdir: find command not found" |
192 |
fi |
193 |
} |
194 |
|
195 |
# Same as kdir above, but for symlinks #103618 |
196 |
ksym() { |
197 |
echo "[[ ! -e ${ROOT}/$2 ]] && { ln -s '$1' '${ROOT}/$2' &> /dev/null || ewarn ' unable to symlink $2 to $1' ; }" \ |
198 |
>> "${D}"/usr/share/baselayout/mklinks.sh |
199 |
} |
200 |
|
201 |
src_install() { |
202 |
local dir libdirs libdirs_env rcscripts_dir |
203 |
|
204 |
# This directory is to stash away things that will be used in |
205 |
# pkg_postinst; it's needed first for kdir to function |
206 |
dodir /usr/share/baselayout |
207 |
|
208 |
# Jeremy Huddleston <eradicator@g.o> |
209 |
# For multilib, we want to make sure that all our multilibdirs exist |
210 |
# and make lib even if it's not listed as one (like on amd64/ppc64 |
211 |
# which sometimes has lib32/lib64 instead of lib/lib64). |
212 |
# lib should NOT be a symlink to one of the other libdirs. |
213 |
# Old systems with symlinks won't be affected by this change, as the |
214 |
# symlinks already exist and won't get removed, but new systems will |
215 |
# be setup properly. |
216 |
# |
217 |
# I'll be making a script to convert existing systems from symlink to |
218 |
# nosymlink and putting it in /usr/portage/scripts. |
219 |
libdirs=$(get_all_libdirs) |
220 |
: ${libdirs:=lib} # it isn't that we don't trust multilib.eclass... |
221 |
|
222 |
# This should be /lib/rcscripts, but we have to support old profiles too. |
223 |
if [[ ${SYMLINK_LIB} == "yes" ]]; then |
224 |
rcscripts_dir="/$(get_abi_LIBDIR ${DEFAULT_ABI})/rcscripts" |
225 |
else |
226 |
rcscripts_dir="/lib/rcscripts" |
227 |
fi |
228 |
|
229 |
einfo "Creating directories..." |
230 |
kdir /usr |
231 |
kdir /usr/local |
232 |
kdir /boot |
233 |
kdir /dev |
234 |
kdir /dev/pts |
235 |
kdir /dev/shm |
236 |
kdir /etc/conf.d |
237 |
kdir /etc/cron.daily |
238 |
kdir /etc/cron.hourly |
239 |
kdir /etc/cron.monthly |
240 |
kdir /etc/cron.weekly |
241 |
kdir /etc/env.d |
242 |
dodir /etc/init.d # .keep file might mess up init.d stuff |
243 |
kdir /etc/modules.autoload.d |
244 |
kdir /etc/modprobe.d |
245 |
kdir /etc/opt |
246 |
kdir /home |
247 |
kdir ${rcscripts_dir} |
248 |
kdir ${rcscripts_dir}/awk |
249 |
kdir ${rcscripts_dir}/sh |
250 |
kdir ${rcscripts_dir}/net |
251 |
# Only install /mnt stuff at bootstrap time #88835 / #90022 |
252 |
if use build ; then |
253 |
kdir /mnt |
254 |
kdir -m 0700 /mnt/cdrom |
255 |
kdir -m 0700 /mnt/floppy |
256 |
fi |
257 |
kdir /opt |
258 |
kdir -o root -g uucp -m0775 /var/lock |
259 |
kdir /proc |
260 |
kdir -m 0700 /root |
261 |
kdir /sbin |
262 |
kdir /sys # for 2.6 kernels |
263 |
kdir /usr/bin |
264 |
kdir /usr/include |
265 |
kdir /usr/include/asm |
266 |
kdir /usr/include/linux |
267 |
kdir /usr/local/bin |
268 |
kdir /usr/local/games |
269 |
kdir /usr/local/sbin |
270 |
kdir /usr/local/share |
271 |
kdir /usr/local/share/doc |
272 |
kdir /usr/local/share/man |
273 |
kdir /usr/local/src |
274 |
kdir ${PORTDIR} |
275 |
kdir /usr/sbin |
276 |
kdir /usr/share/doc |
277 |
kdir /usr/share/info |
278 |
kdir /usr/share/man |
279 |
kdir /usr/share/misc |
280 |
kdir /usr/src |
281 |
kdir -m 1777 /tmp |
282 |
kdir /var |
283 |
dodir /var/db/pkg # .keep file messes up Portage |
284 |
kdir /var/lib/misc |
285 |
kdir /var/lock/subsys |
286 |
kdir /var/log/news |
287 |
kdir /var/run |
288 |
kdir /var/spool |
289 |
kdir /var/state |
290 |
kdir -m 1777 /var/tmp |
291 |
|
292 |
for dir in ${libdirs}; do |
293 |
libdirs_env=${libdirs_env:+$libdirs_env:}/${dir}:/usr/${dir}:/usr/local/${dir} |
294 |
[[ ${dir} == "lib" && ${SYMLINK_LIB} == "yes" ]] && continue |
295 |
kdir /${dir} |
296 |
kdir /usr/${dir} |
297 |
kdir /usr/local/${dir} |
298 |
done |
299 |
|
300 |
# Ugly compatibility with stupid ebuilds and old profiles symlinks |
301 |
if [[ ${SYMLINK_LIB} == "yes" ]] ; then |
302 |
rm -r "${D}"/{lib,usr/lib,usr/local/lib} &> /dev/null |
303 |
ksym $(get_abi_LIBDIR ${DEFAULT_ABI}) /lib |
304 |
ksym $(get_abi_LIBDIR ${DEFAULT_ABI}) /usr/lib |
305 |
ksym $(get_abi_LIBDIR ${DEFAULT_ABI}) /usr/local/lib |
306 |
fi |
307 |
|
308 |
# FHS compatibility symlinks stuff |
309 |
ksym /var/tmp /usr/tmp |
310 |
ksym share/man /usr/local/man |
311 |
|
312 |
# |
313 |
# Setup files in /etc |
314 |
# |
315 |
insopts -m0644 |
316 |
insinto /etc |
317 |
doins -r "${S}"/etc/* || die |
318 |
fperms 0640 /etc/sysctl.conf |
319 |
|
320 |
# Install some files to /usr/share/baselayout instead of /etc to keep from |
321 |
# (1) overwriting the user's settings, (2) screwing things up when |
322 |
# attempting to merge files, (3) accidentally packaging up personal files |
323 |
# with quickpkg |
324 |
fperms 0600 /etc/shadow |
325 |
mv "${D}"/etc/{passwd,shadow,group,fstab,hosts,issue.devfix} "${D}"/usr/share/baselayout || die |
326 |
|
327 |
# doinitd doesnt respect symlinks |
328 |
dodir /etc/init.d |
329 |
cp -P "${S}"/init.d/* "${D}"/etc/init.d/ || die "doinitd" |
330 |
#doinitd "${S}"/init.d/* || die "doinitd" |
331 |
doconfd "${S}"/etc/conf.d/* || die "doconfd" |
332 |
doenvd "${S}"/etc/env.d/* || die "doenvd" |
333 |
insinto /etc/modules.autoload.d |
334 |
doins "${S}"/etc/modules.autoload.d/* || die |
335 |
insinto /etc/modprobe.d |
336 |
doins "${S}"/etc/modprobe.d/* || die |
337 |
|
338 |
# Special-case uglyness... For people updating from lib32 -> lib amd64 |
339 |
# profiles, keep lib32 in the search path while it's around |
340 |
if has_multilib_profile && [ -d /lib32 -o -d /usr/lib32 ] && ! hasq lib32 ${libdirs}; then |
341 |
libdirs_env="${libdirs_env}:/lib32:/usr/lib32:/usr/local/lib32" |
342 |
fi |
343 |
|
344 |
# List all the multilib libdirs in /etc/env/04multilib (only if they're |
345 |
# actually different from the normal |
346 |
if has_multilib_profile || [[ $(get_libdir) != "lib" || -n ${CONF_MULTILIBDIR} ]]; then |
347 |
echo "LDPATH=\"${libdirs_env}\"" > 04multilib |
348 |
doenvd 04multilib |
349 |
fi |
350 |
|
351 |
# As of baselayout-1.10-1-r1, sysvinit is its own package again, and |
352 |
# provides the inittab itself |
353 |
rm -f "${D}"/etc/inittab |
354 |
|
355 |
# Stash the rc-lists for use during pkg_postinst |
356 |
cp -r "${S}"/rc-lists "${D}"/usr/share/baselayout |
357 |
|
358 |
# rc-scripts version for testing of features that *should* be present |
359 |
echo "Gentoo Base System release ${PV}" > "${D}"/etc/gentoo-release |
360 |
|
361 |
# |
362 |
# Setup files related to /dev |
363 |
# |
364 |
into / |
365 |
dosbin "${S}"/sbin/MAKEDEV |
366 |
dosym ../../sbin/MAKEDEV /usr/sbin/MAKEDEV |
367 |
dosym ../sbin/MAKEDEV /dev/MAKEDEV |
368 |
|
369 |
# |
370 |
# Setup files in /bin |
371 |
# |
372 |
cd "${S}"/bin |
373 |
dobin rc-status checkpath || die |
374 |
|
375 |
# |
376 |
# Setup files in /sbin |
377 |
# |
378 |
cd "${S}"/sbin |
379 |
into / |
380 |
dosbin rc rc-update || die |
381 |
dosym rc-update /sbin/update-rc |
382 |
# These moved from /etc/init.d/ to /sbin to help newb systems |
383 |
# from breaking |
384 |
dosbin runscript.sh functions.sh || die |
385 |
|
386 |
# Compat symlinks between /etc/init.d and /sbin |
387 |
# (some stuff have hardcoded paths) |
388 |
dosym ../../sbin/depscan.sh /etc/init.d/depscan.sh |
389 |
dosym ../../sbin/runscript.sh /etc/init.d/runscript.sh |
390 |
dosym ../../sbin/functions.sh /etc/init.d/functions.sh |
391 |
|
392 |
# |
393 |
# Setup files in /lib/rcscripts |
394 |
# These are support files for other things in baselayout that needn't be |
395 |
# under CONFIG_PROTECTed /etc |
396 |
# |
397 |
cd "${S}"/sbin |
398 |
exeinto ${rcscripts_dir}/sh |
399 |
doexe rc-services.sh rc-daemon.sh rc-help.sh || die |
400 |
|
401 |
# This is for new depscan.sh written in awk |
402 |
cd "${S}"/sbin |
403 |
into / |
404 |
dosbin depscan.sh |
405 |
insinto ${rcscripts_dir}/awk |
406 |
doins "${S}"/src/awk/*.awk |
407 |
|
408 |
# Original design had these in /etc/net.modules.d but that is too |
409 |
# problematic with CONFIG_PROTECT |
410 |
dodir ${rcscripts_dir} |
411 |
cp -pPR "${S}"/lib/rcscripts/net "${D}"${rcscripts_dir} |
412 |
chown -R root:0 "${D}"${rcscripts_dir} |
413 |
|
414 |
# |
415 |
# Install baselayout documentation |
416 |
# |
417 |
doman "${S}"/man/*.* |
418 |
docinto / |
419 |
dodoc "${S}"/ChangeLog{,.svn} |
420 |
|
421 |
# |
422 |
# Install baselayout utilities |
423 |
# |
424 |
local libdir="lib" |
425 |
[[ ${SYMLINK_LIB} == "yes" ]] && libdir=$(get_abi_LIBDIR "${DEFAULT_ABI}") |
426 |
|
427 |
cd "${S}"/src |
428 |
emake DESTDIR="${D}" LIBDIR="${libdir}" install || die |
429 |
|
430 |
# Hack to fix bug 9849, continued in pkg_postinst |
431 |
unkdir |
432 |
} |
433 |
|
434 |
# Support function for remapping old wireless dns vars |
435 |
remap_dns_vars() { |
436 |
local f="$1" |
437 |
|
438 |
if [[ -f ${ROOT}/etc/conf.d/${f} ]]; then |
439 |
sed -e 's/\<domain_/dns_domain_/g' \ |
440 |
-e 's/\<mac_domain_/mac_dns_domain_/g' \ |
441 |
-e 's/\<nameservers_/dns_servers_/g' \ |
442 |
-e 's/\<mac_nameservers_/mac_dns_servers_/g' \ |
443 |
-e 's/\<searchdomains_/dns_search_domains_/g' \ |
444 |
-e 's/\<mac_searchdomains_/mac_dns_search_domains_/g' \ |
445 |
"${ROOT}"/etc/conf.d/${f} > "${D}"/etc/conf.d/${f} |
446 |
fi |
447 |
} |
448 |
|
449 |
pkg_preinst() { |
450 |
# When downgrading from 1.13 we need to erase net.lo as it's a symlink |
451 |
# and it's about to become a file - this is fatal in /etc |
452 |
[[ -L "${ROOT}"etc/init.d/net.lo ]] && rm -f "${ROOT}"etc/init.d/net.lo |
453 |
|
454 |
# Reincarnate dirs from kdir/unkdir (hack for bug 9849) |
455 |
# This needs to be in pkg_preinst() rather than pkg_postinst() as |
456 |
# portage may create some dirs/files that'll screw us up (like /usr/lib/debug) |
457 |
einfo "Creating directories and .keep files." |
458 |
einfo "Some of these might fail if they're read-only mounted" |
459 |
einfo "filesystems, for example /dev or /proc. That's okay!" |
460 |
source "${D}"/usr/share/baselayout/mkdirs.sh |
461 |
source "${D}"/usr/share/baselayout/mklinks.sh |
462 |
echo |
463 |
|
464 |
if [[ -f ${ROOT}/etc/modules.autoload && ! -d ${ROOT}/etc/modules.autoload.d ]]; then |
465 |
mkdir -p "${ROOT}"/etc/modules.autoload.d |
466 |
mv -f "${ROOT}"/etc/modules.autoload \ |
467 |
"${ROOT}"/etc/modules.autoload.d/kernel-2.4 |
468 |
ln -snf modules.autoload.d/kernel-2.4 "${ROOT}"/etc/modules.autoload |
469 |
fi |
470 |
|
471 |
# Change some vars introduced in baselayout-1.11.0 before we go stable |
472 |
# The new names make more sense and allow nis_domain |
473 |
# for use in baselayout-1.12.0 |
474 |
remap_dns_vars net |
475 |
remap_dns_vars wireless |
476 |
} |
477 |
|
478 |
pkg_postinst() { |
479 |
local x y |
480 |
|
481 |
# Create /boot/boot symlink in pkg_postinst because sometimes |
482 |
# /boot is a FAT filesystem. When that is the case, then the |
483 |
# symlink will fail. Consequently, if we create it in |
484 |
# src_install, then merge will fail. AFAIK there is no point to |
485 |
# this symlink except for misconfigured grubs. See bug 50108 |
486 |
# (05 May 2004 agriffis) |
487 |
ln -sn . "${ROOT}"/boot/boot 2>/dev/null |
488 |
|
489 |
# For the bootstrap scenario with an empty /dev, let's fill the |
490 |
# sucker with generic crude ... some day we should think about |
491 |
# slimming this way down as we've moved on to udev/devfs |
492 |
if use build ; then |
493 |
if [[ ! -e ${ROOT}/dev/.devfsd && ! -e ${ROOT}/dev/.udev ]] ; then |
494 |
echo |
495 |
einfo "Making device node tarball (this could take a couple minutes)" |
496 |
cd "${ROOT}"/dev || die |
497 |
PATH=${ROOT}/sbin:${PATH} create_dev_nodes |
498 |
fi |
499 |
fi |
500 |
|
501 |
# Set up default runlevel symlinks |
502 |
# This used to be done in src_install but required knowledge of ${ROOT}, |
503 |
# which meant that it was effectively broken for binary installs. |
504 |
if [[ -z $(/bin/ls "${ROOT}"/etc/runlevels 2>/dev/null) ]]; then |
505 |
for x in boot default nonetwork single; do |
506 |
einfo "Creating default runlevel symlinks for ${x}" |
507 |
mkdir -p "${ROOT}"/etc/runlevels/${x} |
508 |
for y in $(<"${ROOT}"/usr/share/baselayout/rc-lists/${x}); do |
509 |
if [[ ! -e ${ROOT}/etc/init.d/${y} ]]; then |
510 |
ewarn "init.d/${y} not found -- ignoring" |
511 |
else |
512 |
ln -sfn /etc/init.d/${y} \ |
513 |
"${ROOT}"/etc/runlevels/${x}/${y} |
514 |
fi |
515 |
done |
516 |
done |
517 |
fi |
518 |
|
519 |
# Create /etc/hosts in pkg_postinst so we don't overwrite an |
520 |
# existing file during bootstrap |
521 |
if [[ ! -e ${ROOT}/etc/hosts ]]; then |
522 |
cp "${ROOT}"/usr/share/baselayout/hosts "${ROOT}"/etc |
523 |
fi |
524 |
|
525 |
# Touching /etc/passwd and /etc/shadow after install can be fatal, as many |
526 |
# new users do not update them properly... see src_install() for why they |
527 |
# are in /usr/share/baselayout/ |
528 |
for x in passwd shadow group fstab ; do |
529 |
if [[ -e ${ROOT}/etc/${x} ]] ; then |
530 |
touch "${ROOT}/etc/${x}" |
531 |
else |
532 |
cp "${ROOT}/usr/share/baselayout/${x}" "${ROOT}/etc/${x}" |
533 |
fi |
534 |
done |
535 |
|
536 |
# Under what circumstances would mtab be a symlink? It would be |
537 |
# nice if there were an explanatory comment here |
538 |
if [[ -L ${ROOT}/etc/mtab ]]; then |
539 |
rm -f "${ROOT}/etc/mtab" |
540 |
if [[ ${ROOT} == / ]]; then |
541 |
cp /proc/mounts "${ROOT}/etc/mtab" |
542 |
else |
543 |
touch "${ROOT}/etc/mtab" |
544 |
fi |
545 |
fi |
546 |
|
547 |
# We should only install empty files if these files don't already exist. |
548 |
[[ -e ${ROOT}/var/log/lastlog ]] || \ |
549 |
touch "${ROOT}/var/log/lastlog" |
550 |
[[ -e ${ROOT}/var/run/utmp ]] || \ |
551 |
install -m 0664 -g utmp /dev/null "${ROOT}/var/run/utmp" |
552 |
[[ -e ${ROOT}/var/log/wtmp ]] || \ |
553 |
install -m 0664 -g utmp /dev/null "${ROOT}/var/log/wtmp" |
554 |
|
555 |
# Reload init to fix unmounting problems of / on next reboot. |
556 |
# This is really needed, as without the new version of init cause init |
557 |
# not to quit properly on reboot, and causes a fsck of / on next reboot. |
558 |
if [[ ${ROOT} == / ]] && ! use build && ! use bootstrap; then |
559 |
# Regenerate init.d dependency tree |
560 |
/sbin/depscan.sh --update &>/dev/null |
561 |
else |
562 |
rm -f "${ROOT}"/etc/modules.conf |
563 |
fi |
564 |
|
565 |
# This is also written in src_install (so it's in CONTENTS), but |
566 |
# write it here so that the new version is immediately in the file |
567 |
# (without waiting for the user to do etc-update) |
568 |
rm -f "${ROOT}"/etc/._cfg????_gentoo-release |
569 |
echo "Gentoo Base System release ${PV}" > "${ROOT}"/etc/gentoo-release |
570 |
|
571 |
echo |
572 |
einfo "Please be sure to update all pending '._cfg*' files in /etc," |
573 |
einfo "else things might break at your next reboot! You can use 'etc-update'" |
574 |
einfo "to accomplish this:" |
575 |
einfo |
576 |
einfo " # etc-update" |
577 |
echo |
578 |
|
579 |
for f in "${ROOT}"etc/init.d/net.* ; do |
580 |
[[ -L ${f} || ${f} == "${ROOT}etc/init.d/net.lo" ]] && continue |
581 |
echo |
582 |
einfo "WARNING: You have older net.* files in ${ROOT}etc/init.d/" |
583 |
einfo "They need to be converted to symlinks to net.lo. If you haven't" |
584 |
einfo "made personal changes to those files, you can update with the" |
585 |
einfo "following command:" |
586 |
einfo |
587 |
einfo " /bin/ls '${ROOT}'etc/init.d/net.* | grep -v '/net.lo$' | xargs -n1 ln -sfvn net.lo" |
588 |
echo |
589 |
break |
590 |
done |
591 |
|
592 |
if sed -e 's/#.*//' "${ROOT}"/etc/conf.d/{net,wireless} 2>/dev/null \ |
593 |
| egrep -q '\<(domain|nameservers|searchdomains)_' ; then |
594 |
echo |
595 |
ewarn "You have deprecated variables in ${ROOT}/etc/conf.d/net" |
596 |
ewarn "or ${ROOT}/etc/conf.d/wireless" |
597 |
ewarn |
598 |
ewarn "domain_* -> dns_domain_*" |
599 |
ewarn "nameservers_* -> dns_servers_*" |
600 |
ewarn "searchdomains_* -> dns_search_domains_*" |
601 |
ewarn |
602 |
ewarn "They have been converted for you - ensure that you" |
603 |
ewarn "update them via 'etc-update'" |
604 |
echo |
605 |
fi |
606 |
|
607 |
if sed -e 's/#.*//' "${ROOT}"/etc/conf.d/net 2>/dev/null \ |
608 |
| egrep -q '\<(iface_|gateway=|ifconfig_|aliases_|broadcasts_|netmasks_|inet6_|ipaddr_|iproute_)'; then |
609 |
echo |
610 |
ewarn "You are using deprecated variables in ${ROOT}/etc/conf.d/net" |
611 |
ewarn |
612 |
ewarn "You are advised to review the new configuration variables as" |
613 |
ewarn "found in '${ROOT}'/etc/conf.d/net.example as there is no" |
614 |
ewarn "guarantee that they will work in future versions." |
615 |
echo |
616 |
fi |
617 |
|
618 |
# Remove old stuff that may cause problems. |
619 |
if [[ -e "${ROOT}"/etc/env.d/01hostname ]] ; then |
620 |
rm -f "${ROOT}"/etc/env.d/01hostname |
621 |
fi |
622 |
if [[ -e "${ROOT}"/etc/init.d/domainname ]] ; then |
623 |
rm -f "${ROOT}"/etc/init.d/domainname |
624 |
rm -f "${ROOT}"/etc/runlevels/*/domainname |
625 |
ewarn "The domainname init script has been removed in this version." |
626 |
ewarn "Consult '${ROOT}'/etc/conf.d/net.example for details about how" |
627 |
ewarn "to apply dns/nis information to the loopback interface." |
628 |
fi |
629 |
|
630 |
elog "The default setting for wiping /tmp has been set to 'yes'." |
631 |
elog "Consult /etc/conf.d/bootmisc for more information." |
632 |
} |
633 |
|
634 |
pkg_prerm() { |
635 |
# Older baselayout installed a net.eth0 link by default |
636 |
# which means during an upgrade, that link gets lost |
637 |
if has_version '=sys-apps/baselayout-2*' && [[ -L ${ROOT}/etc/init.d/net.eth0 ]] ; then |
638 |
readlink "${ROOT}"/etc/init.d/net.eth0 > "${T}"/carry-the-0 |
639 |
else |
640 |
rm -f "${T}"/carry-the-0 |
641 |
fi |
642 |
} |
643 |
|
644 |
pkg_postrm() { |
645 |
# Older baselayout installed a net.eth0 link by default |
646 |
# which means during an upgrade, that link gets lost |
647 |
if has_version '=sys-apps/baselayout-2*' && |
648 |
[[ ! -e ${ROOT}/etc/init.d/net.eth0 ]] && |
649 |
[[ -e ${T}/carry-the-0 ]] |
650 |
then |
651 |
ln -s $(<"${T}"/carry-the-0) "${ROOT}"/etc/init.d/net.eth0 |
652 |
fi |
653 |
} |