- echo "# filelist of $PROGRAMNAME on $(date) using $ISO on ${DEVICE}:" > $DEVICE/grml2hd.filelist
- find ${TMPMNT} -type f | grep -v isolinux | sed 's#^/mnt/test/##' | tr A-Z a-z >> $DEVICE/grml2hd.filelist && \
- find ${DEVICE}/boot/isolinux -type f | sed 's#.*isolinux/##' | tr A-Z a-z >> $DEVICE/grml2hd.filelist && \
- mv ${DEVICE}/boot/isolinux/* ${DEVICE}/ && \
- rmdir ${DEVICE}/boot/isolinux && \
- rmdir ${DEVICE}/boot/
+ echo "# filelist of $PROGRAMNAME on $(date) using $ISO on ${DEVICE}:" > $DEVICE/grml2usb.filelist
+ find ${TMPMNT} -type f | grep -v isolinux | sed 's#^${TMPMNT}##' | tr A-Z a-z >> $DEVICE/grml2usb.filelist && \
+ find ${DEVICE}/boot/isolinux -type f | sed 's#.*isolinux/##' | tr A-Z a-z >> $DEVICE/grml2usb.filelist && \
+ # make sure we have a valid syslinux.cfg, if not use isolinux.cfg as base
+ if ! [ -f "${DEVICE}"/boot/isolinux/syslinux.cfg ] ; then
+ cp ${DEVICE}/boot/isolinux/isolinux.cfg ${DEVICE}/boot/isolinux/syslinux.cfg && \
+ echo 'syslinux.cfg' >> $DEVICE/grml2usb.filelist
+ fi
+
+ if mv ${DEVICE}/boot/isolinux/* ${DEVICE}/ ; then
+ rmdir ${DEVICE}/boot/isolinux
+ fi
+
+ if [ -d "${DEVICE}"/boot/grub ] ; then
+ [ -d "${DEVICE}/grub" ] || mkdir ${DEVICE}/grub
+ mv ${DEVICE}/boot/grub/* ${DEVICE}/grub/
+ fi
+
+ rmdir ${DEVICE}/boot 2>/dev/null
+