From: Daniel Hokka Zakrisson Date: Thu, 16 Aug 2007 20:12:51 +0000 (+0000) Subject: Some cleanup + ntp, and disconnected operations. X-Git-Url: http://git.onelab.eu/?p=bootcd.git;a=commitdiff_plain;h=5677a73a83d2a5b9eae05e3e1d2b71a6e004f364 Some cleanup + ntp, and disconnected operations. --- diff --git a/build.sh b/build.sh index 0e1f598..949bf70 100755 --- a/build.sh +++ b/build.sh @@ -10,7 +10,7 @@ # Mark Huang # Copyright (C) 2004-2006 The Trustees of Princeton University # -# $Id: build.sh,v 1.40 2006/07/25 23:51:39 mlhuang Exp $ +# $Id: build.sh,v 1.42 2006/11/22 20:40:48 mef Exp $ # PATH=/sbin:/bin:/usr/sbin:/usr/bin @@ -18,6 +18,8 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin CONFIGURATION=default NODE_CONFIGURATION_FILE= ALL=0 +# Leave 4 MB of free space +FREE_SPACE=4096 usage() { @@ -253,8 +255,7 @@ mkisofs -o "$iso" \ echo -n "* Creating USB image... " usb="$PLC_NAME-BootCD-$BOOTCD_VERSION.usb" -# Leave 1 MB of free space on the VFAT filesystem -mkfs.vfat -C "$usb" $(($(du -sk $isofs | awk '{ print $1; }') + 1024)) +mkfs.vfat -C "$usb" $(($(du -sk $isofs | awk '{ print $1; }') + $FREE_SPACE)) # Mount it tmp=$(mktemp -d ${BUILDTMP}/bootcd.XXXXXX) @@ -286,8 +287,7 @@ $srcdir/syslinux/unix/syslinux "$usb" echo -n "* Creating USB image... " usb="$PLC_NAME-BootCD-$BOOTCD_VERSION-serial.usb" -# Leave 1 MB of free space on the VFAT filesystem -mkfs.vfat -C "$usb" $(($(du -sk $isofs | awk '{ print $1; }') + 1024)) +mkfs.vfat -C "$usb" $(($(du -sk $isofs | awk '{ print $1; }') + $FREE_SPACE)) # Mount it tmp=$(mktemp -d ${BUILDTMP}/bootcd.XXXXXX) @@ -427,7 +427,6 @@ chown -R 0.0 $cramfs #create the cramfs image echo "* Creating cramfs image" mkfs.cramfs $tmp/ $cramfs -# Leave 1 MB of free space on the VFAT filesystem cramfs_size=$(($(du -sk $cramfs | awk '{ print $1; }'))) mv $cramfs ${BUILDTMP}/cramfs.img rm -rf $tmp @@ -482,8 +481,7 @@ trap - ERR INT echo "* Creating USB CRAMFS based image" usb="$PLC_NAME-BootCD-$BOOTCD_VERSION-cramfs.usb" -# leave 1MB of space on the USB VFAT -let vfat_size=${cramfs_size}+2048 +let vfat_size=${cramfs_size}+$FREE_SPACE # Make VFAT filesystem for USB mkfs.vfat -C "$usb" $vfat_size @@ -518,8 +516,7 @@ $srcdir/syslinux/unix/syslinux "$usb" echo "* Creating USB CRAMFS based image w/ serial line support" usb="$PLC_NAME-BootCD-$BOOTCD_VERSION-cramfs-serial.usb" -# leave 4MB of space on the USB VFAT -let vfat_size=${cramfs_size}+2048 +let vfat_size=${cramfs_size}+$FREE_SPACE # Make VFAT filesystem for USB mkfs.vfat -C "$usb" $vfat_size diff --git a/conf_files/pl_boot b/conf_files/pl_boot index 1f5fa5a..1d75b1d 100644 --- a/conf_files/pl_boot +++ b/conf_files/pl_boot @@ -1,5 +1,7 @@ #!/bin/sh +. /tmp/planet.cnf + # Run gpg once to create default options GNUPGHOME=/root export GNUPGHOME @@ -152,7 +154,21 @@ while : ; do echo "pl_boot: curl request failed with error $curl_err:" cat /tmp/curl_errors echo - continue + if [ -n "$DISCONNECTED_OPERATION" ]; then + mkdir /tmp/boot-media + mount -U "$DISCONNECTED_OPERATION" /tmp/boot-media + cp /tmp/boot-media/bootscript.gpg $UNVERIFIED_SCRIPT + umount /tmp/boot-media + rmdir /tmp/boot-media + else + continue + fi + elif [ -n "$DISCONNECTED_OPERATION" ]; then + mkdir /tmp/boot-media + mount -U "$DISCONNECTED_OPERATION" /tmp/boot-media + cp $UNVERIFIED_SCRIPT /tmp/boot-media + umount /tmp/boot-media + rmdir /tmp/boot-media fi echo "pl_boot: verifying downloaded script" diff --git a/conf_files/pl_sysinit b/conf_files/pl_sysinit index 3f9b4e6..266b1d6 100755 --- a/conf_files/pl_sysinit +++ b/conf_files/pl_sysinit @@ -135,3 +135,5 @@ echo "pl_sysinit: configuring kernel parameters" echo "pl_sysinit: bringing network online" /etc/init.d/pl_netinit +echo "pl_sysinit: attempting to sync clock" +/usr/sbin/ntpdate -b -t 10 -u pool.ntp.org diff --git a/conf_files/pl_validateconf b/conf_files/pl_validateconf index 48e3d5b..f0f0370 100644 --- a/conf_files/pl_validateconf +++ b/conf_files/pl_validateconf @@ -4,7 +4,7 @@ TAGS='IP_METHOD HOST_NAME DOMAIN_NAME PROXY_SERVER IP_ADDRESS IP_GATEWAY IP_NETMASK IP_NETADDR IP_BROADCASTADDR IP_DNS1 IP_DNS2 NET_DEVICE NODE_KEY NODE_ID - IPMI_ADDRESS IPMI_MAC' + IPMI_ADDRESS IPMI_MAC DISCONNECTED_OPERATION' # Valid characters that variable can be set to CHARS='[:alnum:]\.: _-' diff --git a/prep.sh b/prep.sh index 883e10f..8f01024 100755 --- a/prep.sh +++ b/prep.sh @@ -8,7 +8,7 @@ # Mark Huang # Copyright (C) 2004-2006 The Trustees of Princeton University # -# $Id: prep.sh,v 1.12 2006/08/21 20:24:09 mlhuang Exp $ +# $Id: prep.sh,v 1.13 2006/08/21 20:45:23 mlhuang Exp $ # PATH=/sbin:/bin:/usr/sbin:/usr/bin @@ -32,6 +32,7 @@ basearch=i386 # Packages to install packagelist=( +filesystem udev dhclient bash @@ -74,6 +75,7 @@ dos2unix bind-utils sharutils vconfig +ntp ) # Unnecessary junk