2 ################################################################################
3 # Purpose: hackish script to generate netboot package without booting the system
4 ################################################################################
7 echo "Usage: $0 <chroot> <output_file>" >&2
17 if ! [ -f "${CHROOT}/etc/grml_version" ] ; then
18 echo "Error: could not read ${CHROOT}/etc/grml_version" >&2
22 GRML_VERSION="$(awk '{print $1"_"$2}' ${CHROOT}/etc/grml_version)"
24 if ! [ -r "${CHROOT}/usr/lib/syslinux/pxelinux.0" ] ; then
25 echo "Error: /usr/lib/syslinux/pxelinux.0 not found. Please install syslinux[-common]." >&2
29 OUTPUTDIR="$(mktemp -d)" || exit 1
30 WORKING_DIR="${OUTPUTDIR}/grml_netboot_package_${GRML_VERSION}/tftpboot/"
31 mkdir -p "$WORKING_DIR" || exit 2
33 cp "$CHROOT"/boot/vmlinuz-* "$WORKING_DIR"/vmlinuz
34 cp "$CHROOT"/boot/initrd.img-* "$WORKING_DIR"/initrd.img
35 cp "$CHROOT"/usr/lib/syslinux/pxelinux.0 "${WORKING_DIR}/pxelinux.0"
37 mkdir -p "${WORKING_DIR}/pxelinux.cfg"
38 cat > "${WORKING_DIR}/pxelinux.cfg/default" << EOF
42 append initrd=initrd.img root=/dev/nfs rw nfsroot=192.168.0.1:/live/image boot=live apm=power-off quiet nomce noprompt noeject vga=791
45 if tar -C "$OUTPUTDIR" -acf "${OUTPUT_FILE}" "grml_netboot_package_${GRML_VERSION}" ; then
47 echo "Generated ${OUTPUT_FILE}"
50 ## END OF FILE #################################################################