mirror of
https://github.com/RasppleII/a2cloud.git
synced 2025-08-07 11:26:59 +00:00
*.txt: Trailing whitespace removal
This commit is contained in:
@@ -218,7 +218,7 @@ if [[ ( $arg1 == "-p" || $arg1 == "-c" || $arg1 == "-g" || $arg1 == "-e" ) && $2
|
|||||||
[[ $3 && $3 != "-" ]] && outFile="$3"
|
[[ $3 && $3 != "-" ]] && outFile="$3"
|
||||||
[[ ! $3 ]] && outFile="${2##*/}"
|
[[ ! $3 ]] && outFile="${2##*/}"
|
||||||
$ac $getArg "$imageArg" "$fileArg" $outFile 2> $acmdStdErr
|
$ac $getArg "$imageArg" "$fileArg" $outFile 2> $acmdStdErr
|
||||||
|
|
||||||
else # put file
|
else # put file
|
||||||
|
|
||||||
# test ProDOS name validity
|
# test ProDOS name validity
|
||||||
@@ -256,7 +256,7 @@ if [[ ( $arg1 == "-p" || $arg1 == "-c" || $arg1 == "-g" || $arg1 == "-e" ) && $2
|
|||||||
else
|
else
|
||||||
ft="$ftArg"
|
ft="$ftArg"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# set auxtype to $0801 for Applesoft programs if not specified
|
# set auxtype to $0801 for Applesoft programs if not specified
|
||||||
[[ $ft == "BAS" && ! $auxType ]] && auxType="\$0801"
|
[[ $ft == "BAS" && ! $auxType ]] && auxType="\$0801"
|
||||||
|
|
||||||
@@ -268,9 +268,9 @@ if [[ ( $arg1 == "-p" || $arg1 == "-c" || $arg1 == "-g" || $arg1 == "-e" ) && $2
|
|||||||
else
|
else
|
||||||
$ac -d "$imageArg" $prodosPath &> /dev/null
|
$ac -d "$imageArg" $prodosPath &> /dev/null
|
||||||
$ac -p "$imageArg" $prodosPath $ft $auxType 2> $acmdStdErr
|
$ac -p "$imageArg" $prodosPath $ft $auxType 2> $acmdStdErr
|
||||||
fi
|
fi
|
||||||
else # AppleDouble or nulib extended, get resource fork and file metadata from header file
|
else # AppleDouble or nulib extended, get resource fork and file metadata from header file
|
||||||
|
|
||||||
[[ ! -f $prodosArg ]] && { echoerr "$prodosArg not found."; exit 1; }
|
[[ ! -f $prodosArg ]] && { echoerr "$prodosArg not found."; exit 1; }
|
||||||
[[ $AD && ! -f $rFile ]] && { echoerr "Not an AppleDouble file: $rFile"; exit 1; }
|
[[ $AD && ! -f $rFile ]] && { echoerr "Not an AppleDouble file: $rFile"; exit 1; }
|
||||||
|
|
||||||
@@ -372,20 +372,20 @@ if [[ ( $arg1 == "-p" || $arg1 == "-c" || $arg1 == "-g" || $arg1 == "-e" ) && $2
|
|||||||
| dd of="$imageArg" conv=notrunc bs=1 seek=$((parentDirKeyBlockOffset+4+33)) 2> /dev/null
|
| dd of="$imageArg" conv=notrunc bs=1 seek=$((parentDirKeyBlockOffset+4+33)) 2> /dev/null
|
||||||
|
|
||||||
# update extended file metadata
|
# update extended file metadata
|
||||||
|
|
||||||
# storage type (5), name length, name
|
# storage type (5), name length, name
|
||||||
name="${prodosPath##*/}"
|
name="${prodosPath##*/}"
|
||||||
nameLen=${#name}
|
nameLen=${#name}
|
||||||
nameHeader=$(printf %02X $((nameLen + 80)) )
|
nameHeader=$(printf %02X $((nameLen + 80)) )
|
||||||
nameField=$(echo -n $name | xxd -p | tr -d '\n' | sed -e :a -e 's/^.\{1,29\}$/&00/;ta')
|
nameField=$(echo -n $name | xxd -p | tr -d '\n' | sed -e :a -e 's/^.\{1,29\}$/&00/;ta')
|
||||||
|
|
||||||
# blocks used
|
# blocks used
|
||||||
blocksUsed=$(( dfBlocksUsed + rfBlocksUsed + 1 ))
|
blocksUsed=$(( dfBlocksUsed + rfBlocksUsed + 1 ))
|
||||||
|
|
||||||
# store updated metadata
|
# store updated metadata
|
||||||
fileEntry=${nameHeader}${nameField}${fileEntry:32}
|
fileEntry=${nameHeader}${nameField}${fileEntry:32}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# put creation and modified date in file entry
|
# put creation and modified date in file entry
|
||||||
fileEntry=${fileEntry:0:48}${cDateTimeHex}${fileEntry:56:10}${mDateTimeHex}${fileEntry:74:4}
|
fileEntry=${fileEntry:0:48}${cDateTimeHex}${fileEntry:56:10}${mDateTimeHex}${fileEntry:74:4}
|
||||||
|
|
||||||
|
@@ -13,7 +13,7 @@ options:
|
|||||||
-e : Nulib2-compatible filenames with type/auxtype and resource forks.
|
-e : Nulib2-compatible filenames with type/auxtype and resource forks.
|
||||||
-uc : Copy GS/OS mixed case filenames as uppercase.
|
-uc : Copy GS/OS mixed case filenames as uppercase.
|
||||||
-pro: Adapt DOS 3.3 names to ProDOS and remove addr/len from file data.
|
-pro: Adapt DOS 3.3 names to ProDOS and remove addr/len from file data.
|
||||||
|
|
||||||
/extract/path examples:
|
/extract/path examples:
|
||||||
/FULL/PRODOS/PATH (ProDOS image source)
|
/FULL/PRODOS/PATH (ProDOS image source)
|
||||||
"MY FILENAME" (DOS 3.3 image source)
|
"MY FILENAME" (DOS 3.3 image source)
|
||||||
@@ -125,7 +125,7 @@ def unixDateToADDate(arg1):
|
|||||||
# returns byte position in disk image file
|
# returns byte position in disk image file
|
||||||
def getStartPos(arg1, arg2):
|
def getStartPos(arg1, arg2):
|
||||||
if g.D33:
|
if g.D33:
|
||||||
return (ts(arg1) + (35 * (arg2 % 7)) + 11)
|
return (ts(arg1) + (35 * (arg2 % 7)) + 11)
|
||||||
else: # ProDOS
|
else: # ProDOS
|
||||||
return ( (arg1 * 512) +
|
return ( (arg1 * 512) +
|
||||||
(39 * ((arg2 + (arg2 > 11)) % 13)) +
|
(39 * ((arg2 + (arg2 > 11)) % 13)) +
|
||||||
@@ -154,7 +154,7 @@ def getFileName(arg1, arg2):
|
|||||||
for i in range(0, len(fileName)):
|
for i in range(0, len(fileName)):
|
||||||
if (caseMask[i] == "1"):
|
if (caseMask[i] == "1"):
|
||||||
fileName = (fileName[:i] +
|
fileName = (fileName[:i] +
|
||||||
fileName[i:i+1].lower() +
|
fileName[i:i+1].lower() +
|
||||||
fileName[i+1:])
|
fileName[i+1:])
|
||||||
return fileName
|
return fileName
|
||||||
|
|
||||||
@@ -208,7 +208,7 @@ def getKeyPointer(arg1, arg2):
|
|||||||
start = getStartPos(arg1, arg2)
|
start = getStartPos(arg1, arg2)
|
||||||
if g.D33:
|
if g.D33:
|
||||||
return [readcharDec(g.imageData, start+0),
|
return [readcharDec(g.imageData, start+0),
|
||||||
readcharDec(g.imageData, start+1)]
|
readcharDec(g.imageData, start+1)]
|
||||||
else: # ProDOS
|
else: # ProDOS
|
||||||
return (readcharDec(g.imageData, start+17) +
|
return (readcharDec(g.imageData, start+17) +
|
||||||
readcharDec(g.imageData, start+18)*256)
|
readcharDec(g.imageData, start+18)*256)
|
||||||
@@ -228,7 +228,7 @@ def getFileLength(arg1, arg2):
|
|||||||
elif (fileType == 'FC' or fileType == 'FA'): # BAS (A) or INT (I)
|
elif (fileType == 'FC' or fileType == 'FA'): # BAS (A) or INT (I)
|
||||||
# file length is in first two bytes of file data
|
# file length is in first two bytes of file data
|
||||||
return ((readcharDec(g.imageData, ts(fileStart)+0) +
|
return ((readcharDec(g.imageData, ts(fileStart)+0) +
|
||||||
readcharDec(g.imageData, ts(fileStart)+1)*256) + 2)
|
readcharDec(g.imageData, ts(fileStart)+1)*256) + 2)
|
||||||
else: # TXT (T) or other
|
else: # TXT (T) or other
|
||||||
# sadly, we have to walk the whole file
|
# sadly, we have to walk the whole file
|
||||||
# length is determined by sectors in TSlist, minus wherever
|
# length is determined by sectors in TSlist, minus wherever
|
||||||
@@ -338,7 +338,7 @@ def getWorkingDirName(arg1, arg2=None):
|
|||||||
for i in range(0, len(workingDirName)):
|
for i in range(0, len(workingDirName)):
|
||||||
if (caseMask[i] == "1"):
|
if (caseMask[i] == "1"):
|
||||||
workingDirName = (workingDirName[:i] +
|
workingDirName = (workingDirName[:i] +
|
||||||
workingDirName[i:i+1].lower() +
|
workingDirName[i:i+1].lower() +
|
||||||
workingDirName[i+1:])
|
workingDirName[i+1:])
|
||||||
return workingDirName
|
return workingDirName
|
||||||
|
|
||||||
@@ -399,7 +399,7 @@ def ts(track, sector=None):
|
|||||||
if isinstance(sector, type("".encode("L1").decode("L1"))): # hex-ustr
|
if isinstance(sector, type("".encode("L1").decode("L1"))): # hex-ustr
|
||||||
sector = int(sector, 16)
|
sector = int(sector, 16)
|
||||||
return (track*16*256)+(sector*256)
|
return (track*16*256)+(sector*256)
|
||||||
|
|
||||||
# --- main logic functions
|
# --- main logic functions
|
||||||
|
|
||||||
def copyFile(arg1, arg2):
|
def copyFile(arg1, arg2):
|
||||||
@@ -409,7 +409,7 @@ def copyFile(arg1, arg2):
|
|||||||
# ShrinkIt: directory path / file name
|
# ShrinkIt: directory path / file name
|
||||||
# copies file or dfork to g.outFileData, rfork if any to g.exFileData
|
# copies file or dfork to g.outFileData, rfork if any to g.exFileData
|
||||||
g.activeFileBytesCopied = 0
|
g.activeFileBytesCopied = 0
|
||||||
|
|
||||||
if g.SHK:
|
if g.SHK:
|
||||||
with open(os.path.join(arg1, arg2), 'rb') as infile:
|
with open(os.path.join(arg1, arg2), 'rb') as infile:
|
||||||
g.outFileData += infile.read()
|
g.outFileData += infile.read()
|
||||||
@@ -523,7 +523,7 @@ def processEntry(arg1, arg2):
|
|||||||
getFileLength(arg1, arg2), getAuxType(arg1, arg2),
|
getFileLength(arg1, arg2), getAuxType(arg1, arg2),
|
||||||
getCreationDate(arg1, arg2), getModifiedDate(arg1, arg2))
|
getCreationDate(arg1, arg2), getModifiedDate(arg1, arg2))
|
||||||
'''
|
'''
|
||||||
|
|
||||||
eTargetName = None
|
eTargetName = None
|
||||||
g.exFileData = None
|
g.exFileData = None
|
||||||
g.outFileData = bytearray(b'')
|
g.outFileData = bytearray(b'')
|
||||||
@@ -541,7 +541,7 @@ def processEntry(arg1, arg2):
|
|||||||
|
|
||||||
if (not g.PDOSPATH_INDEX or
|
if (not g.PDOSPATH_INDEX or
|
||||||
g.activeFileName.upper() == g.PDOSPATH_SEGMENT.upper()):
|
g.activeFileName.upper() == g.PDOSPATH_SEGMENT.upper()):
|
||||||
|
|
||||||
# if ProDOS directory, not file
|
# if ProDOS directory, not file
|
||||||
if (not g.SHK and getStorageType(arg1, arg2) == 13):
|
if (not g.SHK and getStorageType(arg1, arg2) == 13):
|
||||||
if not g.PDOSPATH_INDEX:
|
if not g.PDOSPATH_INDEX:
|
||||||
@@ -620,7 +620,7 @@ def processEntry(arg1, arg2):
|
|||||||
writecharsHex(g.exFileData,
|
writecharsHex(g.exFileData,
|
||||||
654,
|
654,
|
||||||
getFileType(arg1, arg2) +
|
getFileType(arg1, arg2) +
|
||||||
getAuxType(arg1, arg2))
|
getAuxType(arg1, arg2))
|
||||||
writechars(g.exFileData, 657, b'pdos')
|
writechars(g.exFileData, 657, b'pdos')
|
||||||
saveFile(ADfilePath, g.exFileData)
|
saveFile(ADfilePath, g.exFileData)
|
||||||
touch(saveName, modifiedDate)
|
touch(saveName, modifiedDate)
|
||||||
@@ -632,7 +632,7 @@ def processEntry(arg1, arg2):
|
|||||||
(g.extractFile and
|
(g.extractFile and
|
||||||
(g.extractFile.lower() == origFileName.lower()))):
|
(g.extractFile.lower() == origFileName.lower()))):
|
||||||
quitNow(0)
|
quitNow(0)
|
||||||
g.targetName = None
|
g.targetName = None
|
||||||
#else:
|
#else:
|
||||||
#print(g.activeFileName + " doesn't match " + g.PDOSPATH_SEGMENT)
|
#print(g.activeFileName + " doesn't match " + g.PDOSPATH_SEGMENT)
|
||||||
|
|
||||||
@@ -791,7 +791,7 @@ def binToDec(arg1):
|
|||||||
# arg: binary string up to 8 bits
|
# arg: binary string up to 8 bits
|
||||||
# out: decimal value
|
# out: decimal value
|
||||||
return to_dec([arg1])
|
return to_dec([arg1])
|
||||||
|
|
||||||
def binToHex(arg1):
|
def binToHex(arg1):
|
||||||
# converts single-byte binary string (8 bits) value to hex
|
# converts single-byte binary string (8 bits) value to hex
|
||||||
# warning: no error checking
|
# warning: no error checking
|
||||||
@@ -994,10 +994,10 @@ def to_bytes(val):
|
|||||||
else:
|
else:
|
||||||
raise Exception(
|
raise Exception(
|
||||||
"to_bytes() requires hex-ustr, int/long, or [bin-ustr]")
|
"to_bytes() requires hex-ustr, int/long, or [bin-ustr]")
|
||||||
|
|
||||||
def shift(items):
|
def shift(items):
|
||||||
"""Shift list items to left, losing the first item.
|
"""Shift list items to left, losing the first item.
|
||||||
|
|
||||||
in : list
|
in : list
|
||||||
out: list
|
out: list
|
||||||
"""
|
"""
|
||||||
@@ -1005,7 +1005,7 @@ def shift(items):
|
|||||||
items[i] = items[i+1]
|
items[i] = items[i+1]
|
||||||
del items[-1]
|
del items[-1]
|
||||||
return items
|
return items
|
||||||
|
|
||||||
def s(string):
|
def s(string):
|
||||||
"""Perform local variable substution, e.g. 'total: {num} items'"""
|
"""Perform local variable substution, e.g. 'total: {num} items'"""
|
||||||
# http://stackoverflow.com/questions/2960772/
|
# http://stackoverflow.com/questions/2960772/
|
||||||
@@ -1101,14 +1101,14 @@ while True: # breaks when there are no more arguments starting with dash
|
|||||||
|
|
||||||
if (len(args) == 1):
|
if (len(args) == 1):
|
||||||
usage()
|
usage()
|
||||||
|
|
||||||
if (slyce(args[1],0,1) != "-"):
|
if (slyce(args[1],0,1) != "-"):
|
||||||
break
|
break
|
||||||
|
|
||||||
if (args[1] == "-s"):
|
if (args[1] == "-s"):
|
||||||
g.nomsg = 1
|
g.nomsg = 1
|
||||||
args = args[1:] #shift
|
args = args[1:] #shift
|
||||||
|
|
||||||
elif (args[1] == "-n"):
|
elif (args[1] == "-n"):
|
||||||
g.nodir = 1
|
g.nodir = 1
|
||||||
args = args[1:] #shift
|
args = args[1:] #shift
|
||||||
@@ -1121,7 +1121,7 @@ while True: # breaks when there are no more arguments starting with dash
|
|||||||
g.AD = 1
|
g.AD = 1
|
||||||
g.PNAME = 1
|
g.PNAME = 1
|
||||||
args = args[1:] #shift
|
args = args[1:] #shift
|
||||||
|
|
||||||
elif (args[1] == "-shk"):
|
elif (args[1] == "-shk"):
|
||||||
g.SHK = 1
|
g.SHK = 1
|
||||||
args = args[1:] #shift
|
args = args[1:] #shift
|
||||||
@@ -1191,7 +1191,7 @@ else:
|
|||||||
if not os.path.isdir(args[2]):
|
if not os.path.isdir(args[2]):
|
||||||
print("Target directory not found.")
|
print("Target directory not found.")
|
||||||
quitNow(2)
|
quitNow(2)
|
||||||
|
|
||||||
if g.SHK:
|
if g.SHK:
|
||||||
g.PNAME = 0
|
g.PNAME = 0
|
||||||
if not g.CAT:
|
if not g.CAT:
|
||||||
@@ -1284,7 +1284,7 @@ if g.SHK:
|
|||||||
quitNow(0)
|
quitNow(0)
|
||||||
|
|
||||||
# end script if SHK
|
# end script if SHK
|
||||||
|
|
||||||
g.imageData = loadFile(g.imageFile)
|
g.imageData = loadFile(g.imageFile)
|
||||||
|
|
||||||
# detect if image is 2mg and remove 64-byte header if so
|
# detect if image is 2mg and remove 64-byte header if so
|
||||||
@@ -1345,7 +1345,7 @@ if (len(g.imageData) == 143360):
|
|||||||
#print("saving fixed order file as outfile.dsk")
|
#print("saving fixed order file as outfile.dsk")
|
||||||
#saveFile("outfile.dsk", g.imageData)
|
#saveFile("outfile.dsk", g.imageData)
|
||||||
#print("saved")
|
#print("saved")
|
||||||
|
|
||||||
if not prodosDisk and not g.D33:
|
if not prodosDisk and not g.D33:
|
||||||
print("Warning: Unable to determine disk format, assuming ProDOS.")
|
print("Warning: Unable to determine disk format, assuming ProDOS.")
|
||||||
|
|
||||||
|
@@ -387,7 +387,7 @@ fi
|
|||||||
|
|
||||||
if [[ $slot6 ]]; then
|
if [[ $slot6 ]]; then
|
||||||
echo "Putting blank disks in slot 6..."
|
echo "Putting blank disks in slot 6..."
|
||||||
sudo sed -i 's@^s6d1.*$@s6d1 = $imagesDir/slot6drive1.po@' /usr/local/lib/$configFileName
|
sudo sed -i 's@^s6d1.*$@s6d1 = $imagesDir/slot6drive1.po@' /usr/local/lib/$configFileName
|
||||||
sudo sed -i 's@^s6d2.*$@s6d2 = $imagesDir/slot6drive2.po@' /usr/local/lib/$configFileName
|
sudo sed -i 's@^s6d2.*$@s6d2 = $imagesDir/slot6drive2.po@' /usr/local/lib/$configFileName
|
||||||
if [[ ! -f $imagesDir/slot6drive1.po || ! -f $imagesDir/slot6drive2.po ]]; then
|
if [[ ! -f $imagesDir/slot6drive1.po || ! -f $imagesDir/slot6drive2.po ]]; then
|
||||||
wget -qO- ${binaryURL}slot6.tgz | sudo tar Pzx 2> /dev/null
|
wget -qO- ${binaryURL}slot6.tgz | sudo tar Pzx 2> /dev/null
|
||||||
@@ -467,7 +467,7 @@ if [[ ! -f $imagesDir/INSTALL.HDV ]] \
|
|||||||
REPLY="y"
|
REPLY="y"
|
||||||
if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then
|
if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then
|
||||||
|
|
||||||
echo
|
echo
|
||||||
activeDisk=0
|
activeDisk=0
|
||||||
for diskname in Install System.Disk SystemTools1 SystemTools2 Fonts synthLAB; do
|
for diskname in Install System.Disk SystemTools1 SystemTools2 Fonts synthLAB; do
|
||||||
(( activeDisk++ ))
|
(( activeDisk++ ))
|
||||||
@@ -497,7 +497,7 @@ if [[ ! -f $imagesDir/INSTALL.HDV ]] \
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
rm *.sea* &> /dev/null
|
rm *.sea* &> /dev/null
|
||||||
|
|
||||||
if [[ ! -f $imagesDir/"$gsosHD" ]]; then
|
if [[ ! -f $imagesDir/"$gsosHD" ]]; then
|
||||||
echo "Creating 32 MB blank image at $imagesDir/$gsosHD..."
|
echo "Creating 32 MB blank image at $imagesDir/$gsosHD..."
|
||||||
if [[ -f /usr/local/bin/acmd ]]; then
|
if [[ -f /usr/local/bin/acmd ]]; then
|
||||||
@@ -525,7 +525,7 @@ if [[ ! -f $imagesDir/INSTALL.HDV ]] \
|
|||||||
acmd -convert $gsosHD.shk $imagesDir/"$gsosHD" 65535
|
acmd -convert $gsosHD.shk $imagesDir/"$gsosHD" 65535
|
||||||
echo 3
|
echo 3
|
||||||
rm "PRODOS#"* "GSHK#"* "TEACH#"* $gsosHD.shk &> /dev/null
|
rm "PRODOS#"* "GSHK#"* "TEACH#"* $gsosHD.shk &> /dev/null
|
||||||
|
|
||||||
acmd -n $imagesDir/"$gsosHD" $gsosHDvolName
|
acmd -n $imagesDir/"$gsosHD" $gsosHDvolName
|
||||||
dd bs=512 count=1 conv=notrunc if="$imagesDir/INSTALL.HDV" of="$imagesDir/$gsosHD" 2> /dev/null
|
dd bs=512 count=1 conv=notrunc if="$imagesDir/INSTALL.HDV" of="$imagesDir/$gsosHD" 2> /dev/null
|
||||||
sudo chmod ugo+rw $imagesDir/"$gsosHD"
|
sudo chmod ugo+rw $imagesDir/"$gsosHD"
|
||||||
@@ -539,7 +539,7 @@ if [[ ! -f $imagesDir/INSTALL.HDV ]] \
|
|||||||
echo "s7d1 = $imagesDir/$gsosHD" | tee -a /usr/local/lib/$configFileName > /dev/null
|
echo "s7d1 = $imagesDir/$gsosHD" | tee -a /usr/local/lib/$configFileName > /dev/null
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $(grep ^g_limit_speed /usr/local/lib/$configFileName) ]]; then
|
if [[ $(grep ^g_limit_speed /usr/local/lib/$configFileName) ]]; then
|
||||||
sudo sed -i "s:^g_limit_speed.*$:g_limit_speed = 0:" /usr/local/lib/$configFileName
|
sudo sed -i "s:^g_limit_speed.*$:g_limit_speed = 0:" /usr/local/lib/$configFileName
|
||||||
else
|
else
|
||||||
@@ -551,26 +551,26 @@ if [[ ! -f $imagesDir/INSTALL.HDV ]] \
|
|||||||
echo "Downloading GS-ShrinkIt..."
|
echo "Downloading GS-ShrinkIt..."
|
||||||
wget -qO- http://web.archive.org/web/20131031160750/http://nulib.com/library/gshk11.sea | acmd -p $imagesDir/$gsosHD GS.SHRINKIT.SEA S16
|
wget -qO- http://web.archive.org/web/20131031160750/http://nulib.com/library/gshk11.sea | acmd -p $imagesDir/$gsosHD GS.SHRINKIT.SEA S16
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Spectrum starts here
|
# Spectrum starts here
|
||||||
|
|
||||||
if [[ ! $kegs ]]; then
|
if [[ ! $kegs ]]; then
|
||||||
|
|
||||||
mkdir -p $tempDir/spectrum
|
mkdir -p $tempDir/spectrum
|
||||||
cd $tempDir/spectrum
|
cd $tempDir/spectrum
|
||||||
|
|
||||||
imageName="$tempDir/spectrum/spectrum.dmg"
|
imageName="$tempDir/spectrum/spectrum.dmg"
|
||||||
hfsName="$tempDir/spectrum/spectrumH.dmg"
|
hfsName="$tempDir/spectrum/spectrumH.dmg"
|
||||||
ullName="$tempDir/spectrum/uthernet.bxy"
|
ullName="$tempDir/spectrum/uthernet.bxy"
|
||||||
|
|
||||||
if [[ ! -f /usr/bin/hcopy || ! -f /usr/bin/macsave ]]; then
|
if [[ ! -f /usr/bin/hcopy || ! -f /usr/bin/macsave ]]; then
|
||||||
echo "Installing HFS utilities..."
|
echo "Installing HFS utilities..."
|
||||||
sudo apt-get -y install hfsutils macutils &> /dev/null
|
sudo apt-get -y install hfsutils macutils &> /dev/null
|
||||||
else
|
else
|
||||||
echo "HFS utilities are already installed."
|
echo "HFS utilities are already installed."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -f /usr/local/adtpro/lib/AppleCommander/AppleCommander-1.3.5.13id-ac.jar ]]; then
|
if [[ ! -f /usr/local/adtpro/lib/AppleCommander/AppleCommander-1.3.5.13id-ac.jar ]]; then
|
||||||
echo "Installing AppleCommander..."
|
echo "Installing AppleCommander..."
|
||||||
sudo mkdir -p /usr/local/adtpro/lib/AppleCommander
|
sudo mkdir -p /usr/local/adtpro/lib/AppleCommander
|
||||||
@@ -578,21 +578,21 @@ if [[ ! -f $imagesDir/INSTALL.HDV ]] \
|
|||||||
rm /usr/local/adtpro/lib/AppleCommander/AppleCommander-ac.jar &> /dev/null
|
rm /usr/local/adtpro/lib/AppleCommander/AppleCommander-ac.jar &> /dev/null
|
||||||
ln -s AppleCommander-1.3.5.13id-ac.jar /usr/local/adtpro/lib/AppleCommander/AppleCommander-ac.jar
|
ln -s AppleCommander-1.3.5.13id-ac.jar /usr/local/adtpro/lib/AppleCommander/AppleCommander-ac.jar
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -f "$imageName" ]]; then
|
if [[ ! -f "$imageName" ]]; then
|
||||||
echo "Downloading Spectrum Deluxe..."
|
echo "Downloading Spectrum Deluxe..."
|
||||||
wget -qO spectrum.dmg http://www.wannop.info/speccie/software/spectrum_2.5.3_deluxe.dmg
|
wget -qO spectrum.dmg http://www.wannop.info/speccie/software/spectrum_2.5.3_deluxe.dmg
|
||||||
else
|
else
|
||||||
echo "Spectrum Deluxe has already been downloaded."
|
echo "Spectrum Deluxe has already been downloaded."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p mnt
|
mkdir -p mnt
|
||||||
mkdir -p extract
|
mkdir -p extract
|
||||||
mkdir -p shkstage
|
mkdir -p shkstage
|
||||||
cp "$imageName" "$hfsName"
|
cp "$imageName" "$hfsName"
|
||||||
sudo mount -r -t hfs "$imageName" mnt
|
sudo mount -r -t hfs "$imageName" mnt
|
||||||
hmount "$hfsName"
|
hmount "$hfsName"
|
||||||
|
|
||||||
IFS=''
|
IFS=''
|
||||||
cd $tempDir/spectrum/mnt
|
cd $tempDir/spectrum/mnt
|
||||||
find Spectrum.2.5.3 -type d | while read thisDirPath; do
|
find Spectrum.2.5.3 -type d | while read thisDirPath; do
|
||||||
@@ -639,30 +639,30 @@ if [[ ! -f $imagesDir/INSTALL.HDV ]] \
|
|||||||
done
|
done
|
||||||
cd $tempDir/spectrum/mnt
|
cd $tempDir/spectrum/mnt
|
||||||
done
|
done
|
||||||
|
|
||||||
cd $tempDir/spectrum/shkstage/Spectrum*
|
cd $tempDir/spectrum/shkstage/Spectrum*
|
||||||
humount
|
humount
|
||||||
sudo umount $tempDir/spectrum/mnt
|
sudo umount $tempDir/spectrum/mnt
|
||||||
|
|
||||||
mkdir -p Marinetti/Uthernet
|
mkdir -p Marinetti/Uthernet
|
||||||
cp SAFE2.Archive/Link.Layers/"Uthernet#bc4083" Marinetti/Uthernet
|
cp SAFE2.Archive/Link.Layers/"Uthernet#bc4083" Marinetti/Uthernet
|
||||||
echo -n "After installing Marinetti, put Uthernet in the TCPIP folder of your System folder, and restart GS/OS. Then open Control Panels, choose TCP/IP, and choose Setup Connection. Choose Uthernet for the link layer. Under Primary Domain Name Server, enter 8.8.8.8, then click Configure and select Slot 3 and DHCP. Then click Save." > Marinetti/Uthernet/"Uthernet.README#040000"
|
echo -n "After installing Marinetti, put Uthernet in the TCPIP folder of your System folder, and restart GS/OS. Then open Control Panels, choose TCP/IP, and choose Setup Connection. Choose Uthernet for the link layer. Under Primary Domain Name Server, enter 8.8.8.8, then click Configure and select Slot 3 and DHCP. Then click Save." > Marinetti/Uthernet/"Uthernet.README#040000"
|
||||||
|
|
||||||
echo "Making archive for conversion to disk image..."
|
echo "Making archive for conversion to disk image..."
|
||||||
rm $tempDir/spectrum/spectrum.shk 2> /dev/null
|
rm $tempDir/spectrum/spectrum.shk 2> /dev/null
|
||||||
nulib2 -a -r -0 -e $tempDir/spectrum/spectrum.shk * &> /dev/null
|
nulib2 -a -r -0 -e $tempDir/spectrum/spectrum.shk * &> /dev/null
|
||||||
echo "Converting archive to disk image..."
|
echo "Converting archive to disk image..."
|
||||||
acmd -convert $tempDir/spectrum/spectrum.shk $imagesDir/spectrum.hdv 20480
|
acmd -convert $tempDir/spectrum/spectrum.shk $imagesDir/spectrum.hdv 20480
|
||||||
acmd -n $imagesDir/spectrum.hdv SPECTRUM.DELUXE
|
acmd -n $imagesDir/spectrum.hdv SPECTRUM.DELUXE
|
||||||
|
|
||||||
if [[ $(grep ^s7d7 /usr/local/lib/$configFileName) ]]; then
|
if [[ $(grep ^s7d7 /usr/local/lib/$configFileName) ]]; then
|
||||||
sudo sed -i "s:^s7d7.*$:s7d7 = $imagesDir/spectrum.hdv:" /usr/local/lib/$configFileName
|
sudo sed -i "s:^s7d7.*$:s7d7 = $imagesDir/spectrum.hdv:" /usr/local/lib/$configFileName
|
||||||
else
|
else
|
||||||
echo "s7d7 = $imagesDir/spectrum.hdv" | tee -a /usr/local/lib/$configFileName > /dev/null
|
echo "s7d7 = $imagesDir/spectrum.hdv" | tee -a /usr/local/lib/$configFileName > /dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd $tempDir
|
cd $tempDir
|
||||||
|
|
||||||
rm -rf $tempDir/spectrum/extract $tempDir/spectrum/shkstage $tempDir/spectrum/spectrum.shk $tempDir/spectrum/mnt &> /dev/null
|
rm -rf $tempDir/spectrum/extract $tempDir/spectrum/shkstage $tempDir/spectrum/spectrum.shk $tempDir/spectrum/mnt &> /dev/null
|
||||||
fi
|
fi
|
||||||
# Spectrum ends here
|
# Spectrum ends here
|
||||||
@@ -698,7 +698,7 @@ fi
|
|||||||
echo "When it's done, reboot."
|
echo "When it's done, reboot."
|
||||||
echo "(Use Shut Down, ctrl-F12, or ctrl-solidapple-equals.)"
|
echo "(Use Shut Down, ctrl-F12, or ctrl-solidapple-equals.)"
|
||||||
if [[ -f "$imagesDir/spectrum.hdv" ]]; then
|
if [[ -f "$imagesDir/spectrum.hdv" ]]; then
|
||||||
echo
|
echo
|
||||||
echo "Then on the Spectrum disk, optionally install:"
|
echo "Then on the Spectrum disk, optionally install:"
|
||||||
echo "Marinetti (plus update): TCP/IP driver for GS/OS"
|
echo "Marinetti (plus update): TCP/IP driver for GS/OS"
|
||||||
echo "Uthernet: Ethernet driver for Marinetti"
|
echo "Uthernet: Ethernet driver for Marinetti"
|
||||||
|
@@ -563,7 +563,7 @@ if [[ $installADTPro ]]; then
|
|||||||
wget -qO /usr/local/adtpro/adtpro.sh "${scriptURL}setup/adtpro.sh.txt"
|
wget -qO /usr/local/adtpro/adtpro.sh "${scriptURL}setup/adtpro.sh.txt"
|
||||||
sudo chmod ugo+rwx /usr/local/adtpro/adtpro.sh
|
sudo chmod ugo+rwx /usr/local/adtpro/adtpro.sh
|
||||||
|
|
||||||
### ADTPro: Replace A2CLOUD's disks with the ones ...
|
### ADTPro: Replace A2CLOUD's disks with the ones ...
|
||||||
### FIXME: where are these created/downloaded to move?
|
### FIXME: where are these created/downloaded to move?
|
||||||
if [[ $updateADTPro ]]; then
|
if [[ $updateADTPro ]]; then
|
||||||
echo "A2CLOUD: Replacing disks folder..."
|
echo "A2CLOUD: Replacing disks folder..."
|
||||||
@@ -597,7 +597,7 @@ if [[ $installADTPro ]]; then
|
|||||||
else
|
else
|
||||||
sharePath=/media/A2SHARED
|
sharePath=/media/A2SHARED
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -d ${sharePath}/ADTDISKS || ! $(grep ADTDISKS /usr/local/etc/netatalk/AppleVolumes.default) ]]; then
|
if [[ ! -d ${sharePath}/ADTDISKS || ! $(grep ADTDISKS /usr/local/etc/netatalk/AppleVolumes.default) ]]; then
|
||||||
echo "A2CLOUD: Setting up /usr/local/adtpro/disks for Apple file sharing..."
|
echo "A2CLOUD: Setting up /usr/local/adtpro/disks for Apple file sharing..."
|
||||||
if [[ ! -d ${sharePath}/ADTDISKS ]]; then
|
if [[ ! -d ${sharePath}/ADTDISKS ]]; then
|
||||||
@@ -1288,7 +1288,7 @@ if [[ -f /usr/bin/X ]]; then
|
|||||||
fi
|
fi
|
||||||
if [[ ! -f /usr/local/share/gsport32.ico ]]; then
|
if [[ ! -f /usr/local/share/gsport32.ico ]]; then
|
||||||
sudo wget -qO /usr/local/share/gsport32.ico ${binaryURL}gsport32.ico
|
sudo wget -qO /usr/local/share/gsport32.ico ${binaryURL}gsport32.ico
|
||||||
fi
|
fi
|
||||||
# LinApple:
|
# LinApple:
|
||||||
if [[ -f /usr/local/bin/linapple ]]; then
|
if [[ -f /usr/local/bin/linapple ]]; then
|
||||||
echo -e "[Desktop Entry]\nName=LinApple\nComment=Apple IIe Emulator\nExec=lxterminal -e /usr/local/bin/linapple\nIcon=/usr/local/linapple/icon.bmp\nTerminal=false\nType=Application\nCategories=AppleII\n" | sudo tee /usr/share/raspi-ui-overrides/linapple.desktop > ~/Desktop/linapple.desktop
|
echo -e "[Desktop Entry]\nName=LinApple\nComment=Apple IIe Emulator\nExec=lxterminal -e /usr/local/bin/linapple\nIcon=/usr/local/linapple/icon.bmp\nTerminal=false\nType=Application\nCategories=AppleII\n" | sudo tee /usr/share/raspi-ui-overrides/linapple.desktop > ~/Desktop/linapple.desktop
|
||||||
|
Reference in New Issue
Block a user