summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDirk von Suchodoletz2008-02-27 20:03:20 +0100
committerDirk von Suchodoletz2008-02-27 20:03:20 +0100
commitb71b4bd2052b52afc3a9dd4f9d6303927eb77764 (patch)
tree071115150d873f612e3ceea1afd907ebd1c52d81
parentMoved file location ... (diff)
downloadcore-b71b4bd2052b52afc3a9dd4f9d6303927eb77764.tar.gz
core-b71b4bd2052b52afc3a9dd4f9d6303927eb77764.tar.xz
core-b71b4bd2052b52afc3a9dd4f9d6303927eb77764.zip
Script for creation of a simple remote boot CD ...
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1577 95ad53e4-c205-0410-b2fa-d234c58c8868
-rwxr-xr-xinitramfs/cdboot/mkcdboot80
1 files changed, 80 insertions, 0 deletions
diff --git a/initramfs/cdboot/mkcdboot b/initramfs/cdboot/mkcdboot
new file mode 100755
index 00000000..ceeaf814
--- /dev/null
+++ b/initramfs/cdboot/mkcdboot
@@ -0,0 +1,80 @@
+#!/bin/bash
+# This program is free software distributed under the GPL version 2.
+# See http://openslx.org/COPYING
+#
+# If you have any feedback please consult http://openslx.org/feedback and
+# send your feedback to feedback@openslx.org
+#
+# General information about OpenSLX can be found at http://openslx.org
+#
+# Script for generating an InitRamFS for using a demo CD/DVD instead of
+# PXE/linux boot functionality
+
+BUILDDIR=/tmp/slxcdboot
+SLX_SHARE_PATH=/opt/openslx/share
+NWMODULES="forcedeth e1000 e100 tg3 3c59x via-rhine r8169 pcnet32 b44 8139too"
+KERNVER=$(uname -r)
+
+rm -rf ${BUILDDIR}
+mkdir -p ${BUILDDIR}/{dev,proc,tmp,root,bin,sys,lib,etc}
+mkdir -p ${BUILDDIR}/var/{lib,run}
+ln -s /bin ${BUILDDIR}/sbin
+
+cp ${SLX_SHARE_PATH}/cdboot/init ${BUILDDIR}/init
+ chmod 755 ${BUILDDIR}/init
+
+cp ${SLX_SHARE_PATH}/busybox/busybox.i586 ${BUILDDIR}/bin/busybox
+for bbins in [ ar arping ash bunzip2 cat chmod chown chroot cp cpio cut \
+ date dd df dmesg du echo env expr fdisk free grep gunzip hwclock \
+ insmod id ip kill killall ln ls lsmod mdev mkdir \
+ mknod mkswap modprobe mount mv nice ping printf ps rdate \
+ rm rmmod sed sleep sort swapoff swapon switch_root tar test tftp \
+ time touch tr udhcpc umount uptime usleep vconfig vi wget zcat zcip; do
+ ln -fs /bin/busybox ${BUILDDIR}/bin/$bbins
+done
+cp /sbin/kexec ${BUILDDIR}/bin
+
+cp /lib/{libc.so.6,libresolv.so.2,libz.so.1,libcrypt.so.1,libnss_dns.so.2} \
+ ${BUILDDIR}/lib
+cp /lib/ld-linux.so.2 ${BUILDDIR}/lib
+
+mkdir -p ${BUILDDIR}/lib/modules/${KERNVER}/kernel/drivers/net
+cp /lib/modules/${KERNVER}/modules.dep ${BUILDDIR}/lib/modules/${KERNVER}
+for module in af_packet unix ${NWMODULES} mii ; do
+ mod=$(cd /; find "lib/modules/${KERNVER}" -name ${module}.ko 2>/dev/null)
+ mpath=${BUILDDIR}/${mod%/*}
+ mkdir -p ${mpath}
+ cp /$mod /${mpath}
+done
+
+# finally create the compressed initial ramfs cpio archive
+mkdir -p ${BUILDDIR}/iso/isolinux
+cp ${SLX_SHARE_PATH}/cdboot/isolinux.bin ${BUILDDIR}/iso/isolinux
+cp ${SLX_SHARE_PATH}/tftpboot/menu.c32 ${BUILDDIR}/iso/isolinux
+cp /boot/vmlinuz-${KERNVER} ${BUILDDIR}/iso/isolinux
+pushd . > /dev/null 2>&1
+ cd ${BUILDDIR}
+ find . ! -name "*~" | cpio -H newc --create | gzip -9 \
+ > ${BUILDDIR}/iso/isolinux/cd-initramfs
+popd > /dev/null 2>&1
+
+# starting to setup the menu driven boot chooser
+echo -e "DEFAULT menu.c32\nPROMPT 0\nMENU WIDTH 78\nMENU MARGIN 9\n\
+MENU ROWS 9\nMENU TABMSGROW 15\nMENU CMDLINEROW 15\nMENU ENDROW -1\n\
+MENU TIMEOUTROW 15\nMENU HELPMSGROW 15\nMENU HELPMSGENDROW -1\n\
+MENU HSHIFT 0\nMENU VSHIFT 5\n\nMENU TITLE OpenSLX PreBoot ISO\
+" > ${BUILDDIR}/iso/isolinux/isolinux.cfg
+echo -e "\nTest to boot an OpenSLX Client" \
+ >> ${BUILDDIR}/iso/isolinux/isolinux.cfg
+echo -e "\tTEXT HELP\n\tYou should have DHCP running ...\n\tENDTEXT" \
+ >> ${BUILDDIR}/iso/isolinux/isolinux.cfg
+echo -e "\tKERNEL vmlinuz-${KERNVER}\n\tAPPEND initrd=cd-initramfs" \
+ >> ${BUILDDIR}/iso/isolinux/isolinux.cfg
+
+# produce the iso image
+mkisofs -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -r -J -l \
+ -boot-info-table -o OpenSLX.iso -joliet-long -publisher "OpenSLX \
+Project - http://www.openslx.org" -p "OpenSLX Project - \
+openslx-devel@openslx.org" -relaxed-filenames -V "OpenSLX BootCD" \
+ -volset "OpenSLX Project - PreBoot CD for non PXE/TFTP start of a \
+Linux Stateless Client" ${BUILDDIR}/iso