fix config file for HEN
authorMazet Laurent <mazet@softndesign.org>
Tue, 12 Dec 2023 07:25:53 +0000 (08:25 +0100)
committerMazet Laurent <mazet@softndesign.org>
Tue, 12 Dec 2023 07:25:53 +0000 (08:25 +0100)
iso2ps2

diff --git a/iso2ps2 b/iso2ps2
index 4309809271b306c373fff98ea2f2cddd230e2821..e7a76998290f6d06a45975a89f033565a2b426ca 100755 (executable)
--- a/iso2ps2
+++ b/iso2ps2
@@ -11,8 +11,8 @@ CONFIGS=$PWD/CONFIGS
 KLICENSE="e4e54fd67c16c316f47829a30484d843"
 PS2CLASSIC=$PWD/ps2classic/ps2classic
 PSNPACKAGE=$PWD/psn_package_npdrm/psn_package_npdrm
-# FAT SLIM SUPER ULTRA
-MODEL="ULTRA"
+# HAN HEN
+MODEL="HEN"
 
 # formating functions
 function title () { echo -e "\033[0;1m=== $* ===\033[0;0m"; }
@@ -28,6 +28,8 @@ id=0
 
 # init
 file="$1"
+[ -f "$file" ] || fail "can't find file"
+[ "$(file $file | grep UDF)" ] || fail "file is not an UDF iso"
 
 # get serial
 serial=$(isoinfo -f -i "$file" | \
@@ -139,25 +141,23 @@ echo "00000000  $KLICENSE" | xxd -r - $serial/ps2.key
 
 # find config file
 title "find config file"
-confname=$(echo $serial.CONFIG | sed 's/-/_/;s/_\(...\)/_\1./')
-if [ -f "$CACHE/$confname" ]; then
-    cp "$CACHE/$confname" $serial/$confname
-else
+if [ ! -f "$CACHE/$serial.CONFIG" ]; then
+    confname=$(echo $serial | sed 's/-/_/;s/_\(...\)/_\1./')
     case "$MODEL" in
-    FAT)
-        config=$(cd $CONFIGS; find GX -name $confname | head -1)
+    HAN)
+        confname=$confname.CONFIG
+        config=$(cd $CONFIGS; find NET GX SOFTCUSTOM -name $confname | head -1)
         ;;
-    SLIM|SUPER|ULTRA)
-        config=$(cd $CONFIGS; find CUSTOM SOFT NET -name $confname | head -1)
-        #config=$(cd $CONFIGS; find SOFT NET -name $confname | head -1)
+    HEN)
+        confname=$confname.ENC
+        config=$(cd $CONFIGS; find ENC -name $confname | head -1)
         ;;
     esac
     if [ "$config" ]; then
-        cp $CONFIGS/$config "$CACHE/$confname"
-        cp "$CACHE/$confname" $serial/$confname
+        cp $CONFIGS/$config "$CACHE/$serial.CONFIG"
     fi
 fi
-[ -f $serial/$confname ] || warn "can't find config"
+[ -f "$CACHE/$serial.CONFIG" ] && cp "$CACHE/$serial.CONFIG" $serial/USRDIR/CONFIG || warn "can't find config"
 
 # create package config
 title "create package config"
@@ -179,8 +179,7 @@ $PS2CLASSIC e cex $serial/ps2.key "$file" $serial/USRDIR/ISO.BIN.ENC ISO.BIN.ENC
 
 # create package
 title "create package"
-( cd $serial; $PSNPACKAGE package.conf . ) || fail "can't create package"
-mv $serial/$cid.pkg .
+$PSNPACKAGE $serial || fail "can't create package"
 
 # create rap file
 title "create rap file"