Move PXE cache to /root/pxe

This commit is contained in:
Dean Troyer 2011-10-03 11:43:28 -05:00
parent 10db445b32
commit 3508a3a926

View file

@ -20,6 +20,7 @@ if [ "$1" = "-k" ]; then
fi fi
DEST_DIR=${1:-/tmp}/tftpboot DEST_DIR=${1:-/tmp}/tftpboot
PXEDIR=${PXEDIR:-/root/pxe}
OPWD=`pwd` OPWD=`pwd`
PROGDIR=`dirname $0` PROGDIR=`dirname $0`
@ -41,23 +42,23 @@ EOF
# Setup devstack boot # Setup devstack boot
mkdir -p $DEST_DIR/ubuntu mkdir -p $DEST_DIR/ubuntu
if [ ! -d $OPWD/pxe ]; then if [ ! -d $PXEDIR ]; then
mkdir -p $OPWD/pxe mkdir -p $PXEDIR
fi fi
if [ ! -r $OPWD/pxe/vmlinuz-${KVER} ]; then if [ ! -r $PXEDIR/vmlinuz-${KVER} ]; then
sudo chmod 644 /boot/vmlinuz-${KVER} sudo chmod 644 /boot/vmlinuz-${KVER}
if [ ! -r /boot/vmlinuz-${KVER} ]; then if [ ! -r /boot/vmlinuz-${KVER} ]; then
echo "No kernel found" echo "No kernel found"
else else
cp -p /boot/vmlinuz-${KVER} $OPWD/pxe cp -p /boot/vmlinuz-${KVER} $PXEDIR
fi fi
fi fi
cp -p $OPWD/pxe/vmlinuz-${KVER} $DEST_DIR/ubuntu cp -p $PXEDIR/vmlinuz-${KVER} $DEST_DIR/ubuntu
if [ ! -r $OPWD/pxe/stack-initrd.gz ]; then if [ ! -r $PXEDIR/stack-initrd.gz ]; then
cd $OPWD cd $PXEDIR
sudo $PROGDIR/build_pxe_ramdisk.sh $OPWD/pxe/stack-initrd.gz sudo $PROGDIR/build_pxe_ramdisk.sh $PXEDIR/stack-initrd.gz
fi fi
cp -p $OPWD/pxe/stack-initrd.gz $DEST_DIR/ubuntu cp -p $PXEDIR/stack-initrd.gz $DEST_DIR/ubuntu
cat >>$DEFAULT <<EOF cat >>$DEFAULT <<EOF
LABEL devstack LABEL devstack
@ -68,8 +69,8 @@ LABEL devstack
EOF EOF
# Get Ubuntu # Get Ubuntu
if [ -d $OPWD/pxe ]; then if [ -d $PXEDIR ]; then
cp -p $OPWD/pxe/natty-base-initrd.gz $DEST_DIR/ubuntu cp -p $PXEDIR/natty-base-initrd.gz $DEST_DIR/ubuntu
fi fi
cat >>$DEFAULT <<EOF cat >>$DEFAULT <<EOF