IIgs installer works! No longer requires being run as root.

This commit is contained in:
Scott Duensing 2019-07-12 21:48:19 -05:00
parent 37eb12b76a
commit 0315c83012
2 changed files with 108 additions and 32 deletions

View file

@ -8,7 +8,7 @@ fi
mkdir -p ${OUT} mkdir -p ${OUT}
pushd ${JOEY}/joeylib/joeylib/src pushd ${JOEY}/joeylib/joeylib/src
iix assemble +L jIIgs.asm keep=31:/out/joey/jIIgsasm > jIIgs.asm.map iix assemble +L jIIgs.asm keep=31:/out/joey/jIIgsasm > jIIgs.asm.dis
iix compile jIIgs.c keep=31:/out/joey/jIIgsc iix compile jIIgs.c keep=31:/out/joey/jIIgsc
iix compile joey.c keep=31:/out/joey/joey iix compile joey.c keep=31:/out/joey/joey
@ -37,7 +37,7 @@ if [ ! -z $1 ]; then
VOL=Import VOL=Import
mkdir -p `dirname ${IMPORT}` mkdir -p `dirname ${IMPORT}`
rm ${OUT}/JLSTATS 2> /dev/null || true rm /tmp/IIgs/JLSTATS#040000 2> /dev/null || true
rm ${IMPORT} 2> /dev/null || true rm ${IMPORT} 2> /dev/null || true
cp ${OUT}/test ${OUT}/Test#B30000 cp ${OUT}/test ${OUT}/Test#B30000

View file

