Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/postinstall postinstall: move dhcpcd files to the c...



details:   https://anonhg.NetBSD.org/src/rev/81da8424b695
branches:  trunk
changeset: 746582:81da8424b695
user:      roy <roy%NetBSD.org@localhost>
date:      Thu Apr 02 13:04:09 2020 +0000

description:
postinstall: move dhcpcd files to the chroot

diffstat:

 usr.sbin/postinstall/postinstall.in |  39 +++++++++++++++++++++++++++++++-----
 1 files changed, 33 insertions(+), 6 deletions(-)

diffs (76 lines):

diff -r 68dc93ce75e7 -r 81da8424b695 usr.sbin/postinstall/postinstall.in
--- a/usr.sbin/postinstall/postinstall.in       Thu Apr 02 13:03:53 2020 +0000
+++ b/usr.sbin/postinstall/postinstall.in       Thu Apr 02 13:04:09 2020 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall.in,v 1.15 2020/02/25 10:27:01 nakayama Exp $
+# $NetBSD: postinstall.in,v 1.16 2020/04/02 13:04:09 roy Exp $
 #
 # Copyright (c) 2002-2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -943,32 +943,59 @@
        populate_dir "$op" true "${dir}" "${DEST_DIR}/etc" 644 dhcpcd.conf
        failed=$(( ${failed} + $? ))
 
-       check_dir "${op}" "${DEST_DIR}/var/db/dhcpcd" 755
+       dstdir="${DESTDIR}/var/chroot/dhcpcd"
+
+       check_dir "${op}" "${dstdir}/var/db/dhcpcd" 755
        failed=$(( ${failed} + $? ))
 
        move_file "${op}" \
                "${DEST_DIR}/etc/dhcpcd.duid" \
-               "${DEST_DIR}/var/db/dhcpcd/duid"
+               "${dstdir}/var/db/dhcpcd/duid"
        failed=$(( ${failed} + $? ))
 
        move_file "${op}" \
                "${DEST_DIR}/etc/dhcpcd.secret" \
-               "${DEST_DIR}/var/db/dhcpcd/secret"
+               "${dstdir}/var/db/dhcpcd/secret"
        failed=$(( ${failed} + $? ))
 
        move_file "${op}" \
                "${DEST_DIR}/var/db/dhcpcd-rdm.monotonic" \
-               "${DEST_DIR}/var/db/dhcpcd/rdm_monotonic"
+               "${dstdir}/var/db/dhcpcd/rdm_monotonic"
        failed=$(( ${failed} + $? ))
 
        for lease in "${DEST_DIR}/var/db/dhcpcd-"*.lease*; do
                [ -f "${lease}" ] || continue
                new_lease=$(basename "${lease}" | ${SED} -e 's/dhcpcd-//')
-               new_lease="${DEST_DIR}/var/db/dhcpcd/${new_lease}"
+               new_lease="${dstdir}/var/db/dhcpcd/${new_lease}"
                move_file "${op}" "${lease}" "${new_lease}"
                failed=$(( ${failed} + $? ))
        done
 
+       move_file "${op}" \
+               "${DEST_DIR}/var/db/dhcpcd/duid" \
+               "${dstdir}/var/db/dhcpcd/duid"
+       failed=$(( ${failed} + $? ))
+
+       move_file "${op}" \
+               "${DEST_DIR}/var/db/dhcpcd/secret" \
+               "${dstdir}/var/db/dhcpcd/secret"
+       failed=$(( ${failed} + $? ))
+
+       move_file "${op}" \
+               "${DEST_DIR}/var/db/dhcpcd/rdm_monotonic" \
+               "${dstdir}/var/db/dhcpcd/rdm_monotonic"
+       failed=$(( ${failed} + $? ))
+
+       for lease in "${DEST_DIR}/var/db/dhcpcd/"*.lease*; do
+               [ -f "${lease}" ] || continue
+               new_lease="${dstdir}/var/db/dhcpcd/$(basename ${lease})"
+               move_file "${op}" "${lease}" "${new_lease}"
+               failed=$(( ${failed} + $? ))
+       done
+
+       contents_owner "${op}" "${dstdir}/var/db/dhcpcd" _dhcpcd _dhcpcd
+       failed=$(( ${failed} + $? ))
+
        return ${failed}
 }
 



Home | Main Index | Thread Index | Old Index