#!/bin/sh # required files from slackware-12.0 # kernels/huge.s/bzImage # kernels/hugesmp.s/bzImage # kernels/speakup.s/bzImage # isolinux/f2.txt # isolinux/message.txt # usb-and-pxe-installers/initrd.img # usb-and-pxe-installers/pxelinux.cfg_default # /usr/share/syslinux/pxelinux.0 SLACKWARE=${1/%\//} TMP=${TMP:-/tmp} if [ -z "$SLACKWARE" -o ! -d "$SLACKWARE" ] ; then echo "Point this script at your toplevel slackware-\$VERSION directory." echo echo "IE: \"$(basename $0) /pub/mirrors/slackware/slackware-12.0/\"" exit 1 fi # clean up old template rm -rf $TMP/tftpboot/ mkdir -p $TMP/tftpboot/pxelinux.cfg/ cd $SLACKWARE/ # we'll do the following in stages in case the user points this script # at a non-slackware directory. if [ ! -z "$(ls kernels/*/bzImage 2> /dev/null)" ] ; then cp -p --parents kernels/*/bzImage $TMP/tftpboot/ else echo "Kernels ($SLACKWARE/kernels/*/bzImage) not found, aborting." exit 1 fi if [ ! -z "$(ls isolinux/*.txt 2> /dev/null)" ] ; then cp -p isolinux/*.txt $TMP/tftpboot/ else echo "Installer messages ($SLACKWARE/isolinux/*.txt) not found, aborting." exit 1 fi if [ -e usb-and-pxe-installers/initrd.img ] ; then cp -p usb-and-pxe-installers/initrd.img $TMP/tftpboot/ else echo "Initial ramdisk image ($SLACKWARE/usb-and-pxe-installers/initrd.img) not found, aborting." exit 1 fi if [ -e usb-and-pxe-installers/pxelinux.cfg_default ] ; then cp -p usb-and-pxe-installers/pxelinux.cfg_default $TMP/tftpboot/pxelinux.cfg/default else echo "Installer config ($SLACKWARE/usb-and-pxe-installers/pxelinux.cfg_default) not found, aborting." exit 1 fi if [ ! -z "$(ls slackware/a/syslinux-*.tgz 2> /dev/null)" ] ; then mkdir $TMP/$$/ tar zxf slackware/a/syslinux-*.tgz -C $TMP/$$/ cp -p $(find $TMP/$$/ -name 'pxelinux.0') $TMP/tftpboot/ rm -rf $TMP/$$/ else echo "Syslinux package ($SLACKWARE/slackware/a/syslinux-*.tgz) not found, aborting." exit 1 fi echo "$TMP/tftpboot/ was successfully created & populated." echo echo "You may wish to \"chown -R root:root $TMP/tftpboot/\" before" echo "moving it to your preferred location (typically /tftpboot/)."