diff options
author | Daniel Baumann <mail@daniel-baumann.ch> | 2013-03-11 09:49:07 +0100 |
---|---|---|
committer | Daniel Baumann <mail@daniel-baumann.ch> | 2013-05-06 14:50:07 +0200 |
commit | 5a00aa44827cd477e13470b4ce417b7b6fff62f9 (patch) | |
tree | 558cdaf7913c1bb38ff737f96f05ad42c406649e /scripts/build/chroot_hostname | |
parent | 20f042f923d25772cb87515a184308e2d2dec084 (diff) | |
download | vyos-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_hostname')
-rwxr-xr-x | scripts/build/chroot_hostname | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/scripts/build/chroot_hostname b/scripts/build/chroot_hostname index edc38a151..c42b1a77d 100755 --- a/scripts/build/chroot_hostname +++ b/scripts/build/chroot_hostname @@ -29,8 +29,6 @@ Require_stagefile .build/config .build/bootstrap case "${1}" in install) - Echo_message "Configuring file /etc/hostname" - # Checking stage file Check_stagefile .build/chroot_hostname @@ -40,15 +38,15 @@ case "${1}" in # Creating lock file Create_lockfile .lock - # Save hostname - mv chroot/bin/hostname chroot/bin/hostname.orig - # Create hostname file + Echo_message "Configuring file /etc/hostname" + echo "localhost.localdomain" > chroot/etc/hostname + # Create custom hostname Echo_message "Configuring file /bin/hostname" - # Create hostname program + Chroot chroot dpkg-divert --rename --quiet --add /bin/hostname cat > chroot/bin/hostname << EOF #!/bin/sh @@ -79,11 +77,9 @@ EOF Echo_message "Deconfiguring file /bin/hostname" - # Restore hostname file - if [ -e chroot/bin/hostname.orig ] - then - mv chroot/bin/hostname.orig chroot/bin/hostname - fi + # Remove custom hostname + rm -f chroot/bin/hostname + Chroot chroot dpkg-divert --rename --quiet --remove /bin/hostname # Removing stage file rm -f .build/chroot_hostname |