From e497da300246cce37f375ab46a25f7d5895ad976 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Mon, 1 Jun 2020 13:57:36 +0000 Subject: [PATCH] dhcpcd: Move any existing files out of the dhcp chroot. So it's empty once more. --- etc/Makefile | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/etc/Makefile b/etc/Makefile index f92ad4a75f..e630867e5c 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -260,6 +260,19 @@ upgrade_base: upgrade_check preupgrade remove-obsolete-files echo " make install"; \ fi +# Move the dhcpcd duid, secret and lease files back outside the chroot. +# Then ensure the chroot is empty. + DHCPCD_DB="${DESTDIR}/var/db/dhcpcd"; \ + DHCPCD_CHROOT=`pw -V ${DESTDIR}/etc usershow _dhcp | cut -d: -f9`; \ + DHCPCD_CHROOT_DB="${DESTDIR}$$DHCPCD_CHROOT/var/db/dhcpcd"; \ + if [ -f "$$DHCPCD_CHROOT_DB/duid" ] && \ + [ ! -f "$$DHCPCD_DB/duid" ]; then \ + mkdir -p "$$DHCPCD_DB" && \ + mv "$$DHCPCD_CHROOT_DB"/* "$$DHCPCD_DB"; \ + chown -R root:wheel "$$DHCPCD_DB"; \ + rm -rf "$$DHCPCD_CHROOT"/*; \ + fi + upgrade_etc: upgrade_base remove-deprecated-files @echo "Upgrade was successful" -- 2.11.4.GIT