From d1047e809a90daa0e88329efc0db21931be0b919 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 6 May 2013 14:48:46 +0200 Subject: Adding debian version 4.0~a1-1. --- scripts/build/chroot_hostname | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'scripts/build/chroot_hostname') 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 +## Copyright (C) 2006-2012 Daniel Baumann ## ## 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 -- cgit v1.2.3