summaryrefslogtreecommitdiff
path: root/helpers/lh_chroot_hostname
diff options
context:
space:
mode:
authorCody A.W. Somerville <cody.somerville@canonical.com>2009-09-02 07:32:45 +0200
committerDaniel Baumann <daniel@debian.org>2011-03-09 19:09:46 +0100
commita55187778e01050f348532995eb9618897d96908 (patch)
tree52a98b1c534c66dab3e6b19991ed8972b2bc5e38 /helpers/lh_chroot_hostname
parent8f36b8bcbfd452868d05d14ce79c3eac32366bd3 (diff)
downloadvyos-live-build-a55187778e01050f348532995eb9618897d96908.tar.gz
vyos-live-build-a55187778e01050f348532995eb9618897d96908.zip
Fix build failure when retrying build at deconfiguring file /bin/hostname.
If you attempt a build and it fails for whatever reasons (say, a configuration issue) and then you retry your build without calling lh_clean, you can sometimes run into an issue with the 'deconfiguring file /bin/hostname' step. It'll try to move chroot/bin/hostname.orig to chroot/bin/hostname but chroot/bin/hostname.orig won't exist as chroot/bin/hostname hasn't been moved aside like it expects (ie. the original file is still chroot/bin/hostname). This is frustrating since if the error was ignored, the build would be able to complete successfully and as expected. So, let lh_chroot_hostname check if 'chroot/bin/hostname.orig' exists before attempting to move it to 'chroot/bin/hostname'.
Diffstat (limited to 'helpers/lh_chroot_hostname')
-rwxr-xr-xhelpers/lh_chroot_hostname5
1 files changed, 4 insertions, 1 deletions
diff --git a/helpers/lh_chroot_hostname b/helpers/lh_chroot_hostname
index c6ceecb0a..2df0aa2ac 100755
--- a/helpers/lh_chroot_hostname
+++ b/helpers/lh_chroot_hostname
@@ -73,7 +73,10 @@ EOF
Echo_message "Deconfiguring file /bin/hostname"
# Restore hostname file
- mv chroot/bin/hostname.orig chroot/bin/hostname
+ if [ -e chroot/bin/hostname.orig ]
+ then
+ mv chroot/bin/hostname.orig chroot/bin/hostname
+ fi
# Removing stage file
rm -f .stage/chroot_hostname