diff options
| author | Michael Neves | 2013-05-14 13:21:27 +0200 |
|---|---|---|
| committer | Michael Neves | 2013-05-14 13:21:27 +0200 |
| commit | 97b27ddaee661d5a87584948654157f202258a81 (patch) | |
| tree | 973018bdbb0abab7b4da05ae0140f43ba96449a0 | |
| parent | vmware (diff) | |
| parent | Updat eto generate_bootmenu (diff) | |
| download | tm-scripts-97b27ddaee661d5a87584948654157f202258a81.tar.gz tm-scripts-97b27ddaee661d5a87584948654157f202258a81.tar.xz tm-scripts-97b27ddaee661d5a87584948654157f202258a81.zip | |
Merge branch 'master' of git.openslx.org:openslx-ng/tm-scripts
| -rwxr-xr-x | generate_bootmenu.sh | 131 | ||||
| -rw-r--r-- | remote/modules/vmplayer/vmplayer.build | 53 |
2 files changed, 162 insertions, 22 deletions
diff --git a/generate_bootmenu.sh b/generate_bootmenu.sh new file mode 100755 index 00000000..de3dc24e --- /dev/null +++ b/generate_bootmenu.sh @@ -0,0 +1,131 @@ +#!/bin/bash + +# This is a temporary script to create/update the PXE boot menu +# for OpenSLX-NG. It is designed to facilitate testing in early +# stages and will be replaced by more sophisticated scripts or tools +# later on. +# - Simon Rettberg + +MLTK_PID="$$" +qnd_exit() { + unset_quiet + kill "$MLTK_PID" + [ $# -ge 1 ] && kill "$1" +} + + +. "helper/logging.inc" + +[ $# -lt 1 ] && perror "Usage: $0 <this server's ip address>" + +[ ! -d "server/boot" ] && perror "Not in tm-scripts root directory or no cloned systems created." + +cd "server/boot" || perror "Could not cd to server/boot" + +SERVERIP="$1" + +ifconfig | grep -- "$SERVERIP" > /dev/null +RET=$? +if [ "x$RET" != "x0" ]; then + pwarning "Given server IP '$SERVERIP' not found in ifconfig output. Are you sure this machine is reachable with this address?" + sleep 2 +fi + +# generate config header +LINKLOC="/srv/openslx/www" +if [ -L "$LINKLOC/boot" -o ! -e "$LINKLOC/boot" ]; then + ln -sf -t "$LINKLOC" "$(pwd)" "boot" || perror "Could not link $LINKLOC/boot to $(pwd)" +fi +mkdir -p "/srv/openslx/tftp/pxelinux.cfg" || perror "Could not create directory /srv/openslx/tftp/pxelinux.cfg" +CONF="/srv/openslx/tftp/pxelinux.cfg/default" + +## This is the template for the boot menu +cat > "$CONF" << HEREEND +# generated by openslx-ng +# if you intend to change this file, remember that it will +# be overwritten by generate_bootmenu.sh +# this file was generated $(date) + +DEFAULT vesamenu.c32 + +# static configuration (override with include file) +NOESCAPE 0 +PROMPT 0 + +MENU BACKGROUND openslx.png +MENU WIDTH 78 +MENU MARGIN 9 +MENU PASSWORDMARGIN 9 +MENU ROWS 10 +MENU TABMSGROW 16 +MENU CMDLINEROW 16 +MENU ENDROW -1 +MENU PASSWORDROW 16 +MENU TIMEOUTROW 20 +MENU HELPMSGROW 16 +MENU HELPMSGENDROW -1 +MENU HSHIFT 0 +MENU VSHIFT 7 + +menu color screen 37;40 #80ffffff #00000000 std +menu color border 37;40 #40000000 #ff8093a1 std +menu color title 1;37;40 #ffff8b00 #ff8093a1 std +menu color unsel 37;40 #fff0f0f0 #ff8093a1 std +menu color hotkey 1;37;40 #ffff8b00 #ff8093a1 std +menu color sel 7;37;40 #ff1c2a33 #667799bb all +menu color hotsel 1;7;37;40 #ffff8b00 #667799bb all +menu color disabled 1;37;40 #ffff8b00 #ff8093a1 std +menu color scrollbar 37;40 #40000000 #ee000000 std +menu color tabmsg 37;40 #ffff8b00 #ff8093a1 std +menu color cmdmark 1;37;40 #ffff8b00 #ff8093a1 std +menu color cmdline 37;40 #fff0f0f0 #ff8093a1 std +menu color pwdborder 37;40 #40000000 #ff8093a1 std +menu color pwdheader 37;40 #ffff8b00 #ff8093a1 std +menu color pwdentry 37;40 #ffff8b00 #ff8093a1 std +menu color timeout_msg 37;40 #fff0f0f0 #ff8093a1 std +menu color timeout 1;37;40 #ffff8b00 #ff8093a1 std +menu color help 37;40 #ff1c2a33 #00000000 none +MENU MSGCOLOR #ff1c2a33 #00000000 none + + +# slxsettings configuration +TIMEOUT 600 +TOTALTIMEOUT 1800 +MENU TITLE OpenSLX-NG Preview + +HEREEND + +BASEDIR="$(pwd)" +LABEL=0 +for BASE in $(ls "$BASEDIR"); do + pinfo "Found base $BASE....." + for STAGE31 in $(ls "$BASEDIR/$BASE/initramfs-stage31"*); do + STAGE31="$(basename "$STAGE31")" + SSTAGE31="$(echo "$STAGE31" | cut -c 19-)" + [ ! -z "$SSTAGE31" ] && SSTAGE31="(31-$SSTAGE31)" + pinfo " Found stage31 $SSTAGE31" + for STAGE32 in $(ls "$BASEDIR/$BASE/initramfs-stage32"*); do + STAGE32="$(basename "$STAGE32")" + SSTAGE32="$(echo "$STAGE32" | cut -c 19-)" + [ ! -z "$SSTAGE32" ] && SSTAGE32="(32-$SSTAGE32)" + pinfo " Found stage32 $SSTAGE32" + for KERNEL in $(ls "$BASEDIR/$BASE/kernel/vmlinuz-"*); do + KERNEL="$(basename "$KERNEL")" + KKERNEL="$(echo "$KERNEL" | cut -c 9-)" + pinfo " Found kernel $KKERNEL" + LABEL=$[$LABEL + 1] + # write out this combination + cat >> "$CONF" << HEREEND + +# --- $BASE --- $KERNEL --- $STAGE31 --- $STAGE32 --- # +LABEL system$LABEL + MENU LABEL $BASE ($KKERNEL) $SSTAGE31 $SSTAGE32 + KERNEL http://$SERVERIP/boot/$BASE/kernel/$KERNEL + INITRD http://$SERVERIP/boot/$BASE/$STAGE31,http://$SERVERIP/boot/$BASE/$STAGE32 + IPAPPEND 3 +HEREEND + done + done + done +done + diff --git a/remote/modules/vmplayer/vmplayer.build b/remote/modules/vmplayer/vmplayer.build index c0067b01..63f44fdd 100644 --- a/remote/modules/vmplayer/vmplayer.build +++ b/remote/modules/vmplayer/vmplayer.build @@ -49,29 +49,30 @@ build() { post_copy() { # FIXME: gconftool is copied without dependencies - tarcopy "$(find /usr/lib/ -name gconv -type d) $(which gconftool-2)" "$TARGET_BUILD_DIR" + #tarcopy "$(find /usr/lib/ -name gconv -type d)" "$TARGET_BUILD_DIR" + : } build_modules(){ pdebug "PAtCHIGN" # need to be in src - cd "$MODULE_DIR"/src || perror "Could not cd to '$MODULE_DIR/src'" + cd "$MODULE_DIR/src" || perror "Could not cd to '$MODULE_DIR/src'" local VMWARE_MODCONFIG="$MODULE_DIR/src/vmware-vmx/bin/vmware-modconfig" [ -e "$VMWARE_MODCONFIG" ] && chmod +x "$VMWARE_MODCONFIG" || perror "Could not find $VMWARE_MODCONFIG" # link vmware-modconfig-console in the build dir local MANIFEST="$MODULE_DIR/src/vmware-vmx/manifest.xml" - local BUILD_NUMBER=$(grep -o -E '<buildNumber>[0-9]*</buildNumber>' "$MANIFEST"|grep -o -E '[0-9]*') - local VERSION=$(grep -o -E '<version>[0-9.]*</version>' "$MANIFEST"|grep -o -E '[0-9.]*') - local CORE_VERSION=$(grep -o -E '<coreVersion>[0-9.]*</coreVersion>' "$MANIFEST"|grep -o -E '[0-9.]*') + local BUILD_NUMBER="$(grep -o -E '<buildNumber>[0-9]*</buildNumber>' "$MANIFEST"|grep -o -E '[0-9]*')" + local VERSION="$(grep -o -E '<version>[0-9.]*</version>' "$MANIFEST"|grep -o -E '[0-9.]*')" + local CORE_VERSION="$(grep -o -E '<coreVersion>[0-9.]*</coreVersion>' "$MANIFEST"|grep -o -E '[0-9.]*')" # /etc/vmware/config gen - sed -i.bak1 '/^ETCDIR/d;/^VMISETCDIR/d;/bootstrap/d' $VMWARE_MODCONFIG - sed -i.bak2 "s/libdir=.*/libdir=$(echo $MODULE_BUILD_DIR | escape_replace)\/usr\/lib\/vmware/g" $VMWARE_MODCONFIG - sed -i.bak3 "s/set\ -e/set\ -e\nPREFIX=\"\/usr\"\nBINDIR=\"\/usr\/bin\"\nSBINDIR=\"\/usr\/sbin\"\nLIBDIR=\"\/usr\/lib\"\nDATADIR=\"\/usr\/share\"\nSYSCONFDIR=\"\/etc\"\nDOCDIR=\"\/usr\/share\/doc\"\nMANDIR=\"\/usr\/share\/man\"\nINCLUDEDIR=\"\/usr\/include\"\nINITDIR=\"\/etc\"\nINITSCRIPTDIR=\"\/etc\/init.d\"\nVMWARE\_INSTALLER=\"\/usr\/lib\/vmware-installer\/$CORE_VERSION\"\nVERSION=\"$CORE_VERSION\"\nVMISVERSION=\"$CORE_VERSION\"\nVMISPYVERSION=\"25\"/g" "$VMWARE_MODCONFIG" + sed -i.bak1 '/^ETCDIR/d;/^VMISETCDIR/d;/bootstrap/d' "$VMWARE_MODCONFIG" + sed -i.bak2 "s/libdir=.*/libdir=$(echo $MODULE_BUILD_DIR | escape_replace)\/usr\/lib\/vmware/g" "$VMWARE_MODCONFIG" + sed -i.bak3 "s#set -e#set -e\nPREFIX=\"/usr\"\nBINDIR=\"/usr/bin\"\nSBINDIR=\"/usr/sbin\"\nLIBDIR=\"/usr/lib\"\nDATADIR=\"/usr/share\"\nSYSCONFDIR=\"/etc\"\nDOCDIR=\"/usr/share/doc\"\nMANDIR=\"/usr/share/man\"\nINCLUDEDIR=\"/usr/include\"\nINITDIR=\"/etc\"\nINITSCRIPTDIR=\"/etc/init.d\"\nVMWARE_INSTALLER=\"/usr/lib/vmware-installer/$CORE_VERSION\"\nVERSION=\"$CORE_VERSION\"\nVMISVERSION=\"$CORE_VERSION\"\nVMISPYVERSION=\"25\"#g" "$VMWARE_MODCONFIG" - [ -e /etc/vmware/config ] && cp /etc/vmware/config /etc/vmware/config.mltk.bak - cat > /etc/vmware/config << EOF + [ -e "/etc/vmware/config" ] && cp "/etc/vmware/config" "/etc/vmware/config.mltk.bak" + cat > "/etc/vmware/config" << EOF .encoding = "UTF-8" installerDefaults.componentDownloadEnabled = "yes" installerDefaults.dataCollectionEnabled = "no" @@ -98,26 +99,34 @@ product.version = "9.0.1" workstation.product.version = "9.0.1" product.name = "VMware Workstation" EOF - mkdir -p $MODULE_BUILD_DIR/usr/lib/vmware/modules - ln -sf $MODULE_DIR/src/vmware-vmx/extra/modules.xml $MODULE_BUILD_DIR/usr/lib/vmware/modules/ - ln -sf $MODULE_DIR/src/vmware-vmx/lib/modules/source $MODULE_BUILD_DIR/usr/lib/vmware/modules/ + mkdir -p "$MODULE_BUILD_DIR/usr/lib/vmware/modules" + ln -sf "$MODULE_DIR/src/vmware-vmx/extra/modules.xml" "$MODULE_BUILD_DIR/usr/lib/vmware/modules/" + ln -sf "$MODULE_DIR/src/vmware-vmx/lib/modules/source" "$MODULE_BUILD_DIR/usr/lib/vmware/modules/" - ln -sf appLoader $MODULE_BUILD_DIR/usr/lib/vmware/bin/vmware-modconfig - ln -sf appLoader $MODULE_BUILD_DIR/usr/lib/vmware/bin/vmware-modconfig-console + ln -sf "appLoader" "$MODULE_BUILD_DIR/usr/lib/vmware/bin/vmware-modconfig" + ln -sf "appLoader" "$MODULE_BUILD_DIR/usr/lib/vmware/bin/vmware-modconfig-console" - [ ! -e "$MODULES_DIR"/kernel/ksrc/include/generated/utsrelease.h ] && perror "Could not find uts release!!!" - local UTS_RELEASE=$(cat "$MODULES_DIR"/kernel/ksrc/include/generated/utsrelease.h |awk -F "\"" '{print $2}') + [ ! -e "$MODULES_DIR/kernel/ksrc/include/generated/utsrelease.h" ] && perror "Could not find uts release!!!" + local UTS_RELEASE="$(cat "$MODULES_DIR/kernel/ksrc/include/generated/utsrelease.h" | awk -F '"' '{print $2}')" + pinfo "Patching vmblock.tar" + cd "$MODULE_BUILD_DIR/usr/lib/vmware/modules/source" || perror "cd failed." + tar xf "vmblock.tar" || perror "untar of vmblock.tar failed." + for sourcefile in $(grep -l -r -E '\sputname' "vmblock-only/"); do + sed -r -i 's/\sputname/__putname/g' "$sourcefile" || perror "sed of $sourcefile failed." + done + tar cf "vmblock.tar" "vmblock-only/" || perror "repacking of vmblock.tar failed." + cd - - pinfo "KOMPALIER" + pinfo "KOMPALIERE VMWARE KERNEL MODULE" for MOD in vsock vmblock vmmon vmnet vmci; do - pdebug "Kompaliere $MOD" - $VMWARE_MODCONFIG --console --build-mod -k $UTS_RELEASE $MOD $(which gcc) $MODULES_DIR/kernel/ksrc/include vmplayer $MOD + pinfo "Kompaliere $MOD" + "$VMWARE_MODCONFIG" --console --build-mod -k "$UTS_RELEASE $MOD" "$(which gcc)" "$MODULES_DIR/kernel/ksrc/include" "vmplayer" "$MOD" done cd - - mkdir -p "$TARGET_BUILD_DIR"/lib/modules/vmware/ - cp "/lib/modules/$UTS_RELEASE/vmplayer/"* "$TARGET_BUILD_DIR"/lib/modules/vmware/ || perror "Could not cp vmware modules to target!" + mkdir -p "$TARGET_BUILD_DIR/lib/modules/vmware/" + cp "/lib/modules/$UTS_RELEASE/vmplayer/"* "$TARGET_BUILD_DIR/lib/modules/vmware/" || perror "Could not cp vmware modules to target!" } |
