X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=prep.sh;h=0ddafb170ba816ec2d160cca6fd1794ea87aa5d5;hb=refs%2Fheads%2F3.4;hp=89862a81290abe5825cb781bb82621ab97652a00;hpb=bf88553ffbf1ac6e746557f1626862beb7ef02a5;p=bootcd.git diff --git a/prep.sh b/prep.sh index 89862a8..0ddafb1 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$ # PATH=/sbin:/bin:/usr/sbin:/usr/bin @@ -26,111 +26,12 @@ fi export PATH -# Release and architecture to install -releasever=4 -basearch=i386 - -# Packages to install -packagelist=( -udev -dhclient -bash -coreutils -iputils -kernel -bzip2 -diffutils -logrotate -passwd -rsh -rsync -sudo -tcpdump -telnet -traceroute -time -wget -yum -curl -gzip -python -tar -pciutils -kbd -authconfig -hdparm -lvm -lvm2 -kexec-tools -gnupg -nano -parted -pyparted -openssh-server -openssh-clients -ncftp -dosfstools -dos2unix -bind-utils -sharutils -) - -# Unnecessary junk -junk=( -lib/obsolete -lib/tls -usr/share/cracklib -usr/share/emacs -usr/share/gnupg -usr/share/i18n -usr/share/locale -usr/share/terminfo -usr/share/zoneinfo -usr/sbin/build-locale-archive -usr/sbin/dbconverter-2 -usr/sbin/sasl* -usr/sbin/tcpslice -usr/lib/perl* -usr/lib/locale -usr/lib/sasl* -usr/lib/gconv -usr/lib/tls -) - -precious=( -usr/share/i18n/locales/en_US -usr/share/i18n/charmaps/UTF-8.gz -usr/share/locale/en -usr/share/terminfo/l/linux -usr/share/terminfo/v/vt100 -usr/share/terminfo/x/xterm -usr/share/zoneinfo/UTC -usr/lib/locale/en_US.utf8 -) - -usage() -{ - echo "Usage: prep.sh [OPTION]..." - echo " -r release Fedora release number (default: $releasever)" - echo " -a arch Fedora architecture (default: $basearch)" - echo " -h This message" - exit 1 -} - -# Get options -while getopts "r:a:h" opt ; do - case $opt in - r) - releasever=$OPTARG - ;; - a) - basearch=$OPTARG - ;; - h|*) - usage - ;; - esac -done +. build.common + +# pldistro expected as $1 - defaults to planetlab +pldistro=$1 ; shift + +# Packages to install, junk and precious : see build//bootcd.pkgs # Do not tolerate errors set -e @@ -143,29 +44,14 @@ install -d -m 755 $bootcd rpmquery --specfile bootcd.spec --queryformat '%{VERSION}\n' | head -1 >build/version.txt # Install base system -for package in "${packagelist[@]}" ; do - packages="$packages -p $package" -done -mkfedora -v -r $releasever -a $basearch -k $packages $bootcd - -pushd $bootcd +pl_root_makedevs $bootcd +pkgsfile=$(pl_locateDistroFile ../build/ $pldistro bootcd.pkgs) +pl_root_mkfedora $bootcd $pldistro $pkgsfile +pl_root_tune_image $bootcd -echo "* Removing unnecessary junk" - -# Save precious files -tar --ignore-failed-read -cpf precious.tar ${precious[*]} - -# Remove unnecessary junk -rm -rf ${junk[*]} - -# Restore precious files -tar -xpf precious.tar -rm -f precious.tar - -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" @@ -183,14 +69,6 @@ done echo "* Installing fallback node configuration file" install -D -m 644 conf_files/default-net.cnf $bootcd/usr/boot/default-net.cnf -# Build pcitable for hardware detection -echo "* Building pcitable for hardware detection" -pci_map_file=$(find $bootcd/lib/modules/ -name modules.pcimap | head -1) -module_dep_file=$(find $bootcd/lib/modules/ -name modules.dep | head -1) -pci_table=$bootcd/usr/share/hwdata/pcitable -$srcdir/bootmanager/source/merge_hw_tables.py \ - $module_dep_file $pci_map_file $pci_table $bootcd/etc/pl_pcitable - # Copy /etc/passwd out install -D -m 644 $bootcd/etc/passwd build/passwd @@ -216,11 +94,11 @@ echo "* Compressing reference image" (cd $bootcd && find . | cpio --quiet -c -o) | gzip -9 >$isofs/bootcd.img # Build syslinux -echo "* Building syslinux" -CFLAGS="-Werror -Wno-unused -finline-limit=2000" make -C syslinux +# echo "* Building syslinux" +# CFLAGS="-Werror -Wno-unused -finline-limit=2000" make -C syslinux # Install isolinux -echo "* Installing isolinux" -install -D -m 644 syslinux/isolinux.bin $isofs/isolinux.bin +#echo "* Installing isolinux" +#install -D -m 644 syslinux/isolinux.bin $isofs/isolinux.bin exit 0