Merge branch 'ivanx-1.5.x'

Ivan added support to build everything on Debian/Raspbian stretch, added
some alternate URLs, and updated the "just how the hell do you install
Marinetti right now exactly?" dance.

This was more frustrating to merge than it honestly should've been and
I'm kinda responsible for some of that, but it's never gonna get easier
to maintain unless we break from the single-developer monolithic blocks.

Hopefully this will be the last time we do things this way.
This commit is contained in:
T. Joseph Carter 2018-04-09 18:51:26 -07:00
commit 45c00cb920
7 changed files with 153 additions and 81 deletions

View File

@ -23,15 +23,14 @@ wget -O files/external/appleii/PPPX.1.3d4.SHK http://www.apple2.org/marinetti/PP
wget -O files/external/appleii/dsk2file.shk http://www.dwheeler.com/6502/oneelkruns/dsk2file.zip wget -O files/external/appleii/dsk2file.shk http://www.dwheeler.com/6502/oneelkruns/dsk2file.zip
wget -O files/external/appleii/gshk11.sea http://www.nulib.com/library/gshk11.sea wget -O files/external/appleii/gshk11.sea http://www.nulib.com/library/gshk11.sea
wget -O files/external/appleii/shrinkit.sdk http://www.nulib.com/library/shrinkit.sdk wget -O files/external/appleii/shrinkit.sdk http://www.nulib.com/library/shrinkit.sdk
wget -O files/external/appleii/spectrum_gold_2mg.zip http://www.speccie.co.uk/speccie/software/spectrum_gold_2mg.zip wget -O files/external/appleii/spectrum_gold_2mg.zip http://speccie.uk/speccie/downloads/spectrum_gold_2mg.zip
wget -O files/external/appleii/uthernet2ll.bxy http://www.speccie.co.uk/speccie/software/uthernet2ll.bxy wget -O files/external/appleii/uthernet2ll.bxy http://speccie.uk/speccie/downloads/uthernet2ll.bxy
wget -O files/external/appleii/uthernetll.bxy http://www.speccie.co.uk/speccie/software/uthernetll.bxy wget -O files/external/appleii/uthernetll.bxy http://speccie.uk/speccie/downloads/uthernetll.bxy
unset safeUrl samUrl snapUrl safeVer samVer snapVer unset safeUrl samUrl snapUrl
html=$(wget -qO- http://speccie.co.uk/speccie/Site/Download_Centre_files/widget1_markup.html) safeUrl=$(wget -qO- http://speccie.uk/software/safe2/ | grep -i 'safe2.*bxy' | tr '<>' '\n' | grep href | cut -d '=' -f 2 | tr -d '"')
safeUrl=$(echo "$html" | grep -i 'safe2.*bxy' | tr '<>' '\n' | grep href | cut -d '=' -f 2 | tr -d '"') samUrl=$(wget -qO- http://speccie.uk/software/sam2/ | grep -i 'sam2.*bxy' | tr '<>' '\n' | grep href | cut -d '=' -f 2 | tr -d '"')
samUrl=$(echo "$html" | grep -i 'sam2.*bxy' | tr '<>' '\n' | grep href | cut -d '=' -f 2 | tr -d '"') snapUrl=$(wget -qO- http://speccie.uk/software/snap/ | grep -i 'snap.*bxy' | tr '<>' '\n' | grep href | cut -d '=' -f 2 | tr -d '"')
snapUrl=$(echo "$html" | grep -i 'snap.*bxy' | tr '<>' '\n' | grep href | cut -d '=' -f 2 | tr -d '"')
wget -O files/external/appleii/safe2.bxy "$safeUrl" wget -O files/external/appleii/safe2.bxy "$safeUrl"
wget -O files/external/appleii/sam2.bxy "$samUrl" wget -O files/external/appleii/sam2.bxy "$samUrl"
wget -O files/external/appleii/snap.bxy "$snapUrl" wget -O files/external/appleii/snap.bxy "$snapUrl"

View File

@ -36,10 +36,18 @@ fi
debianName=$(lsb_release -cs) debianName=$(lsb_release -cs)
# skip this if already done # enable SSH (disabled by default in Raspbian from late 2016 onward)
if [[ $isRpi ]] && ! ps aux | grep -q '[s]shd'; then
echo "A2SERVER: Enabling ssh access..."
sudo systemctl enable ssh &> /dev/null && sudo systemctl start ssh &> /dev/null
else
echo "A2SERVER: ssh access is already enabled."
fi
if [[ -f /usr/local/etc/A2SERVER-version ]]; then if [[ -f /usr/local/etc/A2SERVER-version ]]; then
read a2sVersion </usr/local/etc/A2SERVER-version read a2sVersion </usr/local/etc/A2SERVER-version
fi fi
# If A2SERVER 101 or greater is installed, we already did this and can skip it.
if [[ "$a2sVersion" != *.*.* && "$a2sVersion" -lt 101 ]]; then if [[ "$a2sVersion" != *.*.* && "$a2sVersion" -lt 101 ]]; then
echo "A2SERVER: Installing Netatalk (this will take a while)..." echo "A2SERVER: Installing Netatalk (this will take a while)..."
# stop Netatalk and samba if running (during upgrade) # stop Netatalk and samba if running (during upgrade)
@ -61,15 +69,18 @@ if [[ "$a2sVersion" != *.*.* && "$a2sVersion" -lt 101 ]]; then
if [[ $(apt-cache search '^libdb5.1$') ]]; then # Wheezy if [[ $(apt-cache search '^libdb5.1$') ]]; then # Wheezy
# Dependencies: netatalk 2.2.4 # Dependencies: netatalk 2.2.4
sudo apt-get -y install libdb5.1 sudo apt-get -y install libdb5.1
elif [[ $(apt-cache search '^libdb5.3$') ]]; then # Jessie elif [[ $(apt-cache search '^libdb5.3$') ]]; then # Jessie or Stretch
# Dependencies: netatalk 2.2.4 # Dependencies: netatalk 2.2.4
sudo apt-get -y install libdb5.3 sudo apt-get -y install libdb5.3
else else
break break
fi fi
if [[ $(apt-cache search '^libssl1.0.0$') ]]; then if [[ $(apt-cache search '^libssl1.0.0$') ]]; then # Wheezy or Jessie
# Dependencies: netatalk 2.2.4 # Dependencies: netatalk 2.2.4
sudo apt-get -y install libssl1.0.0 sudo apt-get -y install libssl1.0.0
elif [[ $(apt-cache search '^libssl1.0.2$') ]]; then # Stretch
# Dependencies: netatalk 2.2.4
sudo apt-get -y install libssl1.0.2
else else
break break
fi fi
@ -77,7 +88,7 @@ if [[ "$a2sVersion" != *.*.* && "$a2sVersion" -lt 101 ]]; then
if [[ $(apt-cache search '^libgcrypt11$') ]]; then # Wheezy if [[ $(apt-cache search '^libgcrypt11$') ]]; then # Wheezy
# Dependencies: netatalk 2.2.4 # Dependencies: netatalk 2.2.4
sudo apt-get -y install libgcrypt11 sudo apt-get -y install libgcrypt11
elif [[ $(apt-cache search '^libgcrypt20$') ]]; then # Jessie elif [[ $(apt-cache search '^libgcrypt20$') ]]; then # Jessie or Stretch
# Dependencies: netatalk 2.2.4 # Dependencies: netatalk 2.2.4
sudo apt-get -y install libgcrypt20 sudo apt-get -y install libgcrypt20
else else
@ -97,11 +108,23 @@ if [[ "$a2sVersion" != *.*.* && "$a2sVersion" -lt 101 ]]; then
if [[ $compileFromSource ]]; then if [[ $compileFromSource ]]; then
# Dependencies: build-deps for netatalk 2.2.4 # Dependencies: build-deps for netatalk 2.2.4
sudo apt-get -y install build-essential libssl-dev sudo apt-get -y install build-essential
if [[ $(apt-cache search '^libssl1.0-dev$') ]]; then # Stretch
if [[ $(dpkg -l | grep libssl-dev | tr -s ' ' | cut -d ' ' -f 3 | cut -c 1-3) == "1.1" ]]; then
echo "A2SERVER: WARNING: libssl-dev will be removed to install libssl1.0-dev"
fi
# Note the libssl1.0-dev package will go away; we need a 1.1 patch
# Dependencies: build-deps for netatalk 2.2.4
sudo apt-get -y install libssl1.0-dev libssl-dev-
else # probably Jessie or Wheezy
# Dependencies: build-deps for netatalk 2.2.4
sudo apt-get -y install libssl-dev
fi
if [[ $(apt-cache search '^libdb5.1-dev$') ]]; then # Wheezy if [[ $(apt-cache search '^libdb5.1-dev$') ]]; then # Wheezy
# Dependencies: build-deps for netatalk 2.2.4 # Dependencies: build-deps for netatalk 2.2.4
sudo apt-get -y install libdb5.1-dev sudo apt-get -y install libdb5.1-dev
elif [[ $(apt-cache search '^libdb5.3-dev$') ]]; then # Jessie elif [[ $(apt-cache search '^libdb5.3-dev$') ]]; then # Jessie or Stretch
# Dependencies: build-deps for netatalk 2.2.4 # Dependencies: build-deps for netatalk 2.2.4
sudo apt-get -y install libdb5.3-dev sudo apt-get -y install libdb5.3-dev
else else
@ -109,7 +132,7 @@ if [[ "$a2sVersion" != *.*.* && "$a2sVersion" -lt 101 ]]; then
# Dependencies: build-deps for netatalk 2.2.4 # Dependencies: build-deps for netatalk 2.2.4
sudo apt-get -y install libdb-dev sudo apt-get -y install libdb-dev
fi fi
if [[ $(apt-cache search '^libgcrypt11-dev$') ]]; then # Jessie or Wheezy if [[ $(apt-cache search '^libgcrypt11-dev$') ]]; then # Wheezy, Jessie, Stretch
# Dependencies: build-deps for netatalk 2.2.4 # Dependencies: build-deps for netatalk 2.2.4
sudo apt-get -y install libgcrypt11-dev sudo apt-get -y install libgcrypt11-dev
else else
@ -181,16 +204,16 @@ if ! hash macipgw &>/dev/null; then
# note: topdir will be macipgw-<full hash>, EEK! # note: topdir will be macipgw-<full hash>, EEK!
# note: .tar.gz also works # note: .tar.gz also works
if [[ $useExternalURL ]]; then if [[ $useExternalURL ]]; then
wget -qO macipgw.zip "https://github.com/zero2sixd/macipgw/archive/cc544d8.zip" wget -qO macipgw.zip "https://github.com/zero2sixd/macipgw/archive/4f77c09.zip"
unzip macipgw.zip 2> /dev/null unzip macipgw.zip 2> /dev/null
rm macipgw.zip &> /dev/null rm macipgw.zip &> /dev/null
fi fi
if [[ ! -d macipgw-master ]]; then if [[ ! -d macipgw-* ]]; then
wget -qO macipgw.zip "${a2sBinaryURL}/source/macipgw-cc544d8.zip" wget -qO macipgw.zip "${a2sBinaryURL}/source/macipgw-4f77c09.zip"
unzip macipgw.zip 2> /dev/null unzip macipgw.zip 2> /dev/null
rm macipgw.zip &> /dev/null rm macipgw.zip &> /dev/null
fi fi
cd macipgw* cd macipgw-*
make make
sudo make install sudo make install
cd "$wd" cd "$wd"
@ -394,6 +417,9 @@ if ! hash ciopfs &> /dev/null; then
cd /tmp/ciopfs cd /tmp/ciopfs
if [[ $useExternalURL ]]; then if [[ $useExternalURL ]]; then
wget -q -O ciopfs-0.4.tar.gz "http://www.brain-dump.org/projects/ciopfs/ciopfs-0.4.tar.gz" wget -q -O ciopfs-0.4.tar.gz "http://www.brain-dump.org/projects/ciopfs/ciopfs-0.4.tar.gz"
if (( $? != 0 )); then
wget -q -O ciopfs-0.4.tar.gz http://web.archive.org/web/20160911102924/http://www.brain-dump.org/projects/ciopfs/ciopfs-0.4.tar.gz
fi
tar zxf ciopfs-0.4.tar.gz &> /dev/null tar zxf ciopfs-0.4.tar.gz &> /dev/null
fi fi
if [ ! -f ciopfs*/ciopfs.c ]; then # single brackets required for glob if [ ! -f ciopfs*/ciopfs.c ]; then # single brackets required for glob
@ -407,6 +433,9 @@ if ! hash ciopfs &> /dev/null; then
rm -rf /tmp/ciopfs rm -rf /tmp/ciopfs
fi fi
if ! grep -q '^ciopfs' /etc/fstab; then if ! grep -q '^ciopfs' /etc/fstab; then
# http://www.brain-dump.org/projects/ciopfs/ recommends:
# /data/projects/ciopfs/data /data/projects/ciopfs/mnt ciopfs allow_other,default_permissions,use_ino,attr_timeout=0 0 0
# Really should check the docs on that
echo "ciopfs#/srv/A2SERVER/.a2files /srv/A2SERVER/A2FILES fuse allow_other 0 0" | sudo tee -a /etc/fstab > /dev/null echo "ciopfs#/srv/A2SERVER/.a2files /srv/A2SERVER/A2FILES fuse allow_other 0 0" | sudo tee -a /etc/fstab > /dev/null
fi fi
if ! mount | grep '^ciopfs.*A2FILES'; then if ! mount | grep '^ciopfs.*A2FILES'; then
@ -517,6 +546,7 @@ if [[ -f "/lib/modules/$kernelRelease/kernel/drivers/net/appletalk/ipddp.ko" ]];
else else
# if we didn't load it successfully, remove it # if we didn't load it successfully, remove it
sudo rm /lib/modules/$kernelRelease/kernel/net/appletalk/appletalk.ko 2> /dev/null sudo rm /lib/modules/$kernelRelease/kernel/net/appletalk/appletalk.ko 2> /dev/null
echo "A2SERVER: failed to load AppleTalk kernel module"
fi fi
fi fi
fi fi

View File

@ -33,6 +33,7 @@ diskToolsP8Dir=$p8Dir/Disk.Tools.P8
commDir="/srv/A2SERVER/A2FILES/Comm" commDir="/srv/A2SERVER/A2FILES/Comm"
gsosURL="http://download.info.apple.com/Apple_Support_Area/Apple_Software_Updates/English-North_American/Apple_II/Apple_IIGS_System_6.0.1/" gsosURL="http://download.info.apple.com/Apple_Support_Area/Apple_Software_Updates/English-North_American/Apple_II/Apple_IIGS_System_6.0.1/"
# alernate: http://web.archive.org/web/20080907081050/http://download.info.apple.com/Apple_Support_Area/Apple_Software_Updates/English-North_American/Apple_II/Apple_IIGS_System_6.0.1/
gsosBackupURL="http://archive.org/download/download.info.apple.com.2012.11/download.info.apple.com.2012.11.zip/download.info.apple.com%2FApple_Support_Area%2FApple_Software_Updates%2FEnglish-North_American%2FApple_II%2FApple_IIGS_System_6.0.1%2F" gsosBackupURL="http://archive.org/download/download.info.apple.com.2012.11/download.info.apple.com.2012.11.zip/download.info.apple.com%2FApple_Support_Area%2FApple_Software_Updates%2FEnglish-North_American%2FApple_II%2FApple_IIGS_System_6.0.1%2F"
# --- bashByter library routines # --- bashByter library routines
@ -138,11 +139,11 @@ updateP8YearTables () {
patched=0 # 0 is true in this case since it's the return value patched=0 # 0 is true in this case since it's the return value
while (( $i < ${#files[@]} )); do while (( $i < ${#files[@]} )); do
[[ ! -f "${files[$i]}" ]] && { (( i++ )); continue; } [[ ! -f "${files[$i]}" ]] && { (( i++ )); continue; }
if [[ ! $patch1 || $patch1 != $(sudo dd if="${files[$i]}" skip=${offset1[$i]} bs=1 count=7 2> /dev/null) ]]; then if [[ ! $patch1 || $patch1 != $(sudo dd if="${files[$i]}" skip=${offset1[$i]} bs=1 count=7 2> /dev/null | tr -d '\0') ]]; then
patched=1 # 1 is false patched=1 # 1 is false
break break
fi fi
if [[ ! $patch2 || $patch2 != $(sudo dd if="${files[$i]}" skip=${offset2[$i]} bs=1 count=9 2> /dev/null) ]]; then if [[ ! $patch2 || $patch2 != $(sudo dd if="${files[$i]}" skip=${offset2[$i]} bs=1 count=9 2> /dev/null | tr -d '\0') ]]; then
patched=1 # 1 is false patched=1 # 1 is false
break break
fi fi
@ -404,8 +405,8 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then
fi fi
# delete previously downloaded installer # delete previously downloaded installer
rm "$imagesDir/* $imagesDir/.AppleDouble"/* 2> /dev/null rm -f "$imagesDir/* $imagesDir/.AppleDouble"/*
rm "$netInstallDir/* $netInstallDir/.AppleDouble"/* 2> /dev/null rm -f "$netInstallDir/* $netInstallDir/.AppleDouble"/*
afpsync -v $gsosDir > /dev/null afpsync -v $gsosDir > /dev/null
for diskname in ${diskNames[@]}; do for diskname in ${diskNames[@]}; do
@ -490,10 +491,8 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then
elif [[ $action == 3 || $action == 4 ]]; then elif [[ $action == 3 || $action == 4 ]]; then
if [[ -f "$targetPath" ]]; then if [[ -f "$targetPath" ]]; then
echo "deleting $targetPath" echo "deleting $targetPath"
rm "$targetPath" rm -f "$targetPath"
if [[ -f $targetParent/.AppleDouble/$targetFile ]]; then rm -f "$targetParent/.AppleDouble/$targetFile"
rm "$targetParent/.AppleDouble/$targetFile"
fi
fi fi
fi fi
(( entryIndex++ )) (( entryIndex++ ))
@ -592,6 +591,9 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then
cd /tmp/netboot cd /tmp/netboot
if [[ $useExternalURL ]]; then if [[ $useExternalURL ]]; then
wget -qO Asimov.shk "http://www.ninjaforce.com/downloads/Asimov.shk" wget -qO Asimov.shk "http://www.ninjaforce.com/downloads/Asimov.shk"
if (( $? != 0 )); then
wget -qO Asimov.shk "http://web.archive.org/web/20160330184627/http://www.ninjaforce.com/downloads/Asimov.shk"
fi
nulib2 -x -s Asimov.shk &> /dev/null nulib2 -x -s Asimov.shk &> /dev/null
fi fi
if [[ ! -d Asimov ]]; then if [[ ! -d Asimov ]]; then
@ -696,6 +698,9 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then
if [[ $useExternalURL ]]; then if [[ $useExternalURL ]]; then
# This should not be .zip *sigh* # This should not be .zip *sigh*
wget -q -O dsk2file.shk "http://www.dwheeler.com/6502/oneelkruns/dsk2file.zip" wget -q -O dsk2file.shk "http://www.dwheeler.com/6502/oneelkruns/dsk2file.zip"
if (( $? != 0 )); then
wget -q -O dsk2file.shk http://web.archive.org/web/20120726132356/http://www.dwheeler.com/6502/oneelkruns/dsk2file.zip
fi
nulib2 -x -s dsk2file.shk &> /dev/null nulib2 -x -s dsk2file.shk &> /dev/null
fi fi
if [[ ! -f DSK2FILE58 ]]; then if [[ ! -f DSK2FILE58 ]]; then
@ -780,17 +785,15 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then
unset safeUrl samUrl snapUrl safeVer samVer snapVer unset safeUrl samUrl snapUrl safeVer samVer snapVer
if [[ $useExternalURL ]]; then if [[ $useExternalURL ]]; then
html=$(wget -qO- "http://speccie.co.uk/speccie/Site/Download_Centre_files/widget1_markup.html") safeUrl=$(wget -qO- http://speccie.uk/software/safe2/ | grep -i 'safe2.*bxy' | tr '<>' '\n' | grep href | cut -d '=' -f 2 | tr -d '"')
safeUrl=$(echo "$html" | grep -i 'safe2.*bxy' | tr '<>' '\n' | grep href | cut -d '=' -f 2 | tr -d '"') samUrl=$(wget -qO- http://speccie.uk/software/sam2/ | grep -i 'sam2.*bxy' | tr '<>' '\n' | grep href | cut -d '=' -f 2 | tr -d '"')
samUrl=$(echo "$html" | grep -i 'sam2.*bxy' | tr '<>' '\n' | grep href | cut -d '=' -f 2 | tr -d '"') snapUrl=$(wget -qO- http://speccie.uk/software/snap/ | grep -i 'snap.*bxy' | tr '<>' '\n' | grep href | cut -d '=' -f 2 | tr -d '"')
snapUrl=$(echo "$html" | grep -i 'snap.*bxy' | tr '<>' '\n' | grep href | cut -d '=' -f 2 | tr -d '"')
safeVer=$(echo $safeUrl | rev | cut -d '/' -f 1 | cut -d '.' -f 2 | rev | cut -c 5- | sed 's/./.&/g' | cut -c 2-) safeVer=$(echo $safeUrl | rev | cut -d '/' -f 1 | cut -d '.' -f 2 | rev | cut -c 5- | sed 's/./.&/g' | cut -c 2-)
samVer=$(echo $samUrl | rev | cut -d '/' -f 1 | cut -d '.' -f 2 | rev | cut -c 4- | sed 's/./.&/g' | cut -c 2-) samVer=$(echo $samUrl | rev | cut -d '/' -f 1 | cut -d '.' -f 2 | rev | cut -c 4- | sed 's/./.&/g' | cut -c 2-)
snapVer=$(echo $snapUrl | rev | cut -d '/' -f 1 | cut -d '.' -f 2 | rev | cut -c 5- | sed 's/./.&/g' | cut -c 2-) snapVer=$(echo $snapUrl | rev | cut -d '/' -f 1 | cut -d '.' -f 2 | rev | cut -c 5- | sed 's/./.&/g' | cut -c 2-)
spectrumVer=$(echo "$html" | grep 'Spectrum.*Gold.2mg' | tr '<>' '\n' | grep '^Spectrum.*2mg$' | cut -d ' ' -f 2)
fi fi
echo -n "Spectrum $spectrumVer" echo -n "Spectrum"
# get Spectrum # get Spectrum
if [[ -f $commDir/Spectrum/Spectrum ]]; then if [[ -f $commDir/Spectrum/Spectrum ]]; then
echo " is already installed." echo " is already installed."
@ -847,6 +850,9 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then
# Marinetti 3.0b1 -- had to repackage because installer is GS/OS self-contained app # Marinetti 3.0b1 -- had to repackage because installer is GS/OS self-contained app
wget -qO MarinettiB1.SHK "${a2sBinaryURL}/appleii/MarinettiB1.SHK" wget -qO MarinettiB1.SHK "${a2sBinaryURL}/appleii/MarinettiB1.SHK"
if (( $? != 0 )); then
wget -qO Marinetti3.0b8.po http://web.archive.org/web/20171105043713/http://a2retrosystems.com/downloads/Marinetti3.0b8.po
fi
cppo -ad -s -n MarinettiB1.SHK $gsosDir > /dev/null cppo -ad -s -n MarinettiB1.SHK $gsosDir > /dev/null
# TCP/IP update (3.0b8) # TCP/IP update (3.0b8)
@ -862,6 +868,9 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then
# PPP Scripted Link Layer update (1.3d4) # PPP Scripted Link Layer update (1.3d4)
if [[ $useExternalURL ]]; then if [[ $useExternalURL ]]; then
wget -qO PPPX.1.3d4.SHK "http://www.apple2.org/marinetti/PPPX.1.3d4.SHK" wget -qO PPPX.1.3d4.SHK "http://www.apple2.org/marinetti/PPPX.1.3d4.SHK"
if (( $? != 0 )); then
wget -qO PPPX.1.3d4.SHK http://web.archive.org/web/20160331231844/http://www.apple2.org/marinetti/PPPX.1.3d4.SHK
fi
fi fi
if [[ $? != 0 || ! -f PPPX.1.3d4.SHK || $(wc -c < PPPX.1.3d4.SHK) != "22068" ]]; then if [[ $? != 0 || ! -f PPPX.1.3d4.SHK || $(wc -c < PPPX.1.3d4.SHK) != "22068" ]]; then
wget -qO PPPX.1.3d4.SHK "${a2sBinaryURL}/appleii/PPPX.1.3d4.SHK" wget -qO PPPX.1.3d4.SHK "${a2sBinaryURL}/appleii/PPPX.1.3d4.SHK"
@ -908,13 +917,13 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then
cd /tmp/netboot/safe2 cd /tmp/netboot/safe2
if [[ $useExternalURL ]]; then if [[ $useExternalURL ]]; then
if [[ ! $safeUrl ]]; then if [[ ! $safeUrl ]]; then
safeUrl="http://www.speccie.co.uk/speccie/software/safe229.bxy" safeUrl="http://www.speccie.co.uk/speccie/software/safe230.bxy"
fi fi
wget -qO safe2.bxy "$safeUrl" wget -qO safe2.bxy "$safeUrl"
cppo -s -ad safe2.bxy . &> /dev/null cppo -s -ad safe2.bxy . &> /dev/null
fi fi
if [[ ! -f SAFE2.Archive/Safe2 ]]; then if [[ ! -f SAFE2.Archive/Safe2 ]]; then
wget -qO safe2.bxy "${a2sBinaryURL}/appleii/safe229.bxy" wget -qO safe2.bxy "${a2sBinaryURL}/appleii/safe230.bxy"
cppo -s -ad safe2.bxy . &> /dev/null cppo -s -ad safe2.bxy . &> /dev/null
fi fi
cd SAFE2.Archive cd SAFE2.Archive

View File

@ -158,7 +158,7 @@ readchars () {
&& ( $3 -ge 0 ) ]] || return 23; } && ( $3 -ge 0 ) ]] || return 23; }
# args are valid # args are valid
dd if="$1" bs=1 skip=$(($2)) $([[ $3 ]] && echo -n "count=$3") \ dd if="$1" bs=1 skip=$(($2)) $([[ $3 ]] && echo -n "count=$3") \
2> /dev/null 2> /dev/null | tr -d ' \0'
} }
readcharDec () { readcharDec () {
@ -175,7 +175,7 @@ readcharDec () {
&& ( $2 -ge 0 ) ]] || return 22; } && ( $2 -ge 0 ) ]] || return 22; }
# args are valid # args are valid
charX="$(dd if="$1" bs=1 skip=$(($2)) \ charX="$(dd if="$1" bs=1 skip=$(($2)) \
count=1 2> /dev/null; echo -n X)" count=1 2> /dev/null | tr -d '\0'; echo -n X)"
[[ ${#charX} -gt 1 ]] || { echo -n 0; return 0; } [[ ${#charX} -gt 1 ]] || { echo -n 0; return 0; }
echo -n "${charX:0:1}" | od -t u1 | \ echo -n "${charX:0:1}" | od -t u1 | \
head -1 | sed 's/[0\ ]*//' | tr -d ' \n' head -1 | sed 's/[0\ ]*//' | tr -d ' \n'
@ -195,7 +195,7 @@ readcharHex () {
&& ( $2 -ge 0 ) ]] || return 22; } && ( $2 -ge 0 ) ]] || return 22; }
# args are valid # args are valid
charX="$(dd if="$1" bs=1 skip=$(($2)) \ charX="$(dd if="$1" bs=1 skip=$(($2)) \
count=1 2> /dev/null; echo -n X)" count=1 2> /dev/null | tr -d '\0'; echo -n X)"
[[ ${#charX} -gt 1 ]] || { echo -n "00"; return 0; } [[ ${#charX} -gt 1 ]] || { echo -n "00"; return 0; }
printf %02X $(echo -n "${charX:0:1}" | od -t u1 | \ printf %02X $(echo -n "${charX:0:1}" | od -t u1 | \
head -1 | sed 's/[0\ ]*//' | tr -d ' \n') head -1 | sed 's/[0\ ]*//' | tr -d ' \n')

View File

@ -6,7 +6,7 @@
# netatalk configured for Apple II use on Debian or Raspbian. # netatalk configured for Apple II use on Debian or Raspbian.
# more info is at http://ivanx.com/a2server # more info is at http://ivanx.com/a2server
a2serverVersion="1.5.1" a2serverVersion="1.5.2"
a2sScriptURL="https://raw.githubusercontent.com/RasppleII/a2server/master" a2sScriptURL="https://raw.githubusercontent.com/RasppleII/a2server/master"
a2sDevel="$( dirname "${BASH_SOURCE[0]}" )/.." a2sDevel="$( dirname "${BASH_SOURCE[0]}" )/.."
@ -148,9 +148,6 @@ while [[ $1 ]]; do
echo "-b: auto-setup network boot (use with -y)" echo "-b: auto-setup network boot (use with -y)"
echo "-w: auto-setup Windows file sharing (use with -y)" echo "-w: auto-setup Windows file sharing (use with -y)"
echo "-c: compile non-package items, rather than downloading binaries" echo "-c: compile non-package items, rather than downloading binaries"
if [[ $isRpi ]]; then
echo "-os: update Raspbian OS, A2CLOUD, A2SERVER, and Apple II Pi"
fi
if [[ $0 == "-bash" ]]; then if [[ $0 == "-bash" ]]; then
return 1 return 1
else else
@ -170,9 +167,8 @@ fi
a2server_update=0 a2server_update=0
doSetup=1 doSetup=1
if a2sCmpInstalled lt 1.5.0; then if a2sCmpInstalled lt 1.5.2; then
a2server_update=1 a2server_update=1
fi
unsupportedOS=1 unsupportedOS=1
if [[ $isRpi ]]; then #supported Raspbian? (16-Feb-15, 20-Jun-14, 09-Jan-14, etc) if [[ $isRpi ]]; then #supported Raspbian? (16-Feb-15, 20-Jun-14, 09-Jan-14, etc)
@ -180,22 +176,26 @@ if [[ $isRpi ]]; then #supported Raspbian? (16-Feb-15, 20-Jun-14, 09-Jan-14, etc
fwsupported="-8aca5762- -462f3e3f476f7b6- -c32bc633039cd9- -9d34d0475f9- fwsupported="-8aca5762- -462f3e3f476f7b6- -c32bc633039cd9- -9d34d0475f9-
-d4f5315cfac4e- -6f4a90c8cb8817f- -5dd9b4962e- -17c8799375- -d4f5315cfac4e- -6f4a90c8cb8817f- -5dd9b4962e- -17c8799375-
-960832a6c2590635216c296b6ee0bebf67b21d50- -960832a6c2590635216c296b6ee0bebf67b21d50-
-2a329e0c7d8ea19c085bac5633aa4fccee0f21be-" -2a329e0c7d8ea19c085bac5633aa4fccee0f21be-
[[ "$fwsupported" == *-$fwhash-* ]] && unsupportedOS= -b2420fc150ae4616f5d9ec24bdaedc630586a529-"
if [[ "$fwsupported" == *-$fwhash-* ]]; then
unsupportedOS=
fi
elif [[ $isDebian ]]; then # supported Debian? elif [[ $isDebian ]]; then # supported Debian?
debianVersion=$(cat /etc/debian_version) debianVersion=$(cat /etc/debian_version)
debianSupported="-8.2- -7.9- -7.8- -7.6- -7.3-" debianSupported="-9.2- -8.2- -7.9- -7.8- -7.6- -7.3-"
[[ $debianSupported == *-$debianVersion-* ]] && unsupportedOS= [[ $debianSupported == *-$debianVersion-* ]] && unsupportedOS=
fi fi
if [[ $unsupportedOS && $isRpi ]]; then if [[ $unsupportedOS && $isRpi ]]; then
echo echo
echo "A2SERVER and its installer scripts have been tested on Raspbian Wheezy and" echo "A2SERVER and its installer scripts have been tested on Raspbian Wheezy and"
echo "Jessie, though not this specific firmware version ($fwhash). Just FYI." echo "Jessie, though not this specific firmware version"
echo "(${fwhash:0:7}). Just FYI."
unsupportedOS= unsupportedOS=
elif [[ $unsupportedOS && $isDebian ]]; then elif [[ $unsupportedOS && $isDebian ]]; then
echo echo
echo "A2SERVER and its installer scripts have been tested on Debian 7 and 8," echo "A2SERVER and its installer scripts have been tested on Debian 7/8/9,"
echo "though not this specific point release ($debianVersion). Just FYI." echo "though not this specific point release ($debianVersion). Just FYI."
unsupportedOS= unsupportedOS=
fi fi
@ -239,33 +239,36 @@ if (( $doSetup )); then
rm -rf /tmp/a2server-install &>/dev/null rm -rf /tmp/a2server-install &>/dev/null
mkdir -p /tmp/a2server-install mkdir -p /tmp/a2server-install
isApple2Pw= checkPw=1
isRaspberryPw= while [[ $checkPw ]] ; do
userPw=$(sudo grep "^$USER" /etc/shadow | cut -f 2 -d ':') userPw=$(sudo grep "^$USER" /etc/shadow | cut -f 2 -d ':')
[[ $userPw == "$(echo 'apple2' | perl -e '$_ = <STDIN>; chomp; print crypt($_, $ARGV[0])' "${userPw%"${userPw#\$*\$*\$}"}")" ]] && isApple2Pw=1 [[ $userPw == "$(echo 'apple2' | perl -e '$_ = <STDIN>; chomp; print crypt($_, $ARGV[0])' "${userPw%"${userPw#\$*\$*\$}"}")" ]] && isApple2Pw=1 || isApple2Pw=
[[ $userPw == "$(echo 'raspberry' | perl -e '$_ = <STDIN>; chomp; print crypt($_, $ARGV[0])' "${userPw%"${userPw#\$*\$*\$}"}")" ]] && isRaspberryPw=1 [[ $userPw == "$(echo 'raspberry' | perl -e '$_ = <STDIN>; chomp; print crypt($_, $ARGV[0])' "${userPw%"${userPw#\$*\$*\$}"}")" ]] && isRaspberryPw=1 || isRaspberryPw=
password="your password" password="your password"
[[ $isApple2Pw ]] && password="'apple2'" [[ $isApple2Pw ]] && password="'apple2'"
[[ $isRaspberryPw ]] && password="'raspberry'" [[ $isRaspberryPw ]] && password="'raspberry'"
checkPw=
[[ $isRpi ]] && a2server="your Raspberry Pi" || a2server="A2SERVER" [[ $isRpi ]] && a2server="your Raspberry Pi" || a2server="A2SERVER"
if [[ ! $isApple2Pw && ! -f /usr/local/etc/A2SERVER-version ]]; then if [[ ! $isApple2Pw && ! -f /usr/local/etc/A2SERVER-version ]]; then
if [[ ! $autoAnswerYes ]]; then if [[ ! $autoAnswerYes ]]; then
echo echo
echo "To ensure that all client computers are able to connect to" echo "To ensure that all client computers are able to connect to"
echo "${a2server} using the same password, you probably want" echo "${a2server} using the same password, you probably want"
echo "to change your user password to 'apple2'." echo "to change your user password to 'apple2'."
echo echo
echo -n "Do you want to change the password for user '$USER' to 'apple2' now? " echo -n "Do you want to change the password for user '$USER' to 'apple2' now? "
read read
fi
if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then
echo "A2SERVER: changing password for user '$USER' to 'apple2'..."
echo "$USER:apple2" | sudo chpasswd
fi
fi fi
if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then done
echo "A2SERVER: changing password for user '$USER' to 'apple2'..."
echo "$USER:apple2" | sudo chpasswd
fi
fi
echo echo
echo "During this installation, enter ${password} if prompted for passwords." echo "During this installation, enter ${password} if prompted for passwords."
@ -273,9 +276,6 @@ if (( $doSetup )); then
sudo true sudo true
echo
echo "A2SERVER: Downloading scripts..."
read -d '' a2sSubScripts <<-EOF read -d '' a2sSubScripts <<-EOF
a2server-1-storage.txt a2server-1-storage.txt
a2server-2-tools.txt a2server-2-tools.txt
@ -288,6 +288,8 @@ if (( $doSetup )); then
if [[ -n "$a2sDevel" ]]; then if [[ -n "$a2sDevel" ]]; then
a2sScriptDir="$a2sDevel/scripts" a2sScriptDir="$a2sDevel/scripts"
else else
echo
echo "A2SERVER: Downloading scripts..."
a2sScriptDir="/tmp/a2server-install/scripts" a2sScriptDir="/tmp/a2server-install/scripts"
mkdir -p "$a2sScriptDir" mkdir -p "$a2sScriptDir"
for _script in $a2sSubScripts; do for _script in $a2sSubScripts; do
@ -299,7 +301,14 @@ if (( $doSetup )); then
fi fi
if [[ $installAll ]]; then if [[ $installAll ]]; then
sudo rm -f /usr/local/etc/A2SERVER-version /usr/local/bin/nulib2 /usr/local/bin/unar /usr/local/sbin/macipgw /usr/local/bin/ciopfs /usr/local/etc/netatalk/afppasswd /usr/local/etc/netatalk/a2boot/p8 /usr/local/etc/netatalk/a2boot/ProDOS16\ Image sudo rm -f /usr/local/etc/A2SERVER-version
sudo rm -f /usr/local/bin/nulib2
sudo rm -f /usr/local/bin/unar
sudo rm -f /usr/local/sbin/macipgw
sudo rm -f /usr/local/bin/ciopfs
sudo rm -f /usr/local/etc/netatalk/afppasswd
sudo rm -f /usr/local/etc/netatalk/a2boot/p8
sudo rm -f /usr/local/etc/netatalk/a2boot/ProDOS16\ Image
fi fi
for _script in $a2sSubScripts; do for _script in $a2sSubScripts; do
@ -314,10 +323,7 @@ if (( $doSetup )); then
rm -f /tmp/a2server-packageReposUpdated rm -f /tmp/a2server-packageReposUpdated
if [[ ! -f /usr/local/etc/A2SERVER-version ]] \ echo "$a2serverVersion" | sudo tee /usr/local/etc/A2SERVER-version &> /dev/null
|| (( $(head -c 3 /usr/local/etc/A2SERVER-version) < ${a2serverVersion:0:3} )); then
echo "$a2serverVersion" | sudo tee /usr/local/etc/A2SERVER-version &> /dev/null
fi
source /usr/local/etc/a2serverrc source /usr/local/etc/a2serverrc

View File

@ -98,4 +98,22 @@
[unannounced] [unannounced]
1.5.1: May 2016: changed URLs from rawgit.com to raw.githubusercontent.com 1.5.1: May 2016: changed URLs from rawgit.com to raw.githubusercontent.com
to resolve https problems during install to resolve https problems during install; OS X temp dir
path corrected; added getexternal.sh to repo;
cppo changes; minor text changes (JTC); better Debian
version checking (JTC)
[unannounced]
1.5.1r2: Oct 2017: set internal version to 1.5.1; expanded version history
[unannounced]
1.5.2: Nov 2017: support for Stretch; suppress null byte read warnings in
Bash 4.4; enable SSH server on Raspberry Pi if disabled;
use Internet Archive backup URL's for external downloads if
possible; compile AppleTalk kernel if -c flag is
specified (rather than downloading); better cleanup after
AppleTalk kernel compile; notification if AppleTalk kernel
module doesn't load; fixed download links for comm software;
bug fixes when compiling macipgw and ciopfs;
os option (Raspbian update) removed from a2server-setup

View File

@ -70,6 +70,16 @@
1.5.0r2: Jan 16: fixed GitHub URLs to prevent https errors during installation 1.5.0r2: Jan 16: fixed GitHub URLs to prevent https errors during installation
(thanks to http://blogs.yahoo.co.jp/ushi_cow/57459736.html) (thanks to http://blogs.yahoo.co.jp/ushi_cow/57459736.html)
1.5.1: Jan 2016: fixed GitHub URLs to prevent https errors during installation
(thanks to http://blogs.yahoo.co.jp/ushi_cow/57459736.html);
bug fixes and minor text changes
1.5.1r2: Oct 2017: corrected version number
1.5.2: Nov 2017: support for Debian/Raspbian Stretch; fixes minor bugs during
install; enable SSH server if disabled on Raspberry Pi; fixes
changed download links for GS/OS communication software
Big thanks to: Anthony Martino, Henry Courbis, Joseph Carter, Jason King, Big thanks to: Anthony Martino, Henry Courbis, Joseph Carter, Jason King,
Andy McFadden, Steven Hirsch, Geoff Body, Peter Wong, Tony Diaz, David Schmidt, Andy McFadden, Steven Hirsch, Geoff Body, Peter Wong, Tony Diaz, David Schmidt,
David Schmenk, Ewen Wannop, Andrew Roughan, Antoine Vignau, Martin Haye, David Schmenk, Ewen Wannop, Andrew Roughan, Antoine Vignau, Martin Haye,