In both postinstall and etcupdate, in modes where the -s argument refers to tgz files or to a directory in which tgz files have already been extracted, make it an error for the files that should have come from etc.tgz to be missing. This is intended to prevent users from accidentally deleting necessary files when they run "postinstall -s xetc.tgz fix". Use the absence of .../etc/mtree/set.etc in the extracted directory as a test for the error case.diff -r1.46 -r1.47 src/usr.sbin/etcupdate/etcupdate
(apb)
--- src/usr.sbin/etcupdate/etcupdate 2008/09/14 14:22:45 1.46
+++ src/usr.sbin/etcupdate/etcupdate 2008/10/04 08:07:38 1.47
@@ -1,16 +1,16 @@ | @@ -1,16 +1,16 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh | |
2 | # | 2 | # | |
3 | # $NetBSD: etcupdate,v 1.46 2008/09/14 14:22:45 apb Exp $ | 3 | # $NetBSD: etcupdate,v 1.47 2008/10/04 08:07:38 apb Exp $ | |
4 | # | 4 | # | |
5 | # Copyright (c) 2001-2008 The NetBSD Foundation, Inc. | 5 | # Copyright (c) 2001-2008 The NetBSD Foundation, Inc. | |
6 | # All rights reserved. | 6 | # All rights reserved. | |
7 | # | 7 | # | |
8 | # This code is derived from software contributed to The NetBSD Foundation | 8 | # This code is derived from software contributed to The NetBSD Foundation | |
9 | # by Martti Kuparinen. | 9 | # by Martti Kuparinen. | |
10 | # | 10 | # | |
11 | # Redistribution and use in source and binary forms, with or without | 11 | # Redistribution and use in source and binary forms, with or without | |
12 | # modification, are permitted provided that the following conditions | 12 | # modification, are permitted provided that the following conditions | |
13 | # are met: | 13 | # are met: | |
14 | # 1. Redistributions of source code must retain the above copyright | 14 | # 1. Redistributions of source code must retain the above copyright | |
15 | # notice, this list of conditions and the following disclaimer. | 15 | # notice, this list of conditions and the following disclaimer. | |
16 | # 2. Redistributions in binary form must reproduce the above copyright | 16 | # 2. Redistributions in binary form must reproduce the above copyright | |
@@ -562,26 +562,30 @@ if ! ${CONTINUE}; then | @@ -562,26 +562,30 @@ if ! ${CONTINUE}; then | |||
562 | echo "*** ERROR: Unable to find ${SRCDIR}/etc/Makefile" | 562 | echo "*** ERROR: Unable to find ${SRCDIR}/etc/Makefile" | |
563 | exit 1 | 563 | exit 1 | |
564 | fi | 564 | fi | |
565 | set_makeenv | 565 | set_makeenv | |
566 | echo "*** Populating ${TEMPROOT} from ${SRCDIR} (make distribution)" | 566 | echo "*** Populating ${TEMPROOT} from ${SRCDIR} (make distribution)" | |
567 | cd ${SRCDIR}/etc | 567 | cd ${SRCDIR}/etc | |
568 | if ! ${VERBOSE}; then | 568 | if ! ${VERBOSE}; then | |
569 | eval "${MAKE_ENV} make distribution > /dev/null" | 569 | eval "${MAKE_ENV} make distribution > /dev/null" | |
570 | else | 570 | else | |
571 | eval "${MAKE_ENV} make distribution" | 571 | eval "${MAKE_ENV} make distribution" | |
572 | fi | 572 | fi | |
573 | [ $? -ne 0 ] && exit 1 | 573 | [ $? -ne 0 ] && exit 1 | |
574 | fi | 574 | fi | |
575 | if ! [ -f "${TEMPROOT}/etc/mtree/set.etc" ]; then | |||
576 | echo "*** ERROR: Files from the etc.tgz set are missing" | |||
577 | exit 1 | |||
578 | fi | |||
575 | if [ ! -f "${TEMPROOT}/dev/MAKEDEV" ]; then | 579 | if [ ! -f "${TEMPROOT}/dev/MAKEDEV" ]; then | |
576 | echo "" | 580 | echo "" | |
577 | echo "*** WARNING: ${TEMPROOT}/dev/MAKEDEV not found" | 581 | echo "*** WARNING: ${TEMPROOT}/dev/MAKEDEV not found" | |
578 | echo "Make sure you update /dev/MAKEDEV later and run" | 582 | echo "Make sure you update /dev/MAKEDEV later and run" | |
579 | echo "(cd /dev && ./MAKEDEV all) to rebuild the device nodes" | 583 | echo "(cd /dev && ./MAKEDEV all) to rebuild the device nodes" | |
580 | echo "" | 584 | echo "" | |
581 | fi | 585 | fi | |
582 | 586 | |||
583 | # Ignore the following files during comparision | 587 | # Ignore the following files during comparision | |
584 | rm -f "${TEMPROOT}"/etc/passwd | 588 | rm -f "${TEMPROOT}"/etc/passwd | |
585 | rm -f "${TEMPROOT}"/etc/pwd.db | 589 | rm -f "${TEMPROOT}"/etc/pwd.db | |
586 | rm -f "${TEMPROOT}"/etc/spwd.db | 590 | rm -f "${TEMPROOT}"/etc/spwd.db | |
587 | find "${TEMPROOT}" -type f -size 0 -exec rm {} \; | 591 | find "${TEMPROOT}" -type f -size 0 -exec rm {} \; |
--- src/usr.sbin/etcupdate/etcupdate.8 2008/09/14 14:22:45 1.17
+++ src/usr.sbin/etcupdate/etcupdate.8 2008/10/04 08:07:38 1.18
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | .\" $NetBSD: etcupdate.8,v 1.17 2008/09/14 14:22:45 apb Exp $ | 1 | .\" $NetBSD: etcupdate.8,v 1.18 2008/10/04 08:07:38 apb Exp $ | |
2 | .\" | 2 | .\" | |
3 | .\" Copyright (c) 2001-2008 The NetBSD Foundation, Inc. | 3 | .\" Copyright (c) 2001-2008 The NetBSD Foundation, Inc. | |
4 | .\" All rights reserved. | 4 | .\" All rights reserved. | |
5 | .\" | 5 | .\" | |
6 | .\" This code is derived from software contributed to The NetBSD Foundation | 6 | .\" This code is derived from software contributed to The NetBSD Foundation | |
7 | .\" by Martti Kuparinen. | 7 | .\" by Martti Kuparinen. | |
8 | .\" | 8 | .\" | |
9 | .\" Redistribution and use in source and binary forms, with or without | 9 | .\" Redistribution and use in source and binary forms, with or without | |
10 | .\" modification, are permitted provided that the following conditions | 10 | .\" modification, are permitted provided that the following conditions | |
11 | .\" are met: | 11 | .\" are met: | |
12 | .\" 1. Redistributions of source code must retain the above copyright | 12 | .\" 1. Redistributions of source code must retain the above copyright | |
13 | .\" notice, this list of conditions and the following disclaimer. | 13 | .\" notice, this list of conditions and the following disclaimer. | |
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | 14 | .\" 2. Redistributions in binary form must reproduce the above copyright | |
@@ -17,27 +17,27 @@ | @@ -17,27 +17,27 @@ | |||
17 | .\" | 17 | .\" | |
18 | .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | 18 | .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | |
19 | .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 19 | .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
20 | .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 20 | .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
21 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 21 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
22 | .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 22 | .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
23 | .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 23 | .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
24 | .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 24 | .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
25 | .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 25 | .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
26 | .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 26 | .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
27 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 27 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
28 | .\" POSSIBILITY OF SUCH DAMAGE. | 28 | .\" POSSIBILITY OF SUCH DAMAGE. | |
29 | .\" | 29 | .\" | |
30 | .Dd September 5, 2008 | 30 | .Dd October 4, 2008 | |
31 | .Dt ETCUPDATE 8 | 31 | .Dt ETCUPDATE 8 | |
32 | .Os | 32 | .Os | |
33 | .Sh NAME | 33 | .Sh NAME | |
34 | .Nm etcupdate | 34 | .Nm etcupdate | |
35 | .Nd update the configuration and startup files in | 35 | .Nd update the configuration and startup files in | |
36 | .Pa /etc | 36 | .Pa /etc | |
37 | .Sh SYNOPSIS | 37 | .Sh SYNOPSIS | |
38 | .Nm | 38 | .Nm | |
39 | .Op Fl ahlv | 39 | .Op Fl ahlv | |
40 | .Op Fl p Ar pager | 40 | .Op Fl p Ar pager | |
41 | .Op Fl s Brq Ar srcdir | Ar tgzdir | Ar tgzfile | 41 | .Op Fl s Brq Ar srcdir | Ar tgzdir | Ar tgzfile | |
42 | .Op Fl t Ar temproot | 42 | .Op Fl t Ar temproot | |
43 | .Op Fl w Ar width | 43 | .Op Fl w Ar width | |
@@ -179,52 +179,60 @@ in the | @@ -179,52 +179,60 @@ in the | |||
179 | directory. | 179 | directory. | |
180 | Note that | 180 | Note that | |
181 | .Ar srcdir | 181 | .Ar srcdir | |
182 | should refer to the top of the source directory tree; | 182 | should refer to the top of the source directory tree; | |
183 | earlier versions of | 183 | earlier versions of | |
184 | .Nm | 184 | .Nm | |
185 | expected | 185 | expected | |
186 | .Ar srcdir | 186 | .Ar srcdir | |
187 | to refer to the | 187 | to refer to the | |
188 | .Pa etc | 188 | .Pa etc | |
189 | subdirectory within the source tree. | 189 | subdirectory within the source tree. | |
190 | .It Fl s Ar tgzdir | 190 | .It Fl s Ar tgzdir | |
191 | A directory in which reference files have been | 191 | A directory in which reference files have been | |
192 | extracted from one or more of the | 192 | extracted from a binary distribution of | |
193 | .Nx . | |||
194 | The files that are distributed in the | |||
193 | .Dq Pa etc.tgz | 195 | .Dq Pa etc.tgz | |
194 | or | 196 | set file must be present. | |
197 | The files that are distributed in the | |||
195 | .Dq Pa xetc.tgz | 198 | .Dq Pa xetc.tgz | |
196 | files from a binary distribution of | 199 | set file are optional. | |
197 | .Nx . | |||
198 | The reference files from the specified directory will be copied to the | 200 | The reference files from the specified directory will be copied to the | |
199 | .Pa temproot | 201 | .Pa temproot | |
200 | directory. | 202 | directory. | |
201 | .It Fl s Ar tgzfile | 203 | .It Fl s Ar tgzfile | |
202 | The location of a set file | 204 | The location of a set file | |
203 | (or | 205 | (or | |
204 | .Dq "tgz file" ) | 206 | .Dq "tgz file" ) | |
205 | such as | 207 | such as | |
206 | .Pa etc.tgz | 208 | .Dq Pa etc.tgz | |
207 | or | 209 | or | |
208 | .Pa xetc.tgz | 210 | .Dq Pa xetc.tgz | |
209 | from a binary distribution of | 211 | from a binary distribution of | |
210 | .Nx . | 212 | .Nx . | |
211 | Each set file is a compressed archive containing reference files, | 213 | Each set file is a compressed archive containing reference files, | |
212 | which will be extracted to the | 214 | which will be extracted to the | |
213 | .Pa temproot | 215 | .Pa temproot | |
214 | directory. | 216 | directory. | |
215 | Multiple | 217 | Multiple | |
216 | .Fl s | 218 | .Fl s | |
217 | options may be used to specify multiple set files. | 219 | options may be used to specify multiple set files. | |
220 | The | |||
221 | .Dq Pa etc.tgz | |||
222 | set file must be specified. | |||
223 | The | |||
224 | .Dq Pa xetc.tgz | |||
225 | set file is optional. | |||
218 | .El | 226 | .El | |
219 | .It Fl t Ar temproot | 227 | .It Fl t Ar temproot | |
220 | Specifies the location of the | 228 | Specifies the location of the | |
221 | .Pa temproot | 229 | .Pa temproot | |
222 | directory. | 230 | directory. | |
223 | This directory will be used for a temporary copy of | 231 | This directory will be used for a temporary copy of | |
224 | the reference files created by running | 232 | the reference files created by running | |
225 | .Dq "make distribution" | 233 | .Dq "make distribution" | |
226 | in the source directory specified by | 234 | in the source directory specified by | |
227 | .Fl s Ar srcdir , | 235 | .Fl s Ar srcdir , | |
228 | or a temporary copy of the reference files extracted from | 236 | or a temporary copy of the reference files extracted from | |
229 | the binary sets specified by | 237 | the binary sets specified by | |
230 | .Fl s Ar tgzfile , | 238 | .Fl s Ar tgzfile , |
--- src/usr.sbin/postinstall/Attic/postinstall 2008/09/21 06:20:07 1.70
+++ src/usr.sbin/postinstall/Attic/postinstall 2008/10/04 08:07:38 1.71
@@ -1,16 +1,16 @@ | @@ -1,16 +1,16 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh | |
2 | # | 2 | # | |
3 | # $NetBSD: postinstall,v 1.70 2008/09/21 06:20:07 junyoung Exp $ | 3 | # $NetBSD: postinstall,v 1.71 2008/10/04 08:07:38 apb Exp $ | |
4 | # | 4 | # | |
5 | # Copyright (c) 2002-2008 The NetBSD Foundation, Inc. | 5 | # Copyright (c) 2002-2008 The NetBSD Foundation, Inc. | |
6 | # All rights reserved. | 6 | # All rights reserved. | |
7 | # | 7 | # | |
8 | # This code is derived from software contributed to The NetBSD Foundation | 8 | # This code is derived from software contributed to The NetBSD Foundation | |
9 | # by Luke Mewburn. | 9 | # by Luke Mewburn. | |
10 | # | 10 | # | |
11 | # Redistribution and use in source and binary forms, with or without | 11 | # Redistribution and use in source and binary forms, with or without | |
12 | # modification, are permitted provided that the following conditions | 12 | # modification, are permitted provided that the following conditions | |
13 | # are met: | 13 | # are met: | |
14 | # 1. Redistributions of source code must retain the above copyright | 14 | # 1. Redistributions of source code must retain the above copyright | |
15 | # notice, this list of conditions and the following disclaimer. | 15 | # notice, this list of conditions and the following disclaimer. | |
16 | # 2. Redistributions in binary form must reproduce the above copyright | 16 | # 2. Redistributions in binary form must reproduce the above copyright | |
@@ -1302,47 +1302,55 @@ list() | @@ -1302,47 +1302,55 @@ list() | |||
1302 | printf " %-12s %s\n" "${i}" "${desc}" | 1302 | printf " %-12s %s\n" "${i}" "${desc}" | |
1303 | done | 1303 | done | |
1304 | 1304 | |||
1305 | } | 1305 | } | |
1306 | 1306 | |||
1307 | 1307 | |||
1308 | main() | 1308 | main() | |
1309 | { | 1309 | { | |
1310 | TGZLIST= # quoted list list of tgz files | 1310 | TGZLIST= # quoted list list of tgz files | |
1311 | SRC_ARGLIST= # quoted list of one or more "-s" args | 1311 | SRC_ARGLIST= # quoted list of one or more "-s" args | |
1312 | N_SRC_ARGS=0 # number of "-s" args | 1312 | N_SRC_ARGS=0 # number of "-s" args | |
1313 | TGZMODE=false # true if "-s" specifies a tgz file | 1313 | TGZMODE=false # true if "-s" specifies a tgz file | |
1314 | DIRMODE=false # true if "-s" specified a directory | 1314 | DIRMODE=false # true if "-s" specified a directory | |
1315 | SOURCEMODE=false # true if "-s" specified a source directory | |||
1315 | 1316 | |||
1316 | while getopts s:d:m:a: ch; do | 1317 | while getopts s:d:m:a: ch; do | |
1317 | case "${ch}" in | 1318 | case "${ch}" in | |
1318 | s) | 1319 | s) | |
1319 | qarg="$(shell_quote "${OPTARG}")" | 1320 | qarg="$(shell_quote "${OPTARG}")" | |
1320 | N_SRC_ARGS=$(( $N_SRC_ARGS + 1 )) | 1321 | N_SRC_ARGS=$(( $N_SRC_ARGS + 1 )) | |
1321 | SRC_ARGLIST="${SRC_ARGLIST}${SRC_ARGLIST:+ }-s ${qarg}" | 1322 | SRC_ARGLIST="${SRC_ARGLIST}${SRC_ARGLIST:+ }-s ${qarg}" | |
1322 | if [ -f "${OPTARG}" ]; then | 1323 | if [ -f "${OPTARG}" ]; then | |
1323 | # arg refers to a *.tgz file. | 1324 | # arg refers to a *.tgz file. | |
1324 | # This may happen twice, for both | 1325 | # This may happen twice, for both | |
1325 | # etc.tgz and xetc.tgz, so we build up a | 1326 | # etc.tgz and xetc.tgz, so we build up a | |
1326 | # quoted list in TGZLIST. | 1327 | # quoted list in TGZLIST. | |
1327 | TGZMODE=true | 1328 | TGZMODE=true | |
1328 | TGZLIST="${TGZLIST}${TGZLIST:+ }${qarg}" | 1329 | TGZLIST="${TGZLIST}${TGZLIST:+ }${qarg}" | |
1329 | # Note that, when TGZMODE is true, | 1330 | # Note that, when TGZMODE is true, | |
1330 | # SRC_ARG is used only for printing | 1331 | # SRC_ARG is used only for printing | |
1331 | # human-readable messages. | 1332 | # human-readable messages. | |
1332 | SRC_ARG="${TGZLIST}" | 1333 | SRC_ARG="${TGZLIST}" | |
1333 | elif [ -d "${OPTARG}" ]; then | 1334 | elif [ -d "${OPTARG}" ]; then | |
1335 | # arg refers to a directory. | |||
1336 | # It might be a source directory, or a | |||
1337 | # directory where the sets have already | |||
1338 | # been extracted. | |||
1334 | DIRMODE=true | 1339 | DIRMODE=true | |
1335 | SRC_ARG="${OPTARG}" | 1340 | SRC_ARG="${OPTARG}" | |
1341 | if [ -f "${OPTARG}/etc/Makefile" ]; then | |||
1342 | SOURCEMODE=true | |||
1343 | fi | |||
1336 | elif [ -f "${OPTARG%%:*}" -a -f "${OPTARG##*:}" \ | 1344 | elif [ -f "${OPTARG%%:*}" -a -f "${OPTARG##*:}" \ | |
1337 | -a ! -f "${OPTARG}" ] | 1345 | -a ! -f "${OPTARG}" ] | |
1338 | then | 1346 | then | |
1339 | # Backward compatibility: allow arg to refer | 1347 | # Backward compatibility: allow arg to refer | |
1340 | # to a colon-separated list of tgz files. | 1348 | # to a colon-separated list of tgz files. | |
1341 | # Remove this after NetBSD-5.0 is released. | 1349 | # Remove this after NetBSD-5.0 is released. | |
1342 | cat >&2 <<EOF | 1350 | cat >&2 <<EOF | |
1343 | *** WARNING: The "-s tgzfile1:tgzfile2" option is deprecated. Please use | 1351 | *** WARNING: The "-s tgzfile1:tgzfile2" option is deprecated. Please use | |
1344 | "-s tgzfile1 -s tgzfile2" in future. | 1352 | "-s tgzfile1 -s tgzfile2" in future. | |
1345 | EOF | 1353 | EOF | |
1346 | TGZMODE=true | 1354 | TGZMODE=true | |
1347 | TGZLIST="${TGZLIST}${TGZLIST:+ }$( \ | 1355 | TGZLIST="${TGZLIST}${TGZLIST:+ }$( \ | |
1348 | IFS=: eval shell_quote \${OPTARG} )" | 1356 | IFS=: eval shell_quote \${OPTARG} )" | |
@@ -1395,26 +1403,29 @@ EOF | @@ -1395,26 +1403,29 @@ EOF | |||
1395 | tar -zxf - | 1403 | tar -zxf - | |
1396 | ) || err 2 "Can't extract ${tgz}" | 1404 | ) || err 2 "Can't extract ${tgz}" | |
1397 | done | 1405 | done | |
1398 | ) | 1406 | ) | |
1399 | SRC_DIR="${ETCTGZDIR}" | 1407 | SRC_DIR="${ETCTGZDIR}" | |
1400 | else | 1408 | else | |
1401 | SRC_DIR="${SRC_ARG}" | 1409 | SRC_DIR="${SRC_ARG}" | |
1402 | fi | 1410 | fi | |
1403 | 1411 | |||
1404 | [ -d "${SRC_DIR}" ] || err 2 "${SRC_DIR} is not a directory" | 1412 | [ -d "${SRC_DIR}" ] || err 2 "${SRC_DIR} is not a directory" | |
1405 | [ -d "${DEST_DIR}" ] || err 2 "${DEST_DIR} is not a directory" | 1413 | [ -d "${DEST_DIR}" ] || err 2 "${DEST_DIR} is not a directory" | |
1406 | [ -n "${MACHINE}" ] || err 2 "\${MACHINE} is not defined" | 1414 | [ -n "${MACHINE}" ] || err 2 "\${MACHINE} is not defined" | |
1407 | [ -n "${MACHINE_ARCH}" ] || err 2 "\${MACHINE_ARCH} is not defined" | 1415 | [ -n "${MACHINE_ARCH}" ] || err 2 "\${MACHINE_ARCH} is not defined" | |
1416 | if ! $SOURCEMODE && ! [ -f "${SRC_DIR}/etc/mtree/set.etc" ]; then | |||
1417 | err 2 "Files from the etc.tgz set are missing" | |||
1418 | fi | |||
1408 | 1419 | |||
1409 | # If directories are /, clear them, so various messages | 1420 | # If directories are /, clear them, so various messages | |
1410 | # don't have leading "//". However, this requires | 1421 | # don't have leading "//". However, this requires | |
1411 | # the use of ${foo:-/} to display the variables. | 1422 | # the use of ${foo:-/} to display the variables. | |
1412 | # | 1423 | # | |
1413 | [ "${SRC_DIR}" = "/" ] && SRC_DIR="" | 1424 | [ "${SRC_DIR}" = "/" ] && SRC_DIR="" | |
1414 | [ "${DEST_DIR}" = "/" ] && DEST_DIR="" | 1425 | [ "${DEST_DIR}" = "/" ] && DEST_DIR="" | |
1415 | 1426 | |||
1416 | op="$1" | 1427 | op="$1" | |
1417 | shift | 1428 | shift | |
1418 | 1429 | |||
1419 | case "${op}" in | 1430 | case "${op}" in | |
1420 | diff) | 1431 | diff) |
--- src/usr.sbin/postinstall/postinstall.8 2008/09/14 14:24:15 1.12
+++ src/usr.sbin/postinstall/postinstall.8 2008/10/04 08:07:38 1.13
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | .\" $NetBSD: postinstall.8,v 1.12 2008/09/14 14:24:15 apb Exp $ | 1 | .\" $NetBSD: postinstall.8,v 1.13 2008/10/04 08:07:38 apb Exp $ | |
2 | .\" | 2 | .\" | |
3 | .\" Copyright (c) 2005-2008 The NetBSD Foundation, Inc. | 3 | .\" Copyright (c) 2005-2008 The NetBSD Foundation, Inc. | |
4 | .\" All rights reserved. | 4 | .\" All rights reserved. | |
5 | .\" | 5 | .\" | |
6 | .\" This code is derived from software contributed to The NetBSD Foundation | 6 | .\" This code is derived from software contributed to The NetBSD Foundation | |
7 | .\" by Thomas Klausner. | 7 | .\" by Thomas Klausner. | |
8 | .\" | 8 | .\" | |
9 | .\" Redistribution and use in source and binary forms, with or without | 9 | .\" Redistribution and use in source and binary forms, with or without | |
10 | .\" modification, are permitted provided that the following conditions | 10 | .\" modification, are permitted provided that the following conditions | |
11 | .\" are met: | 11 | .\" are met: | |
12 | .\" 1. Redistributions of source code must retain the above copyright | 12 | .\" 1. Redistributions of source code must retain the above copyright | |
13 | .\" notice, this list of conditions and the following disclaimer. | 13 | .\" notice, this list of conditions and the following disclaimer. | |
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | 14 | .\" 2. Redistributions in binary form must reproduce the above copyright | |
@@ -17,27 +17,27 @@ | @@ -17,27 +17,27 @@ | |||
17 | .\" | 17 | .\" | |
18 | .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | 18 | .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | |
19 | .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 19 | .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
20 | .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 20 | .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
21 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 21 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
22 | .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 22 | .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
23 | .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 23 | .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
24 | .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 24 | .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
25 | .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 25 | .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
26 | .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 26 | .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
27 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 27 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
28 | .\" POSSIBILITY OF SUCH DAMAGE. | 28 | .\" POSSIBILITY OF SUCH DAMAGE. | |
29 | .\" | 29 | .\" | |
30 | .Dd September 7, 2008 | 30 | .Dd October 4, 2008 | |
31 | .Dt POSTINSTALL 8 | 31 | .Dt POSTINSTALL 8 | |
32 | .Os | 32 | .Os | |
33 | .Sh NAME | 33 | .Sh NAME | |
34 | .Nm postinstall | 34 | .Nm postinstall | |
35 | .Nd check and fix installation after system upgrades | 35 | .Nd check and fix installation after system upgrades | |
36 | .Sh SYNOPSIS | 36 | .Sh SYNOPSIS | |
37 | .Nm postinstall | 37 | .Nm postinstall | |
38 | .Op Fl a Ar arch | 38 | .Op Fl a Ar arch | |
39 | .Op Fl d Ar destdir | 39 | .Op Fl d Ar destdir | |
40 | .Op Fl m Ar machine | 40 | .Op Fl m Ar machine | |
41 | .Op Fl s Brq Ar srcdir | Ar tgzdir | Ar tgzfile | 41 | .Op Fl s Brq Ar srcdir | Ar tgzdir | Ar tgzfile | |
42 | .Ar operation | 42 | .Ar operation | |
43 | .Op Ar item Op ... | 43 | .Op Ar item Op ... | |
@@ -76,49 +76,57 @@ Defaults to machine of the host operatin | @@ -76,49 +76,57 @@ Defaults to machine of the host operatin | |||
76 | The location of the reference files, or the | 76 | The location of the reference files, or the | |
77 | .Nx | 77 | .Nx | |
78 | source files used to create the reference files. | 78 | source files used to create the reference files. | |
79 | This may be specified in one of three ways: | 79 | This may be specified in one of three ways: | |
80 | .Bl -tag -width XXsXtgzfileXX | 80 | .Bl -tag -width XXsXtgzfileXX | |
81 | .It Fl s Ar srcdir | 81 | .It Fl s Ar srcdir | |
82 | The top level directory of the | 82 | The top level directory of the | |
83 | .Nx | 83 | .Nx | |
84 | source tree. | 84 | source tree. | |
85 | By default this is | 85 | By default this is | |
86 | .Pa /usr/src . | 86 | .Pa /usr/src . | |
87 | .It Fl s Ar tgzdir | 87 | .It Fl s Ar tgzdir | |
88 | A directory in which reference files have been | 88 | A directory in which reference files have been | |
89 | extracted from one or more of the | 89 | extracted from a binary distribution of | |
90 | .Nx . | |||
91 | The files that are distributed in the | |||
90 | .Dq Pa etc.tgz | 92 | .Dq Pa etc.tgz | |
91 | or | 93 | set file must be present. | |
94 | The files that are distributed in the | |||
92 | .Dq Pa xetc.tgz | 95 | .Dq Pa xetc.tgz | |
93 | files from a binary distribution of | 96 | set file are optional. | |
94 | .Nx . | |||
95 | .It Fl s Ar tgzfile | 97 | .It Fl s Ar tgzfile | |
96 | The location of a set file | 98 | The location of a set file | |
97 | (or | 99 | (or | |
98 | .Dq "tgz file" ) | 100 | .Dq "tgz file" ) | |
99 | such as | 101 | such as | |
100 | .Pa etc.tgz | 102 | .Dq Pa etc.tgz | |
101 | or | 103 | or | |
102 | .Pa xetc.tgz | 104 | .Dq Pa xetc.tgz | |
103 | from a binary distribution of | 105 | from a binary distribution of | |
104 | .Nx . | 106 | .Nx . | |
105 | Each set file is a compressed archive containing reference files, | 107 | Each set file is a compressed archive containing reference files, | |
106 | which will be extracted to the | 108 | which will be extracted to the | |
107 | .Pa temproot | 109 | .Pa temproot | |
108 | directory. | 110 | directory. | |
109 | Multiple | 111 | Multiple | |
110 | .Fl s | 112 | .Fl s | |
111 | options may be used to specify multiple set files. | 113 | options may be used to specify multiple set files. | |
114 | The | |||
115 | .Dq Pa etc.tgz | |||
116 | set file must be specified. | |||
117 | The | |||
118 | .Dq Pa xetc.tgz | |||
119 | set file is optional. | |||
112 | .El | 120 | .El | |
113 | .El | 121 | .El | |
114 | .Pp | 122 | .Pp | |
115 | The | 123 | The | |
116 | .Ar operation | 124 | .Ar operation | |
117 | argument may be one of: | 125 | argument may be one of: | |
118 | .Bl -tag -width usageXX -offset indent | 126 | .Bl -tag -width usageXX -offset indent | |
119 | .It Cm check | 127 | .It Cm check | |
120 | Perform post-installation checks on items. | 128 | Perform post-installation checks on items. | |
121 | .It Cm diff Op Xr diff 1 options | 129 | .It Cm diff Op Xr diff 1 options | |
122 | Similar to | 130 | Similar to | |
123 | .Cm check , | 131 | .Cm check , | |
124 | but also show the differences between the files. | 132 | but also show the differences between the files. |