summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2012-07-08 19:25:13 +0200
committerDaniel Baumann <daniel@debian.org>2012-07-08 19:25:13 +0200
commitf5f8671ab6f22f63990dcd5cb02c2bf2b32e0659 (patch)
tree16a69589242bdb49b1e190df9b42d666e1b368bf /scripts
parent730ce8483b82baf37a18520e6081b1b11cbd988d (diff)
downloadvyos-live-build-f5f8671ab6f22f63990dcd5cb02c2bf2b32e0659.tar.gz
vyos-live-build-f5f8671ab6f22f63990dcd5cb02c2bf2b32e0659.zip
Truncating udev persistent net rules in remove-udev-persistent-rules.chroot hook rather than to remove them (Closes: #680763).
This allows to have non-persistent net devices with persistence properly, see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=680763#10 for more information.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build/lb_chroot_hacks10
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/build/lb_chroot_hacks b/scripts/build/lb_chroot_hacks
index d27d2d48b..804811683 100755
--- a/scripts/build/lb_chroot_hacks
+++ b/scripts/build/lb_chroot_hacks
@@ -147,8 +147,14 @@ rm -f chroot/var/lib/dbus/machine-id
# they are regenerated by live-config.
rm -f chroot/etc/ssh/ssh_host_*_key chroot/etc/ssh/ssh_host_*_key.pub
-# Removing udev mac caching rule
-rm -f chroot/etc/udev/rules.d/*persistent-net.rules
+# Truncating udev mac caching rule
+for _FILE in /etc/udev/rules.d/*persistent-net.rules
+do
+ if [ -e "${_FILE}" ]
+ then
+ : > ${_FILE}
+ fi
+done
case "${LB_BINARY_IMAGES}" in
net)