modified: genpxml.sh
modified: pnd_make.sh
modified: pnd_run.sh
echo '
<?xml version="1.0" encoding="UTF-8"?>
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>
<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>'
<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"/>"
for image in $(file -i -0 * | grep -a image | cut -d" " -f1)
do
echo "<pic src="$image"/>"
<clockspeed frequency="600"/><!--Frequency in Hz-->
</PXML>
<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"#####
#!/bin/bash
######adjust path of genpxml.sh if you want to use that "feture"#####
TEMP=`getopt -o p:d:x:i: -- "$@"`
TEMP=`getopt -o p:d:x:i: -- "$@"`
rnd=$RANDOM; # random number for genpxml and index$rnd.xml
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
PXML=tmp$rnd.pxml
echo "$PXMLtxt" > tmp$rnd.pxml
fi
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 [ ! $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
-
-
mkisofs -o $PNDNAME.iso -R $FOLDER
mkisofs -o $PNDNAME.iso -R $FOLDER
-#pxmlstart=$(stat -c%s "$PNDNAME.iso")
-
cat $PNDNAME.iso $PXML > $PNDNAME
cat $PNDNAME.iso $PXML > $PNDNAME
+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
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
-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
- #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
# -n to skip union mount, should probably be removed before release
# -s startdir
# arguments can be inside -e, -a is optional
- 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
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
#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
if [ ! -d /mnt/utmp/$BASENAME ]; then sudo mkdir -p /mnt/utmp/$BASENAME; fi
#mount
echo "$mntline"
$mntline #mount the pnd/folder
echo "mounting union!"
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"
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
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
sudo rmdir /mnt/utmp/$BASENAME;
fi
if [ $DFS = ISO ]; then
sleep 5
sudo /etc/init.d/gdm start
fi
sleep 5
sudo /etc/init.d/gdm start
fi