diff options
author | Daniel Baumann <mail@daniel-baumann.ch> | 2013-05-06 14:48:46 +0200 |
---|---|---|
committer | Daniel Baumann <mail@daniel-baumann.ch> | 2013-05-06 14:48:46 +0200 |
commit | d1047e809a90daa0e88329efc0db21931be0b919 (patch) | |
tree | 5dc92aaaeb4d15dcad4796935b90a9675be93ad5 /scripts/build/chroot_hostname | |
parent | 160d6bade79bf58a1c0d1842dc9b55ec178ec303 (diff) | |
download | vyos-live-build-d1047e809a90daa0e88329efc0db21931be0b919.tar.gz vyos-live-build-d1047e809a90daa0e88329efc0db21931be0b919.zip |
Adding debian version 4.0~a1-1.debian/4.0_a1-1
Diffstat (limited to 'scripts/build/chroot_hostname')
-rwxr-xr-x | scripts/build/chroot_hostname | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/scripts/build/chroot_hostname b/scripts/build/chroot_hostname index e013afaec..9f56901e4 100755 --- a/scripts/build/chroot_hostname +++ b/scripts/build/chroot_hostname @@ -1,7 +1,7 @@ #!/bin/sh ## live-build(7) - System Build Scripts -## Copyright (C) 2006-2013 Daniel Baumann <daniel@debian.org> +## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org> ## ## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING. ## This is free software, and you are welcome to redistribute it @@ -29,6 +29,8 @@ Require_stagefile .build/config .build/bootstrap case "${1}" in install) + Echo_message "Configuring file /etc/hostname" + # Checking stage file Check_stagefile .build/chroot_hostname @@ -38,15 +40,15 @@ case "${1}" in # Creating lock file Create_lockfile .lock - # Create hostname file - Echo_message "Configuring file /etc/hostname" + # Save hostname + mv chroot/bin/hostname chroot/bin/hostname.orig + # Create hostname file echo "localhost.localdomain" > chroot/etc/hostname - # Create custom hostname Echo_message "Configuring file /bin/hostname" - Chroot chroot dpkg-divert --rename --quiet --add /bin/hostname + # Create hostname program cat > chroot/bin/hostname << EOF #!/bin/sh @@ -77,9 +79,11 @@ EOF Echo_message "Deconfiguring file /bin/hostname" - # Remove custom hostname - rm -f chroot/bin/hostname - Chroot chroot dpkg-divert --rename --quiet --remove /bin/hostname + # Restore hostname file + if [ -e chroot/bin/hostname.orig ] + then + mv chroot/bin/hostname.orig chroot/bin/hostname + fi # Removing stage file rm -f .build/chroot_hostname |