# 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 \
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
# Mark Huang <mlhuang@cs.princeton.edu>
# 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
# 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"
(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
# 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"
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"
/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
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
# 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:]\.: _-'
# Mark Huang <mlhuang@cs.princeton.edu>
# 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
# Packages to install
packagelist=(
-dev
+udev
dhclient
bash
coreutils
dos2unix
bind-utils
sharutils
+vconfig
)
# Unnecessary junk
# 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