echo '
<?xml version="1.0" encoding="UTF-8"?>
-<PXML xmlns="http://openpandora.org/namespaces/PXML"
-xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="'$BASENAME-$rnd'" xsi:noNamespaceSchemaLocation="PXML_schema.xsd">
+<PXML xmlns="http://openpandora.org/namespaces/PXML" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="'$BASENAME-$rnd'" xsi:noNamespaceSchemaLocation="PXML_schema.xsd">
<title lang="en_US">'$BASENAMEnoex'</title>
<title lang="de_DE">'$BASENAMEnoex' - German (lol!)</title>
<description lang="de_DE">de_DE Automatisch generiertes pxml aus'$(pwd)' exe='$BASENAME'</description>
<previewpics>'
+#add all images in the folder as preview pics
for image in $(file -i -0 * | grep -a image | cut -d" " -f1)
do
echo "<pic src="$image"/>"
<clockspeed frequency="600"/><!--Frequency in Hz-->
</PXML>
-'
+'
\ No newline at end of file
#!/bin/bash
######adjust path of genpxml.sh if you want to use that "feture"#####
-# \!/ black magic ahead
TEMP=`getopt -o p:d:x:i: -- "$@"`
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
#!/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
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
#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
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"
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
sleep 5
sudo /etc/init.d/gdm start
fi
-
-