[Debian-live-changes] r2299 - in dists/trunk/live-helper: docs helpers

daniel at alioth.debian.org daniel at alioth.debian.org
Sat Jun 30 16:56:34 UTC 2007


Author: daniel
Date: 2007-06-30 16:56:34 +0000 (Sat, 30 Jun 2007)
New Revision: 2299

Added:
   dists/trunk/live-helper/helpers/lh_chroot_hostname
Modified:
   dists/trunk/live-helper/docs/ChangeLog
   dists/trunk/live-helper/helpers/lh_binary
   dists/trunk/live-helper/helpers/lh_binary_usb-hdd
   dists/trunk/live-helper/helpers/lh_chroot
   dists/trunk/live-helper/helpers/lh_source
Log:


Modified: dists/trunk/live-helper/docs/ChangeLog
===================================================================
--- dists/trunk/live-helper/docs/ChangeLog	2007-06-30 11:20:45 UTC (rev 2298)
+++ dists/trunk/live-helper/docs/ChangeLog	2007-06-30 16:56:34 UTC (rev 2299)
@@ -1,3 +1,9 @@
+2007-06-30  Daniel Baumann  <daniel at debian.org>
+
+	* functions/releases.sh, helpers/lh_binary_disk, lh_source_disk,
+	  lh_chroot_hostname:
+	  - Added.
+
 2007-06-29  Daniel Baumann  <daniel at debian.org>
 
 	* helpers/lh_binary_syslinux:

Modified: dists/trunk/live-helper/helpers/lh_binary
===================================================================
--- dists/trunk/live-helper/helpers/lh_binary	2007-06-30 11:20:45 UTC (rev 2298)
+++ dists/trunk/live-helper/helpers/lh_binary	2007-06-30 16:56:34 UTC (rev 2299)
@@ -30,6 +30,7 @@
 # Configuring chroot
 lh_chroot_proc install ${*}
 lh_chroot_sysfs install ${*}
+lh_chroot_hostname install ${*}
 lh_chroot_hosts install ${*}
 lh_chroot_resolv install ${*}
 lh_chroot_sources install ${*}
@@ -63,5 +64,6 @@
 rm -f .stage/chroot_sources
 lh_chroot_resolv remove ${*}
 lh_chroot_hosts remove ${*}
+lh_chroot_hostname remove ${*}
 lh_chroot_sysfs remove ${*}
 lh_chroot_proc remove ${*}

Modified: dists/trunk/live-helper/helpers/lh_binary_usb-hdd
===================================================================
--- dists/trunk/live-helper/helpers/lh_binary_usb-hdd	2007-06-30 11:20:45 UTC (rev 2298)
+++ dists/trunk/live-helper/helpers/lh_binary_usb-hdd	2007-06-30 16:56:34 UTC (rev 2299)
@@ -108,7 +108,7 @@
 Chroot " mkfs.vfat -F 16 -n DEBIAN_LIVE ${FREELO}"
 mkdir -p chroot/binary.tmp
 ${LH_ROOT_COMMAND} mount ${FREELO} chroot/binary.tmp
