From 25449423959fea1a6884c22997bcf227f9d9866b Mon Sep 17 00:00:00 2001 From: user Date: Sat, 31 Oct 2009 21:49:05 +0100 Subject: [PATCH] Updated support scripts modified: genpxml.sh modified: pnd_make.sh modified: pnd_run.sh --- testdata/scripts/genpxml.sh | 6 +++--- testdata/scripts/pnd_make.sh | 30 ++++++++++++++---------------- testdata/scripts/pnd_run.sh | 16 +++++++--------- 3 files changed, 24 insertions(+), 28 deletions(-) diff --git a/testdata/scripts/genpxml.sh b/testdata/scripts/genpxml.sh index dd0aa8e..8a2af03 100755 --- a/testdata/scripts/genpxml.sh +++ b/testdata/scripts/genpxml.sh @@ -12,8 +12,7 @@ loc=$(dirname "$0") echo ' - + '$BASENAMEnoex' '$BASENAMEnoex' - German (lol!) @@ -23,6 +22,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="'$BASENAME-$rnd'" xsi: de_DE Automatisch generiertes pxml aus'$(pwd)' exe='$BASENAME' ' +#add all images in the folder as preview pics for image in $(file -i -0 * | grep -a image | cut -d" " -f1) do echo "" @@ -46,4 +46,4 @@ echo ' -' +' \ No newline at end of file diff --git a/testdata/scripts/pnd_make.sh b/testdata/scripts/pnd_make.sh index 2586ac6..6643f3e 100755 --- a/testdata/scripts/pnd_make.sh +++ b/testdata/scripts/pnd_make.sh @@ -1,7 +1,6 @@ #!/bin/bash ######adjust path of genpxml.sh if you want to use that "feture"##### -# \!/ black magic ahead TEMP=`getopt -o p:d:x:i: -- "$@"` @@ -21,38 +20,37 @@ done rnd=$RANDOM; # random number for genpxml and index$rnd.xml -if [ $PXML = "guess" ] && [ $PNDNAME ] && [ $FOLDER ]; then - PXMLtxt=$(~/pndtest/genxml.sh $FOLDER $ICON) +#generate pxml if guess or empty +if [ ! $PXML ] || [ $PXML = "guess" ] && [ $PNDNAME ] && [ $FOLDER ]; then + PXMLtxt=$(./genpxml.sh $FOLDER $ICON) PXML=tmp$rnd.pxml echo "$PXMLtxt" > tmp$rnd.pxml fi +#check arguments if [ ! $PNDNAME ] || [ ! $FOLDER ] || [ ! $PXML ]; then echo " Usage: pnd_make.sh -p your.pnd -d folder/containing/your/app/ -x your.pxml (or \"guess\" to try to generate it from the folder) -i icon.png" exit 1 fi +if [ ! -d $FOLDER ]; then echo "$FOLDER doesnt exist"; exit 1; fi #check if folder actually exists +if [ ! -f $PXML ]; then echo "$PXML doesnt exist"; exit 1; fi #check if pxml actually exists -if [ ! -d $FOLDER ]; then echo "$FOLDER doesnt exist"; exit 1; fi -if [ ! -f $PXML ]; then echo "$PXML doesnt exist"; exit 1; fi - - +#make iso from folder mkisofs -o $PNDNAME.iso -R $FOLDER -#pxmlstart=$(stat -c%s "$PNDNAME.iso") - +#append pxml to iso cat $PNDNAME.iso $PXML > $PNDNAME -rm $PNDNAME.iso +rm $PNDNAME.iso #cleanup -if [ $ICON ]; then # is -i used? +#append icon if specified +if [ $ICON ]; then # check if we want to add an icon if [ ! -f $ICON ]; then #does the icon actually exist? echo "$ICON doesnt exist" else # yes mv $PNDNAME $PNDNAME.tmp - cat $PNDNAME.tmp $ICON > $PNDNAME + cat $PNDNAME.tmp $ICON > $PNDNAME # append icon + rm $PNDNAME.tmp #cleanup fi fi -if [ $PXML = "guess" ];then rm tmp$rnd.pxml; fi - -#printf %08d $pxmlstart >> $PNDNAME #append end of iso/start of pxml offset - +if [ $PXML = "guess" ];then rm tmp$rnd.pxml; fi #cleanup diff --git a/testdata/scripts/pnd_run.sh b/testdata/scripts/pnd_run.sh index c78d3a9..7152556 100755 --- a/testdata/scripts/pnd_run.sh +++ b/testdata/scripts/pnd_run.sh @@ -1,7 +1,6 @@ #!/bin/bash - #needs some serious cleanup! -#Usage: pnd_run.sh -p your.pnd -e executeable [-a "(arguments)"] [ -s "cd to folder inside pnd"] [-u (skip union)] [-b override BASENAME (name of mountpoint/appdata)] [-x close x before launching(script needs to be started with nohup for this to work] +#Usage: pnd_run.sh -p your.pnd -e executeable [-a "(arguments)"] [ -s "cd to folder inside pnd"] [-u (skip union)] [-b override BASENAME (name of mountpoint/pandora/appdata)] [-x close x before launching(script needs to be started with nohup for this to work] # -n to skip union mount, should probably be removed before release # -s startdir # arguments can be inside -e, -a is optional @@ -47,7 +46,7 @@ while true ; do done if [ ! $PND ]; then - echo "Usage: pnd_run.sh -p your.pnd -e executeable [-a \"(arguments)\"] [ -s \"cd to folder inside pnd\"] [-u (skip union)] [-b override BASENAME (name of mountpoint/appdata)] [-x close x before launching(script needs to be started with nohup for this to work]" + echo "Usage: pnd_run.sh -p your.pnd -e executeable [-a \"(arguments)\"] [ -s \"cd to folder inside pnd\"] [-u (skip union)] [-b override BASENAME (name of mountpoint/pandora/appdata)] [-x close x before launching(script needs to be started with nohup for this to work]" exit 1 fi if [ $nox ]; then @@ -117,7 +116,7 @@ fi #create mountpoints, check if they exist already first to avoid annoying error messages if [ ! -d /mnt/pnd/$BASENAME ]; then sudo mkdir -p /mnt/pnd/$BASENAME ; fi -if [ ! -d $MOUNTPOINT/appdata/$BASENAME ]; then sudo mkdir -p $MOUNTPOINT/appdata/$BASENAME; fi +if [ ! -d $MOUNTPOINT/pandora/appdata/$BASENAME ]; then sudo mkdir -p $MOUNTPOINT/pandora/appdata/$BASENAME; fi if [ ! -d /mnt/utmp/$BASENAME ]; then sudo mkdir -p /mnt/utmp/$BASENAME; fi #mount @@ -129,7 +128,7 @@ if [ ! $NOUNION ] && [ ! $umount ]; then echo "$mntline" $mntline #mount the pnd/folder echo "mounting union!" - sudo mount -t aufs -o exec,dirs\=$MOUNTPOINT/appdata/$BASENAME=rw+nolwh:/mnt/pnd/$BASENAME=rr none /mnt/utmp/$BASENAME # put union on top + sudo mount -t aufs -o exec,dirs\=$MOUNTPOINT/pandora/appdata/$BASENAME=rw+nolwh:/mnt/pnd/$BASENAME=rr none /mnt/utmp/$BASENAME # put union on top else echo "Union already mounted" @@ -185,8 +184,9 @@ if [ $NOUNION ] ; then sudo umount /mnt/pnd/$BASENAME; fi #umount iso if -u WAS if [ $? -eq 0 ]; then # check if the umount was successfull, if it wasnt it would mean that theres still something running so we skip this stuff, this WILL lead to clutter if it happens, so we should make damn sure it never happens if [ ! $NOUNION ] ; then sudo umount /mnt/pnd/$BASENAME - sudo rmdir $MOUNTPOINT/appdata/$BASENAME/.wh..wh.plink - sudo rmdir $MOUNTPOINT/appdata/$BASENAME/ + sudo rmdir $MOUNTPOINT/pandora/appdata/$BASENAME/.wh..wh.plnk + sudo rmdir $MOUNTPOINT/pandora/appdata/$BASENAME/.wh..wh..tmp + sudo rmdir $MOUNTPOINT/pandora/appdata/$BASENAME/ sudo rmdir /mnt/utmp/$BASENAME; fi if [ $DFS = ISO ]; then @@ -200,5 +200,3 @@ echo "starting x in 5s" sleep 5 sudo /etc/init.d/gdm start fi - - -- 2.39.2