From 5946c16be77d2a87f5aab02261732adbb5c79d93 Mon Sep 17 00:00:00 2001 From: bencoh Date: Thu, 15 Jul 2010 11:11:17 +0000 Subject: bootstrap: Fixed interfaces file, append (rootdev), conf-copy. /etc/profile changed. git-svn-id: https://svn.notk.org/bencoh/kvm-wrapper/@16 19625182-23af-4830-9084-f181c60b83b7 --- bootstrap/lenny/bootstrap.sh | 25 +++++++++++++------------ bootstrap/lenny/conf/etc/profile | 4 +++- 2 files changed, 16 insertions(+), 13 deletions(-) (limited to 'bootstrap') diff --git a/bootstrap/lenny/bootstrap.sh b/bootstrap/lenny/bootstrap.sh index 628fd74..2b89ebc 100755 --- a/bootstrap/lenny/bootstrap.sh +++ b/bootstrap/lenny/bootstrap.sh @@ -25,7 +25,6 @@ cleanup() CLEANUP=( ) -trap cleanup EXIT function map_disk() { @@ -48,28 +47,36 @@ function bs_copy_from_host() function bs_copy_conf_dir() { - cp -rf "$BOOTSTRAP_CONF_DIR/*" "$MNTDIR" + cp -rf "$BOOTSTRAP_CONF_DIR/"* "$MNTDIR/" } function bootstrap_fs() { + trap cleanup EXIT + MNTDIR="`mktemp -d`" + CLEANUP+=("rmdir $MNTDIR") local DISKDEV=$1 local PARTDEV=$1 + local rootdev="/dev/hda" + if [[ BOOTSTRAP_PARTITION_TYPE -eq "msdos" ]]; then sfdisk -H 255 -S 63 -uS --quiet --Linux "$DISKDEV" < "$MNTDIR/etc/hostname" # fstab - LOCAL rootdev="/dev/hda" - if [[ BOOTSTRAP_PARTITION_TYPE -eq "msdos" ]]; then - rootdev="/dev/hda1" - fi - cat > "$MNTDIR/etc/fstab" << EOF $rootdev / ext3 errors=remount-ro 0 1 proc /proc proc defaults 0 0 @@ -142,7 +143,7 @@ EOF if [[ -n "$BOOTSTRAP_NET_ADDR" ]]; then cat >> "$IF_FILE" << EOF iface eth0 inet static - address $BOOTSRAP_NET_ADDR + address $BOOTSTRAP_NET_ADDR netmask $BOOTSTRAP_NET_MASK network $BOOTSTRAP_NET_NW gateway $BOOTSTRAP_NET_GW @@ -158,6 +159,6 @@ EOF cleanup trap - EXIT - desc_update_setting "KVM_APPEND" "root=/dev/hda ro" + desc_update_setting "KVM_APPEND" "root=$rootdev ro" } diff --git a/bootstrap/lenny/conf/etc/profile b/bootstrap/lenny/conf/etc/profile index 7bb5659..6f280be 100644 --- a/bootstrap/lenny/conf/etc/profile +++ b/bootstrap/lenny/conf/etc/profile @@ -4,7 +4,7 @@ if [ "`id -u`" -eq 0 ]; then PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" else - PATH="/usr/local/bin:/usr/bin:/bin:/usr/games" + PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" fi if [ "$PS1" ]; then @@ -22,3 +22,5 @@ fi export PATH umask 022 + +. /etc/bash.bashrc -- cgit v1.2.3-70-g09d2