summaryrefslogtreecommitdiff
path: root/scripts/build/chroot_dpkg
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2013-04-09 05:54:22 +0200
committerDaniel Baumann <daniel@debian.org>2013-04-09 05:54:22 +0200
commit6106e81b856f0247dceac096c778350593ac991f (patch)
treee7774f75ce861d36a9fdd44ccf81ddc6a473ec15 /scripts/build/chroot_dpkg
parent34dd4a6c704d44ed9d8994663d0855cf337f70f8 (diff)
downloadvyos-live-build-6106e81b856f0247dceac096c778350593ac991f.tar.gz
vyos-live-build-6106e81b856f0247dceac096c778350593ac991f.zip
Using dpkg-divert for other diversions too to handle upgrades of the diverted stuff during build.
Diffstat (limited to 'scripts/build/chroot_dpkg')
-rwxr-xr-xscripts/build/chroot_dpkg14
1 files changed, 5 insertions, 9 deletions
diff --git a/scripts/build/chroot_dpkg b/scripts/build/chroot_dpkg
index b9fa840e0..e16eadc43 100755
--- a/scripts/build/chroot_dpkg
+++ b/scripts/build/chroot_dpkg
@@ -40,10 +40,8 @@ case "${1}" in
# Creating lock file
Create_lockfile .lock
- # Save start-stop-daemon program
- mv chroot/sbin/start-stop-daemon chroot/sbin/start-stop-daemon.orig
-
- # Create start-stop-daemon program
+ # Create custom start-stop-daemon program
+ Chroot chroot dpkg-divert --rename --quiet --add /sbin/start-stop-daemon
cat > chroot/sbin/start-stop-daemon << EOF
#!/bin/sh
@@ -103,11 +101,9 @@ EOF
${LB_ROOT_COMMAND} rmdir --ignore-fail-on-non-empty /var/state/samhain || true
fi
- # Restore start-stop-daemon program
- if [ -e chroot/sbin/start-stop-daemon.orig ]
- then
- mv chroot/sbin/start-stop-daemon.orig chroot/sbin/start-stop-daemon
- fi
+ # Remove custom start-stop-daemon program
+ rm -f chroot/sbin/start-stop-daemon
+ Chroot chroot dpkg-divert --rename --quiet --remove /sbin/start-stop-daemon
# Remove dpkg sync configuration
rm -f chroot/etc/dpkg/dpkg.cfg.d/live-build