3 # Builds the BootCD reference image, the first of two
4 # initramfs cpio archives that are concatenated together by
5 # isolinux/syslinux to form a custom BootCD.
7 # Aaron Klingaman <alk@absarokasoft.com>
8 # Mark Huang <mlhuang@cs.princeton.edu>
9 # Copyright (C) 2004-2006 The Trustees of Princeton University
14 PATH=/sbin:/bin:/usr/sbin:/usr/bin
16 # In both a normal CVS environment and a PlanetLab RPM
17 # build environment, all of our dependencies are checked out into
18 # directories at the same level as us.
19 if [ -d ../build ] ; then
23 echo "Error: Could not find sources in either . or .."
31 # pldistro expected as $1 - defaults to planetlab
34 # Packages to install, junk and precious : see build/<pldistro>/bootcd.pkgs
36 # Do not tolerate errors
39 # Root of the initramfs reference image
40 bootcd=$PWD/build/bootcd
41 install -d -m 755 $bootcd
43 # Write version number
44 rpmquery --specfile bootcd.spec --queryformat '%{VERSION}\n' | head -1 >build/version.txt
47 pl_root_makedevs $bootcd
48 pkgsfile=$(pl_locateDistroFile ../build/ $pldistro bootcd.pkgs)
49 pl_root_mkfedora $bootcd $pldistro $pkgsfile
50 pl_root_tune_image $bootcd
52 # Install ipnmac (for SuperMicro machines with IPMI)
53 echo "* Installing IPMI utilities"
54 install -D -m 755 ipnmac/ipnmac.x86 $bootcd/usr/sbin/ipnmac
56 # Install configuration files
57 echo "* Installing configuration files"
58 for file in fstab mtab modprobe.conf inittab hosts sysctl.conf ; do
59 install -D -m 644 conf_files/$file $bootcd/etc/$file
63 echo "* Installing initscripts"
64 for file in pl_sysinit pl_hwinit pl_netinit pl_validateconf pl_boot ; do
65 install -D -m 755 conf_files/$file $bootcd/etc/init.d/$file
68 # Install fallback node configuration file
69 echo "* Installing fallback node configuration file"
70 install -D -m 644 conf_files/default-net.cnf $bootcd/usr/boot/default-net.cnf
72 # Copy /etc/passwd out
73 install -D -m 644 $bootcd/etc/passwd build/passwd
76 isofs=$PWD/build/isofs
77 install -d -m 755 $isofs
80 for kernel in $bootcd/boot/vmlinuz-* ; do
81 if [ -f $kernel ] ; then
82 install -D -m 644 $kernel $isofs/kernel
86 # Don't need /boot anymore
89 # initramfs requires that /init be present
90 ln -sf /sbin/init $bootcd/init
92 # Pack the rest into a compressed archive
93 echo "* Compressing reference image"
94 (cd $bootcd && find . | cpio --quiet -c -o) | gzip -9 >$isofs/bootcd.img
97 # echo "* Building syslinux"
98 # CFLAGS="-Werror -Wno-unused -finline-limit=2000" make -C syslinux
101 #echo "* Installing isolinux"
102 #install -D -m 644 syslinux/isolinux.bin $isofs/isolinux.bin