2018-11-26 05:16:39 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Run this from the top level directory
|
|
|
|
|
|
|
|
set -e
|
2018-11-26 07:12:40 +00:00
|
|
|
source "res/util.sh"
|
2018-11-26 05:16:39 +00:00
|
|
|
|
2018-12-02 05:33:06 +00:00
|
|
|
mkdir -p mount/desk.acc || (cecho red "permission denied"; exit 1)
|
2018-11-26 05:16:39 +00:00
|
|
|
|
2019-01-22 04:58:49 +00:00
|
|
|
# Mount file xxx.built as $F1 file
|
2018-11-26 05:16:39 +00:00
|
|
|
function mount_f1 {
|
2019-01-22 04:58:49 +00:00
|
|
|
srcdir="$2"
|
|
|
|
dstdir="$3"
|
|
|
|
uppercase=$(echo "$1" | tr /a-z/ /A-Z/)
|
|
|
|
src="$srcdir/out/$1.built"
|
|
|
|
dst="$dstdir/$uppercase.\$F1"
|
|
|
|
cp "$src" "$dst" \
|
|
|
|
&& (cecho green "mounted $dst" ) \
|
|
|
|
|| (cecho red "failed to mount $dst" ; return 1)
|
|
|
|
}
|
|
|
|
|
|
|
|
# Mount file xxx.built as $F1 file, with DA auxtype
|
|
|
|
function mount_da {
|
2018-11-26 05:16:39 +00:00
|
|
|
srcdir="$2"
|
|
|
|
dstdir="$3"
|
|
|
|
uppercase=$(echo "$1" | tr /a-z/ /A-Z/)
|
|
|
|
src="$srcdir/out/$1.built"
|
|
|
|
dst="$dstdir/$uppercase.\$F1"
|
|
|
|
cp "$src" "$dst" \
|
|
|
|
&& xattr -wx prodos.AuxType '40 06' "$dst" \
|
|
|
|
&& (cecho green "mounted $dst" ) \
|
|
|
|
|| (cecho red "failed to mount $dst" ; return 1)
|
|
|
|
}
|
|
|
|
|
2019-01-22 04:58:49 +00:00
|
|
|
# Mount file xxx.SYS as SYS file
|
2018-11-26 05:16:39 +00:00
|
|
|
function mount_sys {
|
|
|
|
srcdir="$2"
|
|
|
|
dstdir="$3"
|
|
|
|
uppercase=$(echo "$1" | tr /a-z/ /A-Z/)
|
|
|
|
src="$srcdir/out/$1.SYS"
|
|
|
|
dst="$dstdir/$uppercase.SYS"
|
|
|
|
cp "$src" "$dst" \
|
|
|
|
&& (cecho green "mounted $dst" ) \
|
|
|
|
|| (cecho red "failed to mount $dst" ; return 1)
|
|
|
|
}
|
|
|
|
|
|
|
|
echo "Copying files to mount/"
|
2019-01-21 04:28:54 +00:00
|
|
|
mkdir -p mount
|
2018-11-26 05:16:39 +00:00
|
|
|
|
|
|
|
mount_f1 "desktop2" "desktop" "mount"
|
|
|
|
mount_sys "desktop.system" "desktop.system" "mount"
|
2019-01-21 04:28:54 +00:00
|
|
|
|
|
|
|
mkdir -p mount/desk.acc
|
|
|
|
for file in $(cat desk.acc/TARGETS); do
|
2019-01-22 04:58:49 +00:00
|
|
|
mount_da "$file" "desk.acc" "mount/desk.acc"
|
2019-01-21 04:28:54 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
mkdir -p mount/preview
|
|
|
|
for file in $(cat preview/TARGETS); do
|
2019-01-22 04:58:49 +00:00
|
|
|
mount_da "$file" "preview" "mount/preview"
|
2019-01-21 04:28:54 +00:00
|
|
|
done
|