summaryrefslogtreecommitdiff
path: root/scripts/build/chroot_dpkg
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2013-03-11 09:49:07 +0100
committerDaniel Baumann <mail@daniel-baumann.ch>2013-05-06 14:50:07 +0200
commit5a00aa44827cd477e13470b4ce417b7b6fff62f9 (patch)
tree558cdaf7913c1bb38ff737f96f05ad42c406649e /scripts/build/chroot_dpkg
parent20f042f923d25772cb87515a184308e2d2dec084 (diff)
downloadvyos-live-build-5a00aa44827cd477e13470b4ce417b7b6fff62f9.tar.gz
vyos-live-build-5a00aa44827cd477e13470b4ce417b7b6fff62f9.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 b199cdf17..07ef9667d 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
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