Skip to content

Commit

Permalink
Now supports PREFIX (http)
Browse files Browse the repository at this point in the history
  • Loading branch information
yeupou committed Nov 21, 2012
1 parent 5bf22ea commit f2101d6
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 9 deletions.
14 changes: 12 additions & 2 deletions GNULinux/ipxe-boot-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
# do `export NO_WGET=1` if you want it do skip downloading files.

BOOT_OPTS="vga=normal"

# Use the following if you want to provide access to these over http
# instead of tftp or any other relevant protocol, assuming you set up
# the relevant server to serve these
#PREFIX=http://URL/pxe/

[ $NO_WGET ] && echo "NO_WGET is exported so we won't download required files."

# cd in the directory where this script resides, even if called from a symlink
Expand All @@ -47,8 +53,8 @@ for dist in $DISTS; do
[ ! $NO_WGET ] && wget --quiet $dist/main/installer-$arch/current/images/netboot/$system-installer/$arch/initrd.gz -O `basename $dist`-$arch-initrd.gz
[ ! $NO_WGET ] && wget --quiet $dist/main/installer-$arch/current/images/netboot/$system-installer/$arch/linux -O `basename $dist`-$arch-linux
echo ":$system-`basename $dist`-$arch" >> ipxe-boot
echo "kernel GNULinux/`basename $dist`-$arch-linux $BOOT_OPTS" >> ipxe-boot
echo "initrd GNULinux/`basename $dist`-$arch-initrd.gz" >> ipxe-boot
echo kernel $PREFIX"GNULinux/`basename $dist`-$arch-linux $BOOT_OPTS" >> ipxe-boot
echo initrd $PREFIX"GNULinux/`basename $dist`-$arch-initrd.gz" >> ipxe-boot
echo "boot" >> ipxe-boot
MENU="$MENU\nitem $system-`basename $dist`-$arch `echo $system | tr a-z A-Z` `basename $dist` $arch"
done
Expand All @@ -60,4 +66,8 @@ echo -e "$MENU" >> ipxe-boot
echo "choose target && goto \${target}" >> ipxe-boot
echo "# EOF" >> ipxe-boot

# provide rescue symlinks
if [ ! -e rescue-linux ]; then ln -s stable-i386-linux rescue-linux; fi
if [ ! -e rescue-initrd.gz ]; then ln -s stable-i386-initrd.gz rescue-initrd.gz; fi

# EOF
10 changes: 10 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Obviously, you wont forget to do:
invoke-rc.d tftpd-hpa start



To use it:
----------

Expand All @@ -54,6 +55,15 @@ On your client,
Go in the BIOS, look for "boot on lan" and whatever crap it may be called (it varies greatly), activate it. Then boot. It'll do some DHCP magic to find the path to the PXE and the menu should be printed on your screen at some point.


Further...:
-----------

You can decide to use http instead of tftpd for faster file transfer once
iPXE is loaded (which means tfpd will still be necessary tough).

For instance, you can run
export PREFIX=http://URL/pxe/
before starting the ipxe-boot-update.sh script.


# EOF
16 changes: 9 additions & 7 deletions ipxe-boot-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,21 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA

# basic warning check: does undionly.kpxe exists?
# cd in the directory where this script resides, even if called from a symlink
# in /etc/cron.whatever/
ZERO=$0
if [ -L $0 ]; then ZERO=`readlink $0`; fi
cd `dirname $ZERO`


# basic warning check: does undionly.kpxe exists?
IPXE_CHAINLOADER=undionly.kpxe
if [ ! -e $IPXE_CHAINLOADER ]; then
echo "Did you notice that $IPXE_CHAINLOADER was not there?"
read
wget http://boot.ipxe.org/$IPXE_CHAINLOADER
fi

# cd in the directory where this script resides, even if called from a symlink
# in /etc/cron.whatever/
ZERO=$0
if [ -L $0 ]; then ZERO=`readlink $0`; fi
cd `dirname $ZERO`

# assume each subdirectory in here may contain relevant images
# if an update script exists, run it
for subdir in *; do
Expand Down Expand Up @@ -78,6 +79,7 @@ for subdir in *; do
fi
done
echo ":rescue" >> ipxe-boot
echo "# fallback with tftpd" >> ipxe-boot
echo "kernel GNULinux/rescue-linux vga=normal irqpoll rescue/enable=true" >> ipxe-boot
echo "initrd GNULinux/rescue-initrd.gz" >> ipxe-boot
echo "boot" >> ipxe-boot
Expand Down

0 comments on commit f2101d6

Please sign in to comment.