From f4c1f3b505c6824dbbd631a5e1a5346ef9956d71 Mon Sep 17 00:00:00 2001 From: Mark Huang Date: Mon, 21 Aug 2006 21:27:43 +0000 Subject: [PATCH] merge to HEAD as of 2006-08-21 --- bootcd.spec | 4 ++-- build.sh | 12 ++++++------ conf_files/pl_netinit | 19 +++++++++++++++---- conf_files/pl_validateconf | 3 ++- prep.sh | 9 +++++++-- 5 files changed, 32 insertions(+), 15 deletions(-) diff --git a/bootcd.spec b/bootcd.spec index d3ca071..391fec7 100644 --- a/bootcd.spec +++ b/bootcd.spec @@ -58,7 +58,7 @@ pushd bootcd # Install the reference image and build scripts install -d -m 755 $RPM_BUILD_ROOT/%{_datadir}/%{name} install -m 755 build.sh $RPM_BUILD_ROOT/%{_datadir}/%{name}/ -find \ +tar cpf - \ build/isofs/bootcd.img \ build/isofs/isolinux.bin \ build/isofs/kernel \ @@ -66,7 +66,7 @@ find \ build/version.txt \ configurations \ syslinux/unix/syslinux | \ - cpio -p -d -u $RPM_BUILD_ROOT/%{_datadir}/%{name}/ + tar -C $RPM_BUILD_ROOT/%{_datadir}/%{name}/ -xpf - # Install the default images in the download/ directory install -d -m 755 $RPM_BUILD_ROOT/var/www/html/download diff --git a/build.sh b/build.sh index dded060..2549425 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.39 2006/07/13 17:51:49 mlhuang Exp $ +# $Id: build.sh,v 1.40 2006/07/25 23:51:39 mlhuang Exp $ # PATH=/sbin:/bin:/usr/sbin:/usr/bin @@ -88,7 +88,7 @@ FULL_VERSION_STRING="$PLC_NAME BootCD $BOOTCD_VERSION" # Root of the ISO and USB images overlay=$(mktemp -d /tmp/overlay.XXXXXX) install -d -m 755 $overlay -trap "rm -rf $overlay" ERR +trap "rm -rf $overlay" ERR INT # Create version files echo "* Creating version files" @@ -180,11 +180,11 @@ echo "* Compressing overlay image" (cd $overlay && find . | cpio --quiet -c -o) | gzip -9 >$isofs/overlay.img rm -rf $overlay -trap - ERR +trap - ERR INT # Calculate ramdisk size (total uncompressed size of both archives) ramdisk_size=$(gzip -l $isofs/bootcd.img $isofs/overlay.img | tail -1 | awk '{ print $2; }') # bytes -ramdisk_size=$(($ramdisk_size / 1024)) # kilobytes +ramdisk_size=$((($ramdisk_size + 1023) / 1024)) # kilobytes # Write isolinux configuration echo "$FULL_VERSION_STRING" >$isofs/pl_version @@ -218,7 +218,7 @@ mkfs.vfat -C "$usb" $(($(du -sk $isofs | awk '{ print $1; }') + 1024)) # Mount it tmp=$(mktemp -d /tmp/bootcd.XXXXXX) mount -o loop "$usb" $tmp -trap "umount $tmp; rm -rf $tmp" ERR +trap "umount $tmp; rm -rf $tmp" ERR INT # Populate it echo "* Populating USB image" @@ -228,7 +228,7 @@ echo "* Populating USB image" mv $tmp/isolinux.cfg $tmp/syslinux.cfg umount $tmp rmdir $tmp -trap - ERR +trap - ERR INT echo "* Making USB image bootable" $srcdir/syslinux/unix/syslinux "$usb" diff --git a/conf_files/pl_netinit b/conf_files/pl_netinit index bf662d2..cd48730 100644 --- a/conf_files/pl_netinit +++ b/conf_files/pl_netinit @@ -235,6 +235,17 @@ if [[ $DEFAULT_NET_CONF -eq 1 ]]; then /bin/rm -f $USED_NET_CONF fi +# initialize IPMI device +if [[ -n "$IPMI_ADDRESS" ]] ; then + echo -n "pl_netinit: initializing IPMI: " + cmd="ipnmac -i $IPMI_ADDRESS" + if [[ -n "$IPMI_MAC" ]] ; then + cmd="$cmd -m $IPMI_MAC" + fi + echo $cmd + $cmd +fi + # now, we need to find which device to use (ie, eth0 or eth1). start out # by defaulting to eth0, then see if the network configuration file specified # either a mac address (in which case we will need to find the device), or @@ -243,14 +254,14 @@ fi if [[ -n "$NET_DEVICE" ]]; then # the user specified a mac address we should use. find the network # device for it. - echo "pl_netinit: looking for a device with mac address $NET_DEVICE" + NET_DEVICE=$(tr A-Z a-z <<<$NET_DEVICE) pushd /sys/class/net for device in *; do - dev_address=`cat $device/address` - if [[ "$dev_address" == "$NET_DEVICE" ]]; then + dev_address=`cat $device/address | tr A-Z a-z` + if [ "$device" == "$NET_DEVICE" -o "$dev_address" == "$NET_DEVICE" ]; then ETH_DEVICE=$device - echo "pl_netinit: found device $ETH_DEVICE" + echo "pl_netinit: found device $ETH_DEVICE with mac address $dev_address" break fi done diff --git a/conf_files/pl_validateconf b/conf_files/pl_validateconf index b3a56ec..48e3d5b 100644 --- a/conf_files/pl_validateconf +++ b/conf_files/pl_validateconf @@ -3,7 +3,8 @@ # Valid environment variables to appear in a planetlab config file 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' + IP_DNS1 IP_DNS2 NET_DEVICE NODE_KEY NODE_ID + IPMI_ADDRESS IPMI_MAC' # Valid characters that variable can be set to CHARS='[:alnum:]\.: _-' diff --git a/prep.sh b/prep.sh index 2688d4d..e1164aa 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.10 2006/07/24 15:33:07 mlhuang Exp $ +# $Id: prep.sh,v 1.13 2006/08/21 20:45:23 mlhuang Exp $ # PATH=/sbin:/bin:/usr/sbin:/usr/bin @@ -32,7 +32,7 @@ basearch=i386 # Packages to install packagelist=( -dev +udev dhclient bash coreutils @@ -73,6 +73,7 @@ dosfstools dos2unix bind-utils sharutils +vconfig ) # Unnecessary junk @@ -167,6 +168,10 @@ popd # Disable all services in reference image chroot $bootcd sh -c "/sbin/chkconfig --list | awk '{ print \$1 }' | xargs -i /sbin/chkconfig {} off" +# Install ipnmac (for SuperMicro machines with IPMI) +echo "* Installing IPMI utilities" +install -D -m 755 ipnmac/ipnmac.x86 $bootcd/usr/sbin/ipnmac + # Install configuration files echo "* Installing configuration files" for file in fstab mtab modprobe.conf inittab hosts sysctl.conf ; do -- 2.43.0