diff options
author | Jonathan Bauer | 2012-01-27 16:07:25 +0100 |
---|---|---|
committer | Jonathan Bauer | 2012-01-27 16:07:25 +0100 |
commit | 533457229d17d1226f052c964f60c20289af1bf9 (patch) | |
tree | 7b52bc1578db7a487a59e76403627adbccec8c9d | |
parent | iso serial query (diff) | |
download | usb-boot-stick-533457229d17d1226f052c964f60c20289af1bf9.tar.gz usb-boot-stick-533457229d17d1226f052c964f60c20289af1bf9.tar.xz usb-boot-stick-533457229d17d1226f052c964f60c20289af1bf9.zip |
euhm testing...
-rwxr-xr-x | bin/build.initramfs-serial.sh | 13 | ||||
-rw-r--r-- | config/extlinux/extlinux.conf | 4 | ||||
-rw-r--r-- | inc/functions.iso.sh | 24 | ||||
-rw-r--r-- | inc/functions.pbs.sh | 74 |
4 files changed, 28 insertions, 87 deletions
diff --git a/bin/build.initramfs-serial.sh b/bin/build.initramfs-serial.sh index e4af2d7..302168e 100755 --- a/bin/build.initramfs-serial.sh +++ b/bin/build.initramfs-serial.sh @@ -2,17 +2,16 @@ ROOT_DIR=$(readlink -f $(dirname $(readlink -f $0))/..) -cd ${ROOT_DIR}/build/rootfs echo -e "[build-initramfs-serial] \t Create initramfs-serial." -find . | cpio --quiet -H newc -o > ../initramfs-default.cpio +find . | cpio --quiet -H newc -o > ../initramfs-serial.cpio cd .. -gzip initramfs-default.cpio +gzip initramfs-serial.cpio -mv initramfs-default.cpio.gz initramfs-default -INITRAMFS_SIZE=$(stat -c %s ${ROOT_DIR}/build/initramfs-default) +mv initramfs-serial.cpio.gz initramfs-serial +INITRAMFS_SIZE=$(stat -c %s ${ROOT_DIR}/build/initramfs-serial) cd - > /dev/null 2>&1 -echo -e "[build-initramfs] \t New initramfs created." -echo -e "\t\t\t Location: ${ROOT_DIR}/build/initramfs-default." +echo -e "[build-initramfs] \t New initramfs-serial created." +echo -e "\t\t\t Location: ${ROOT_DIR}/build/initramfs-serial." echo -e "\t\t\t Size: ${INITRAMFS_SIZE} bytes." diff --git a/config/extlinux/extlinux.conf b/config/extlinux/extlinux.conf index 34f0be2..51e0a0c 100644 --- a/config/extlinux/extlinux.conf +++ b/config/extlinux/extlinux.conf @@ -41,7 +41,7 @@ MENU TITLE Welcome to OpenSLX PreBoot USB Ext2/3 (Mini Linux/Kexec) LABEL SLXSTDBOOT MENU LABEL OpenSLX PreBoot - Stateless Netboot Linux ... KERNEL kernel - APPEND initrd=initramfs type=USB vga=0x317 + APPEND initrd=initramfs,serial type=USB vga=0x317 TEXT HELP Use this (default) entry if you have configured your client. You have chance to edit the kernel commandline by hitting the @@ -50,7 +50,7 @@ LABEL SLXSTDBOOT LABEL DEBUGBOOT MENU LABEL OpenSLX PreBoot - Debug Mode KERNEL kernel - APPEND initrd=initramfs,initramfs-serial type=USB vga=0x317 debug=3 + APPEND initrd=initramfs,serial type=USB vga=0x317 debug=3 TEXT HELP Use this to start the preboot environment with debug shells. ENDTEXT diff --git a/inc/functions.iso.sh b/inc/functions.iso.sh index a04cbcd..26e605f 100644 --- a/inc/functions.iso.sh +++ b/inc/functions.iso.sh @@ -66,6 +66,7 @@ pre_start_cleanup () { setup_dir_structure () { pinfo "Create dir structure." mkdir -p $TMP_DIR/isolinux + mkdir -p $TMP_DIR/pbs } copy_files () { @@ -73,7 +74,7 @@ copy_files () { cp -v $ROOT_DIR/build/kernel-preboot-latest $TMP_DIR/isolinux/kernel cp -v $ROOT_DIR/build/initramfs-default $TMP_DIR/isolinux/initramfs - cp -v $ROOT_DIR/build/initramfs-serial $TMP_DIR/isolinux/initramfs-serial + cp -v $TMP_DIR/initramfs-serial $TMP_DIR/isolinux/serial cp -v $SYSLINUX/com32/menu/menu.c32 $TMP_DIR/isolinux/ cp -v $SYSLINUX/com32/menu/vesamenu.c32 $TMP_DIR/isolinux/ @@ -92,7 +93,7 @@ copy_files () { } -get_preboot_serials() { +get_preboot_serial() { pinfo "Retrieving Serials..." @@ -100,10 +101,23 @@ get_preboot_serials() { wget -qO- pbs2.mp.openslx.org/resource/getprebootserials/apikey/apikey_uni-freiburg | cat set_quiet - wget -O serial pbs2.mp.openslx.org/resource/getprebootserials/apikey/apikey_uni-freiburg/serialnr/$NR + pechon "Choose serial to use for the image.\n\tPress the corresponding number, or r for random serial or empty for default serial: " + read serial_choice + if [ "x$serial_choice" = "xr" ] + then + : # get random serial from pbs + else + wget -O $TMP_DIR/pbs/serial pbs2.mp.openslx.org/resource/getprebootserials/apikey/apikey_uni-freiburg/serialnr/$serial_choice + fi } +write_preboot_serial() { + cd $TMP_DIR/pbs + $ROOT_DIR/bin/build.initramfs-serial.sh + cd - +} + create_iso () { pinfo "Create ISO." @@ -125,7 +139,9 @@ run () { set_quiet pre_start_cleanup - setup_dir_structure + setup_dir_structure + get_preboot_serial + write_preboot_serial copy_files create_iso diff --git a/inc/functions.pbs.sh b/inc/functions.pbs.sh deleted file mode 100644 index 563a39e..0000000 --- a/inc/functions.pbs.sh +++ /dev/null @@ -1,74 +0,0 @@ -SHORT_OPTS=":vfdh" -LONG_OPTS="version,force,debug,help" - -LOG_DIR="/tmp/pbmtk" -TMP_DIR=/tmp/openslx-iso - -run_module_checks () { - - if [ ! -z $1 ]; then - perror "Too many parameters. \n" - print_usage - exit 1 - fi - - if [ -z $(which genisoimage) ]; then - perror "'genisoimage' is missing (if you are on a debian/ubuntu system: apt-get install genisoimage)" - exit 1 - fi -} - -init_params () { - FORCE=0 - DEBUG=0 -} - -print_usage() { - echo "Usage: $(basename $SELF) iso [OPTIONS]" - echo -e " -d --debug \t give more debug output" - echo -e " -f --force \t don't ask questions" - echo -e " -h --help \t print help" - echo -e " -v --version \t print version information" -} - -read_params() { - getopt_start $@ - - eval set -- "$GETOPT_TEMP" - - while true ; do - case "$1" in - -v|--version) - echo "OpenSLX PreBoot .. ($VERSION - $VDATE)." - exit 0 - ;; - -h|--help) - print_usage - exit 0 - ;; - -f|--force) pinfo "Disable user-interaction."; FORCE=1; shift ;; - -d|--debug) pinfo "Enabled debugmode."; DEBUG=1; unset_quiet; shift ;; - --) shift ; break ;; - *) perror "Internal error!" ; exit 1 ;; - esac - done -} - -get_preboot_serials() { - - pinfo "Retrieving Serials..." - - unset_quiet - wget -qO- pbs2.mp.openslx.org/resource/getprebootserials/apikey/apikey_uni-freiburg | cat - set_quiet - - -} - -run () { - - set_quiet - get_preboot_serials - unset_quiet - -}
\ No newline at end of file |