set -e
-BOOTCD_VERSION="3.0"
+BOOTCD_VERSION="3.0-beta0.1"
FULL_VERSION_STRING="PlanetLab BootCD $BOOTCD_VERSION"
+# which boot server to contact
+BOOTSERVER='boot.planet-lab.org'
+
+# and on which port (protocol will be https)
+BOOTSERVER_PORT='443'
+
+# finally, what path to request from the server
+BOOTSERVER_PATH='boot/'
+
SYSLINUX_SRC=sources/syslinux-2.11.tar.bz2
ISO=cd.iso
BOOTCD_YUM_GROUP=BootCD
-CDRECORD_FLAGS="-v -dao -blank=fast"
+CDRECORD_FLAGS="-v -dao"
CONF_FILES_DIR=conf_files/
echo "installing our own inittab and init scripts"
cp -f $CONF_FILES_DIR/inittab $CD_ROOT/etc
- cp -f $CONF_FILES_DIR/pl_sysinit $CD_ROOT/etc/init.d/
- cp -f $CONF_FILES_DIR/pl_hwinit $CD_ROOT/etc/init.d/
+ init_scripts="pl_sysinit pl_hwinit pl_netinit pl_validateconf pl_boot"
+ for script in $init_scripts; do
+ cp -f $CONF_FILES_DIR/$script $CD_ROOT/etc/init.d/
+ chmod +x $CD_ROOT/etc/init.d/$script
+ done
echo "setup basic networking files"
cp -f $CONF_FILES_DIR/hosts $CD_ROOT/etc/
+ echo "copying sysctl.conf (fix tcp window scaling and broken routers)"
+ cp -f $CONF_FILES_DIR/sysctl.conf $CD_ROOT/etc/
+
+ echo "setup default network conf file"
+ mkdir -p $CD_ROOT/usr/boot
+ cp -f $CONF_FILES_DIR/default-net.cnf $CD_ROOT/usr/boot/
+
+ echo "setup boot server configuration"
+ cp -f $CONF_FILES_DIR/cacert.pem $CD_ROOT/usr/boot/
+ cp -f $CONF_FILES_DIR/pubring.gpg $CD_ROOT/usr/boot/
+ echo "$BOOTSERVER" > $CD_ROOT/usr/boot/boot_server
+ echo "$BOOTSERVER_PORT" > $CD_ROOT/usr/boot/boot_server_port
+ echo "$BOOTSERVER_PATH" > $CD_ROOT/usr/boot/boot_server_path
+
+ echo "copying old boot cd directory bootme (TEMPORARY)"
+ cp -r bootme_old $CD_ROOT/usr/bootme
+
+ echo "forcing lvm to make lvm1 partitions (TEMPORARY)"
+ cp -f $CONF_FILES_DIR/lvm.conf $CD_ROOT/etc/lvm/
+
echo "copying isolinux configuration files"
cp -f $CONF_FILES_DIR/isolinux.cfg $CD_ROOT/usr/isolinux/
echo "$FULL_VERSION_STRING" > $CD_ROOT/usr/isolinux/message.txt
+ echo "writing /etc/issue"
+ echo "$FULL_VERSION_STRING" > $CD_ROOT/etc/issue
+ echo "Kernel \r on an \m" >> $CD_ROOT/etc/issue
+ echo "" >> $CD_ROOT/etc/issue
+ echo "" >> $CD_ROOT/etc/issue
+
echo "making the isolinux initrd kernel command line match rd size"
let INITRD_SIZE_KB=$(($RAMDISK_SIZE * 1024))
sed -i "s#ramdisk_size=0#ramdisk_size=$INITRD_SIZE_KB#g" \
echo "building pcitable for hardware detection"
pci_map_file=`find $CD_ROOT/lib/modules/ -name modules.pcimap | head -1`
- ./scripts/rewrite-pcitable.py $pci_map_file $CD_ROOT/etc/pl_pcitable
+ module_dep_file=`find $CD_ROOT/lib/modules/ -name modules.dep | head -1`
+ pci_table=$CD_ROOT/usr/share/hwdata/pcitable
+ ./scripts/rewrite-pcitable.py $module_dep_file $pci_map_file $pci_table \
+ $CD_ROOT/etc/pl_pcitable
dd if=/dev/zero of=$INITRD bs=1M count=$RAMDISK_SIZE
mkfs.ext2 -F -m 0 -i $INITRD_BYTES_PER_INODE $INITRD
fi
if [ "$1" == "burn" ]; then
- build_iso
burn
exit
fi