mirror of
https://github.com/RasppleII/a2server.git
synced 2024-06-12 22:29:28 +00:00
Merge branch '1.3.0-dev'
This commit is contained in:
commit
b5496b55aa
15
README.md
15
README.md
|
@ -13,18 +13,19 @@ relatively modern piece of it. As such they should be preserved as they are.
|
|||
|
||||
## Developer note
|
||||
|
||||
To use the scripts on a server other than Ivan's, you need to do two things.
|
||||
First, the server needs to be modified to serve setup/index.txt and
|
||||
update/index.txt the same way they would serve index.html. How you do that is
|
||||
beyond the scope of this repository for the moment. Secondly, you'll want to
|
||||
set the shell variable A2SERVER_SCRIPT_URL to the base URL of this repository
|
||||
To use the scripts on a server other than Ivan's, you'll want to export
|
||||
the shell variable A2SERVER_SCRIPT_URL to the base URL of this repository
|
||||
on your server. The base-URL should be slash-terminated. You can then run
|
||||
the following snippet:
|
||||
|
||||
~~~ bash
|
||||
wget a2server-setup ${A2SERVER_SCRIPT_URL}setup/; source a2server-setup
|
||||
~~~bash
|
||||
wget -O a2server-setup ${A2SERVER_SCRIPT_URL}setup/index.txt; source a2server-setup
|
||||
~~~
|
||||
|
||||
A simple method for installing from a local subdirectory is to 'cd' to it and
|
||||
then type 'python -m SimpleHTTPServer'. Then export A2SERVER_SCRIPT_URL to
|
||||
"http://localhost:8000/" or use the IP address of the host machine on your LAN.
|
||||
|
||||
You should probably export A2SERVER_SCRIPT_URL in your .bashrc or whatever
|
||||
file configures your development environment. Also be advised that as of
|
||||
version 1.24 of A2SERVER, you must use the snippet above.
|
||||
|
|
|
@ -34,7 +34,7 @@ behavior like invisible files.
|
|||
|
||||
Unix-type computers can also use `scp` to copy files to and from A2SERVER;
|
||||
Windows computers can also do so in the command window by using `pscp` in
|
||||
[PuTTY][1]. The shared volumes are within /media/A2SHARED.
|
||||
[PuTTY][1]. The shared volumes are within /srv/A2SERVER.
|
||||
|
||||
If you need to set the ProDOS file type of a file you have copied to A2SERVER,
|
||||
[log in to A2SERVER](a2server_commands.md) and use `afptype`.
|
||||
|
|
|
@ -26,7 +26,7 @@ The default username is either "pi" for Raspberry Pi, and otherwise
|
|||
standard installation of Raspbian; you can use the
|
||||
[installer script](a2server_installer.md) to install A2SERVER.)
|
||||
|
||||
Shared volumes can be found at /media/A2SHARED. Netatalk configuration files
|
||||
Shared volumes can be found at /srv/A2SERVER. Netatalk configuration files
|
||||
are in /usr/local/etc/netatalk.
|
||||
|
||||
Once logged in, you can enter the following commands.
|
||||
|
|
|
@ -21,7 +21,7 @@ themselves):
|
|||
|
||||
[Storage setup](scripts/a2server-1-storage.txt) (runs during initial setup, skipped on subsequent runs)
|
||||
|
||||
* Make the /media/A2SHARED directory
|
||||
* Make the /srv/A2SERVER directory
|
||||
|
||||
|
||||
[A2SERVER tools install](scripts/a2server-2-tools.txt) (always runs)
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
|
||||
# skip if we're already set up
|
||||
if [[ -d /media/A2SHARED ]]; then
|
||||
if [[ -d /srv/A2SERVER ]]; then
|
||||
|
||||
echo "A2SERVER: Shared disk is already prepared for use."
|
||||
|
||||
|
@ -12,8 +12,8 @@ else
|
|||
|
||||
echo "A2SERVER: Preparing the shared files disk..."
|
||||
|
||||
sudo mkdir /media/A2SHARED
|
||||
sudo mkdir /srv/A2SERVER
|
||||
|
||||
sudo chown $USER:$USER /media/A2SHARED
|
||||
sudo chown $USER:$USER /srv/A2SERVER
|
||||
|
||||
fi
|
|
@ -213,7 +213,7 @@ fi
|
|||
sudo sed -i \
|
||||
's/^#share1/\/media\/A2SHARED\/GSFILES\ GSFILES ea:ad/' \
|
||||
/usr/local/etc/netatalk/AppleVolumes.default
|
||||
[[ -d /media/A2SHARED/GSFILES ]] || mkdir -p /media/A2SHARED/GSFILES
|
||||
[[ -d /srv/A2SERVER/GSFILES ]] || mkdir -p /srv/A2SERVER/GSFILES
|
||||
|
||||
# set up A2FILES share (for ProDOS 8 files, and GS/OS system)
|
||||
# file names must be ProDOS 8 compliant (all caps, 15 chars, letters/numbers/periods only)
|
||||
|
@ -222,9 +222,9 @@ sudo sed -i \
|
|||
sudo sed -i \
|
||||
's/^#share2/\/media\/A2SHARED\/A2FILES\ A2FILES options:prodos\ casefold:toupper ea:ad/' \
|
||||
/usr/local/etc/netatalk/AppleVolumes.default
|
||||
[[ -d /media/A2SHARED/A2FILES ]] || mkdir -p /media/A2SHARED/A2FILES
|
||||
if [[ ! -d /media/A2SHARED/A2FILES/.AppleDesktop ]]; then
|
||||
cd /media/A2SHARED/A2FILES
|
||||
[[ -d /srv/A2SERVER/A2FILES ]] || mkdir -p /srv/A2SERVER/A2FILES
|
||||
if [[ ! -d /srv/A2SERVER/A2FILES/.AppleDesktop ]]; then
|
||||
cd /srv/A2SERVER/A2FILES
|
||||
mkdir .AppleDesktop
|
||||
ln -s .AppleDesktop .APPLEDESKTOP
|
||||
fi
|
||||
|
@ -232,11 +232,11 @@ fi
|
|||
# set up ADTDISKS share (ADTPro disk image folder, if A2CLOUD is installed)
|
||||
# classic Mac OS file names are allowed (31 chars, mixed case, everything but colons)
|
||||
if [[ -d /usr/local/adtpro/disks ]]; then # A2CLOUD/ADTPro installed
|
||||
if [[ ! -d /media/A2SHARED/ADTDISKS ]]; then
|
||||
ln -s /usr/local/adtpro/disks /media/A2SHARED/ADTDISKS
|
||||
if [[ ! -d /srv/A2SERVER/ADTDISKS ]]; then
|
||||
ln -s /usr/local/adtpro/disks /srv/A2SERVER/ADTDISKS
|
||||
fi
|
||||
if [[ ! $(grep ADTDISKS /usr/local/etc/netatalk/AppleVolumes.default) ]]; then
|
||||
sudo sed -i 's@^# End of File@/media/A2SHARED/ADTDISKS ADTDISKS ea:ad\n\n# End of File@' /usr/local/etc/netatalk/AppleVolumes.default
|
||||
sudo sed -i 's@^# End of File@/srv/A2SERVER/ADTDISKS ADTDISKS ea:ad\n\n# End of File@' /usr/local/etc/netatalk/AppleVolumes.default
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
|
@ -6,15 +6,15 @@
|
|||
# program (for Apple IIe users, and IIgs users in ProDOS network mode).
|
||||
# It also can download and install GS/OS for a network boot configuration.
|
||||
|
||||
gsosDir="/media/A2SHARED/A2FILES"
|
||||
gsosDir="/srv/A2SERVER/A2FILES"
|
||||
imagesDir=$gsosDir/GSOS.INSTALLER/IMAGES
|
||||
imageToolsDir=$gsosDir/GSOS.INSTALLER/IMAGE.TOOLS
|
||||
netInstallDir=$gsosDir/GSOS.INSTALLER/NET.INSTALL
|
||||
|
||||
p8Dir="/media/A2SHARED/A2FILES"
|
||||
p8Dir="/srv/A2SERVER/A2FILES"
|
||||
diskToolsP8Dir=$p8Dir/DISK.TOOLS.P8
|
||||
|
||||
commDir="/media/A2SHARED/A2FILES/COMM"
|
||||
commDir="/srv/A2SERVER/A2FILES/COMM"
|
||||
spectrumDir=$commDir/SPECTRUM
|
||||
protermDir=$commDir/PROTERM
|
||||
zlinkDir=$commDir/Z.LINK
|
||||
|
@ -116,7 +116,7 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then
|
|||
mkatinit -gs -d -f # GS/OS registered user and Guest starts up with SYSTEM/FINDER
|
||||
mkatinit -d -f guest # ProDOS 8 Guest starts up with BASIC.SYSTEM (no registered user)
|
||||
|
||||
if [[ -f "/media/A2SHARED/A2FILES/SYSTEM/START.GS.OS" ]]; then
|
||||
if [[ -f "/srv/A2SERVER/A2FILES/SYSTEM/START.GS.OS" ]]; then
|
||||
echo "A2SERVER: GS/OS has already been downloaded and installed."
|
||||
gsosInstall=1
|
||||
else
|
||||
|
|
|
@ -62,7 +62,7 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupWindowsSharing ]]; then
|
|||
echo "A2SERVER: $sharename is already set up for Windows file sharing."
|
||||
else
|
||||
echo "[$sharename]" | sudo tee -a /etc/samba/smb.conf > /dev/null
|
||||
echo " path = /media/A2SHARED/$sharename" | sudo tee -a /etc/samba/smb.conf > /dev/null
|
||||
echo " path = /srv/A2SERVER/$sharename" | sudo tee -a /etc/samba/smb.conf > /dev/null
|
||||
echo " browsable = yes" | sudo tee -a /etc/samba/smb.conf > /dev/null
|
||||
echo " guest ok = yes" | sudo tee -a /etc/samba/smb.conf > /dev/null
|
||||
echo " read only = no" | sudo tee -a /etc/samba/smb.conf > /dev/null
|
||||
|
|
|
@ -47,8 +47,8 @@ alias appletalk-on='sudo sed -i "s/ATALKD_RUN=no/ATALKD_RUN=yes/" /etc/default/n
|
|||
|
||||
|
||||
NETATALK="/usr/local/etc/netatalk"
|
||||
A2FILES="/media/A2SHARED/A2FILES"
|
||||
GSFILES="/media/A2SHARED/GSFILES"
|
||||
A2FILES="/srv/A2SERVER/A2FILES"
|
||||
GSFILES="/srv/A2SERVER/GSFILES"
|
||||
|
||||
alias netboot-gsos="mkatinit -gs -d -f"
|
||||
alias netboot-gsos-guest="mkatinit -gs -d -f guest"
|
||||
|
@ -70,9 +70,9 @@ alias samba-start='[[ $(lsb_release -d 2> /dev/null | grep Ubuntu) ]] && { sudo
|
|||
alias samba-restart='[[ $(lsb_release -d 2> /dev/null | grep Ubuntu) ]] && { sudo initctl restart smbd; sudo initctl restart nmbd; } || { sudo /etc/init.d/samba restart; }'
|
||||
|
||||
alias gsfiles-share="sudo sed -i 's/^\/media\/A2SHARED\/GSFILES\ GSFILES options:prodos/#share1/' /usr/local/etc/netatalk/AppleVolumes.default"
|
||||
alias gsfiles-unshare="sudo sed -i 's/^#share1/\/media\/A2SHARED\/GSFILES\ GSFILES options:prodos/' /usr/local/etc/netatalk/AppleVolumes.default; [[ -d /media/A2SHARED/GSFILES ]] || mkdir /media/A2SHARED/GSFILES"
|
||||
alias gsfiles-unshare="sudo sed -i 's/^#share1/\/media\/A2SHARED\/GSFILES\ GSFILES options:prodos/' /usr/local/etc/netatalk/AppleVolumes.default; [[ -d /srv/A2SERVER/GSFILES ]] || mkdir /srv/A2SERVER/GSFILES"
|
||||
alias a2files-share="sudo sed -i 's/^\/media\/A2SHARED\/A2FILES\ A2FILES options:prodos\ casefold:toupper/#share2/' /usr/local/etc/netatalk/AppleVolumes.default"
|
||||
alias a2files-unshare="sudo sed -i 's/^#share2/\/media\/A2SHARED\/A2FILES\ A2FILES options:prodos\ casefold:toupper/' /usr/local/etc/netatalk/AppleVolumes.default; [[ -d /media/A2SHARED/A2FILES ]] || mkdir /media/A2SHARED/A2FILES"
|
||||
alias a2files-unshare="sudo sed -i 's/^#share2/\/media\/A2SHARED\/A2FILES\ A2FILES options:prodos\ casefold:toupper/' /usr/local/etc/netatalk/AppleVolumes.default; [[ -d /srv/A2SERVER/A2FILES ]] || mkdir /srv/A2SERVER/A2FILES"
|
||||
|
||||
alias showalias="alias | cut -d= -f 1 | cut -d' ' -f2 | more"
|
||||
|
||||
|
|
|
@ -3,18 +3,29 @@
|
|||
|
||||
# --- Setting up the share volume
|
||||
|
||||
# 1.3.0: move /media/A2SHARED (pre-1.3.0) to /srv/A2SERVER
|
||||
if [[ -d /media/A2SHARED ]]; then
|
||||
echo "A2SERVER: Moving /media/A2SHARED to /srv/A2SERVER..."
|
||||
sudo /etc/init.d/netatalk stop &> /dev/null
|
||||
sudo /etc/init.d/samba stop &> /dev/null
|
||||
[[ ! -d /srv ]] && sudo mkdir -p /srv
|
||||
sudo mv /media/A2SHARED /srv/A2SERVER
|
||||
sudo sed -i 's|/media/A2SHARED|/srv/A2SERVER|g' /usr/local/etc/netatalk/AppleVolumes.default
|
||||
[[ -f /etc/samba/smbd.conf ]] && sudo sed -i 's|/media/A2SHARED|/srv/A2SERVER|g' /etc/samba/smbd.conf
|
||||
|
||||
fi
|
||||
|
||||
# skip if we're already set up
|
||||
if [[ -d /media/A2SHARED ]]; then
|
||||
if [[ -d /srv/A2SERVER ]]; then
|
||||
|
||||
echo "A2SERVER: Shared disk is already prepared for use."
|
||||
echo "A2SERVER: Shared volume is already prepared for use."
|
||||
|
||||
else
|
||||
|
||||
echo "A2SERVER: Preparing the shared files disk..."
|
||||
echo "A2SERVER: Preparing the shared files volume..."
|
||||
|
||||
sudo mkdir /media/A2SHARED
|
||||
sudo mkdir /srv/A2SERVER
|
||||
|
||||
sudo chown $USER:$USER /media/A2SHARED
|
||||
sudo chown $USER:$USER /srv/A2SERVER
|
||||
|
||||
fi
|
||||
|
|
|
@ -14,11 +14,14 @@ isRpi=
|
|||
[[ -f /usr/bin/raspi-config ]] && isRpi=1
|
||||
|
||||
isDebian=
|
||||
[[ ( -f /etc/debian_version ) && ( $(cut -c 1-2 < /etc/debian_version) == "7." ) && ( $(uname -m) == "i686" ) ]] && isDebian=1
|
||||
[[ ( -f /etc/debian_version ) && ( $(cut -c 1 < /etc/debian_version) -ge "7" ) && ( $(uname -m) == "i686" ) ]] && isDebian=1
|
||||
|
||||
isJessie=
|
||||
[[ ( -f /etc/debian_version ) && ( $(cut -c 1-2 < /etc/debian_version) == "8." ) ]] && isJessie=1
|
||||
|
||||
echo "A2SERVER: Installing A2SERVER tools..."
|
||||
|
||||
if [[ ! -f /usr/local/bin/nulib2 ]]; then
|
||||
if ! command -v nulib2 > /dev/null; then
|
||||
|
||||
echo "A2SERVER: Installing nulib2..."
|
||||
|
||||
|
@ -29,7 +32,7 @@ if [[ ! -f /usr/local/bin/nulib2 ]]; then
|
|||
wget -qO- "http://appleii.ivanx.com/a2server/files/nulib2-debian7_x86.tgz" | sudo tar Pzx
|
||||
fi
|
||||
|
||||
if [[ ! -f /usr/local/bin/nulib2 ]]; then
|
||||
if ! command -v nulib2 > /dev/null; then
|
||||
|
||||
if [[ ! -f /tmp/a2server-packageReposUpdated ]]; then
|
||||
# prepare for installing packages
|
||||
|
@ -65,7 +68,7 @@ fi
|
|||
# download and install The Unarchiver, for expanding Apple disk images
|
||||
# http://wakaba.c3.cx/s/apps/unarchiver.html
|
||||
|
||||
if ! command -v unar >/dev/null; then
|
||||
if ! command -v unar > /dev/null; then
|
||||
|
||||
echo "A2SERVER: Installing The Unarchiver..."
|
||||
|
||||
|
@ -75,16 +78,17 @@ if ! command -v unar >/dev/null; then
|
|||
touch /tmp/a2server-packageReposUpdated
|
||||
fi
|
||||
|
||||
if apt-cache show unar &>/dev/null; then
|
||||
# Debian package exists >= jessie.
|
||||
sudo apt-get -y install unar
|
||||
else
|
||||
# Legacy binary tarballs for wheezy.
|
||||
if [[ $isJessie ]]; then
|
||||
sudo apt-get install -y unar
|
||||
sudo apt-get clean
|
||||
fi
|
||||
|
||||
if ! command -v unar > /dev/null; then
|
||||
if [[ $isRpi || $isDebian ]]; then
|
||||
sudo apt-get -y install libgnustep-base1.22
|
||||
sudo apt-get clean
|
||||
if [[ $isRpi ]]; then
|
||||
wget -qO- "http://appleii.ivanx.com/a2server/files/unar-rpi.tgz" | sudo tar Pzx
|
||||
wget -qO- "http://appleii.ivanx.com/a2server/files/unar-rpi_wheezy.tgz" | sudo tar Pzx
|
||||
elif [[ $isDebian ]]; then
|
||||
wget -qO- "http://appleii.ivanx.com/a2server/files/unar-debian7_x86.tgz" | sudo tar Pzx
|
||||
fi
|
||||
|
@ -117,7 +121,7 @@ fi
|
|||
|
||||
if ! command -v unzip >/dev/null; then
|
||||
echo "A2SERVER: Installing unzip..."
|
||||
sudo apt-get -y install unzip
|
||||
sudo apt-get -y install unzip
|
||||
else
|
||||
echo "A2SERVER: unzip has already been installed."
|
||||
fi
|
||||
|
@ -140,9 +144,9 @@ echo "source /usr/local/etc/a2server-aliases" | sudo tee -a /etc/bash.bashrc > /
|
|||
|
||||
motd="/etc/motd"
|
||||
if [[ ! $(grep A2SERVER $motd) ]]; then
|
||||
echo | sudo tee -a $motd > /dev/null
|
||||
echo "Type 'system-shutdown' to turn off A2SERVER." | sudo tee -a $motd > /dev/null
|
||||
echo "Type 'a2server-setup' to configure network boot." | sudo tee -a $motd > /dev/null
|
||||
echo "Type 'a2server-help' for a list of other commands." | sudo tee -a $motd > /dev/null
|
||||
echo | sudo tee -a $motd > /dev/null
|
||||
echo | sudo tee -a $motd > /dev/null
|
||||
echo "Type 'system-shutdown' to turn off A2SERVER." | sudo tee -a $motd > /dev/null
|
||||
echo "Type 'a2server-setup' to configure network boot." | sudo tee -a $motd > /dev/null
|
||||
echo "Type 'a2server-help' for a list of other commands." | sudo tee -a $motd > /dev/null
|
||||
echo | sudo tee -a $motd > /dev/null
|
||||
fi
|
||||
|
|
|
@ -4,13 +4,7 @@
|
|||
# A2SERVER -- a virtual machine for sharing files to Apple II clients
|
||||
# by Ivan X, ivan@ivanx.com
|
||||
|
||||
# Installs Netatalk 2.2.4 for debian/raspbian (Wheezy)
|
||||
# last update: 3-Mar-15
|
||||
|
||||
# The lastest version of this document, and the ready-to-use premade
|
||||
# virtual machine, will be at http://appleii.ivanx.com .
|
||||
|
||||
# Please send corrections and comments to ivan@ivanx.com
|
||||
# Installs Netatalk 2.2.4 for debian/raspbian (Wheezy or Jessie)
|
||||
|
||||
# Thanks to Steven Hirsch, Geoff Body, Peter Wong, Tony Diaz, and others
|
||||
# at comp.sys.apple2 for the work they've done and insight they've
|
||||
|
@ -29,31 +23,57 @@ esac
|
|||
isRpi=
|
||||
[[ -f /usr/bin/raspi-config ]] && isRpi=1
|
||||
|
||||
isDebian=
|
||||
[[ ( -f /etc/debian_version ) && ( $(cut -c 1-2 < /etc/debian_version) == "7." ) && ( $(uname -m) == "i686" ) ]] && isDebian=1
|
||||
isDebian_x86=
|
||||
[[ ( -f /etc/debian_version ) && ( $(cut -c 1 < /etc/debian_version) -ge 7 ) && ( $(uname -m) == "i686" ) ]] && isDebian_x86=1
|
||||
|
||||
isJessie=
|
||||
[[ ( -f /etc/debian_version ) && ( $(cut -c 1-2 < /etc/debian_version) == "8." ) ]] && isJessie=1
|
||||
|
||||
# skip this if already done
|
||||
if [[ -f /usr/local/etc/A2SERVER-version ]] && (( $(cat /usr/local/etc/A2SERVER-version) >= 101 )); then
|
||||
if [[ -f /usr/local/etc/A2SERVER-version ]] && (( $(head -c 3 /usr/local/etc/A2SERVER-version) >= 101 )); then
|
||||
|
||||
echo "A2SERVER: Netatalk is already installed."
|
||||
|
||||
|
||||
else
|
||||
|
||||
echo "A2SERVER: Installing Netatalk (this will take a while)..."
|
||||
|
||||
# stop Netatalk if running (during upgrade)
|
||||
[[ $(ps --no-headers -C afpd) ]] && sudo /etc/init.d/netatalk stop
|
||||
|
||||
|
||||
# stop Netatalk and samba if running (during upgrade)
|
||||
if [[ $(ps --no-headers -C afpd) ]]; then
|
||||
sudo /etc/init.d/netatalk stop
|
||||
sudo /etc/init.d/samba stop &> /dev/null
|
||||
fi
|
||||
|
||||
if [[ ! -f /tmp/a2server-packageReposUpdated ]]; then
|
||||
# prepare for installing packages
|
||||
sudo apt-get -y update
|
||||
touch /tmp/a2server-packageReposUpdated
|
||||
fi
|
||||
|
||||
getOldPackage () {
|
||||
for url in $@; do
|
||||
pkgFile=${url##*/}
|
||||
pkgName=${pkgFile%%_*}
|
||||
if ! dpkg -l $pkgName 2> /dev/null | grep -q '^ii'; then
|
||||
wget -qO /tmp/${url##*/} "$url"
|
||||
sudo dpkg -i /tmp/${url##*/}
|
||||
sudo apt-get clean
|
||||
rm /tmp/${url##*/}
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
compileFromSource=1
|
||||
while [[ $isRpi || $isDebian ]]; do
|
||||
urls=
|
||||
while [[ $isRpi || $isDebian_x86 ]]; do
|
||||
# Install runtime libraries needed by Netatalk
|
||||
if [[ $(apt-cache search '^libdb4.8$') ]]; then
|
||||
if [[ $isJessie ]]; then
|
||||
if [[ $isRpi ]]; then
|
||||
getOldPackage "http://mirrordirector.raspbian.org/raspbian/pool/main/d/db/libdb5.1_5.1.29-5_armhf.deb"
|
||||
elif [[ $isDebian_x86 ]]; then
|
||||
getOldPackage "http://ftp.debian.org/debian/pool/main/d/db/libdb5.1_5.1.29-5_i386.deb"
|
||||
fi
|
||||
elif [[ $(apt-cache search '^libdb4.8$') ]]; then
|
||||
sudo apt-get -y install libdb4.8
|
||||
elif [[ $(apt-cache search '^libdb5.1$') ]]; then
|
||||
sudo apt-get -y install libdb5.1
|
||||
|
@ -67,20 +87,27 @@ else
|
|||
else
|
||||
break
|
||||
fi
|
||||
if [[ $(apt-cache search '^libgcrypt11$') ]]; then
|
||||
|
||||
if [[ $isJessie ]]; then
|
||||
if [[ $isRpi ]]; then
|
||||
getOldPackage "http://mirrordirector.raspbian.org/raspbian/pool/main/libg/libgcrypt11/libgcrypt11_1.5.0-5+deb7u3_armhf.deb"
|
||||
elif [[ $isDebian_x86 ]]; then
|
||||
getOldPackage "http://ftp.debian.org/debian/pool/main/libg/libgcrypt11/libgcrypt11_1.5.0-5+deb7u3_i386.deb"
|
||||
fi
|
||||
elif [[ $(apt-cache search '^libgcrypt11$') ]]; then
|
||||
sudo apt-get -y install libgcrypt11
|
||||
else
|
||||
break
|
||||
fi
|
||||
|
||||
|
||||
# install Netatalk
|
||||
if [[ $isRpi ]]; then
|
||||
{ wget -qO- /tmp/netatalk.tgz "http://appleii.ivanx.com/a2server/files/netatalk224-rpi.tgz" | sudo tar Pzx; } 2> /dev/null
|
||||
elif [[ $isDebian ]]; then
|
||||
{ wget -qO- /tmp/netatalk.tgz "http://appleii.ivanx.com/a2server/files/netatalk224-rpi_wheezy.tgz" | sudo tar Pzx; } 2> /dev/null
|
||||
elif [[ $isDebian_x86 ]]; then
|
||||
{ wget -qO- /tmp/netatalk.tgz "http://appleii.ivanx.com/a2server/files/netatalk224-debian7_x86.tgz" | sudo tar Pzx; } 2> /dev/null
|
||||
fi
|
||||
sudo mandb &> /dev/null
|
||||
|
||||
|
||||
[[ -f /usr/local/sbin/atalkd ]] && compileFromSource=
|
||||
|
||||
break
|
||||
|
@ -89,50 +116,68 @@ else
|
|||
if [[ $compileFromSource ]]; then
|
||||
# Install development libraries needed by Netatalk
|
||||
sudo apt-get -y install build-essential
|
||||
if [[ $(apt-cache search '^libdb4.8-dev$') ]]; then
|
||||
sudo apt-get -y install libssl-dev
|
||||
if [[ $isJessie ]]; then
|
||||
if [[ $isRpi ]]; then
|
||||
getOldPackage "http://mirrordirector.raspbian.org/raspbian/pool/main/d/db/libdb5.1-dev_5.1.29-5_armhf.deb"
|
||||
elif [[ $isDebian_x86 ]]; then
|
||||
getOldPackage "http://ftp.us.debian.org/debian/pool/main/d/db/libdb5.1-dev_5.1.29-5_i386.deb"
|
||||
fi
|
||||
elif [[ $(apt-cache search '^libdb4.8-dev$') ]]; then
|
||||
sudo apt-get -y install libdb4.8-dev
|
||||
elif [[ $(apt-cache search '^libdb5.1-dev$') ]]; then
|
||||
sudo apt-get -y install libdb5.1-dev
|
||||
else
|
||||
echo "A2SERVER: WARNING: unknown version of libdb-dev is being installed"
|
||||
echo "A2SERVER: WARNING: unknown version of libdb-dev is being installed."
|
||||
sudo apt-get -y install libdb-dev
|
||||
fi
|
||||
sudo apt-get -y install libssl-dev
|
||||
sudo apt-get -y install libgcrypt11-dev
|
||||
if [[ $isJessie ]]; then
|
||||
sudo apt-get -y install libgpg-error-dev
|
||||
if [[ $isRpi ]]; then
|
||||
getOldPackage "http://mirrordirector.raspbian.org/raspbian/pool/main/libg/libgcrypt11/libgcrypt11-dev_1.5.0-5+deb7u3_armhf.deb"
|
||||
elif [[ $isDebian_x86 ]]; then
|
||||
getOldPackage "http://ftp.debian.org/debian/pool/main/libg/libgcrypt11/libgcrypt11-dev_1.5.0-5+deb7u3_i386.deb"
|
||||
fi
|
||||
elif [[ $(apt-cache search '^libgcrypt11-dev$') ]]; then
|
||||
sudo apt-get -y install libgcrypt11-dev
|
||||
else
|
||||
echo "A2SERVER: WARNING: unknown version of libgcrypt-dev is being installed."
|
||||
sudo apt-get -y install $(apt-cache search '^libgcrypt.*dev$' | sort -r | head -1 | cut -d ' ' -f 1)
|
||||
fi
|
||||
sudo apt-get clean
|
||||
|
||||
|
||||
# get Netatalk
|
||||
rm -rf /tmp/netatalk &> /dev/null
|
||||
mkdir /tmp/netatalk
|
||||
cd /tmp/netatalk
|
||||
|
||||
|
||||
wget -q "http://downloads.sourceforge.net/project/netatalk/netatalk/2.2.4/netatalk-2.2.4.tar.gz"
|
||||
tar zxf netatalk-2.2.4.tar.gz
|
||||
cd netatalk-2.2.4
|
||||
|
||||
|
||||
# Patch the source so file dates are preserved during a GS/OS folder copy,
|
||||
# and the AsanteTalk bridge consistently starts up in AppleTalk Phase 2
|
||||
# and the Dayna bridge doesn't crash GS/OS
|
||||
# props to Steven Hirsch for these
|
||||
sed -i ':a;N;$!ba;s/case FILPBIT_ATTR :\n *change_mdate = 1;\n/case FILPBIT_ATTR :\n/g' etc/afpd/file.c
|
||||
sed -i 's/rtmp->rt_iface == iface/rtmp->rt_iface != iface/g' etc/atalkd/main.c
|
||||
|
||||
|
||||
# prepare to build Netatalk
|
||||
./configure --enable-debian --enable-ddp --enable-a2boot
|
||||
|
||||
|
||||
# uninstall Netatalk if already installed
|
||||
[[ -f /usr/local/sbin/afpd ]] && sudo make uninstall
|
||||
|
||||
|
||||
# compile and install Netatalk
|
||||
make
|
||||
sudo make install
|
||||
|
||||
|
||||
# to remove the Netatalk source code (optional), type:
|
||||
cd
|
||||
rm -rf /tmp/netatalk
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# --- Configuring Netatalk
|
||||
|
||||
echo "A2SERVER: Configuring Netatalk..."
|
||||
|
@ -175,10 +220,10 @@ if [[ ! $(grep '^- -ddp.*uams_randnum.so' /usr/local/etc/netatalk/afpd.conf) ]];
|
|||
# disable DHX (DHCAST128) on Raspberry Pi, which refuses uams if the config string is too long
|
||||
[[ -f /usr/bin/raspi-config ]] && dhx="" || dhx="uams_dhx.so,"
|
||||
echo -n -e \
|
||||
"- -ddp -tcp -uamlist uams_guest.so,uams_clrtxt.so,uams_randnum.so" \
|
||||
| sudo tee -a /usr/local/etc/netatalk/afpd.conf > /dev/null
|
||||
"- -ddp -tcp -uamlist uams_guest.so,uams_clrtxt.so,uams_randnum.so" \
|
||||
| sudo tee -a /usr/local/etc/netatalk/afpd.conf > /dev/null
|
||||
echo -e ",${dhx}uams_dhx2.so" \
|
||||
| sudo tee -a /usr/local/etc/netatalk/afpd.conf > /dev/null
|
||||
| sudo tee -a /usr/local/etc/netatalk/afpd.conf > /dev/null
|
||||
fi
|
||||
|
||||
# replace home folder share and end of file mark with share placeholders
|
||||
|
@ -194,57 +239,151 @@ if [[ ! $(grep ^eth0 /usr/local/etc/netatalk/atalkd.conf) && ! $(grep ^wlan0 /us
|
|||
# needs -router and -zone to prevent GS/OS AppleShare CDEV crash when used
|
||||
# with Dayna or Asante bridges
|
||||
echo -e 'eth0 -router -phase 2 -net 1 -zone "A2SERVER"' \
|
||||
| sudo tee -a /usr/local/etc/netatalk/atalkd.conf > /dev/null
|
||||
| sudo tee -a /usr/local/etc/netatalk/atalkd.conf > /dev/null
|
||||
fi
|
||||
|
||||
# Raspberry Pi
|
||||
if [[ $isRpi ]]; then
|
||||
# blink LED upon netatalk startup so you know when to attach power to an AsanteTalk bridge
|
||||
# blink LED upon netatalk startup
|
||||
if [[ ! $(grep 'led0' /etc/init.d/netatalk) ]]; then
|
||||
sudo sed -i ':a;N;$!ba;s/fi\n}/fi\n\n # blink LED on Raspberry Pi\n ([[ -e \/sys\/class\/leds\/ACT ]] \&\& led=ACT || led=led0; echo none > \/sys\/class\/leds\/$led\/trigger; for i in {1..20}; do echo 1 > \/sys\/class\/leds\/$led\/brightness; sleep 0.25; echo 0 > \/sys\/class\/leds\/$led\/brightness; sleep 0.25; done; echo mmc0 > \/sys\/class\/leds\/$led\/trigger) \&\n}/' /etc/init.d/netatalk
|
||||
fi
|
||||
|
||||
# set console port login to 4800 bps for usage with Apple II (using RPi console cable)
|
||||
sudo sed -i 's/ttyAMA0 115200/ttyAMA0 4800/' /etc/inittab
|
||||
|
||||
# enable serial console login with USB-serial adapter
|
||||
# 10-4-13: creates unwanted console messages if no adapter present,
|
||||
# and physical port isn't predictable with more than one adapter present, so
|
||||
# has been superseded by scanttyUSB supplied by A2CLOUD install
|
||||
#if [[ ! $(grep 'ttyUSB0 19200' /etc/inittab) ]]; then
|
||||
# echo -e "\n\n#for USB-to-serial adapter with Prolific PL2303 chipset\nT1:23:respawn:/sbin/getty -L ttyUSB0 19200 vt100" | sudo tee -a /etc/inittab > /dev/null
|
||||
#fi
|
||||
fi
|
||||
|
||||
# 1.3.0: we are no longer setting up new GSFILES
|
||||
# set up GSFILES share (for GS data files, not GSOS system)
|
||||
# classic Mac OS file names are allowed (31 chars, mixed case, everything but colons)
|
||||
sudo sed -i \
|
||||
's/^#share1/\/media\/A2SHARED\/GSFILES\ GSFILES ea:ad/' \
|
||||
/usr/local/etc/netatalk/AppleVolumes.default
|
||||
[[ -d /media/A2SHARED/GSFILES ]] || mkdir -p /media/A2SHARED/GSFILES
|
||||
#sudo sed -i \
|
||||
# 's/^#share1/\/media\/A2SHARED\/GSFILES\ GSFILES ea:ad/' \
|
||||
# /usr/local/etc/netatalk/AppleVolumes.default
|
||||
|
||||
# set up A2FILES share (for ProDOS 8 files, and GS/OS system)
|
||||
# 1.3.0: if GSFILES is being shared, make directory if not there
|
||||
if grep -q '^/srv/A2SERVER/GSFILES' /usr/local/etc/netatalk/AppleVolumes.default; then
|
||||
[[ -d /srv/A2SERVER/GSFILES ]] || mkdir -p /srv/A2SERVER/GSFILES;
|
||||
fi
|
||||
|
||||
# prior to 1.3.0:
|
||||
# file names must be ProDOS 8 compliant (all caps, 15 chars, letters/numbers/periods only)
|
||||
# lowercase filenames will be converted to upper automatically
|
||||
# need for GS/OS system because it may refer to files by either upper or lower
|
||||
sudo sed -i \
|
||||
's/^#share2/\/media\/A2SHARED\/A2FILES\ A2FILES options:prodos\ casefold:toupper ea:ad/' \
|
||||
/usr/local/etc/netatalk/AppleVolumes.default
|
||||
[[ -d /media/A2SHARED/A2FILES ]] || mkdir -p /media/A2SHARED/A2FILES
|
||||
if [[ ! -d /media/A2SHARED/A2FILES/.AppleDesktop ]]; then
|
||||
cd /media/A2SHARED/A2FILES
|
||||
mkdir .AppleDesktop
|
||||
ln -s .AppleDesktop .APPLEDESKTOP
|
||||
|
||||
# 1.3.0+:
|
||||
# see if shared already uses ciopfs (case-insensitive file system), and convert if not
|
||||
# restore known GS/OS file paths to mixed case
|
||||
# set up ciopfs (case insensitive file system) for share
|
||||
if [[ -d /srv/A2SERVER/A2FILES && ! -d /srv/A2SERVER/.a2files ]]; then
|
||||
echo "A2SERVER: Converting A2FILES to support mixed case..."
|
||||
sudo /etc/init.d/netatalk stop &> /dev/null
|
||||
sudo /etc/init.d/samba stop &> /dev/null
|
||||
if ! command -v getfattr &> /dev/null; then
|
||||
sudo apt-get -y install attr &> /dev/null
|
||||
sudo apt-get clean
|
||||
fi
|
||||
rm /srv/A2SERVER/A2FILES/.APPLEDESKTOP 2> /dev/null
|
||||
mkdir -p /tmp/netboot
|
||||
a2FilesList="$(wget -qO- http://ivanx.com/a2server/files/A2FILES-list.txt)"
|
||||
find /srv/A2SERVER/A2FILES -name '*' | tail -n +2 | tac | while read -d $'\n' thisFile; do
|
||||
mixedCase="${thisFile##*/}"
|
||||
gsosPath=$(grep -i "^${thisFile}$" <<< "$a2FilesList")
|
||||
[[ $gsosPath ]] && mixedCase="${gsosPath##*/}"
|
||||
sudo setfattr -n "user.filename" -v "$mixedCase" "$thisFile"
|
||||
if [[ ${thisFile##*/} != $mixedCase ]]; then
|
||||
echo -e " renaming $thisFile to ${mixedCase}\n"
|
||||
else
|
||||
echo -e " processing $thisFile\n"
|
||||
fi
|
||||
sudo mv "$thisFile" "${thisFile%/*}"/"$(tr [:upper:] [:lower:] <<< $mixedCase)" 2> /dev/null
|
||||
done
|
||||
mv /srv/A2SERVER/A2FILES /srv/A2SERVER/.a2files
|
||||
mkdir /srv/A2SERVER/A2FILES
|
||||
sudo sed -i 's/casefold:toupper //' /usr/local/etc/netatalk/AppleVolumes.default
|
||||
sudo sed -i 's/^VOLCASEFOLD:.*/VOLCASEFOLD:/' /srv/A2SERVER/.a2files/.appledesktop/.volinfo
|
||||
fi
|
||||
|
||||
# set up ADTDISKS share (ADTPro disk image folder, if A2CLOUD is installed)
|
||||
# 1.3.0: remove GSFILES if empty
|
||||
if grep -q '^/srv/A2SERVER/GSFILES' /usr/local/etc/netatalk/AppleVolumes.default; then
|
||||
gsFilesContents=
|
||||
if [[ -d /srv/A2SERVER/GSFILES ]]; then
|
||||
gsFilesContents="$(find /srv/A2SERVER/GSFILES -not -path '*/\.*' | grep -v '^/srv/A2SERVER/GSFILES$' | grep -v '^/srv/A2SERVER/GSFILES/Network Trash Folder$' | grep -v '^/srv/A2SERVER/GSFILES/Temporary Items$')"
|
||||
if [[ ! $gsFilesContents ]]; then
|
||||
echo "A2SERVER: Removing empty GSFILES shared volume..."
|
||||
sudo /etc/init.d/netatalk stop &> /dev/null
|
||||
sudo /etc/init.d/samba stop &> /dev/null
|
||||
sudo sed -i 's|^/srv/A2SERVER/GSFILES.*$|#share1|' /usr/local/etc/netatalk/AppleVolumes.default
|
||||
sudo rm -r /srv/A2SERVER/GSFILES
|
||||
else
|
||||
echo "A2SERVER: GSFILES shared volume has files, leaving as is."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# set up A2FILES case-insensitive share (for ProDOS 8 files, and GS/OS system)
|
||||
sudo sed -i \
|
||||
's/^#share2/\/media\/A2SHARED\/A2FILES\ A2FILES options:prodos\ ea:ad/' \
|
||||
/usr/local/etc/netatalk/AppleVolumes.default
|
||||
[[ -d /srv/A2SERVER/A2FILES ]] || mkdir -p /srv/A2SERVER/A2FILES
|
||||
[[ -d /srv/A2SERVER/.a2files ]] || mkdir -p /srv/A2SERVER/.a2files
|
||||
|
||||
# set up ciopfs
|
||||
if ! command -v ciopfs > /dev/null; then
|
||||
echo "A2SERVER: Installing ciopfs (case insensitive file system)..."
|
||||
cd /tmp
|
||||
sudo apt-get -y install fuse libglib2.0-0 libattr1 libfuse2
|
||||
if [[ $isRpi ]]; then
|
||||
wget -qO- "http://appleii.ivanx.com/a2server/files/ciopfs-rpi.tgz" | sudo tar Pzx
|
||||
elif [[ $isDebian_x86 ]]; then
|
||||
wget -qO- "http://appleii.ivanx.com/a2server/files/ciopfs-debian7_x86.tgz" | sudo tar Pzx
|
||||
fi
|
||||
if [[ -f /etc/fuse.conf ]] && sudo grep -q user_allow_other /etc/fuse.conf; then
|
||||
sudo sed -i 's/#user_allow_other/user_allow_other/' /etc/fuse.conf
|
||||
else
|
||||
echo "user_allow_other" | sudo tee /etc/fuse.conf > /dev/null
|
||||
fi
|
||||
|
||||
if ! command -v ciopfs > /dev/null; then
|
||||
if [[ ! -f /tmp/a2server-packageReposUpdated ]]; then
|
||||
# prepare for installing packages
|
||||
sudo apt-get -y update
|
||||
touch /tmp/a2server-packageReposUpdated
|
||||
fi
|
||||
sudo apt-get -y install build-essential
|
||||
sudo apt-get -y install libfuse-dev libglib2.0-dev libattr1-dev
|
||||
sudo apt-get -y clean
|
||||
cd /tmp
|
||||
rm -rf /tmp/ciopfs &> /dev/null
|
||||
mkdir /tmp/ciopfs
|
||||
cd /tmp/ciopfs
|
||||
wget -q -O ciopfs-0.4.tar.gz http://www.brain-dump.org/projects/ciopfs/ciopfs-0.4.tar.gz
|
||||
tar zxf ciopfs-0.4.tar.gz
|
||||
cd ciopfs*
|
||||
make
|
||||
sudo mv ciopfs /usr/local/bin
|
||||
cd
|
||||
rm -rf /tmp/ciopfs
|
||||
fi
|
||||
if ! grep -q '^ciopfs' /etc/fstab; then
|
||||
echo "ciopfs#/srv/A2SERVER/.a2files /srv/A2SERVER/A2FILES fuse allow_other 0 0" | sudo tee -a /etc/fstab > /dev/null
|
||||
fi
|
||||
if ! mount | grep '^ciopfs.*A2FILES'; then
|
||||
sudo ciopfs /srv/A2SERVER/.a2files /srv/A2SERVER/A2FILES -o allow_other
|
||||
fi
|
||||
else
|
||||
echo "A2SERVER: ciopfs (case insensitive file system) has already been installed."
|
||||
fi
|
||||
|
||||
if [[ ! -d /srv/A2SERVER/A2FILES/.AppleDesktop ]]; then
|
||||
cd /srv/A2SERVER/A2FILES
|
||||
mkdir .AppleDesktop
|
||||
fi
|
||||
|
||||
# set up ADTDISKS share (ADTPro disk image folder, if A2CLOUD is installed)
|
||||
# classic Mac OS file names are allowed (31 chars, mixed case, everything but colons)
|
||||
if [[ -d /usr/local/adtpro/disks ]]; then # A2CLOUD/ADTPro installed
|
||||
if [[ ! -d /media/A2SHARED/ADTDISKS ]]; then
|
||||
ln -s /usr/local/adtpro/disks /media/A2SHARED/ADTDISKS
|
||||
if [[ ! -d /srv/A2SERVER/ADTDISKS ]]; then
|
||||
ln -s /usr/local/adtpro/disks /srv/A2SERVER/ADTDISKS
|
||||
fi
|
||||
if [[ ! $(grep ADTDISKS /usr/local/etc/netatalk/AppleVolumes.default) ]]; then
|
||||
sudo sed -i 's@^# End of File@/media/A2SHARED/ADTDISKS ADTDISKS ea:ad\n\n# End of File@' /usr/local/etc/netatalk/AppleVolumes.default
|
||||
sudo sed -i 's@^# End of File@/srv/A2SERVER/ADTDISKS ADTDISKS ea:ad\n\n# End of File@' /usr/local/etc/netatalk/AppleVolumes.default
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -264,12 +403,12 @@ if [[ -f /usr/local/etc/netatalk/afppasswd ]]; then
|
|||
else
|
||||
|
||||
echo
|
||||
echo "A2SERVER: Setting up AFP password 'apple2' for Apple II and Mac clients."
|
||||
echo "A2SERVER: Setting up AFP password 'apple2' for Apple II and Mac clients..."
|
||||
# echo "A2SERVER: Enter 'apple2' or another password of up to eight characters."
|
||||
echo
|
||||
echo
|
||||
# set registered user login using RandNum authentication
|
||||
sudo afppasswd -c
|
||||
sudo sed -i 's/^pi.*$/pi:6170706C65320000:****************:********/' /usr/local/etc/netatalk/afppasswd
|
||||
sudo sed -i "s/^\(${USER}\).*$/\1:6170706C65320000:****************:********/" /usr/local/etc/netatalk/afppasswd
|
||||
# while [[ ! $(sudo afppasswd -a $USER) ]]; do
|
||||
# true
|
||||
# done
|
||||
|
@ -294,12 +433,12 @@ if [[ $kernelMajorRelease -eq 3 && $kernelMinorRelease -ge 12 && $kernelMinorRel
|
|||
if [[ $(sha1sum /lib/modules/$kernelRelease/kernel/net/appletalk/appletalk.ko | cut -f 1 -d ' ') != "ecb239fc084c36de93f6926e7749b80f6024f269" ]]; then
|
||||
# stop Netatalk
|
||||
sudo /etc/init.d/netatalk stop &> /dev/null
|
||||
echo "A2SERVER: Deleting defective AppleTalk kernel module."
|
||||
echo "A2SERVER: Deleting defective AppleTalk kernel module..."
|
||||
sudo rmmod appletalk 2> /dev/null
|
||||
sudo rm -r /lib/modules/$kernelRelease/kernel/net/appletalk
|
||||
# disable single-user mode on Pi (other Linux can use Recovery boot)
|
||||
if [[ $isRpi && $(grep ' single' /boot/cmdline.txt 2> /dev/null) ]]; then
|
||||
echo "A2SERVER: Disabling single-user mode for next boot."
|
||||
echo "A2SERVER: Disabling single-user mode for next boot..."
|
||||
sudo sed -i 's/ single//' /boot/cmdline.txt
|
||||
touch /tmp/singleUser # so note to restart can display following install
|
||||
fi
|
||||
|
@ -323,8 +462,8 @@ echo "A2SERVER: Netatalk is installed, configured, and running."
|
|||
echo
|
||||
|
||||
# if atalkd isn't running (no AppleTalk), and this is a Rasbperry Pi:
|
||||
if [[ ( ! $(ps aux | grep [a]talkd) ) && ( $isRpi ) ]]; then
|
||||
|
||||
if [[ ( ! $(ps aux | grep [a]talkd) ) && ( $isRpi ) ]]; then
|
||||
|
||||
# if AppleTalk module exists, try to load it
|
||||
if [[ -f /lib/modules/$kernelRelease/kernel/net/appletalk/appletalk.ko ]]; then # module present, but not loaded?
|
||||
sudo depmod
|
||||
|
@ -362,17 +501,8 @@ if [[ ( ! $(ps aux | grep [a]talkd) ) && ( $isRpi ) ]]; then
|
|||
rm /tmp/rpiUpdate 2> /dev/null
|
||||
if [[ ! $(ps aux | grep [a]talkd) ]]; then
|
||||
# use specific rpi-update commit (at https://github.com/Hexxeh/rpi-firmware/)
|
||||
# from when AppleTalk was added/fixed, so we have a consistent firmware that
|
||||
# from when AppleTalk was fixed, so we have a consistent firmware that
|
||||
# we're loading until the next proper release of Raspbian that includes it
|
||||
#
|
||||
# # 10-26-13: when AppleTalk was added to Raspbian:
|
||||
# sudo rpi-update 9530adbe31fe6b8e05b3bd5cfadfc90f067f5362
|
||||
# sudo modprobe appletalk 2> /dev/null
|
||||
# if [[ $(lsmod | grep appletalk) ]]; then
|
||||
# # if it loaded, restart netatalk
|
||||
# sudo sed -i "s/ATALKD_RUN=no/ATALKD_RUN=yes/" /etc/default/netatalk; sudo /etc/init.d/netatalk restart
|
||||
# fi
|
||||
#
|
||||
# 07-23-14: when AppleTalk was fixed after kernel panics in Raspbian 2014-06-20 (kernel 3.12.22+)
|
||||
sudo rm /boot/.firmware_revision
|
||||
sudo rpi-update cfd9a203590737f9536de70a1e01db25a3e8e069
|
||||
|
|
|
@ -13,50 +13,65 @@ case "$A2SERVER_SCRIPT_URL" in
|
|||
*) scriptURL="${A2SERVER_SCRIPT_URL:-http://ivanx.com/a2server}/" ;;
|
||||
esac
|
||||
|
||||
gsosDir="/media/A2SHARED/A2FILES"
|
||||
imagesDir=$gsosDir/GSOS.INSTALLER/IMAGES
|
||||
imageToolsDir=$gsosDir/GSOS.INSTALLER/IMAGE.TOOLS
|
||||
netInstallDir=$gsosDir/GSOS.INSTALLER/NET.INSTALL
|
||||
gsosDir="/srv/A2SERVER/A2FILES"
|
||||
imagesDir=$gsosDir/GSOS.Installer/Images
|
||||
imageToolsDir=$gsosDir/GSOS.Installer/Image.Tools
|
||||
netInstallDir=$gsosDir/GSOS.Installer/Net.Install
|
||||
|
||||
p8Dir="/media/A2SHARED/A2FILES"
|
||||
diskToolsP8Dir=$p8Dir/DISK.TOOLS.P8
|
||||
p8Dir="/srv/A2SERVER/A2FILES"
|
||||
diskToolsP8Dir=$p8Dir/Disk.Tools.P8
|
||||
|
||||
commDir="/media/A2SHARED/A2FILES/COMM"
|
||||
spectrumDir=$commDir/SPECTRUM
|
||||
protermDir=$commDir/PROTERM
|
||||
zlinkDir=$commDir/Z.LINK
|
||||
adtproDir=$commDir/ADTPRO
|
||||
commDir="/srv/A2SERVER/A2FILES/Comm"
|
||||
spectrumDir=$commDir/Spectrum
|
||||
protermDir=$commDir/ProTERM
|
||||
zlinkDir=$commDir/Z.Link
|
||||
adtproDir=$commDir/ADTPro
|
||||
|
||||
gsosURL="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"
|
||||
|
||||
updateP8YearTables () {
|
||||
# Geoff Body and Andrew Roughan helped Joseph Carter with this one
|
||||
# Update ProDOS 8 year table (and spalsh date because may as well)
|
||||
# Effectively, we're turning p8 into the 6.0.3 version here.
|
||||
wd=$PWD
|
||||
cd /usr/local/etc/netatalk/a2boot
|
||||
echo -n -e "\xb0\xb2\xad\xc1\xf5\xe7\xad\xb1\xb5" | sudo dd of="p8" bs=38 seek=1 conv=notrunc 2> /dev/null
|
||||
echo -n -e "\x12\x11\x0b\x10\x0f\x0e\x0d" | sudo dd of="p8" bs=3958 seek=1 conv=notrunc 2> /dev/null
|
||||
echo -n -e "\xb0\xb2\xad\xc1\xf5\xe7\xad\xb1\xb5" | sudo dd of="ProDOS16 Image" bs=3110 seek=1 conv=notrunc 2> /dev/null
|
||||
echo -n -e "\x12\x11\x0b\x10\x0f\x0e\x0d" | sudo dd of="ProDOS16 Image" bs=7030 seek=1 conv=notrunc 2> /dev/null
|
||||
echo -n -e "\xb0\xb2\xad\xc1\xf5\xe7\xad\xb1\xb5" | sudo dd of="Apple :2f:2fe Boot Blocks" bs=79 seek=1 conv=notrunc 2> /dev/null
|
||||
echo -n -e "\x12\x11\x0b\x10\x0f\x0e\x0d" | sudo dd of="Apple :2f:2fe Boot Blocks" bs=7071 seek=1 conv=notrunc 2> /dev/null
|
||||
cd "$wd"
|
||||
}
|
||||
|
||||
# bail out on automated netboot setup unless -b is also specified
|
||||
[[ -f /tmp/a2server-autoAnswerYes ]] && autoAnswerYes=1 || autoAnswerYes=
|
||||
if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then
|
||||
|
||||
|
||||
if [[ ! $autoAnswerYes ]]; then
|
||||
echo
|
||||
echo "Do you want to set up A2SERVER to be able to boot Apple II"
|
||||
echo -n "computers over the network? "
|
||||
read
|
||||
fi
|
||||
|
||||
|
||||
if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then
|
||||
|
||||
|
||||
nbmode=1
|
||||
echo
|
||||
|
||||
|
||||
sudo true
|
||||
mkdir -p /tmp/netboot
|
||||
cd /tmp/netboot
|
||||
|
||||
|
||||
# this will get "Disk 7" (Apple II Setup) as a raw (block dump) image
|
||||
if [[ ! -f /usr/local/etc/netatalk/a2boot/ProDOS16\ Boot\ Blocks ]] \
|
||||
|| [[ ! -f /usr/local/etc/netatalk/a2boot/ProDOS16\ Image ]] \
|
||||
|| [[ ! -f /usr/local/etc/netatalk/a2boot/Apple\ :2f:2fe\ Boot\ Blocks ]]; then
|
||||
|| [[ ! -f /usr/local/etc/netatalk/a2boot/ProDOS16\ Image ]] \
|
||||
|| [[ ! -f /usr/local/etc/netatalk/a2boot/Apple\ :2f:2fe\ Boot\ Blocks ]]; then
|
||||
echo "A2SERVER: Downloading Apple II Boot Blocks..."
|
||||
cd /tmp/netboot
|
||||
|
||||
|
||||
wget --max-redirect 0 -qO Disk_7_of_7-Apple_II_Setup.sea.bin ${gsosURL}Disk_7_of_7-Apple_II_Setup.sea.bin
|
||||
if (( $? != 0 )); then
|
||||
wget -qO Disk_7_of_7-Apple_II_Setup.sea.bin ${gsosBackupURL}Disk_7_of_7-Apple_II_Setup.sea.bin
|
||||
|
@ -64,7 +79,7 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then
|
|||
unar -k skip Disk_7_of_7-Apple_II_Setup.sea.bin &> /dev/null
|
||||
truncate -s 819284 'Disk 7 of 7-Apple II Setup.sea'
|
||||
dd if='Disk 7 of 7-Apple II Setup.sea' of=APPLE2SETUP.HDV bs=84 skip=1 2> /dev/null
|
||||
|
||||
|
||||
# copy the Boot Blocks into the right place
|
||||
mkdir -p a2setup
|
||||
sudo mount -t hfs -o ro,loop APPLE2SETUP.HDV a2setup
|
||||
|
@ -72,55 +87,47 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then
|
|||
sudo cp -p a2setup/System\ Folder/* /usr/local/etc/netatalk/a2boot
|
||||
sudo umount a2setup
|
||||
sudo mv /usr/local/etc/netatalk/a2boot/Apple* /usr/local/etc/netatalk/a2boot/'Apple :2f:2fe Boot Blocks'
|
||||
|
||||
cd /usr/local/etc/netatalk/a2boot
|
||||
|
||||
cd /usr/local/etc/netatalk/a2boot
|
||||
# thanks to Geoff Body for these Boot Blocks patches
|
||||
# fix cleartext password login bug
|
||||
echo -n -e "\xA8\xA2\x01\xBD\x80\x38\x99\xA0\x38\xC8\xE8\xE0\x09\x90\xF4" | \
|
||||
sudo dd of='Apple :2f:2fe Boot Blocks' bs=19779 seek=1 conv=notrunc 2> /dev/null
|
||||
sudo dd of='Apple :2f:2fe Boot Blocks' bs=19779 seek=1 conv=notrunc 2> /dev/null
|
||||
echo -n -e "\xA8\xA2\x01\xBD\x80\x10\x99\xA0\x10\xC8\xE8\xE0\x09\x90\xF4" | \
|
||||
sudo dd of='ProDOS16 Image' bs=22583 seek=1 conv=notrunc 2> /dev/null
|
||||
sudo dd of='ProDOS16 Image' bs=22583 seek=1 conv=notrunc 2> /dev/null
|
||||
# enable typing "8" during GS/OS netboot to force ProDOS 8 boot
|
||||
echo -n -e "\x92" | sudo dd of='ProDOS16 Image' bs=256 seek=1 conv=notrunc 2> /dev/null
|
||||
echo -n -e "\x20\x7d\x14" | sudo dd of='ProDOS16 Image' bs=864 seek=1 conv=notrunc 2> /dev/null
|
||||
echo -n -e "\xad\x00\xc0\x29\xff\x00\xc9\xb8\x00\xd0\x06\xa9\x02\x00\x8d\x53\x14\xa9\x10\x0f\x60" | \
|
||||
sudo dd of='ProDOS16 Image' bs=1661 seek=1 conv=notrunc 2> /dev/null
|
||||
# Geoff Body and Andrew Roughan helped Joseph Carter with this one
|
||||
# Update ProDOS 8 year table (and spalsh date because may as well)
|
||||
# Effectively, we're turning p8 into the 6.0.3 version here.
|
||||
echo -n -e "\xb0\xb2\xad\xc1\xf5\xe7\xad\xb1\xb5" | sudo dd of="p8" bs=38 seek=1 conv=notrunc 2> /dev/null
|
||||
echo -n -e "\x12\x11\x0b\x10\x0f\x0e\x0d" | sudo dd of="p8" bs=3958 seek=1 conv=notrunc 2> /dev/null
|
||||
echo -n -e "\xb0\xb2\xad\xc1\xf5\xe7\xad\xb1\xb5" | sudo dd of="ProDOS16 Image" bs=3110 seek=1 conv=notrunc 2> /dev/null
|
||||
echo -n -e "\x12\x11\x0b\x10\x0f\x0e\x0d" | sudo dd of="ProDOS16 Image" bs=7030 seek=1 conv=notrunc 2> /dev/null
|
||||
echo -n -e "\xb0\xb2\xad\xc1\xf5\xe7\xad\xb1\xb5" | sudo dd of="Apple :2f:2fe Boot Blocks" bs=79 seek=1 conv=notrunc 2> /dev/null
|
||||
echo -n -e "\x12\x11\x0b\x10\x0f\x0e\x0d" | sudo dd of="Apple :2f:2fe Boot Blocks" bs=7071 seek=1 conv=notrunc 2> /dev/null
|
||||
sudo dd of='ProDOS16 Image' bs=1661 seek=1 conv=notrunc 2> /dev/null
|
||||
fi
|
||||
echo "A2SERVER: Boot Blocks have been installed."
|
||||
|
||||
|
||||
# get a2server-tools if necessary
|
||||
if [[ ! -f /usr/local/bin/mkatinit ]] \
|
||||
|| [[ ! -f /usr/local/bin/afptype ]] \
|
||||
|| [[ ! -f /usr/local/bin/mkvolinfo ]] \
|
||||
|| [[ ! -f /usr/local/bin/afpsync ]]; then
|
||||
|| [[ ! -f /usr/local/bin/afptype ]] \
|
||||
|| [[ ! -f /usr/local/bin/mkvolinfo ]] \
|
||||
|| [[ ! -f /usr/local/bin/afpsync ]] \
|
||||
|| [[ ! -f /usr/local/bin/cppo ]]; then
|
||||
rm /tmp/2.tools &> /dev/null
|
||||
wget -q -O /tmp/2.tools "${scriptURL}scripts/a2server-2-tools.txt"
|
||||
chmod ugo+x /tmp/2.tools
|
||||
/tmp/2.tools
|
||||
rm /tmp/2.tools
|
||||
fi
|
||||
|
||||
|
||||
# put BASIC.SYSTEM at root for ProDOS 8 startup
|
||||
cp -p /usr/local/etc/netatalk/a2boot/Basic.System $gsosDir/BASIC.SYSTEM
|
||||
cp -p /usr/local/etc/netatalk/a2boot/Basic.System $gsosDir/BASIC.System
|
||||
afpsync -v $gsosDir > /dev/null
|
||||
afptype -p SYS -q $gsosDir/BASIC.SYSTEM
|
||||
|
||||
afptype -p SYS -q $gsosDir/BASIC.System
|
||||
|
||||
# create tools for setting GS/OS or ProDOS 8 boot in battery RAM and rebooting. Props yet again to Geoff Body.
|
||||
if [[ ! -f $p8Dir/NETBOOT.P8 ]]; then
|
||||
echo
|
||||
echo "A2SERVER: Creating NETBOOT.P8..."
|
||||
touch $p8Dir/NETBOOT.P8
|
||||
echo -n -e "\x38\x20\x1f\xfe\x90\x01\x60\xfb\x08\xc2\x30\xf4\x02\x00\xf4\x62\x00\xa2\x03\x0b\x22\x00\x00\xe1\x78\xf4\x00\x00\xf4\x00\x00\xab\xab\x2b\x38\xfb\xce\xf4\x03\xa9\x0c\x8d\x68\xc0\x9c\x47\xc0\x9c\x41\xc0\xa9\x09\x8d\x39\xc0\xa9\xc0\x8d\x39\xc0\x5c\x62\xfa\x00" | \
|
||||
sudo dd of="$p8Dir/NETBOOT.P8" 2> /dev/null
|
||||
sudo dd of="$p8Dir/NETBOOT.P8" 2> /dev/null
|
||||
afpsync -v $p8Dir > /dev/null
|
||||
afptype -p SYS -q $p8Dir/NETBOOT.P8
|
||||
fi
|
||||
|
@ -130,11 +137,11 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then
|
|||
# create tool for setting GSOS boot in battery RAM and rebooting. Props yet again to Geoff Body.
|
||||
touch $gsosDir/NETBOOT.GSOS
|
||||
echo -n -e "\x38\x20\x1f\xfe\x90\x01\x60\xfb\x08\xc2\x30\xf4\x01\x00\xf4\x62\x00\xa2\x03\x0b\x22\x00\x00\xe1\x78\xf4\x00\x00\xf4\x00\x00\xab\xab\x2b\x38\xfb\xce\xf4\x03\xa9\x0c\x8d\x68\xc0\x9c\x47\xc0\x9c\x41\xc0\xa9\x09\x8d\x39\xc0\xa9\xc0\x8d\x39\xc0\x5c\x62\xfa\x00" | \
|
||||
sudo dd of="$p8Dir/NETBOOT.GSOS" 2> /dev/null
|
||||
sudo dd of="$p8Dir/NETBOOT.GSOS" 2> /dev/null
|
||||
afpsync -v $gsosDir > /dev/null
|
||||
afptype -p SYS -q $gsosDir/NETBOOT.GSOS
|
||||
fi
|
||||
|
||||
|
||||
mkatinit -gs -d -f # GS/OS registered user and Guest starts up with SYSTEM/FINDER
|
||||
mkatinit -d -f guest # ProDOS 8 Guest starts up with BASIC.SYSTEM (no registered user)
|
||||
|
||||
|
@ -146,15 +153,15 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then
|
|||
gsosReinstall=
|
||||
echo
|
||||
echo "GS/OS is already installed on this volume."
|
||||
echo "0: don't install GS/OS now"
|
||||
echo "1: delete installed GS/OS, then install new GS/OS"
|
||||
echo "2: install GS/OS over existing system"
|
||||
echo "1: leave existing GS/OS system in place"
|
||||
echo "2: delete installed GS/OS system, then install new GS/OS"
|
||||
echo "3: install or upgrade GS/OS on top of existing GS/OS system"
|
||||
echo
|
||||
echo -n "What do you wanna do? "
|
||||
echo -n "Which would you like to do? "
|
||||
read
|
||||
if [[ $REPLY == "1" || $REPLY == "2" ]]; then
|
||||
if [[ $REPLY == "2" || $REPLY == "3" ]]; then
|
||||
gsosReinstall=$REPLY
|
||||
if (( $gsosReinstall == 1 )); then
|
||||
if (( $gsosReinstall == 2 )); then
|
||||
echo
|
||||
echo -n "Are you sure you want to delete your entire GS/OS System folder? "
|
||||
read
|
||||
|
@ -172,7 +179,7 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then
|
|||
afpsync &> /dev/null
|
||||
echo
|
||||
break
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
else
|
||||
gsosInstall=1
|
||||
|
@ -195,18 +202,21 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then
|
|||
[[ $autoAnswerYes ]] && gsosVersion=1
|
||||
if [[ $REPLY == "1" || $REPLY == "2" || $REPLY == "3" ]]; then
|
||||
gsosInstall=$REPLY
|
||||
|
||||
if [[ gsosInstall -gt 1 ]]; then
|
||||
updateP8YearTables
|
||||
fi
|
||||
|
||||
# get GS/OS disks from Internet Archive and put them in IMAGES
|
||||
# get GS/OS disks and put them in IMAGES
|
||||
# also dump contents into NET.INSTALL and modify scripts to work from there
|
||||
# echo
|
||||
# echo "Come back in a while."
|
||||
echo
|
||||
echo "A2SERVER: Downloading GS/OS 6.0.${gsosInstall} installer disk images..."
|
||||
cd /tmp/netboot
|
||||
mkdir -p $imagesDir
|
||||
mkdir -p $netInstallDir
|
||||
activeDisk=0
|
||||
|
||||
|
||||
diskNames=( Install System.Disk SystemTools1 SystemTools2 Fonts synthLAB )
|
||||
if (( $gsosInstall == 1 )); then
|
||||
:
|
||||
|
@ -217,14 +227,14 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then
|
|||
elif (( $gsosInstall == 3 )); then
|
||||
gsosURL="ftp://ftp.apple.asimov.net/pub/apple_II/images/gs/os/gsos/Apple_IIGS_System_6.0.3/"
|
||||
fi
|
||||
|
||||
|
||||
# delete previously downloaded installer
|
||||
rm "$imagesDir/* $imagesDir/.AppleDouble/*" 2> /dev/null
|
||||
rm "$netInstallDir/* $netInstallDir/.AppleDouble/*" 2> /dev/null
|
||||
afpsync -v $gsosDir > /dev/null
|
||||
|
||||
|
||||
for diskname in ${diskNames[@]}; do
|
||||
outfile="$imagesDir/$(tr [:lower:] [:upper:] <<< $diskname)"
|
||||
outfile="$imagesDir/$diskname"
|
||||
(( activeDisk++ ))
|
||||
echo "A2SERVER: Disk ${activeDisk} of ${#diskNames[@]}: $diskname"
|
||||
if (( $gsosInstall == 1 )); then
|
||||
|
@ -239,14 +249,14 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then
|
|||
wget -qO $outfile "$gsosURL/IIGS%20System%206.0.2%20-%20Disk%20${activeDisk}%20${diskWebNames[$activeDisk-1]}.po"
|
||||
elif (( $gsosInstall == 3 )); then
|
||||
wget -qO $outfile "$gsosURL/$diskname.po"
|
||||
fi
|
||||
fi
|
||||
cppo -s -ad $outfile $netInstallDir 2> /dev/null
|
||||
done
|
||||
rm *.sea* &> /dev/null
|
||||
sed -i "s/\([^\\]\r:\)/\1A2FILES:GSOS.INSTALLER:NET.INSTALL:/g" $netInstallDir/INSTALL/SCRIPTS/*
|
||||
|
||||
sed -i "s/\([^\\]\r:\)/\1A2FILES:GSOS.Installer:Net.Install:/g" $netInstallDir/Install/Scripts/*
|
||||
|
||||
afpsync -v $gsosDir > /dev/null
|
||||
|
||||
|
||||
# install GS/OS
|
||||
# spec for GS/OS installer scripts: GS/OS Tech Note #64
|
||||
# http://www.1000bit.it/support/manuali/apple/technotes/iigs/tn.iigs.064.html
|
||||
|
@ -254,7 +264,7 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then
|
|||
scriptEntries=$(cat $1 | tr '\r' '#' | tr '~' '\n' | sed 's/4#D/5/')
|
||||
IFS=$'\n'
|
||||
scriptEntries=($scriptEntries)
|
||||
pathPrefix="/A2FILES/GSOS.INSTALLER/NET.INSTALL"$(tr ':' '/' <<< ${scriptEntries[0]##S*\\\\#})
|
||||
pathPrefix="/A2FILES/GSOS.Installer/Net.Install"$(tr ':' '/' <<< ${scriptEntries[0]##S*\\\\#})
|
||||
entryCount=${#scriptEntries[@]}
|
||||
(( entryCount -= 2 ))
|
||||
# echo "entryCount: $entryCount"
|
||||
|
@ -266,14 +276,14 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then
|
|||
action=${scriptEntry[1]:0:1}
|
||||
sourcePathMixed=$(tr ':' '/' <<< ${scriptEntry[5]})
|
||||
[[ ${sourcePathMixed:0:1} != '/' ]] && sourcePathMixed="${pathPrefix}/$sourcePathMixed"
|
||||
sourcePath=$(tr [:lower:] [:upper:] <<< $sourcePathMixed)
|
||||
targetPath=$gsosDir/$(tr ':' '/' <<< ${scriptEntry[6]} | tr [:lower:] [:upper:])
|
||||
sourcePath=$sourcePathMixed
|
||||
targetPath=$gsosDir/$(tr ':' '/' <<< ${scriptEntry[6]})
|
||||
# volumeName=$(cut -d/ -f 2 <<< $sourcePath)
|
||||
targetParent=${targetPath%/*}
|
||||
targetFile=${targetPath##*/}
|
||||
sourceParent=${sourcePath%/*}
|
||||
sourceFile=${sourcePath##*/}
|
||||
|
||||
|
||||
if [[ $action == 1 || $action == 2 ]]; then
|
||||
mkdir -p $targetParent
|
||||
echo "copying: $sourcePathMixed"
|
||||
|
@ -294,31 +304,40 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then
|
|||
done
|
||||
unset IFS
|
||||
}
|
||||
|
||||
|
||||
mkdir -p /tmp/netboot
|
||||
cd /tmp/netboot
|
||||
|
||||
echo "A2SERVER: Preparing GS/OS installer scripts..."
|
||||
|
||||
echo "A2SERVER: Preparing GS/OS installer scripts..."
|
||||
# work through installer scripts
|
||||
echo "Script: INSTALL.SYS.FILE"
|
||||
processScript $netInstallDir/INSTALL/SCRIPTS/INSTAL.SYS.FILE
|
||||
echo "Script: Install.Sys.File"
|
||||
processScript $netInstallDir/Install/Scripts/Instal.Sys.File
|
||||
echo "Script: HFS.FST"
|
||||
processScript $netInstallDir/INSTALL/SCRIPTS/HFS.FST
|
||||
processScript $netInstallDir/Install/Scripts/HFS.FST
|
||||
echo "Script: DOS33.FST"
|
||||
processScript $netInstallDir/INSTALL/SCRIPTS/DOS3.3.FST
|
||||
echo "Script: TEACH"
|
||||
processScript $netInstallDir/INSTALL/SCRIPTS/TEACH
|
||||
echo "Script: APPLESHARE"
|
||||
processScript $netInstallDir/INSTALL/SCRIPTS/APPLESHARE
|
||||
echo "Script: SERVER.SYS.FILE"
|
||||
processScript $netInstallDir/INSTALL/SCRIPTS/SERVER.SYS.FILE
|
||||
|
||||
echo "Script: Teach"
|
||||
processScript $netInstallDir/Install/Scripts/Teach
|
||||
echo "Script: AppleShare"
|
||||
processScript $netInstallDir/Install/Scripts/Appleshare
|
||||
echo "Script: Server.Sys.File"
|
||||
processScript $netInstallDir/Install/Scripts/Server.Sys.File
|
||||
|
||||
# sync netatalk database
|
||||
afpsync -v $gsosDir > /dev/null
|
||||
else
|
||||
gsosInstall=
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ ! $autoAnswerYes && gsosInstall -lt 2 ]]; then
|
||||
echo
|
||||
echo -n "Do you want to update the ProDOS 8 year tables? "
|
||||
read
|
||||
fi
|
||||
if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then
|
||||
updateP8YearTables
|
||||
fi
|
||||
|
||||
if [[ ! $autoAnswerYes ]]; then
|
||||
echo
|
||||
|
@ -327,26 +346,26 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then
|
|||
read
|
||||
fi
|
||||
if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then
|
||||
|
||||
|
||||
# download image tools and put them in IMAGE.TOOLS
|
||||
echo "A2SERVER: Downloading GS/OS disk image utilities..."
|
||||
mkdir -p $imageToolsDir
|
||||
|
||||
|
||||
# get Asimov2 (for GS/OS)
|
||||
echo -n "Asimov 2.0"
|
||||
if [[ -f $imageToolsDir/ASIMOV ]]; then
|
||||
if [[ -f $imageToolsDir/Asimov ]]; then
|
||||
echo " is already installed."
|
||||
else
|
||||
echo
|
||||
cd /tmp/netboot
|
||||
wget -q -nc http://www.ninjaforce.com/downloads/Asimov.shk
|
||||
wget -qO Asimov.shk http://www.ninjaforce.com/downloads/Asimov.shk
|
||||
nulib2 -x -s Asimov.shk > /dev/null
|
||||
cp -p Asimov/Asimov $imageToolsDir/ASIMOV
|
||||
cp -p Asimov/Asimov $imageToolsDir/Asimov
|
||||
afpsync -v $gsosDir > /dev/null
|
||||
cat Asimov/Asimov_rsrc_ >> $imageToolsDir/.AppleDouble/ASIMOV
|
||||
afptype -p S16 -q $imageToolsDir/ASIMOV
|
||||
cat Asimov/Asimov_rsrc_ >> $imageToolsDir/.AppleDouble/Asimov
|
||||
afptype -p S16 -q $imageToolsDir/Asimov
|
||||
fi
|
||||
|
||||
|
||||
echo -n "GS-ShrinkIt 1.1"
|
||||
# get GS-ShrinkIt
|
||||
if [[ -f $imageToolsDir/GSHK ]]; then
|
||||
|
@ -362,15 +381,15 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then
|
|||
cat GSHK_rsrc_ >> $imageToolsDir/.AppleDouble/GSHK
|
||||
afptype -p S16 -a DB07 -q $imageToolsDir/GSHK
|
||||
fi
|
||||
|
||||
echo -n "MountIt 1.4"
|
||||
|
||||
echo -n "MountIt 1.4"
|
||||
# get MountIt (for GS/OS)
|
||||
if [[ -f $imageToolsDir/MOUNTIT.SHK ]]; then
|
||||
echo " is already installed."
|
||||
else
|
||||
echo
|
||||
cd /tmp/netboot
|
||||
wget -q -nc http://www.brutaldeluxe.fr/products/apple2gs/MOUNTIT.SHK
|
||||
wget -q -O MOUNTIT.SHK http://www.brutaldeluxe.fr/products/apple2gs/MOUNTIT.SHK
|
||||
cp -p MOUNTIT.SHK $imageToolsDir/MOUNTIT.SHK
|
||||
afpsync -v $gsosDir > /dev/null
|
||||
afptype -p SHK -q $imageToolsDir/MOUNTIT.SHK
|
||||
|
@ -384,11 +403,11 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then
|
|||
read
|
||||
fi
|
||||
if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then
|
||||
|
||||
|
||||
echo "A2SERVER: Downloading ProDOS 8 disk image utilities..."
|
||||
|
||||
mkdir -p $diskToolsP8Dir
|
||||
|
||||
|
||||
echo -n "ShrinkIt 3.4"
|
||||
# get ShrinkIt 3.4 (for ProDOS 8)
|
||||
if [[ -f $diskToolsP8Dir/SHRINKIT ]]; then
|
||||
|
@ -402,7 +421,7 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then
|
|||
cppo -s -ad SHRINKIT /SHRINKIT/SHRINKIT $diskToolsP8Dir 2> /dev/null
|
||||
afpsync -v $sharepath > /dev/null
|
||||
fi
|
||||
|
||||
|
||||
echo -n "DSK2FILE 5.8"
|
||||
# get DSK2FILE (for ProDOS 8)
|
||||
if [[ -f $diskToolsP8Dir/DSK2FILE ]]; then
|
||||
|
@ -416,7 +435,7 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then
|
|||
afpsync -v $sharepath > /dev/null
|
||||
afptype -p SYS -q $diskToolsP8Dir/DSK2FILE
|
||||
fi
|
||||
|
||||
|
||||
echo -n "Apple System Utilities 3.1"
|
||||
if [[ -f $diskToolsP8Dir/SYSUTIL ]]; then
|
||||
echo " is already installed."
|
||||
|
@ -436,24 +455,25 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then
|
|||
cppo -s -ad A2SYSDISK32.HDV /UTILITIES/UTIL.2 $diskToolsP8Dir 2> /dev/null
|
||||
afpsync -v $sharepath > /dev/null
|
||||
fi
|
||||
|
||||
|
||||
fi
|
||||
|
||||
if [[ ! $autoAnswerYes ]]; then
|
||||
[[ -f "$gsosDir/SYSTEM/START.GS.OS" ]] && gsosInstalled="GS/OS and " || gsosInstalled=
|
||||
echo
|
||||
echo "Do you want to download serial communications software for"
|
||||
echo -n "GS/OS and ProDOS 8? "
|
||||
echo "Do you want to download communications software for"
|
||||
echo -n "$gsosInstalled""ProDOS 8? "
|
||||
read
|
||||
fi
|
||||
if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then
|
||||
|
||||
|
||||
echo "A2SERVER: Downloading communications software..."
|
||||
|
||||
mkdir -p $commDir
|
||||
|
||||
echo -n "Spectrum"
|
||||
# get Spectrum
|
||||
if [[ -f $spectrumDir/SPECTRUM.HDV || -d $spectrumDir/SPECTRUM.2.5.4 ]]; then
|
||||
if [[ -f $spectrumDir/SPECTRUM.HDV || -f $spectrumDir/Spectrum ]]; then
|
||||
echo " is already installed."
|
||||
else
|
||||
mkdir -p $spectrumDir
|
||||
|
@ -461,7 +481,7 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then
|
|||
mkdir -p /tmp/netboot
|
||||
cd /tmp/netboot
|
||||
if [[ ! -f $gsosDir/SYSTEM/START.GS.OS ]]; then
|
||||
#if true; then
|
||||
#if true; then
|
||||
# provide disk images for MountIt if no GS/OS present
|
||||
wget -qO- http://www.speccie.co.uk/speccie/software/spectrum.2mg | dd bs=64 skip=1 of=$spectrumDir/SPECTRUM.HDV 2> /dev/null
|
||||
wget -qO- http://www.speccie.co.uk/speccie/software/spectrum_extras.2mg | dd bs=64 skip=1 of=$spectrumDir/EXTRAS.HDV 2> /dev/null
|
||||
|
@ -477,33 +497,33 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then
|
|||
cppo -s -ad Spectrum.Gold.HDV .
|
||||
userFolder=$(tr [:lower:] [:upper:] <<< $USER)
|
||||
for thisFolder in \
|
||||
INSTALLER/EXTRAS/CDEVS^SYSTEM/CDEVS \
|
||||
INSTALLER/EXTRAS/TOOLS^SYSTEM/TOOLS \
|
||||
INSTALLER/EXTRAS/FONTS^SYSTEM/FONTS \
|
||||
INSTALLER/EXTRAS/SYSTEM.SETUP^SYSTEM/SYSTEM.SETUP \
|
||||
INSTALLER/HELP^SYSTEM/DESK.ACCS \
|
||||
INSTALLER/SPECTRUM.SOUNDS^SYSTEM/SOUNDS \
|
||||
SPECTRUM.2.5.4/ADD.ONS^USERS/$userFolder/ADD.ONS \
|
||||
SPECTRUM.2.5.4/SPECTRUM.SCRIPT^USERS/$userFolder/SPECTRUM.SCRIPT \
|
||||
SPECTRUM.2.5.4/ADD.ONS^COMM/SPECTRUM/ADD.ONS \
|
||||
SPECTRUM.2.5.4/SPECTRUM.SCRIPT^COMM/SPECTRUM/SPECTRUM.SCRIPT \
|
||||
MANUALS^COMM/SPECTRUM/MANUALS
|
||||
Installer/Extras/CDEvs^System/CDevs \
|
||||
Installer/Extras/Tools^System/Tools \
|
||||
Installer/Extras/Fonts^System/Fonts \
|
||||
Installer/Extras/System.Setup^System/System.Setup \
|
||||
Installer/Help^System/Desk.Accs \
|
||||
Installer/Spectrum.Sounds^System/Sounds \
|
||||
Spectrum.2.5.4/Add.Ons^USERS/$userFolder/Add.Ons \
|
||||
Spectrum.2.5.4/Spectrum.Script^USERS/$userFolder/Spectrum.Script \
|
||||
Spectrum.2.5.4/Add.Ons^Comm/Spectrum/Add.Ons \
|
||||
Spectrum.2.5.4/Spectrum.Script^Comm/Spectrum/Spectrum.Script \
|
||||
Manuals^Comm/Spectrum/Manuals
|
||||
do
|
||||
mkdir -p $gsosDir/"${thisFolder##*^}"
|
||||
cp -R SPECTRUM.GOLD/${thisFolder%%^*}/* $gsosDir/"${thisFolder##*^}"
|
||||
cp -R Spectrum.Gold/${thisFolder%%^*}/* $gsosDir/"${thisFolder##*^}"
|
||||
mkdir -p $gsosDir/"${thisFolder##*^}"/.AppleDouble
|
||||
cp -R SPECTRUM.GOLD/${thisFolder%%^*}/.AppleDouble/* $gsosDir/"${thisFolder##*^}"/.AppleDouble
|
||||
cp -R Spectrum.Gold/${thisFolder%%^*}/.AppleDouble/* $gsosDir/"${thisFolder##*^}"/.AppleDouble
|
||||
done
|
||||
mv SPECTRUM.GOLD/INSTALLER/SOUNDPATCH SPECTRUM.GOLD/SPECTRUM.2.5.4/SPECTRUM $spectrumDir
|
||||
mv Spectrum.Gold/Installer/SoundPatch Spectrum.Gold/Spectrum.2.5.4/Spectrum $spectrumDir
|
||||
mkdir -p $spectrumDir/.AppleDouble
|
||||
mv SPECTRUM.GOLD/INSTALLER/.AppleDouble/SOUNDPATCH SPECTRUM.GOLD/SPECTRUM.2.5.4/.AppleDouble/SPECTRUM $spectrumDir/.AppleDouble
|
||||
mv Spectrum.Gold/Installer/.AppleDouble/SoundPatch Spectrum.Gold/Spectrum.2.5.4/.AppleDouble/Spectrum $spectrumDir/.AppleDouble
|
||||
afpsync -v $gsosDir > /dev/null
|
||||
fi
|
||||
fi
|
||||
|
||||
echo -n "ProTERM and Z-Link"
|
||||
# get A2CLOUD disk and copy from there
|
||||
if [[ -f $commDir/PROTERM/PROTERM ]]; then
|
||||
if [[ -f $protermDir/PROTERM ]]; then
|
||||
echo " are already installed."
|
||||
else
|
||||
mkdir -p $protermDir
|
||||
|
@ -521,10 +541,10 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then
|
|||
mv *PT3* *PROTERM* $protermDir/.AppleDouble
|
||||
mv Z.LINK $zlinkDir/.AppleDouble
|
||||
afpsync -v $gsosDir > /dev/null
|
||||
fi
|
||||
fi
|
||||
|
||||
echo -n "ADTPro and VSDRIVE"
|
||||
if [[ -f $commDir/ADTPRO/ADTPRO ]]; then
|
||||
if [[ -f $adtproDir/ADTPRO ]]; then
|
||||
echo " are already installed."
|
||||
else
|
||||
mkdir -p $adtproDir
|
||||
|
@ -535,25 +555,25 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then
|
|||
cd .AppleDouble
|
||||
mv *ADTPRO* *VEDRIVE* *VSDRIVE* $adtproDir/.AppleDouble
|
||||
afpsync -v $gsosDir > /dev/null
|
||||
fi
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
|
||||
# clean up
|
||||
cd
|
||||
[[ -d /tmp/netboot ]] && rm -rf /tmp/netboot
|
||||
[[ -d ~/GNUstep ]] && rm -rf ~/GNUstep
|
||||
|
||||
|
||||
# rock and roll!
|
||||
echo
|
||||
|
||||
|
||||
echo
|
||||
if [[ $gsosInstall ]]; then
|
||||
echo "GS/OS network boot (for registered user and Guest) and"
|
||||
fi
|
||||
echo "ProDOS 8 network boot (for Guest only) is now configured."
|
||||
echo "See http://appleii.ivanx.com/a2server for info using it."
|
||||
|
||||
echo "See http://appleii.ivanx.com/a2server for info using it."
|
||||
|
||||
fi
|
||||
|
||||
if [[ ! $autoAnswerYes ]]; then
|
||||
|
@ -563,6 +583,7 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupNetBoot ]]; then
|
|||
read
|
||||
fi
|
||||
if [[ $autoAnswerYes || ${REPLY:0:1} == "Y" || ${REPLY:0:1} == "y" ]]; then
|
||||
# Farallon bridge patch for GS/OS courtesy of Geoff Body
|
||||
echo "A2SERVER: Downloading Farallon bridge patch..."
|
||||
wget -O /tmp/FARALLON.PO "http://appleii.ivanx.com/a2server/files/FARALLON.B1.PO" &> /dev/null
|
||||
if [[ -d $gsosDir/SYSTEM/SYSTEM.SETUP ]]; then
|
||||
|
|
|
@ -52,7 +52,7 @@ if [[ ! $autoAnswerYes || -f /tmp/a2server-setupWindowsSharing ]]; then
|
|||
echo "A2SERVER: $sharename is already set up for Windows file sharing."
|
||||
else
|
||||
echo "[$sharename]" | sudo tee -a /etc/samba/smb.conf > /dev/null
|
||||
echo " path = /media/A2SHARED/$sharename" | sudo tee -a /etc/samba/smb.conf > /dev/null
|
||||
echo " path = /srv/A2SERVER/$sharename" | sudo tee -a /etc/samba/smb.conf > /dev/null
|
||||
echo " browsable = yes" | sudo tee -a /etc/samba/smb.conf > /dev/null
|
||||
echo " guest ok = yes" | sudo tee -a /etc/samba/smb.conf > /dev/null
|
||||
echo " read only = no" | sudo tee -a /etc/samba/smb.conf > /dev/null
|
||||
|
|
|
@ -47,8 +47,8 @@ alias appletalk-on='sudo sed -i "s/ATALKD_RUN=no/ATALKD_RUN=yes/" /etc/default/n
|
|||
|
||||
|
||||
NETATALK="/usr/local/etc/netatalk"
|
||||
A2FILES="/media/A2SHARED/A2FILES"
|
||||
GSFILES="/media/A2SHARED/GSFILES"
|
||||
A2FILES="/srv/A2SERVER/A2FILES"
|
||||
GSFILES="/srv/A2SERVER/GSFILES"
|
||||
|
||||
alias netboot-gsos="mkatinit -gs -d -f"
|
||||
alias netboot-gsos-guest="mkatinit -gs -d -f guest"
|
||||
|
@ -69,10 +69,8 @@ alias samba-stop='sudo /etc/init.d/samba stop'
|
|||
alias samba-start='sudo /etc/init.d/samba start'
|
||||
alias samba-restart='sudo /etc/init.d/samba restart'
|
||||
|
||||
alias gsfiles-share="sudo sed -i 's/^\/media\/A2SHARED\/GSFILES\ GSFILES options:prodos/#share1/' /usr/local/etc/netatalk/AppleVolumes.default"
|
||||
alias gsfiles-unshare="sudo sed -i 's/^#share1/\/media\/A2SHARED\/GSFILES\ GSFILES options:prodos/' /usr/local/etc/netatalk/AppleVolumes.default; [[ -d /media/A2SHARED/GSFILES ]] || mkdir /media/A2SHARED/GSFILES"
|
||||
alias a2files-share="sudo sed -i 's/^\/media\/A2SHARED\/A2FILES\ A2FILES options:prodos\ casefold:toupper/#share2/' /usr/local/etc/netatalk/AppleVolumes.default"
|
||||
alias a2files-unshare="sudo sed -i 's/^#share2/\/media\/A2SHARED\/A2FILES\ A2FILES options:prodos\ casefold:toupper/' /usr/local/etc/netatalk/AppleVolumes.default; [[ -d /media/A2SHARED/A2FILES ]] || mkdir /media/A2SHARED/A2FILES"
|
||||
alias a2files-share="sudo sed -i 's/^#share2/\/srv\/A2SERVER\/A2FILES\ A2FILES options:prodos ea:ad/' /usr/local/etc/netatalk/AppleVolumes.default; [[ -d /srv/A2SERVER/A2FILES ]] || mkdir /srv/A2SERVER/A2FILES"
|
||||
alias a2files-unshare="sudo sed -i 's/^\/srv\/A2SERVER\/A2FILES.*$/#share2/' /usr/local/etc/netatalk/AppleVolumes.default"
|
||||
|
||||
alias showalias="alias | cut -d= -f 1 | cut -d' ' -f2 | more"
|
||||
|
||||
|
|
|
@ -69,8 +69,6 @@ samba-stop: stop Windows file sharing until reboot
|
|||
samba-start: start Windows file sharing
|
||||
samba-restart: stop and restart Windows file sharing
|
||||
|
||||
gsfiles-share: disable the GSFILES shared volume
|
||||
gsfiles-unshare: enable the GSFILES shared volume
|
||||
a2files-share: disable the A2FILES shared volume
|
||||
a2files-unshare: enable the A2FILES shared volume
|
||||
|
||||
|
|
|
@ -36,9 +36,9 @@ processPath () {
|
|||
else
|
||||
IFS=''
|
||||
result=$(sudo dbd -r $sharepath | grep encoding)
|
||||
f=$(echo $result | wc -l)
|
||||
[[ $(echo $result | wc -w) == 0 ]] && f=0
|
||||
[[ f -eq 1 && $(echo $result | grep APPLEDESKTOP) && $(grep MTOULOWER $sharepath/.AppleDesktop/.volinfo) ]] && (( f-- ))
|
||||
f=$(wc -l <<< $result)
|
||||
[[ $(wc -w <<< $result) == 0 ]] && f=0
|
||||
[[ $f -eq 1 && $(grep AppleDesktop <<< "$result") && $(grep MTOULOWER $sharepath/.AppleDesktop/.volinfo) ]] && (( f-- ))
|
||||
if (( f == 0 )); then
|
||||
echo "AppleDouble files have been updated for volume $sharepath."
|
||||
else
|
||||
|
@ -103,7 +103,10 @@ else
|
|||
sudo true
|
||||
if [[ $1 ]]; then
|
||||
sharepath=$(readlink -m $1)
|
||||
processPath
|
||||
# behavior change in 1.3.0: now defaults to mixed case
|
||||
# on a volume when specifying a folder and -v
|
||||
# (as opposed to defaulting to casefold:toupper previously)
|
||||
processPath 1
|
||||
else
|
||||
grep ^/media /usr/local/etc/netatalk/AppleVolumes.default | \
|
||||
while read line; do
|
||||
|
|
|
@ -4,16 +4,17 @@
|
|||
"""cppo: Copy or catalog one or all files from a ProDOS raw disk image.
|
||||
|
||||
copy all files:
|
||||
cppo [-ad|-e] imagefile target_directory
|
||||
cppo [-uc] [-ad|-e] imagefile target_directory
|
||||
copy one file:
|
||||
cppo [-ad|-e] imagefile /FULL/PRODOS/FILE/PATH target_path
|
||||
cppo [-uc] [-ad|-e] imagefile /FULL/PRODOS/FILE/PATH target_path
|
||||
catalog image:
|
||||
cppo -cat imagefile
|
||||
cppo [-uc] -cat imagefile
|
||||
|
||||
-ad : Create AppleDouble header files and preserve resource forks.
|
||||
-e : Append ProDOS type and auxtype to filenames, and copy resource
|
||||
forks, for adding to ShrinkIt archives with Nulib2
|
||||
using its -e option.
|
||||
-uc : Copy GS/OS mixed case filenames as uppercase.
|
||||
|
||||
Wildcard matching/globbing (*) is not supported.
|
||||
No verification or validation of the disk image is performed.
|
||||
|
@ -71,6 +72,7 @@ g.imageFile = None
|
|||
g.AD = 0
|
||||
g.EX = 0
|
||||
g.DIR = 0
|
||||
g.UC = 0
|
||||
g.silent = 0
|
||||
|
||||
# functions
|
||||
|
@ -129,12 +131,29 @@ def getFileName(arg1, arg2):
|
|||
firstByte = readcharDec(g.imageData, start)
|
||||
entryType = (firstByte//16)
|
||||
nameLength = (firstByte - entryType*16)
|
||||
return readchars(g.imageData, start+1, nameLength)
|
||||
fileName = readchars(g.imageData, start+1, nameLength)
|
||||
caseMask = getCaseMask(arg1, arg2)
|
||||
if (not g.UC and caseMask != None):
|
||||
for i in range(0, len(fileName)):
|
||||
if (caseMask[i] == "1"):
|
||||
fileName = (fileName[:i] +
|
||||
fileName[i].lower() +
|
||||
fileName[(i+1):])
|
||||
return fileName
|
||||
|
||||
def getCaseMask(arg1, arg2):
|
||||
start = getStartPos(arg1, arg2)
|
||||
caseMaskDec = (readcharDec(g.imageData, start+28) +
|
||||
readcharDec(g.imageData, start+29)*256)
|
||||
if (caseMaskDec < 32768):
|
||||
return None
|
||||
else:
|
||||
return to_bin(caseMaskDec - 32768).zfill(15)
|
||||
|
||||
def getFileType(arg1, arg2):
|
||||
start = getStartPos(arg1, arg2)
|
||||
return readcharHex(g.imageData, start+16)
|
||||
|
||||
|
||||
def getKeyPointer(arg1, arg2):
|
||||
start = getStartPos(arg1, arg2)
|
||||
return (readcharDec(g.imageData, start+17) +
|
||||
|
@ -184,12 +203,29 @@ def getModifiedDate(arg1, arg2):
|
|||
def getVolumeName():
|
||||
return getWorkingDirName(2)
|
||||
|
||||
def getWorkingDirName(arg1):
|
||||
def getWorkingDirName(arg1, arg2=None):
|
||||
# arg1:block, arg2:casemask (optional)
|
||||
start = ( arg1 * 512 )
|
||||
firstByte = readcharDec(g.imageData, start+4)
|
||||
entryType = (firstByte//16)
|
||||
nameLength = (firstByte - entryType*16)
|
||||
return readchars(g.imageData, start+5, nameLength)
|
||||
workingDirName = readchars(g.imageData, start+5, nameLength)
|
||||
if (entryType == 15): # volume directory, get casemask from header
|
||||
caseMaskDec = (readcharDec(g.imageData, start+26) +
|
||||
readcharDec(g.imageData, start+27)*256)
|
||||
if (caseMaskDec < 32768):
|
||||
caseMask = None
|
||||
else:
|
||||
caseMask = to_bin(caseMaskDec - 32768).zfill(15)
|
||||
else: # subdirectory, get casemask from arg2 (not available in header)
|
||||
caseMask = arg2
|
||||
if (not g.UC and caseMask != None):
|
||||
for i in range(0, len(workingDirName)):
|
||||
if (caseMask[i] == "1"):
|
||||
workingDirName = (workingDirName[:i] +
|
||||
workingDirName[i].lower() +
|
||||
workingDirName[(i+1):])
|
||||
return workingDirName
|
||||
|
||||
def getDirEntryCount(arg1):
|
||||
start = ( arg1 * 512 )
|
||||
|
@ -242,6 +278,9 @@ def copyBlock(arg1, arg2):
|
|||
|
||||
def processDir(arg1, arg2=None, arg3=None, arg4=None, arg5=None):
|
||||
# arg1: dirBlock
|
||||
# for key block (with directory header):
|
||||
# arg2: casemask (optional), arg3:None, arg4:None, arg5:None
|
||||
# for secondary directory blocks (non-key block):
|
||||
# arg2/3/4/5: for non-key chunks: entryCount, entry#,
|
||||
# workingDirName, processedEntryCount
|
||||
|
||||
|
@ -250,7 +289,7 @@ def processDir(arg1, arg2=None, arg3=None, arg4=None, arg5=None):
|
|||
pe = None
|
||||
workingDirName = None
|
||||
|
||||
if arg2:
|
||||
if arg3:
|
||||
entryCount = arg2
|
||||
e = arg3
|
||||
workingDirName = arg4
|
||||
|
@ -259,7 +298,7 @@ def processDir(arg1, arg2=None, arg3=None, arg4=None, arg5=None):
|
|||
e = 0
|
||||
pe = 0
|
||||
entryCount = getDirEntryCount(arg1)
|
||||
workingDirName = getWorkingDirName(arg1).decode("L1")
|
||||
workingDirName = getWorkingDirName(arg1, arg2).decode("L1")
|
||||
g.DIRPATH = (g.DIRPATH + "/" + workingDirName)
|
||||
if g.PDOSPATH_INDEX:
|
||||
if (g.PDOSPATH_INDEX == 1):
|
||||
|
@ -307,7 +346,7 @@ def processEntry(arg1, arg2):
|
|||
if g.PDOSPATH_SEGMENT:
|
||||
g.PDOSPATH_INDEX += 1
|
||||
g.PDOSPATH_SEGMENT = g.PDOSPATH[g.PDOSPATH_INDEX]
|
||||
processDir(getKeyPointer(arg1, arg2))
|
||||
processDir(getKeyPointer(arg1, arg2), getCaseMask(arg1, arg2))
|
||||
g.DIRPATH = g.DIRPATH.rsplit("/", 1)[0]
|
||||
if not g.PDOSPATH_INDEX:
|
||||
g.targetDir = g.targetDir.rsplit("/", 1)[0]
|
||||
|
@ -366,7 +405,7 @@ def processEntry(arg1, arg2):
|
|||
if g.PDOSPATH_SEGMENT:
|
||||
syncExit()
|
||||
g.targetName = None
|
||||
|
||||
|
||||
#else:
|
||||
#print(g.activeFileName + " doesn't match " + g.PDOSPATH_SEGMENT)
|
||||
|
||||
|
@ -507,7 +546,7 @@ def binToDec(arg1):
|
|||
# arg: binary string up to 8 bits
|
||||
# out: decimal value
|
||||
return to_dec([arg1])
|
||||
|
||||
|
||||
def binToHex(arg1):
|
||||
# converts single-byte binary string (8 bits) value to hex
|
||||
# warning: no error checking
|
||||
|
@ -701,10 +740,10 @@ def to_bytes(val):
|
|||
else:
|
||||
raise Exception(
|
||||
"to_bytes() requires hex-ustr, int/long, or [bin-ustr]")
|
||||
|
||||
|
||||
def shift(items):
|
||||
"""Shift list items to left, losing the first item.
|
||||
|
||||
|
||||
in : list
|
||||
out: list
|
||||
"""
|
||||
|
@ -712,7 +751,7 @@ def shift(items):
|
|||
items[i] = items[i+1]
|
||||
del items[-1]
|
||||
return items
|
||||
|
||||
|
||||
def s(string):
|
||||
"""Perform local variable substution, e.g. 'total: {num} items'"""
|
||||
# http://stackoverflow.com/questions/2960772/
|
||||
|
@ -805,7 +844,11 @@ if (len(args) == 1):
|
|||
usage()
|
||||
|
||||
if (args[1] == "-s"):
|
||||
g.silent=1
|
||||
g.silent = 1
|
||||
args = args[1:] #shift
|
||||
|
||||
if (args[1] == "-uc"):
|
||||
g.UC = 1
|
||||
args = args[1:] #shift
|
||||
|
||||
if (args[1] == "-ad"):
|
||||
|
@ -835,7 +878,7 @@ if not os.path.isfile(g.imageFile):
|
|||
g.imageData = loadFile(g.imageFile)
|
||||
|
||||
if (len(args) == 4):
|
||||
g.PDOSPATH = args[2].upper()
|
||||
g.PDOSPATH = args[2]
|
||||
targetPath = args[3]
|
||||
if os.path.isdir(targetPath):
|
||||
g.targetDir = targetPath
|
||||
|
@ -881,3 +924,4 @@ else:
|
|||
processDir(2)
|
||||
if not g.DIR:
|
||||
syncExit()
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
# to download and execute, type:
|
||||
# wget appleii.ivanx.com/a2server/setup; source setup
|
||||
|
||||
a2serverVersion="130"
|
||||
a2serverVersion="128d1"
|
||||
|
||||
# Ensure URL we'll use ends in a /
|
||||
case "$A2SERVER_SCRIPT_URL" in
|
||||
|
@ -83,7 +83,7 @@ if [[ $updateRasppleII ]]; then
|
|||
[[ $0 == "-bash" ]] && return 0 || exit 0
|
||||
fi
|
||||
|
||||
if { [[ -f /usr/local/etc/A2SERVER-version ]] && (( $(cat /usr/local/etc/A2SERVER-version) < 110 )); }; then
|
||||
if { [[ -f /usr/local/etc/A2SERVER-version ]] && (( $(head -c 3 /usr/local/etc/A2SERVER-version) < 110 )); }; then
|
||||
echo
|
||||
echo "WARNING: The current A2SERVER installer scripts haven't been tested for"
|
||||
echo "updating the earlier version of A2SERVER that you have. A fresh install"
|
||||
|
@ -212,7 +212,7 @@ if (( $doSetup )); then
|
|||
rm /tmp/a2server-packageReposUpdated &> /dev/null
|
||||
|
||||
if [[ ! -f /usr/local/etc/A2SERVER-version ]] \
|
||||
|| (( $(cat /usr/local/etc/A2SERVER-version) < "$a2serverVersion" )); then
|
||||
|| (( $(head -c 3 /usr/local/etc/A2SERVER-version) < ${a2serverVersion:0:3} )); then
|
||||
echo "$a2serverVersion" | sudo tee /usr/local/etc/A2SERVER-version &> /dev/null
|
||||
fi
|
||||
|
||||
|
@ -223,6 +223,7 @@ if (( $doSetup )); then
|
|||
kernelMajorRelease=$(cut -d '.' -f 1 <<< $kernelRelease)
|
||||
kernelMinorRelease=$(cut -d '.' -f 2 <<< $kernelRelease | sed 's/\(^[0-9]*\)[^0-9].*$/\1/')
|
||||
|
||||
echo
|
||||
# all done, see if AppleTalk is available and notify either way
|
||||
if [[ $(ps aux | grep [a]talkd) ]]; then
|
||||
echo "You now have a fully functional file server for Apple II clients."
|
||||
|
@ -249,7 +250,7 @@ if (( $doSetup )); then
|
|||
fi
|
||||
rm /tmp/rpiUpdate
|
||||
echo
|
||||
elif [[ $kernelMajorRelease -eq 3 && $kernelMinorRelease -ge 12 ]]; then
|
||||
elif [[ $kernelMajorRelease -eq 3 && $kernelMinorRelease -ge 12 && $kernelMinorRelease -le 15 ]]; then
|
||||
echo "A2SERVER is now configured, but Apple II clients cannot connect"
|
||||
echo "because of a kernel-crashing bug in Linux kernel 3.12 through 3.15."
|
||||
echo "You have kernel version $kernelMajorRelease.$kernelMinorRelease."
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
#! /bin/bash
|
||||
# vim: set tabstop=4 shiftwidth=4 expandtab filetype=sh:
|
||||
|
||||
currentVersion=125
|
||||
|
||||
if [[ -f /usr/local/etc/A2SERVER-version ]]; then
|
||||
installedVersion=$(cat /usr/local/etc/A2SERVER-version)
|
||||
else
|
||||
installedVersion=100
|
||||
fi
|
||||
|
||||
# Ensure URL we'll use ends in a /
|
||||
case "$A2SERVER_SCRIPT_URL" in
|
||||
*/) scriptURL="$A2SERVER_SCRIPT_URL" ;;
|
||||
*) scriptURL="${A2SERVER_SCRIPT_URL:-http://appleii.ivanx.com/a2server}/" ;;
|
||||
esac
|
||||
|
||||
currentVersion=$(wget -qO- "${scriptURL}setup/index.txt" | grep '^a2serverVersion' | cut -d '"' -f 2)
|
||||
|
||||
if [[ -f /usr/local/etc/A2SERVER-version ]]; then
|
||||
installedVersion=$(cat /usr/local/etc/A2SERVER-version)
|
||||
else
|
||||
installedVersion=100
|
||||
fi
|
||||
|
||||
autoAnswerYes=
|
||||
for arg in $@; do
|
||||
if [[ $arg == "-y" ]]; then
|
||||
|
@ -39,7 +39,7 @@ fi
|
|||
if [[ ${REPLY:0:1} == "y" || ${REPLY:0:1} == "Y" ]]; then
|
||||
sudo rm /usr/local/etc/A2SERVER-version &> /dev/null
|
||||
# sudo rm /usr/local/etc/netatalk/a2boot/* &> /dev/null
|
||||
wget -q -O /tmp/setup "${scriptURL}setup"; source /tmp/setup "$@"
|
||||
wget -q -O /tmp/setup "${scriptURL}setup/index.txt"; source /tmp/setup "$@"
|
||||
fi
|
||||
|
||||
unset currentVersion 2> /dev/null
|
||||
|
|
|
@ -50,6 +50,10 @@
|
|||
|
||||
1.2.4: Jul 2015: offer to download A2CLOUD disk contents onto A2FILES volume
|
||||
|
||||
1.2.4+:Oct 2015: support for using A2SERVER scripts from a location other than
|
||||
appleii.ivanx.com/a2server for development purposes
|
||||
[not released]
|
||||
|
||||
1.2.5: Nov 2015: netboot install option for GS/OS 6.0.2/3
|
||||
netboot always downloads GS/OS disk images even if present
|
||||
provides error if a2setup doesn't have internet
|
||||
|
@ -58,10 +62,23 @@
|
|||
download images from Apple, with Internet Archive as a backup
|
||||
install HFS.FST during netboot install
|
||||
|
||||
1.3.0: Oct 2015: support for using A2SERVER scripts from a location other than
|
||||
appleii.ivanx.com/a2server for development purposes
|
||||
Nov 2015: Merged Ivan's 1.2.5 release, removed support for Ubuntu for
|
||||
1.2.5+:Nov 2015: Merged Ivan's 1.2.5 release, removed support for Ubuntu for
|
||||
now (see RasppleII/a2server#11), patched ProDOS 8 in boot
|
||||
files for current year table, merged Ivan's 1.2.6 which does
|
||||
a better Spectrum installation, make sure unzip is installed,
|
||||
install unar from a package if it exists.
|
||||
files for current year table, install unar from a package if
|
||||
it exists.
|
||||
[not released]
|
||||
|
||||
1.2.6: Nov 2015: full, ready to use install of Spectrum; install unzip
|
||||
[released briefly, then withdrawn]
|
||||
|
||||
1.2.6+:Nov 2015: merged Ivan's 1.2.6
|
||||
[not released]
|
||||
|
||||
1.2.7: Dec 2015: codebase unified; preliminary Jessie support; case insensitive
|
||||
file system for A2FILES; removes GSFILES if empty; DOS3.3.FST
|
||||
and TEACH are installed with netboot installation; minor bug
|
||||
fixes and tweaks
|
||||
[not released]
|
||||
|
||||
128d1: Dec 2015: moved /media/A2SHARED to /srv/A2SERVER
|
||||
[not released]
|
||||
|
|
Loading…
Reference in New Issue
Block a user