@ -27,6 +27,8 @@
# #
G_TITLE="JoeyLib Installer" G_TITLE="JoeyLib Installer"
G_PARENT= G_PARENT=
G_UID=$(id -ru)
G_GID=$(id -rg)
G_HAS_IIGS=0 G_HAS_IIGS=0
@ -201,11 +203,11 @@ function fetchGitHubRelease() {
local DEVELOPER=$2 local DEVELOPER=$2
local COMPONENT=$3 local COMPONENT=$3
local EXTENSION=$4 local EXTENSION=$4
local URL=`curl -s https://api.github.com/repos/${DEVELOPER}/${COMPONENT}/releases \ local URL=$(curl -s https://api.github.com/repos/${DEVELOPER}/${COMPONENT}/releases \
| grep "browser_download_url.*${EXTENSION}" \ | grep "browser_download_url.*${EXTENSION}" \
| cut -d : -f 2,3 \ | cut -d : -f 2,3 \
| tr -d \" \ | tr -d \" \
| head -n 1` | head -n 1)
local FILE=${URL##*/} local FILE=${URL##*/}
if [[ -e "${FILE}" ]]; then if [[ -e "${FILE}" ]]; then
rm "${FILE}" rm "${FILE}"
@ -217,12 +219,20 @@ function fetchGitHubRelease() {
function installIIgs() { function installIIgs() {
local RESULT= local RESULT=
local PREFIX=
local O= local O=
local ORCA= local ORCA=
local GGATE=
local IIGS="${G_PARENT}/sdks/IIgs" local IIGS="${G_PARENT}/sdks/IIgs"
G_HAS_IIGS=1
configWrite
configRead
if [[ -e "${IIGS}/unmountORCA.sh" ]]; then
"${IIGS}/unmountORCA.sh"
fi
mkdir -p "${IIGS}/ORCA" mkdir -p "${IIGS}/ORCA"
chmod 777 "${IIGS}/ORCA"
if [[ ! -e "${IIGS}/hfsDrive.img" ]]; then if [[ ! -e "${IIGS}/hfsDrive.img" ]]; then
echo "" echo ""
@ -254,6 +264,7 @@ function installIIgs() {
fi fi
"${IIGS}/mountORCA.sh" "${IIGS}/mountORCA.sh"
sudo chown ${G_UID}:${G_GID} "${IIGS}/ORCA/."
if [[ ! -e "${IIGS}/ORCA/Languages/cc" ]]; then if [[ ! -e "${IIGS}/ORCA/Languages/cc" ]]; then
tFileBrowser ORCA "Please locate your 'OPUS ][ The Software' ISO" .iso .. tFileBrowser ORCA "Please locate your 'OPUS ][ The Software' ISO" .iso ..
@ -266,6 +277,10 @@ function installIIgs() {
tBoldBox tCYAN "NOTE: If an error is encountered, installer will exit!" tBoldBox tCYAN "NOTE: If an error is encountered, installer will exit!"
if [[ ! -d GoldenGate ]]; then if [[ ! -d GoldenGate ]]; then
tFileBrowser GGATE "Please locate your 'Golden Gate' MSI" .msi ..
if [[ -z ${GGATE} || "${GGATE}" == "" ]]; then
return 0
fi
echo "" echo ""
tBoldBox tPURPLE "Building GoldenGate" tBoldBox tPURPLE "Building GoldenGate"
echo "" echo ""
@ -279,16 +294,20 @@ function installIIgs() {
pushd GoldenGate >& /dev/null pushd GoldenGate >& /dev/null
git submodule init git submodule init
git submodule update git submodule update
PREFIX=`pwd`/installed
mkdir -p build mkdir -p build
cd build cd build
cmake -DCMAKE_INSTALL_PREFIX=${PREFIX} .. | tee make.out cmake -DCMAKE_INSTALL_PREFIX=$(pwd)/installed ..
make | tee -a make.out make
make install
if [[ ! -e bin/iix ]]; then if [[ ! -e bin/iix ]]; then
tBoldBox tRED "Failed to build GoldenGate." tBoldBox tRED "Failed to build GoldenGate."
exit 1 exit 1
fi fi
cp -f bin/{iix,dumpobj,opus-extractor} "${IIGS}/." cp -f bin/{iix,dumpobj,opus-extractor} "${IIGS}/."
cd installed
msiextract "${GGATE}"
find -name ".*" -delete
cp -rf GoldenGate/* "${IIGS}/ORCA/."
popd >& /dev/null popd >& /dev/null
fi fi
@ -296,7 +315,6 @@ function installIIgs() {
echo "" echo ""
tBoldBox tPURPLE "Installing ORCA/C" tBoldBox tPURPLE "Installing ORCA/C"
echo "" echo ""
chown -R `id -ru`:`id -rg` "${IIGS}/ORCA"
isoinfo -i "${ORCA}" -x /FOR_EMUL/BYTEWORK.S\;1 > BYTEWORKS isoinfo -i "${ORCA}" -x /FOR_EMUL/BYTEWORK.S\;1 > BYTEWORKS
"${IIGS}/opus-extractor" -v BYTEWORKS "${IIGS}/ORCA" "${IIGS}/opus-extractor" -v BYTEWORKS "${IIGS}/ORCA"
@ -304,8 +322,34 @@ function installIIgs() {
tBoldBox tPURPLE "Upgrading ORCA/C" tBoldBox tPURPLE "Upgrading ORCA/C"
echo "" echo ""
fetchGitHubRelease RESULT byteworksinc ORCA-C 2mg fetchGitHubRelease RESULT byteworksinc ORCA-C 2mg
"${IIGS}/opus-extractor" -v -s / ${RESULT} orcaUpdate "${IIGS}/opus-extractor" -v -s / ${RESULT} "${IIGS}/ORCA"
cp -rf orcaUpdate/* "${IIGS}/ORCA/."
pushd ${GOLDEN_GATE} >& /dev/null
#find . -type d -exec chmod 755 {} \;
#find . -type f -exec chmod 644 {} \;
for O in etc/* ; do iix chtyp -t txt "${O}" ; done
for O in lib/* ; do if [ -f "${O}" ] ; then iix chtyp -t lib "${O}" ; fi ; done
for O in usr/lib/lib* ; do iix chtyp -t lib "${O}" ; done
for O in usr/lib/tmac/* ; do iix chtyp -t txt "${O}" ; done
for O in bin/* ; do iix chtyp -t exe "${O}" ; done
for O in usr/bin/* ; do iix chtyp -t exe "${O}" ; done
for O in usr/local/bin/* ; do iix chtyp -t exe "${O}" ; done
for O in Languages/* ; do if [ -f "${O}" ] ; then iix chtyp -t exe "${O}" ; fi ; done ;
for O in Utilities/Help/* ; do if [ -f "${O}" ] ; then iix chtyp -t txt "${O}" ; fi ; done ;
for O in Utilities/* ; do if [ -f "${O}" ] ; then iix chtyp -t exe "${O}" ; fi ; done ;
for O in Libraries/* ; do if [ -f "${O}" ] ; then iix chtyp -t lib "${O}" ; fi ; done ;
for O in Libraries/AInclude/* ; do if [ -f "${O}" ] ; then iix chtyp -t txt "${O}" ; fi ; done ;
for O in Libraries/APWCInclude/* ; do if [ -f "${O}" ] ; then iix chtyp -t txt "${O}" ; fi ; done ;
for O in Libraries/AppleUtil/* ; do if [ -f "${O}" ] ; then iix chtyp -t txt "${O}" ; fi ; done ;
for O in Libraries/ORCACDefs/* ; do if [ -f "${O}" ] ; then iix chtyp -l cc "${O}" ; fi ; done ;
for O in Libraries/ORCAInclude/* ; do if [ -f "${O}" ] ; then iix chtyp -l asm "${O}" ; fi ; done ;
for O in Libraries/RInclude/* ; do if [ -f "${O}" ] ; then iix chtyp -l rez "${O}" ; fi ; done ;
for O in Libraries/Tool.Interface/* ; do if [ -f "${O}" ] ; then iix chtyp -l pascal "${O}" ; fi ; done ;
for O in Libraries/GSoftDefs/* ; do if [ -f "${O}" ] ; then iix chtyp -t 0x5e -a 0x8007 "${O}" ; fi ; done ;
for O in Libraries/ORCAPascalDefs/* ; do if [ -f "${O}" ] ; then iix chtyp -t 0x5e -a 0x8009 "${O}" ; fi ; done ;
for O in Libraries/m2defs/* ; do if [ -f "${O}" ] ; then iix chtyp -t 0x5e -a 0x8006 "${O}" ; fi ; done ;
popd >& /dev/null
fi fi
if [[ ! -d gsplus ]]; then if [[ ! -d gsplus ]]; then
@ -324,14 +368,32 @@ function installIIgs() {
mkdir -p "${IIGS}/gsplus" mkdir -p "${IIGS}/gsplus"
cp -f bin/{GSplus,partls,to_pro} "${IIGS}/gsplus/." cp -f bin/{GSplus,partls,to_pro} "${IIGS}/gsplus/."
popd >& /dev/null popd >& /dev/null
echo -e "s7d1 = System601.po\n\ng_limit_speed = 0\n" > "${IIGS}/gsplus/config.txt"
echo -e "s7d1 = System601.po\ns7d2 = /tmp/IIgs/import.po\n" > "${IIGS}/gsplus/IIgsTest.cfg"
fi
if [[ ! -f "${IIGS}/gsplus/ROM.03" ]]; then
echo ""
tBoldBox tPURPLE "Installing IIgs ROM"
echo ""
if [[ -e rom3.zip ]]; then
rm -f rom3.zip
fi
wget http://www.whatisthe2gs.apple2.org.za/files/rom3.zip wget http://www.whatisthe2gs.apple2.org.za/files/rom3.zip
unzip rom3.zip unzip rom3.zip
mv -f APPLE2GS.ROM2 "${IIGS}/gsplus/ROM.03" mv -f APPLE2GS.ROM2 "${IIGS}/gsplus/ROM.03"
fi
if [[ ! -f "${IIGS}/gsplus/System601.po" ]]; then
echo ""
tBoldBox tPURPLE "Installing GS/OS"
echo ""
if [[ -e harddrive_image.zip ]]; then
rm -f harddrive_image.zip
fi
wget http://www.whatisthe2gs.apple2.org.za/files/harddrive_image.zip wget http://www.whatisthe2gs.apple2.org.za/files/harddrive_image.zip
unzip harddrive_image.zip unzip harddrive_image.zip
mv -f "System 6 and Free Games.hdv" "${IIGS}/gsplus/System601.po" mv -f "System 6 and Free Games.hdv" "${IIGS}/gsplus/System601.po"
echo -e "s7d1 = System601.po\n\ng_limit_speed = 0\n" > "${IIGS}/gsplus/config.txt"
echo -e "s7d1 = System601.po\ns7d2 = /tmp/IIgs/import.po\n" > "${IIGS}/gsplus/IIgsTest.cfg"
fi fi
if [[ ! -d cadius ]]; then if [[ ! -d cadius ]]; then
@ -350,29 +412,42 @@ function installIIgs() {
popd >& /dev/null popd >& /dev/null
fi fi
if [[ ! -e ntconverter.zip ]]; then if [[ ! -e "${IIGS}/ntconverter/ntconverter.php" ]]; then
echo "" echo ""
tBoldBox tPURPLE "Installing NinjaTracker Converter" tBoldBox tPURPLE "Installing NinjaTracker Converter"
echo "" echo ""
if [[ -e ntconverter.zip ]]; then
rm -f ntconverter.zip
fi
wget https://www.ninjaforce.com/downloads/ntconverter.zip wget https://www.ninjaforce.com/downloads/ntconverter.zip
unzip ntconverter.zip unzip ntconverter.zip
mkdir -p "${IIGS}/ntconverter" mkdir -p "${IIGS}/ntconverter"
cp -f ntconverter.php "${IIGS}/ntconverter/." cp -f ntconverter.php "${IIGS}/ntconverter/."
fi fi
mkdir -p "${JOEY}/dist/IIgs"
if [[ ! -e "${JOEY}/dist/IIgs/Tool221#ba0000" ]]; then
echo ""
tBoldBox tPURPLE "Installing Tool221"
echo ""
if [[ -e ninjatracker_tool221_v2.1.2mg ]]; then
rm -f ninjatracker_tool221_v2.1.2mg
fi
wget https://www.brutaldeluxe.fr/products/apple2gs/tool221/ninjatracker_tool221_v2.1.2mg
"${IIGS}/cadius/cadius" extractfile ninjatracker_tool221_v2.1.2mg NT.TOOL221.V2.1/SYSTEM/TOOLS/TOOL221 .
cp -f TOOL221#BA0000 "${JOEY}/dist/IIgs/Tool221#ba0000"
fi
echo "" echo ""
tBoldBox tPURPLE "Building JoeyLib" tBoldBox tPURPLE "Building JoeyLib"
echo "" echo ""
set -x
O=${IIGS}/ORCA/out/joey O=${IIGS}/ORCA/out/joey
if [[ -d "${O}" ]]; then if [[ -d "${O}" ]]; then
rm -rf "${O}" rm -rf "${O}"
fi fi
mkdir -p "${O}" mkdir -p "${O}"
G_HAS_IIGS=1 pushd "${JOEY}/joeylib/joeylib/src" >& /dev/null
configWrite
configRead
pushd ${JOEY}/joeylib/joeylib/src >& /dev/null
iix assemble +L jIIgs.asm keep=31:/out/joey/jIIgsasm > jIIgs.asm.dis iix assemble +L jIIgs.asm keep=31:/out/joey/jIIgsasm > jIIgs.asm.dis
iix compile jIIgs.c keep=31:/out/joey/jIIgsc iix compile jIIgs.c keep=31:/out/joey/jIIgsc
iix compile joey.c keep=31:/out/joey/joey iix compile joey.c keep=31:/out/joey/joey
@ -381,11 +456,15 @@ function installIIgs() {
iix makelib 31:/out/joey/joeylib +31:/out/joey/jIIgsc.a iix makelib 31:/out/joey/joeylib +31:/out/joey/jIIgsc.a
iix makelib 31:/out/joey/joeylib +31:/out/joey/joey.a iix makelib 31:/out/joey/joeylib +31:/out/joey/joey.a
popd >& /dev/null popd >& /dev/null
mkdir -p ${JOEY}/dist/IIgs cp -f "${O}/joeylib" "${JOEY}/dist/IIgs/joeylib#b20000"
cp -f ${JOEY}/joeylib/joeylib/lib/IIgs/Tool221#ba0000 ${JOEY}/dist/IIgs/. cp -f "${JOEY}/joeylib/joeylib/src/joey.h" "${JOEY}/dist/."
cp -f ${O}/joeylib ${JOEY}/dist/IIgs/joeylib#b20000 cp -f "${JOEY}/joeylib/scripts/build-IIgs.helper.sh" "${JOEY}/dist/."
cp -f ${JOEY}/joeylib/joeylib/src/joey.h ${JOEY}/dist/.
cp -f ${JOEY}/joeylib/scripts/build-IIgs.helper.sh ${JOEY}/dist/. "${IIGS}/unmountORCA.sh"
if [[ ! -e "${IIGS}/hfsDrive.img.backup.tar.bz2" ]]; then
tar cjf "${IIGS}/hfsDrive.img.backup.tar.bz2" "${IIGS}/hfsDrive.img"
fi
} }
@ -463,6 +542,7 @@ function mainMenu() {
set e- set e-
) )
if [[ "${CHOICE}" != "" ]]; then if [[ "${CHOICE}" != "" ]]; then
sudo -v
CHOICE="install${CHOICE}" CHOICE="install${CHOICE}"
${CHOICE} ${CHOICE}
fi fi
@ -472,11 +552,6 @@ function mainMenu() {
# --- START # --- START
if [[ $EUID -ne 0 ]]; then
echo "The installer must be run as root."
exit 1
fi
mkdir -p installerWork mkdir -p installerWork
# Do we have Towel yet? # Do we have Towel yet?
@ -484,7 +559,7 @@ if [[ ! -f installerWork/towel/towel.sh ]]; then
# Do we have GIT? # Do we have GIT?
if [[ "$(which git || true)" == "" ]]; then if [[ "$(which git || true)" == "" ]]; then
echo "Installing git..." echo "Installing git..."
apt-get -y install git >& /dev/null sudo apt-get -y install git >& /dev/null
fi fi
echo "Downloading towel.sh support library..." echo "Downloading towel.sh support library..."
git clone https://skunkworks.kangaroopunch.com/skunkworks/towel.git installerWork/towel >& /dev/null git clone https://skunkworks.kangaroopunch.com/skunkworks/towel.git installerWork/towel >& /dev/null
@ -509,9 +584,10 @@ tCheckPackages MISSING cmake ragel hfsplus hfsutils hfsprogs libreadline-dev lib
uuid-dev libssl-dev bash patch make tar xz-utils bzip2 gzip sed cpio \ uuid-dev libssl-dev bash patch make tar xz-utils bzip2 gzip sed cpio \
libpulse-dev{,:i386} libasound-dev{,:i386} \ libpulse-dev{,:i386} libasound-dev{,:i386} \
libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libfreetype6-dev libpcap0.8-dev \ libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libfreetype6-dev libpcap0.8-dev \
php-cli php-cli msitools
if [[ "${MISSING}" != "" ]]; then if [[ "${MISSING}" != "" ]]; then
sudo -v
if (whiptail --title "${G_TITLE}" --yesno "Some required packages are missing.\n\nInstall them now?" 9 40); then if (whiptail --title "${G_TITLE}" --yesno "Some required packages are missing.\n\nInstall them now?" 9 40); then
TEMP=" ${MISSING//[^ ]}" TEMP=" ${MISSING//[^ ]}"
TOTAL=${#TEMP} TOTAL=${#TEMP}
@ -520,7 +596,7 @@ if [[ "${MISSING}" != "" ]]; then
for PACKAGE in ${MISSING}; do for PACKAGE in ${MISSING}; do
PERCENT=$(( 100*(++COUNT)/TOTAL )) PERCENT=$(( 100*(++COUNT)/TOTAL ))
echo ${PERCENT} echo ${PERCENT}
apt-get -y install ${PACAKGE} >& /dev/null sudo apt-get -y install ${PACAKGE} >& /dev/null
done done
} | whiptail --title "${G_TITLE}" --gauge "\nInstalling packages..." 7 50 0 } | whiptail --title "${G_TITLE}" --gauge "\nInstalling packages..." 7 50 0
else else