-cp -r binary/* chroot/binary.tmp
+cp -rL binary/* chroot/binary.tmp
 
 FIXME()
 {

Modified: dists/trunk/live-helper/helpers/lh_chroot
===================================================================
--- dists/trunk/live-helper/helpers/lh_chroot	2007-06-30 11:20:45 UTC (rev 2298)
+++ dists/trunk/live-helper/helpers/lh_chroot	2007-06-30 16:56:34 UTC (rev 2299)
@@ -38,6 +38,7 @@
 lh_chroot_sysfs install ${*}
 lh_chroot_debianchroot install ${*}
 lh_chroot_sysvrc install ${*}
+lh_chroot_hostname install ${*}
 lh_chroot_hosts install ${*}
 lh_chroot_resolv install ${*}
 lh_chroot_apt install ${*}
@@ -66,6 +67,7 @@
 lh_chroot_apt remove ${*}
 lh_chroot_resolv remove ${*}
 lh_chroot_hosts remove ${*}
+lh_chroot_hostname remove ${*}
 lh_chroot_sysvrc remove ${*}
 lh_chroot_debianchroot remove ${*}
 lh_chroot_sysfs remove ${*}

Added: dists/trunk/live-helper/helpers/lh_chroot_hostname
===================================================================
--- dists/trunk/live-helper/helpers/lh_chroot_hostname	                        (rev 0)
+++ dists/trunk/live-helper/helpers/lh_chroot_hostname	2007-06-30 16:56:34 UTC (rev 2299)
@@ -0,0 +1,92 @@
+#!/bin/sh
+
+# lh_chroot_hostname(1) - manage /etc/hostname
+# Copyright (C) 2006-2007 Daniel Baumann <daniel at debian.org>
+#
+# live-helper comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
+# This is free software, and you are welcome to redistribute it
+# under certain conditions; see COPYING for details.
+
+set -e
+
+# Including common functions
+LH_BASE="${LH_BASE:-/usr/share/live-helper}"
+
+for FUNCTION in "${LH_BASE}"/functions/*.sh
+do
+	. "${FUNCTION}"
+done
+
+# Setting static variables
+DESCRIPTION="manage /etc/hostname"
+HELP=""
+USAGE="${PROGRAM} {install|remove} [--force]"
+
+Arguments "${@}"
+
+# Reading configuration files
+Read_conffile config/common
+Read_conffile config/bootstrap
+Read_conffile config/chroot
+Read_conffile config/binary
+Read_conffile config/source
+Set_defaults
+
+# Requiring stage file
+Require_stagefile .stage/bootstrap
+
+case "${1}" in
+	install)
+		Echo_message "Configuring file /etc/hostname"
+
+		# Checking stage file
+		Check_stagefile .stage/chroot_hostname
+
+		# Checking lock file
+		Check_lockfile .lock
+
+		# Creating lock file
+		Create_lockfile .lock
+
+		if [ -f chroot/etc/hostname ]
+		then
+			# Save hostname file
+			cp chroot/etc/hostname chroot/etc/hostname.orig
+		fi
+
+		if [ -f /etc/hostname ]
+		then
+			# Copy hostname file
+			cp /etc/hostname chroot/etc/hostname
+		fi
+
+		# Creating stage file
+		Create_stagefile .stage/chroot_hostname
+		;;
+
+	remove)
+		Echo_message "Deconfiguring file /etc/hostname"
+
+		# Checking lock file
+		Check_lockfile .lock
+
+		# Creating lock file
+		Create_lockfile .lock
+
+		if [ -f chroot/etc/hostname.orig ]
+		then
+			# Restore hostname file
+			mv chroot/etc/hostname.orig chroot/etc/hostname
+		else
+			# Remove hostname file
+			rm -f chroot/etc/hostname
+		fi
+
+		# Removing stage file
+		rm -f .stage/chroot_hostname
+		;;
+
+	*)
+		Usage
+		;;
+esac


Property changes on: dists/trunk/live-helper/helpers/lh_chroot_hostname
___________________________________________________________________
Name: svn:executable
   + *

Modified: dists/trunk/live-helper/helpers/lh_source
===================================================================
--- dists/trunk/live-helper/helpers/lh_source	2007-06-30 11:20:45 UTC (rev 2298)
+++ dists/trunk/live-helper/helpers/lh_source	2007-06-30 16:56:34 UTC (rev 2299)
@@ -33,6 +33,7 @@
 Set_defaults
 
 # Enabling network in chroot
+lh_chroot_hostname install ${*}
 lh_chroot_hosts install ${*}
 lh_chroot_resolv install ${*}
 lh_chroot_sources install ${*}
@@ -53,3 +54,4 @@
 rm -f .stage/chroot_sources
 lh_chroot_resolv remove ${*}
 lh_chroot_hosts remove ${*}
+lh_chroot_hostname remove ${*}




More information about the Debian-live-changes mailing list