museum: the owner's media as a private media pack
tools/museum-pack.sh hard-links the IRIX 6.5.29 installation CDs, the Mac OS 9.2 and Tiger images, the SunOS 4.1.4 CD and the PROMs into build/museum-pack (SHA256 MANIFEST, then a tar); museum media --pack DIR imports a pack in place. The BSD-3-Clause ARCS firmware henry_arcs.scc.bin is taken from build/firmware and packed. The Sun SS-5 PROM and MAME's indy_4610 ROM set are proprietary and are only packed when the owner supplies them. Nothing of the pack is committed or part of the release. checkflist exit 0 after installing the updated program.
This commit is contained in:
1 parent
b5145684cf
commit
08823a14c2
4 files changed
+311
-2
No files matched your search
@@ -24,6 +24,29 @@ their own copies; the museum only records symbolic links:
|
||||
The museum home is `$HOME/Museum` (`MUSEUM_DIR`), with `media/<id>/` and
|
||||
`vms/<id>/`.
|
||||
|
||||
## The private media pack
|
||||
|
||||
The media are too large and too proprietary for the tree or the release ISO.
|
||||
`tools/museum-pack.sh` builds a private pack under `build/museum-pack/` (hard
|
||||
links, `MANIFEST` with SHA256, then a tar) from the owner's files:
|
||||
|
||||
- IRIX 6.5.29: the installation CDs under `MUSEUM_IRIX_DIR`
|
||||
- Mac OS 9.2 and Tiger: `MUSEUM_MACOS9`, `MUSEUM_TIGER`
|
||||
- SunOS 4.1.4: `MUSEUM_SUNOS4` and the SS-5 PROM `MUSEUM_SS5`
|
||||
- IRIX ARCS: `MUSEUM_ARCS` (`henry_arcs.scc.bin`, BSD-3-Clause, from the
|
||||
r9999/qemu-sgi-ip22 projects; `build/firmware/` is the fallback)
|
||||
|
||||
The Sun SS-5 PROM is proprietary and is only packed when the owner supplies
|
||||
it; MAME's Indy ROM set is proprietary too. The ARCS firmware is free and
|
||||
is included from `build/firmware/henry_arcs.scc.bin`.
|
||||
|
||||
The pack has the museum home layout and is used in place:
|
||||
|
||||
museum media --pack /media/usb/museum-pack
|
||||
|
||||
or unpacked over the home (`tar -C ~/Museum -xf ...`). Nothing in the pack is
|
||||
committed or shipped.
|
||||
|
||||
## Machines and command lines
|
||||
|
||||
The table is in `machines.c`. The Mac arguments are the measured ones;
|
||||
@@ -51,8 +74,10 @@ SunOS starts only with the SS-5 PROM, and the IRIX entry has two backends.
|
||||
image`. Attaching the ISO as a SCSI disk and `boot disk1:d` fails the same
|
||||
way. The real SS-5 PROM (`ss5.bin`) is required; the museum adds `-bios`
|
||||
when the file is imported.
|
||||
* IRIX: stock QEMU 11.1.2 (`qemu-system-mips64`) has no `indy` machine. The
|
||||
qemu-sgi-ip22 fork is the primary backend, MAME (`indy_4610`,
|
||||
* IRIX: the 6.5.29 installation CDs are here (`~/rev/sgi/.../SGI IRIX
|
||||
6.5.29`, five ISOs), but stock QEMU 11.1.2 (`qemu-system-mips64`) has no
|
||||
`indy` machine and no installed `base.img`/`henry_arcs.scc.bin` exists yet.
|
||||
The qemu-sgi-ip22 fork is the primary backend, MAME (`indy_4610`,
|
||||
`-gio64_gfx xl24 -hard1`) the fallback. Neither is part of `emulators/qemu`.
|
||||
|
||||
## Build and test
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
.Nm
|
||||
.Cm media Ar id Cm --clear
|
||||
.Nm
|
||||
.Cm media Cm --pack Ar dir
|
||||
.Nm
|
||||
.Cm create Ar id
|
||||
.Nm
|
||||
.Cm install Ar id
|
||||
@@ -107,6 +109,15 @@ link in
|
||||
List the imported media and their targets.
|
||||
.It Cm media Ar id Cm --clear
|
||||
Remove the links (the files they point to are not touched).
|
||||
.It Cm media Cm --pack Ar dir
|
||||
Import every machine's media from a pack made by
|
||||
.Pa tools/museum-pack.sh :
|
||||
.Ar dir
|
||||
has the layout
|
||||
.Pa media/<id>/ ,
|
||||
the same as the museum home.
|
||||
The pack is the owner's private copy of the installation media; it is not part
|
||||
of Makronix.
|
||||
.It Cm create Ar id
|
||||
Create the disk image with
|
||||
.Xr qemu-img 1 ,
|
||||
@@ -147,6 +158,13 @@ binary, default
|
||||
.Sq qemu-img
|
||||
from
|
||||
.Ev PATH .
|
||||
.It Ev MUSEUM_SS5
|
||||
The SS-5 PROM for the media pack
|
||||
.Pq Pa tools/museum-pack.sh .
|
||||
.It Ev MUSEUM_ARCS
|
||||
The BSD-licensed
|
||||
.Pa henry_arcs.scc.bin
|
||||
for the media pack and qemu-sgi.
|
||||
.El
|
||||
.Sh SETUP
|
||||
The order is the same for the three scripted machines:
|
||||
@@ -216,6 +234,26 @@ with the real PROM the
|
||||
command at the prompt is what counts.
|
||||
.Cm run
|
||||
then boots the disk.
|
||||
.Ss Media pack
|
||||
The media are proprietary and are not part of Makronix.
|
||||
.Pa tools/museum-pack.sh
|
||||
in the source tree builds a private pack under
|
||||
.Pa build/museum-pack/
|
||||
with the layout above (hard links, a
|
||||
.Pa MANIFEST
|
||||
of SHA256 sums and a tar):
|
||||
.Bd -literal -offset indent
|
||||
$ MUSEUM_IRIX_DIR=~/irix-cds \
|
||||
MUSEUM_MACOS9=~/MacOS9.iso \
|
||||
MUSEUM_TIGER=~/tiger.iso \
|
||||
MUSEUM_SUNOS4=~/sunos.iso \
|
||||
MUSEUM_SS5=~/ss5.bin \
|
||||
MUSEUM_ARCS=~/henry_arcs.scc.bin \
|
||||
tools/museum-pack.sh
|
||||
$ museum media --pack build/museum-pack
|
||||
.Ed
|
||||
.Pp
|
||||
The pack is a private copy and must not be redistributed.
|
||||
.Ss IRIX 6.5
|
||||
Stock QEMU has no SGI Indy machine.
|
||||
.Nm
|
||||
|
||||
@@ -7,7 +7,9 @@
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <dirent.h>
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -25,6 +27,7 @@ usage(void)
|
||||
"directory)\n"
|
||||
" museum media ID -l list the imported media\n"
|
||||
" museum media ID --clear forget the imported media\n"
|
||||
" museum media --pack DIR import a media pack\n"
|
||||
" museum create ID create the disk image\n"
|
||||
" museum install ID boot from the install media\n"
|
||||
" museum run ID boot the installed system\n"
|
||||
@@ -139,6 +142,53 @@ cmd_status(int argc, char **argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
import_pack(const char *dir)
|
||||
{
|
||||
struct museum_state st;
|
||||
DIR *d;
|
||||
struct dirent *de;
|
||||
char path[MUSEUM_PATH];
|
||||
size_t i;
|
||||
int n = 0;
|
||||
|
||||
for (i = 0; i < museum_machine_count; i++) {
|
||||
memset(&st, 0, sizeof(st));
|
||||
st.m = &museum_machines[i];
|
||||
museum_state_init(&st);
|
||||
snprintf(path, sizeof(path), "%s/media/%s", dir, st.m->id);
|
||||
d = opendir(path);
|
||||
if (d == NULL)
|
||||
continue;
|
||||
while ((de = readdir(d)) != NULL) {
|
||||
char file[MUSEUM_PATH];
|
||||
size_t pl, nl;
|
||||
|
||||
if (strcmp(de->d_name, ".") == 0 ||
|
||||
strcmp(de->d_name, "..") == 0)
|
||||
continue;
|
||||
pl = strlen(path);
|
||||
nl = strlen(de->d_name);
|
||||
if (pl + 1 + nl >= sizeof(file))
|
||||
continue;
|
||||
memcpy(file, path, pl);
|
||||
file[pl] = '/';
|
||||
memcpy(file + pl + 1, de->d_name, nl + 1);
|
||||
if (museum_import_media(&st, file) == 0)
|
||||
n++;
|
||||
}
|
||||
closedir(d);
|
||||
}
|
||||
if (n == 0) {
|
||||
fprintf(stderr, "museum: no media under %s/media/*\n", dir);
|
||||
fprintf(stderr, "museum: is the pack extracted, or is the "
|
||||
"medium mounted?\n");
|
||||
return -1;
|
||||
}
|
||||
printf("museum: %d media files imported from %s\n", n, dir);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
cmd_media(int argc, char **argv)
|
||||
{
|
||||
@@ -146,6 +196,9 @@ cmd_media(int argc, char **argv)
|
||||
const struct museum_machine *m;
|
||||
int i, r = 0;
|
||||
|
||||
if (argc >= 2 && strcmp(argv[0], "--pack") == 0)
|
||||
return import_pack(argv[1]) == 0 ? 0 : 1;
|
||||
|
||||
if (argc < 1)
|
||||
usage();
|
||||
m = machine_arg(argv[0]);
|
||||
|
||||
Executable
+193
@@ -0,0 +1,193 @@
|
||||
#!/bin/sh
|
||||
# License: CNCL 1.0 (Could Not Care Less), see LICENSE at the top of the tree.
|
||||
#
|
||||
# museum-pack.sh -- pack the owner's museum media into a private media pack
|
||||
#
|
||||
# usage: tools/museum-pack.sh [--no-tar] [--out DIR]
|
||||
#
|
||||
# The museum's operating system media are proprietary: they belong to their
|
||||
# owner, are not part of Makronix and must not be committed or redistributed.
|
||||
# This tool therefore writes the pack under build/ (gitignored) from the files
|
||||
# the owner already has, with hard links (same file system, no second copy)
|
||||
# and a MANIFEST of SHA256 sums. The pack has the museum home's layout:
|
||||
#
|
||||
# media/irix65/*.iso
|
||||
# media/sunos4/sunos_4.1.4_install.iso ss5.bin
|
||||
# media/macos9/*.ISO
|
||||
# media/tiger/*.iso
|
||||
#
|
||||
# so it can be unpacked over $HOME/Museum, or used in place with
|
||||
# `museum media --pack DIR`.
|
||||
#
|
||||
# Sources come from the environment, defaulting to the known paths here:
|
||||
#
|
||||
# MUSEUM_IRIX_DIR directory with the IRIX 6.5.29 *.iso
|
||||
# MUSEUM_MACOS9 the Mac OS 9 install CD image
|
||||
# MUSEUM_TIGER the Mac OS X 10.4 install DVD image
|
||||
# MUSEUM_SUNOS4 the SunOS 4.1.4 install CD image
|
||||
# MUSEUM_SS5 the SS-5 PROM (ss5.bin), optional but needed to boot
|
||||
# MUSEUM_ARCS henry_arcs.scc.bin (qemu-sgi), optional
|
||||
#
|
||||
# A missing PROM is reported and the pack is still written; a missing
|
||||
# install CD is an error.
|
||||
|
||||
set -eu
|
||||
|
||||
TOP=$(cd "$(dirname "$0")/.." && pwd)
|
||||
OUT=$TOP/build/museum-pack
|
||||
TAR=1
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
case $1 in
|
||||
--no-tar) TAR=0 ;;
|
||||
--out) shift; [ $# -gt 0 ] || { echo "usage: ${0##*/} [--no-tar] [--out DIR]" >&2; exit 2; }; OUT=$1 ;;
|
||||
*) echo "usage: ${0##*/} [--no-tar] [--out DIR]" >&2; exit 2 ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
IRIX_DIR=${MUSEUM_IRIX_DIR:-"$HOME/rev/sgi/fsck.technology/software/Silicon Graphics/IRIX Install Media/SGI IRIX 6.5/SGI IRIX 6.5.29"}
|
||||
MACOS9=${MUSEUM_MACOS9:-"$HOME/rev/apple/MAC_OS_9-2-2_693-4669_0.ISO"}
|
||||
TIGER=${MUSEUM_TIGER:-"$HOME/rev/apple/tiger-10-4-6-ppc.iso"}
|
||||
SUNOS4=${MUSEUM_SUNOS4:-"$HOME/rev/sun/sunos_4.1.4_install.iso"}
|
||||
SS5=${MUSEUM_SS5:-"$HOME/rev/sun/ss5.bin"}
|
||||
ARCS=${MUSEUM_ARCS:-"$HOME/rev/sgi/henry_arcs.scc.bin"}
|
||||
# the BSD-licensed ARCS firmware can be downloaded once into build/firmware/
|
||||
[ -f "$ARCS" ] || ARCS=$TOP/build/firmware/henry_arcs.scc.bin
|
||||
|
||||
missing=
|
||||
warn() { echo "museum-pack: $*" >&2; }
|
||||
|
||||
sha256_file()
|
||||
{
|
||||
if command -v sha256sum >/dev/null 2>&1; then
|
||||
sha256sum "$1" | awk '{print $1}'
|
||||
else
|
||||
cksum -a sha256 "$1" | awk '{print $NF}'
|
||||
fi
|
||||
}
|
||||
|
||||
size_file()
|
||||
{
|
||||
if stat -c '%s' "$1" >/dev/null 2>&1; then
|
||||
stat -c '%s' "$1"
|
||||
else
|
||||
stat -f '%z' "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
# link SRC DEST: a hard link where the file system allows it, a copy otherwise
|
||||
link()
|
||||
{
|
||||
mkdir -p "$(dirname "$2")"
|
||||
[ -e "$2" ] && return 0
|
||||
if ! ln "$1" "$2" 2>/dev/null; then
|
||||
cp -p "$1" "$2"
|
||||
fi
|
||||
}
|
||||
|
||||
add()
|
||||
{
|
||||
src=$1
|
||||
id=$2
|
||||
[ -f "$src" ] || { warn "missing $id media: $src"; missing="$missing $id"; return 1; }
|
||||
[ -s "$src" ] || { warn "empty $id media: $src"; missing="$missing $id"; return 1; }
|
||||
base=$(basename "$src")
|
||||
link "$src" "$OUT/media/$id/$base"
|
||||
printf '%s %s %s %s\n' "$(sha256_file "$src")" \
|
||||
"$(size_file "$src")" "$id" "$base" >> "$OUT/MANIFEST.files"
|
||||
echo " $id/$base"
|
||||
}
|
||||
|
||||
rm -rf "$OUT"
|
||||
mkdir -p "$OUT/media"
|
||||
: > "$OUT/MANIFEST.files"
|
||||
|
||||
echo "museum-pack: IRIX 6.5.29"
|
||||
if [ -d "$IRIX_DIR" ]; then
|
||||
for iso in "$IRIX_DIR"/*.iso; do
|
||||
[ -f "$iso" ] || continue
|
||||
add "$iso" irix65 || true
|
||||
done
|
||||
else
|
||||
warn "no IRIX media directory: $IRIX_DIR"
|
||||
missing="$missing irix65"
|
||||
fi
|
||||
echo "museum-pack: Mac OS 9.2"
|
||||
add "$MACOS9" macos9 || true
|
||||
echo "museum-pack: Mac OS X 10.4 Tiger"
|
||||
add "$TIGER" tiger || true
|
||||
echo "museum-pack: SunOS 4.1.4"
|
||||
add "$SUNOS4" sunos4 || true
|
||||
echo "museum-pack: PROMs"
|
||||
if [ -f "$SS5" ]; then
|
||||
add "$SS5" sunos4 || true
|
||||
else
|
||||
warn "no SS-5 PROM at $SS5; SunOS 4.1.4 cannot boot without it"
|
||||
echo " ss5.bin: missing (set MUSEUM_SS5=/path/to/ss5.bin)"
|
||||
missing="$missing ss5.bin"
|
||||
fi
|
||||
if [ -f "$ARCS" ]; then
|
||||
add "$ARCS" irix65 || true
|
||||
if [ -f "$(dirname "$ARCS")/LICENSE.r9999" ]; then
|
||||
add "$(dirname "$ARCS")/LICENSE.r9999" irix65 || true
|
||||
fi
|
||||
else
|
||||
warn "no henry_arcs.scc.bin at $ARCS; qemu-sgi boots only after the"
|
||||
warn "installed IRIX kernel and the ARCS firmware are in media/irix65/"
|
||||
missing="$missing henry_arcs.scc.bin"
|
||||
fi
|
||||
|
||||
# the manifest: a header, then the files, sorted by machine and name
|
||||
{
|
||||
echo "# Makronix Museum media pack, $(date -u +%Y-%m-%dT%H:%M:%SZ)"
|
||||
echo "# PRIVATE: the media are the owner's; not part of Makronix."
|
||||
echo "# sha256 bytes machine file"
|
||||
sort -k3,3 -k4,4 "$OUT/MANIFEST.files"
|
||||
} > "$OUT/MANIFEST"
|
||||
rm -f "$OUT/MANIFEST.files"
|
||||
|
||||
cat > "$OUT/README" <<'EOF'
|
||||
Makronix Museum media pack
|
||||
==========================
|
||||
|
||||
This pack is a private copy of the museum owner's installation media. The
|
||||
media are proprietary and are NOT part of Makronix: do not redistribute this
|
||||
pack, and do not commit it to the Makronix tree.
|
||||
|
||||
The layout is the museum home:
|
||||
|
||||
media/irix65/ IRIX 6.5.29 installation CDs
|
||||
media/sunos4/ SunOS 4.1.4 install CD and the SS-5 PROM (ss5.bin)
|
||||
media/macos9/ Mac OS 9.2 install CD
|
||||
media/tiger/ Mac OS X 10.4 install DVD
|
||||
|
||||
Use it in place (a mounted USB stick or DVD) with:
|
||||
|
||||
museum media --pack /path/to/museum-pack
|
||||
|
||||
or unpack it into the museum home:
|
||||
|
||||
tar -C "$HOME/Museum" -xf Makronix-museum-media-YYYY-MM-DD.tar
|
||||
|
||||
The Macs need no PROM: QEMU's OpenBIOS is part of emulators/qemu. SunOS
|
||||
4.1.4 needs the SPARCstation 5 PROM (ss5.bin, from an SS-5 or a ROM archive);
|
||||
it is proprietary and is only packed when the owner puts it at MUSEUM_SS5.
|
||||
IRIX's qemu-sgi uses henry_arcs.scc.bin, the BSD-3-Clause ARCS firmware of
|
||||
the r9999/qemu-sgi-ip22 projects; this pack includes it when present in
|
||||
build/firmware/. MAME's indy_4610 ROM set is proprietary and is not packed.
|
||||
|
||||
The IRIX pack holds the installation CDs, not an installed IRIX: qemu-sgi
|
||||
boots an installed kernel from vms/irix65/base.img (see museum(1)).
|
||||
EOF
|
||||
|
||||
total=$(awk '{s += $2} END {printf "%.1f", s / 1073741824}' "$OUT/MANIFEST")
|
||||
echo "museum-pack: $OUT ($total GiB)"
|
||||
[ -z "$missing" ] || echo "museum-pack: missing:$missing" >&2
|
||||
|
||||
if [ "$TAR" = 1 ]; then
|
||||
tarfile=$TOP/build/Makronix-museum-media-$(date +%Y-%m-%d).tar
|
||||
echo "museum-pack: tar $tarfile (this reads every media file once)"
|
||||
tar -cf "$tarfile" -C "$OUT" .
|
||||
ls -lh "$tarfile"
|
||||
fi
|
||||
Reference in new issue
Block a user