museum: four vintage machines in QEMU (Makronix Museum group)
IRIX 6.5.29, SunOS 4.1.4, Mac OS 9.2 and Mac OS X 10.4 Tiger as QEMU machines: /usr/bin/museum (base system, CNCL) links the owner's media, creates the qcow2 disks, prints the exact command and checks what is missing; the emulator comes from pkgsrc, offered by the installer as the new group "Makronix Museum" (kind museum, like games). Measured 2026-11-16 with QEMU 11.1.2: the Mac OS 9.2.2 CD reaches the Finder and the Tiger 10.4.6 DVD the language chooser through `museum install'. OpenBIOS cannot boot the SunOS 4.1.4 CD (the SS-5 PROM ss5.bin is required); stock QEMU has no SGI Indy (qemu-sgi-ip22 or MAME indy_4610). The operating system media are proprietary and stay with their owner. checkflist after installing the program: only the pre-existing missing makronix-guide-vm.7 remains (another session's file).
This commit is contained in:
1 parent
b8d58fb11a
commit
c7fdb6957a
23 files changed
+1867
-26
No files matched your search
+3
-2
@@ -29,8 +29,9 @@ destdir (or start from a clean `build/obj`) before the first release without
|
||||
- **What is ours.** The `makronix` set (CDE, vim, flex, git and what they need)
|
||||
is unpacked by sysinst without a package database: `pkg_add -u` does not
|
||||
update those files, `pkg_info` does not list them. They change with the
|
||||
next release of Makronix. The extra programs (Firefox, Thunderbird, QEMU)
|
||||
are installed with `pkg_add` and are registered: those do update.
|
||||
next release of Makronix. The extra programs (Firefox, Thunderbird, and the
|
||||
QEMU of the Makronix Museum when that group is chosen) are installed with
|
||||
`pkg_add` and are registered: those do update.
|
||||
- **Not measured:** `pkg_add -u` on an installed system, the repository URL after
|
||||
the quarter changes (2026Q4), and what happens when a package of the repository
|
||||
overwrites a file of the `makronix` set (the install of the extra programs
|
||||
|
||||
@@ -148,3 +148,12 @@ games/scummvm games
|
||||
games/scummvm-bass games
|
||||
games/scummvm-fotaq games
|
||||
games/tuxracer games
|
||||
|
||||
# The Makronix Museum (Konrad, 2026-11-16): four vintage machines in QEMU
|
||||
# (IRIX 6.5.29, SunOS 4.1.4, Mac OS 9.2, Mac OS X 10.4 Tiger). The museum
|
||||
# program is in the base system (src/usr.bin/museum); this is its emulator,
|
||||
# a NetBSD project binary like the other "fetch" packages, offered as its own
|
||||
# group in sysinst (kind "museum", like "games"). The operating system media
|
||||
# are proprietary and stay with their owner: nothing here downloads or ships
|
||||
# them.
|
||||
emulators/qemu museum
|
||||
@@ -613,6 +613,7 @@
|
||||
./usr/bin/more base-util-bin
|
||||
./usr/bin/mset base-obsolete obsolete
|
||||
./usr/bin/msgs base-util-bin
|
||||
./usr/bin/museum base-util-bin
|
||||
./usr/bin/natto base-util-bin
|
||||
./usr/bin/nbsvtool base-crypto-bin
|
||||
./usr/bin/nc base-netutil-bin
|
||||
|
||||
@@ -3983,6 +3983,7 @@
|
||||
./usr/share/man/man1/msginit.1 man-locale-man .man
|
||||
./usr/share/man/man1/msgmerge.1 man-locale-man .man
|
||||
./usr/share/man/man1/msgs.1 man-util-man .man
|
||||
./usr/share/man/man1/museum.1 man-util-man .man
|
||||
./usr/share/man/man1/msgunfmt.1 man-locale-man .man
|
||||
./usr/share/man/man1/msguniq.1 man-locale-man .man
|
||||
./usr/share/man/man1/mt.1 man-util-man .man
|
||||
|
||||
@@ -315,6 +315,7 @@
|
||||
./usr/share/man/html1/msginit.html man-locale-htmlman html
|
||||
./usr/share/man/html1/msgmerge.html man-locale-htmlman html
|
||||
./usr/share/man/html1/msgs.html man-util-htmlman html
|
||||
./usr/share/man/html1/museum.html man-util-htmlman html
|
||||
./usr/share/man/html1/msgunfmt.html man-locale-htmlman html
|
||||
./usr/share/man/html1/msguniq.html man-locale-htmlman html
|
||||
./usr/share/man/html1/mt.html man-util-htmlman html
|
||||
|
||||
@@ -18,7 +18,7 @@ SUBDIR= apply asa at atto \
|
||||
locale locate lock logger login logname look lorder m4 \
|
||||
machine mail make man menuc mesg midiplay midirecord mixerctl \
|
||||
mkcsmapper mkdep mkesdb mkfifo mklocale mktemp mkubootimage \
|
||||
moduli msgc msgs \
|
||||
moduli msgc msgs museum \
|
||||
nbperf nc netgroup netstat newgrp newsyslog nice nl nohup \
|
||||
pagesize passwd paste patch pathchk pkill pmap pr \
|
||||
printenv printf progress pwait pwhash qsubst quota radioctl rdist \
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
# $NetBSD$
|
||||
|
||||
PROG= museum
|
||||
SRCS= museum.c machines.c
|
||||
MAN= museum.1
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
@@ -0,0 +1,76 @@
|
||||
# museum -- four vintage machines in QEMU
|
||||
|
||||
`museum` keeps an SGI Indy with IRIX 6.5.29, a SPARCstation 5 with SunOS 4.1.4,
|
||||
a Power Mac G4 with Mac OS 9.2 and one with Mac OS X 10.4 Tiger ready to
|
||||
start. It is a base-system command (`/usr/bin/museum`, man page `museum(1)`);
|
||||
the emulator is the pkgsrc package `emulators/qemu`, installed by the
|
||||
installer's "Makronix Museum" group (kind `museum` in `packages.list`, like
|
||||
"Makronix Games").
|
||||
|
||||
## Why it is in src/usr.bin and not in ext/
|
||||
|
||||
`ext/` is for imported third-party forks with an `IMPORT` (ext/AGENTS.md);
|
||||
the museum is Makronix's own program, so it lives in the base tree like any
|
||||
other utility. It has no build dependency beyond libc: the emulator is
|
||||
started with `execv(2)`, not linked.
|
||||
|
||||
The media are proprietary and are not part of Makronix. The owner imports
|
||||
their own copies; the museum only records symbolic links:
|
||||
|
||||
museum media macos9 /path/to/MacOS9.iso
|
||||
museum media sunos4 /path/to/sunos_4.1.4_install.iso
|
||||
museum media sunos4 /path/to/ss5.bin
|
||||
|
||||
The museum home is `$HOME/Museum` (`MUSEUM_DIR`), with `media/<id>/` and
|
||||
`vms/<id>/`.
|
||||
|
||||
## Machines and command lines
|
||||
|
||||
The table is in `machines.c`. The Mac and Sun arguments are the measured
|
||||
ones; the IRIX entry has two backends.
|
||||
|
||||
| id | machine | emulator | disk |
|
||||
|----|---------|----------|------|
|
||||
| `irix65` | SGI Indy (IP22) | qemu-sgi-ip22 (`MUSEUM_QEMU_IRIX`) or MAME `indy_4610` | overlay on `base.img` / CHD |
|
||||
| `sunos4` | SPARCstation 5 | `qemu-system-sparc -M SS-5` | 2 GiB qcow2 |
|
||||
| `macos9` | Power Mac G4 | `qemu-system-ppc -M mac99,via=pmu` | 2 GiB qcow2 |
|
||||
| `tiger` | Power Mac G4 | `qemu-system-ppc -M mac99,via=pmu -cpu G4` | 12 GiB qcow2 |
|
||||
|
||||
`museum info <id>` prints the exact command, with every placeholder expanded.
|
||||
|
||||
## Measurements (2026-11-16, QEMU 11.1.2 on the build host)
|
||||
|
||||
* Mac OS 9.2.2 (`MAC_OS_9-2-2_693-4669_0.ISO`): `-M mac99,via=pmu -m 512
|
||||
-boot d` reaches the Finder and the "Mac OS 9 Install" window. Screenshot:
|
||||
`/tmp/opencode/museum-test/shot3.png` (not in the tree).
|
||||
* Mac OS X 10.4.6 (`tiger-10-4-6-ppc.iso`): `-M mac99,via=pmu -cpu G4 -m 1024
|
||||
-g 1024x768x32` reaches the language chooser. Screenshot:
|
||||
`/tmp/opencode/museum-test/tiger.png`.
|
||||
* SunOS 4.1.4: OpenBIOS 1.1 (QEMU's firmware) does **not** boot the install
|
||||
CD: `Trying cdrom:d... Not a bootable ELF image / Not a bootable a.out
|
||||
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`,
|
||||
`-gio64_gfx xl24 -hard1`) the fallback. Neither is part of `emulators/qemu`.
|
||||
|
||||
## Build and test
|
||||
|
||||
cd src/usr.bin/museum
|
||||
../../../build/obj/tooldir.*/bin/nbmake-amd64 dependall
|
||||
MUSEUM_DIR=/tmp/museum ./museum list
|
||||
MUSEUM_DIR=/tmp/museum ./museum doctor
|
||||
|
||||
The base build picks the program up through `src/usr.bin/Makefile`; the set
|
||||
lists are `src/distrib/sets/lists/base/mi` (`./usr/bin/museum`) and
|
||||
`.../man/mi` (`./usr/share/man/man1/museum.1`).
|
||||
|
||||
The installer group is wired in:
|
||||
|
||||
* `packages.list`: `emulators/qemu museum`
|
||||
* `tools/pkglist.sh`: kind `museum`
|
||||
* `tools/cd3.sh`: writes `museum.list` next to `desktop.list` and `games.list`
|
||||
* `src/usr.sbin/sysinst/extras.c`: asks `MSG_museum_ask` and passes the list to
|
||||
`pkg_add`
|
||||
* `src/usr.sbin/sysinst/msg.mi.*`: the question in six languages
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,332 @@
|
||||
.\" $NetBSD$
|
||||
.\"
|
||||
.\" License: CNCL 1.0 (Could Not Care Less), see LICENSE at the top of the tree.
|
||||
.\"
|
||||
.Dd November 16, 2026
|
||||
.Dt MUSEUM 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm museum
|
||||
.Nd vintage machines in QEMU: IRIX, SunOS, Mac OS 9, Mac OS X Tiger
|
||||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
.Nm
|
||||
.Cm list
|
||||
.Nm
|
||||
.Cm status
|
||||
.Op Ar id
|
||||
.Nm
|
||||
.Cm info Ar id
|
||||
.Nm
|
||||
.Cm media Ar id Op Ar path ...
|
||||
.Nm
|
||||
.Cm media Ar id Fl l
|
||||
.Nm
|
||||
.Cm media Ar id Cm --clear
|
||||
.Nm
|
||||
.Cm create Ar id
|
||||
.Nm
|
||||
.Cm install Ar id
|
||||
.Nm
|
||||
.Cm run Ar id
|
||||
.Nm
|
||||
.Cm doctor
|
||||
.Sh DESCRIPTION
|
||||
.Nm
|
||||
keeps four vintage machines ready to start: an SGI Indy with IRIX 6.5.29, a
|
||||
SPARCstation 5 with SunOS 4.1.4, a Power Mac G4 with Mac OS 9.2 and one with
|
||||
Mac OS X 10.4 Tiger.
|
||||
It holds the command lines, the disk images and the bookkeeping; the emulator
|
||||
is QEMU from pkgsrc
|
||||
.Pq Pa emulators/qemu ,
|
||||
and the operating system media and firmware stay with their owner.
|
||||
.Pp
|
||||
The museum home is
|
||||
.Pa $HOME/Museum
|
||||
(or
|
||||
.Ev MUSEUM_DIR ) .
|
||||
Each machine has a media directory
|
||||
.Pa media/<id>/
|
||||
and a virtual machine directory
|
||||
.Pa vms/<id>/ .
|
||||
.Nm
|
||||
never copies an ISO: it records a symbolic link, so the media can stay on the
|
||||
disk or on a mounted volume.
|
||||
.Pp
|
||||
The install media, the Sun SS-5 PROM and the SGI ARCS firmware are
|
||||
proprietary.
|
||||
They are not part of Makronix and are not shipped with it: the owner imports
|
||||
the copies they own.
|
||||
.Pp
|
||||
The command with no arguments prints the table of
|
||||
.Cm list .
|
||||
.Sh MACHINES
|
||||
.Bl -tag -width "macos9" -compact
|
||||
.It Cm irix65
|
||||
IRIX 6.5.29 on an SGI Indy (IP22, MIPS R4400).
|
||||
Serial console.
|
||||
Needs a qemu-sgi-ip22 build
|
||||
.Pq Ev MUSEUM_QEMU_IRIX
|
||||
or MAME with the
|
||||
.Sq indy_4610
|
||||
ROM set.
|
||||
See
|
||||
.Sx IRIX 6.5
|
||||
below.
|
||||
.It Cm sunos4
|
||||
SunOS 4.1.4 on a SPARCstation 5 (sun4m).
|
||||
Serial console.
|
||||
Needs the SunOS 4.1.4 install CD and the SS-5 PROM
|
||||
.Pa ss5.bin .
|
||||
.It Cm macos9
|
||||
Mac OS 9.2 on a Power Mac G4 (mac99, via=pmu), 512 MiB, 2 GiB disk.
|
||||
Needs the Mac OS 9.2 install CD.
|
||||
.It Cm tiger
|
||||
Mac OS X 10.4 Tiger on a Power Mac G4 (mac99, via=pmu, G4), 1024 MiB, 12 GiB
|
||||
disk.
|
||||
Needs the Mac OS X 10.4 install DVD.
|
||||
.El
|
||||
.Sh COMMANDS
|
||||
.Bl -tag -width "media id --clear"
|
||||
.It Cm list
|
||||
Print the four machines with the state of the disk (run) and of the install
|
||||
media (install).
|
||||
.It Cm status Op Ar id
|
||||
The same for one machine, or the table.
|
||||
.It Cm info Ar id
|
||||
Paths, media, firmware and the exact commands that
|
||||
.Cm run
|
||||
and
|
||||
.Cm install
|
||||
would execute.
|
||||
.It Cm media Ar id Ar path ...
|
||||
Import media: a file, or every regular file of a directory, becomes a symbolic
|
||||
link in
|
||||
.Pa media/<id>/ .
|
||||
.It Cm media Ar id Fl l
|
||||
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 create Ar id
|
||||
Create the disk image with
|
||||
.Xr qemu-img 1 ,
|
||||
if it does not exist.
|
||||
For
|
||||
.Cm irix65
|
||||
this is a qcow2 overlay on
|
||||
.Pa vms/irix65/base.img ,
|
||||
so the installed IRIX image is never written.
|
||||
.It Cm install Ar id
|
||||
Start the machine with its install media attached, so the guest's installer
|
||||
runs.
|
||||
For
|
||||
.Cm irix65
|
||||
the install is manual and this prints the paths instead.
|
||||
.It Cm run Ar id
|
||||
Start the installed machine.
|
||||
.It Cm doctor
|
||||
Check the emulators, the machine types they know, the media and the disks.
|
||||
.El
|
||||
.Sh ENVIRONMENT
|
||||
.Bl -tag -width "MUSEUM_QEMU_IRIX"
|
||||
.It Ev MUSEUM_DIR
|
||||
The museum home, default
|
||||
.Pa $HOME/Museum .
|
||||
.It Ev MUSEUM_QEMU
|
||||
Use this emulator for every machine (a test hook; a full path or a name in
|
||||
.Ev PATH ) .
|
||||
.It Ev MUSEUM_QEMU_IRIX
|
||||
The qemu-sgi-ip22 binary for
|
||||
.Cm irix65
|
||||
(a full path or a name in
|
||||
.Ev PATH ) .
|
||||
.It Ev MUSEUM_QEMUIMG
|
||||
The
|
||||
.Xr qemu-img 1
|
||||
binary, default
|
||||
.Sq qemu-img
|
||||
from
|
||||
.Ev PATH .
|
||||
.El
|
||||
.Sh SETUP
|
||||
The order is the same for the three scripted machines:
|
||||
.Bd -literal -offset indent
|
||||
$ museum media macos9 /path/to/MacOS9.iso
|
||||
$ museum create macos9
|
||||
$ museum install macos9
|
||||
\&... the guest installer ...
|
||||
$ museum run macos9
|
||||
.Ed
|
||||
.Ss Mac OS 9.2
|
||||
In the installer open
|
||||
.Dq Utilities
|
||||
and start
|
||||
.Dq Drive Setup ,
|
||||
select the disk, click
|
||||
.Dq Initialize
|
||||
and confirm.
|
||||
Quit Drive Setup, run the Mac OS installer, then shut down.
|
||||
.Cm run
|
||||
boots the installed system.
|
||||
.Pp
|
||||
Measured 2026-11-16 with QEMU 11.1.2: the 9.2.2 install CD reaches the Finder
|
||||
with the command in
|
||||
.Cm info macos9 .
|
||||
.Ss Mac OS X 10.4 Tiger
|
||||
The DVD boots to the language chooser; in the installer open
|
||||
.Dq Disk Utility ,
|
||||
erase the 12 GiB disk (Mac OS Extended), then install.
|
||||
The machine has 1024 MiB and a G4 processor; without
|
||||
.Fl cpu Cm G4
|
||||
the DVD does not boot reliably.
|
||||
.Pp
|
||||
Measured 2026-11-16 with QEMU 11.1.2: the 10.4.6 DVD reaches the language
|
||||
chooser.
|
||||
.Ss SunOS 4.1.4
|
||||
Import the install CD and the SS-5 PROM:
|
||||
.Bd -literal -offset indent
|
||||
$ museum media sunos4 /path/to/sunos_4.1.4_install.iso
|
||||
$ museum media sunos4 /path/to/ss5.bin
|
||||
.Ed
|
||||
.Pp
|
||||
OpenBIOS, QEMU's own firmware, cannot boot this CD
|
||||
.Pq Dq Not a bootable ELF image ;
|
||||
the real PROM is required.
|
||||
At the
|
||||
.Li ok
|
||||
prompt of the PROM type
|
||||
.Li boot cdrom .
|
||||
The miniroot asks for
|
||||
.Li 1
|
||||
(install the mini-root) and the target disk
|
||||
.Li sd3 .
|
||||
If it offers to format, answer yes and in
|
||||
.Xr format 8
|
||||
choose type
|
||||
.Li 13
|
||||
.Pq Dv SUN2.1G ,
|
||||
write the label and quit.
|
||||
After the reboot run
|
||||
.Li suninstall
|
||||
and install the full system.
|
||||
The museum starts the machine with
|
||||
.Fl boot Cm d ;
|
||||
with the real PROM the
|
||||
.Li boot cdrom
|
||||
command at the prompt is what counts.
|
||||
.Cm run
|
||||
then boots the disk.
|
||||
.Ss IRIX 6.5
|
||||
Stock QEMU has no SGI Indy machine.
|
||||
.Nm
|
||||
uses a
|
||||
.Sy qemu-sgi-ip22
|
||||
build when
|
||||
.Ev MUSEUM_QEMU_IRIX
|
||||
names one:
|
||||
.Bd -literal -offset indent
|
||||
$ git clone -b sgi_ip22 \\
|
||||
https://github.com/dsheffie/qemu-sgi-ip22.git
|
||||
$ cd qemu-sgi-ip22
|
||||
$ ./configure --target-list=mips64-softmmu
|
||||
$ make -j$(nproc)
|
||||
.Ed
|
||||
.Pp
|
||||
The firmware
|
||||
.Pa henry_arcs.scc.bin
|
||||
comes from the same project's
|
||||
.Pa r9999
|
||||
repository
|
||||
.Pq Pa arcs/henry_arcs.S ,
|
||||
with the included
|
||||
.Pa stub_write-scc.diff
|
||||
applied; it is copied into
|
||||
.Pa media/irix65/ ,
|
||||
together with the IRIX kernel
|
||||
.Pa unix
|
||||
and the installation CDs.
|
||||
The installed disk is installed outside the museum (the
|
||||
.Sq iris
|
||||
simulator or the jimux/qemu-sgi-project installer) and placed at
|
||||
.Pa vms/irix65/base.img .
|
||||
Then:
|
||||
.Bd -literal -offset indent
|
||||
$ MUSEUM_QEMU_IRIX=$HOME/qemu-sgi-ip22/build/qemu-system-mips64 \\
|
||||
museum create irix65
|
||||
$ museum run irix65
|
||||
.Ed
|
||||
.Pp
|
||||
.Cm create
|
||||
makes
|
||||
.Pa vms/irix65/disk.qcow2
|
||||
as an overlay on
|
||||
.Pa base.img ;
|
||||
IRIX rewrites
|
||||
.Pa /unix
|
||||
on the first boot, so the base image must stay untouched.
|
||||
.Pp
|
||||
MAME's Indy is the fallback when
|
||||
.Ev MUSEUM_QEMU_IRIX
|
||||
is not set:
|
||||
put the
|
||||
.Sq indy_4610
|
||||
ROM set into
|
||||
.Pa media/irix65/ ,
|
||||
make a CHD of an IRIX disk with
|
||||
.Sq chdman ,
|
||||
which is part of
|
||||
.Pa emulators/mame
|
||||
and put it at
|
||||
.Pa vms/irix65/irix65.chd .
|
||||
.Nm
|
||||
then starts
|
||||
.Dq Li mame indy_4610 -gio64_gfx xl24 -hard1 ... ,
|
||||
and
|
||||
.Cm install
|
||||
adds
|
||||
.Fl cdrom
|
||||
with the first imported CD.
|
||||
MAME's Indy is slow and has no networking; the qemu-sgi route is the better
|
||||
one.
|
||||
.Sh FILES
|
||||
.Bl -tag -width "$HOME/Museum/vms/<id>/disk.qcow2" -compact
|
||||
.It Pa $HOME/Museum
|
||||
The museum home
|
||||
.Pq Ev MUSEUM_DIR .
|
||||
.It Pa $HOME/Museum/media/<id>/
|
||||
The imported media and firmware, as symbolic links.
|
||||
.It Pa $HOME/Museum/vms/<id>/disk.qcow2
|
||||
The machine's disk.
|
||||
.It Pa $HOME/Museum/vms/irix65/base.img
|
||||
The installed IRIX disk the overlay points at.
|
||||
.It Pa $HOME/Museum/vms/irix65/irix65.chd
|
||||
The MAME disk, when MAME is used.
|
||||
.El
|
||||
.Sh EXIT STATUS
|
||||
.Ex -std
|
||||
.Sh EXAMPLES
|
||||
.Bd -literal -offset indent
|
||||
$ museum list
|
||||
$ museum media tiger /mnt/dvd/tiger-10-4-6-ppc.iso
|
||||
$ museum create tiger
|
||||
$ museum install tiger
|
||||
# after the installation:
|
||||
$ museum run tiger
|
||||
.Ed
|
||||
.Bd -literal -offset indent
|
||||
$ museum doctor
|
||||
$ museum info sunos4
|
||||
.Ed
|
||||
.Sh SEE ALSO
|
||||
.Xr pkg_add 1 ,
|
||||
.Xr pkg_info 1 ,
|
||||
.Xr qemu-img 1
|
||||
.Sh HISTORY
|
||||
The Makronix Museum appeared on 2026-11-16.
|
||||
.Sh CAVEATS
|
||||
The media, the PROMs and the ROM sets are the owner's.
|
||||
Neither Makronix nor
|
||||
.Nm
|
||||
downloads them.
|
||||
The emulated machines are slower than the real ones; Mac OS 9 has no sound
|
||||
with stock QEMU, and IRIX has no usable network under the qemu-sgi Indy yet.
|
||||
@@ -0,0 +1,211 @@
|
||||
/* $NetBSD$ */
|
||||
/*
|
||||
* License: CNCL 1.0 (Could Not Care Less), see LICENSE at the top of the tree.
|
||||
*
|
||||
* museum.c -- the command line of the Makronix Museum.
|
||||
*/
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "museum.h"
|
||||
|
||||
static void
|
||||
usage(void)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"usage: museum list the machines and their state\n"
|
||||
" museum status [ID] one line, or all\n"
|
||||
" museum info ID paths, media and the command\n"
|
||||
" museum media ID [PATH] import media (a file or a "
|
||||
"directory)\n"
|
||||
" museum media ID -l list the imported media\n"
|
||||
" museum media ID --clear forget the imported media\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"
|
||||
" museum doctor what is missing\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
static const struct museum_machine *
|
||||
machine_arg(const char *id)
|
||||
{
|
||||
const struct museum_machine *m;
|
||||
|
||||
m = museum_find(id);
|
||||
if (m == NULL) {
|
||||
fprintf(stderr, "museum: no machine \"%s\"\n", id);
|
||||
fprintf(stderr, "machines:");
|
||||
for (size_t i = 0; i < museum_machine_count; i++)
|
||||
fprintf(stderr, " %s", museum_machines[i].id);
|
||||
fprintf(stderr, "\n");
|
||||
exit(1);
|
||||
}
|
||||
return m;
|
||||
}
|
||||
|
||||
static void
|
||||
print_table(void)
|
||||
{
|
||||
struct museum_state st;
|
||||
char run[64], inst[64];
|
||||
size_t i;
|
||||
|
||||
printf("%-8s %-22s %-13s %s\n", "id", "machine", "run", "install");
|
||||
for (i = 0; i < museum_machine_count; i++) {
|
||||
memset(&st, 0, sizeof(st));
|
||||
st.m = &museum_machines[i];
|
||||
museum_probe(&st);
|
||||
printf("%-8s %-22s %-13s %s\n", st.m->id, st.m->name,
|
||||
museum_status_run(&st, run, sizeof(run)),
|
||||
museum_status_install(&st, inst, sizeof(inst)));
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
print_info(const struct museum_machine *m)
|
||||
{
|
||||
struct museum_state st;
|
||||
struct stat sb;
|
||||
char runbuf[4096], instbuf[4096], media[MUSEUM_PATH];
|
||||
const char *bf;
|
||||
|
||||
memset(&st, 0, sizeof(st));
|
||||
st.m = m;
|
||||
museum_probe(&st);
|
||||
printf("%s - %s\n", m->name, m->subtitle);
|
||||
printf(" id: %s\n", m->id);
|
||||
printf(" home: %s\n", st.home);
|
||||
if (st.have_emulator) {
|
||||
if (strcmp(m->id, "irix65") == 0)
|
||||
bf = st.backend == MUSEUM_MAME ? "MAME" : "qemu-sgi";
|
||||
else
|
||||
bf = "qemu";
|
||||
printf(" emulator: %s (%s)\n", st.emulator, bf);
|
||||
} else
|
||||
printf(" emulator: missing\n");
|
||||
if (strcmp(m->id, "irix65") == 0) {
|
||||
printf(" disk: %s%s\n", st.disk,
|
||||
st.have_disk ? "" : " (missing)");
|
||||
if (st.backend != MUSEUM_MAME)
|
||||
printf(" base: %s%s\n", st.base,
|
||||
st.have_base ? "" : " (missing)");
|
||||
} else {
|
||||
printf(" disk: %s", st.disk);
|
||||
if (stat(st.disk, &sb) == 0)
|
||||
printf(" (%.0f MiB)", (double)sb.st_size /
|
||||
(1024.0 * 1024.0));
|
||||
else
|
||||
printf(" (missing; museum create %s)", m->id);
|
||||
printf("\n");
|
||||
}
|
||||
printf(" media: %s%s\n", st.media,
|
||||
st.have_media ? "" : " (empty)");
|
||||
if (museum_media_file(&st, media, sizeof(media)) != NULL)
|
||||
printf(" %s\n", media);
|
||||
if (m->firmware != NULL)
|
||||
printf(" firmware: %s%s\n", st.firmware,
|
||||
st.have_firmware ? "" : " (missing)");
|
||||
printf(" note: %s\n", m->media_note);
|
||||
museum_command(&st, MUSEUM_RUN, runbuf, sizeof(runbuf));
|
||||
museum_command(&st, MUSEUM_INSTALL, instbuf, sizeof(instbuf));
|
||||
printf(" run: %s\n", runbuf);
|
||||
printf(" install: %s\n", instbuf);
|
||||
}
|
||||
|
||||
static int
|
||||
cmd_status(int argc, char **argv)
|
||||
{
|
||||
struct museum_state st;
|
||||
char run[64], inst[64];
|
||||
const struct museum_machine *m;
|
||||
|
||||
if (argc == 0) {
|
||||
print_table();
|
||||
return 0;
|
||||
}
|
||||
m = machine_arg(argv[0]);
|
||||
memset(&st, 0, sizeof(st));
|
||||
st.m = m;
|
||||
museum_probe(&st);
|
||||
printf("%-8s %-22s run: %-12s install: %s\n", m->id, m->name,
|
||||
museum_status_run(&st, run, sizeof(run)),
|
||||
museum_status_install(&st, inst, sizeof(inst)));
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
cmd_media(int argc, char **argv)
|
||||
{
|
||||
struct museum_state st;
|
||||
const struct museum_machine *m;
|
||||
int i, r = 0;
|
||||
|
||||
if (argc < 1)
|
||||
usage();
|
||||
m = machine_arg(argv[0]);
|
||||
memset(&st, 0, sizeof(st));
|
||||
st.m = m;
|
||||
museum_state_init(&st);
|
||||
if (argc == 1 || strcmp(argv[1], "-l") == 0 ||
|
||||
strcmp(argv[1], "--list") == 0)
|
||||
return museum_list_media(&st);
|
||||
if (strcmp(argv[1], "--clear") == 0)
|
||||
return museum_clear_media(&st);
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (museum_import_media(&st, argv[i]) != 0)
|
||||
r = -1;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
struct museum_state st;
|
||||
const struct museum_machine *m;
|
||||
const char *cmd, *id;
|
||||
|
||||
if (argc < 2) {
|
||||
print_table();
|
||||
return 0;
|
||||
}
|
||||
cmd = argv[1];
|
||||
if (strcmp(cmd, "-h") == 0 || strcmp(cmd, "--help") == 0 ||
|
||||
strcmp(cmd, "help") == 0)
|
||||
usage();
|
||||
if (strcmp(cmd, "list") == 0) {
|
||||
print_table();
|
||||
return 0;
|
||||
}
|
||||
if (strcmp(cmd, "status") == 0)
|
||||
return cmd_status(argc - 2, argv + 2);
|
||||
if (strcmp(cmd, "doctor") == 0)
|
||||
return museum_doctor();
|
||||
if (strcmp(cmd, "media") == 0)
|
||||
return cmd_media(argc - 2, argv + 2);
|
||||
if (argc < 3)
|
||||
usage();
|
||||
id = argv[2];
|
||||
m = machine_arg(id);
|
||||
if (strcmp(cmd, "info") == 0) {
|
||||
print_info(m);
|
||||
return 0;
|
||||
}
|
||||
memset(&st, 0, sizeof(st));
|
||||
st.m = m;
|
||||
if (strcmp(cmd, "create") == 0)
|
||||
return museum_make_disk(&st) == 0 ? 0 : 1;
|
||||
museum_probe(&st);
|
||||
if (strcmp(cmd, "run") == 0)
|
||||
return museum_launch(&st, MUSEUM_RUN, 1) == 0 ? 0 : 1;
|
||||
if (strcmp(cmd, "install") == 0)
|
||||
return museum_launch(&st, MUSEUM_INSTALL, 1) == 0 ? 0 : 1;
|
||||
usage();
|
||||
return 1;
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
/* $NetBSD$ */
|
||||
/*
|
||||
* License: CNCL 1.0 (Could Not Care Less), see LICENSE at the top of the tree.
|
||||
*
|
||||
* museum.h -- the machines, the files, the command lines.
|
||||
*/
|
||||
|
||||
#ifndef MUSEUM_H
|
||||
#define MUSEUM_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#define MUSEUM_PATH 4096
|
||||
#define MUSEUM_MAXARGS 48
|
||||
|
||||
enum museum_mode {
|
||||
MUSEUM_RUN = 0,
|
||||
MUSEUM_INSTALL = 1
|
||||
};
|
||||
|
||||
enum museum_backend {
|
||||
MUSEUM_QEMU = 0, /* a qemu-system-* binary */
|
||||
MUSEUM_QEMU_SGI, /* qemu-sgi-ip22, -M indy */
|
||||
MUSEUM_MAME /* MAME's Indy driver */
|
||||
};
|
||||
|
||||
struct museum_machine {
|
||||
const char *id;
|
||||
const char *name;
|
||||
const char *subtitle;
|
||||
const char *media_note;
|
||||
const char *qemu; /* default binary */
|
||||
const char *qemu_env; /* environment override, may be NULL */
|
||||
const char *machine_type; /* the -M argument, for doctor */
|
||||
const char *firmware; /* file in the media dir, may be NULL */
|
||||
long disk_mb; /* 0: the user brings an image */
|
||||
int console_only; /* serial console, no window */
|
||||
const char *install_args[MUSEUM_MAXARGS];
|
||||
const char *run_args[MUSEUM_MAXARGS];
|
||||
const char *mame; /* MAME fallback binary or NULL */
|
||||
const char *mame_machine; /* MAME driver name */
|
||||
const char *mame_args[MUSEUM_MAXARGS];
|
||||
};
|
||||
|
||||
struct museum_state {
|
||||
const struct museum_machine *m;
|
||||
char home[MUSEUM_PATH];
|
||||
char media[MUSEUM_PATH];
|
||||
char vm[MUSEUM_PATH];
|
||||
char disk[MUSEUM_PATH];
|
||||
char base[MUSEUM_PATH];
|
||||
char emulator[MUSEUM_PATH];
|
||||
char firmware[MUSEUM_PATH];
|
||||
enum museum_backend backend;
|
||||
int have_media;
|
||||
int have_disk;
|
||||
int have_base;
|
||||
int have_emulator;
|
||||
int have_firmware;
|
||||
};
|
||||
|
||||
extern const struct museum_machine museum_machines[];
|
||||
extern const size_t museum_machine_count;
|
||||
|
||||
const struct museum_machine *museum_find(const char *);
|
||||
void museum_state_init(struct museum_state *);
|
||||
int museum_probe(struct museum_state *);
|
||||
int museum_make_disk(struct museum_state *);
|
||||
int museum_build_argv(struct museum_state *, enum museum_mode, char **,
|
||||
int, char *, size_t);
|
||||
int museum_import_media(struct museum_state *, const char *);
|
||||
int museum_clear_media(struct museum_state *);
|
||||
int museum_list_media(struct museum_state *);
|
||||
int museum_doctor(void);
|
||||
int museum_launch(struct museum_state *, enum museum_mode, int);
|
||||
void museum_command(struct museum_state *, enum museum_mode, char *, size_t);
|
||||
const char *museum_media_file(struct museum_state *, char *, size_t);
|
||||
const char *museum_status_run(struct museum_state *, char *, size_t);
|
||||
const char *museum_status_install(struct museum_state *, char *, size_t);
|
||||
|
||||
#endif /* MUSEUM_H */
|
||||
@@ -19,7 +19,8 @@ line: `../../../docs/reference/sysinst-survey.txt`; the encryption design:
|
||||
- Menus and messages: `menus.mi`, `menus.entropy`,
|
||||
`msg.{mi,pm,mbr,entropy}.<lang>`.
|
||||
- Makronix additions: `setup.c` (last step of the simple mode), `extras.c`
|
||||
(extra packages from CD 3 and up), `cgdroot.c` (encrypted root; built only
|
||||
(extra packages from CD 3 and up, and the Makronix Games and Makronix
|
||||
Museum groups), `cgdroot.c` (encrypted root; built only
|
||||
where the port defines `-DCGDROOT`, today `arch/amd64/Makefile`) and the
|
||||
release palette: `Makefile.inc` takes
|
||||
`ext/src/mcde/programs/palettes/<makronix-codename>.dp` and turns slots 5
|
||||
|
||||
@@ -22,7 +22,8 @@
|
||||
* Nothing here is needed for a working system: a medium without the
|
||||
* directory gets the system without them, and pkg_add does it later from the
|
||||
* network repository (setup.c, set_pkg_defaults). The packages are not
|
||||
* asked about; the one question is Makronix Games (MSG_games_ask).
|
||||
* asked about one by one; the two questions are Makronix Games
|
||||
* (MSG_games_ask) and Makronix Museum (MSG_museum_ask).
|
||||
*
|
||||
* License: CNCL 1.0 (Could Not Care Less), see LICENSE at the top of the tree.
|
||||
*/
|
||||
@@ -116,17 +117,24 @@ enable_rcd(const char *name)
|
||||
* runs in the chroot and finds them through PKG_PATH. A second cd9660 mount
|
||||
* of the device inside the target is refused (EBUSY, measured 2026-11-07);
|
||||
* a null mount is NetBSD's way to show a mounted tree a second time.
|
||||
* The packages are the files that desktop.list (and games.list, when the user
|
||||
* wants Makronix Games) name for this medium: tools/cd3.sh writes them, and
|
||||
* puts a package's dependencies on the same CD or an earlier one, so what is
|
||||
* not here is installed already.
|
||||
* The packages are the files that desktop.list (and games.list and
|
||||
* museum.list, when the user wants Makronix Games and Makronix Museum) name
|
||||
* for this medium: tools/cd3.sh writes them, and puts a package's
|
||||
* dependencies on the same CD or an earlier one, so what is not here is
|
||||
* installed already.
|
||||
*/
|
||||
static bool
|
||||
install_from(const char *dir, bool games)
|
||||
install_from(const char *dir, bool games, bool museum)
|
||||
{
|
||||
char tgt[MAXPATHLEN];
|
||||
char tgt[MAXPATHLEN], lists[MAXPATHLEN * 3];
|
||||
bool ok;
|
||||
|
||||
strlcpy(lists, "../desktop.list", sizeof(lists));
|
||||
if (games)
|
||||
strlcat(lists, " ../games.list", sizeof(lists));
|
||||
if (museum)
|
||||
strlcat(lists, " ../museum.list", sizeof(lists));
|
||||
|
||||
(void)snprintf(tgt, sizeof tgt, "%s" PKGMNT, target_prefix());
|
||||
if (run_program(RUN_SILENT | RUN_ERROR_OK, "mkdir -p %s", tgt) != 0 ||
|
||||
run_program(RUN_SILENT | RUN_ERROR_OK, "/sbin/mount_null -o ro %s %s",
|
||||
@@ -134,11 +142,10 @@ install_from(const char *dir, bool games)
|
||||
return false;
|
||||
ok = run_program(RUN_DISPLAY | RUN_PROGRESS | RUN_CHROOT | RUN_ERROR_OK,
|
||||
"sh -c 'cd " PKGMNT "/All && "
|
||||
"cat ../desktop.list %s | sort -u | sed -e s,^,./, > /tmp/mx-pkgs && "
|
||||
"cat %s | sort -u | sed -e s,^,./, > /tmp/mx-pkgs && "
|
||||
"if [ -s /tmp/mx-pkgs ]; then PKG_PATH=" PKGMNT "/All "
|
||||
"xargs /usr/sbin/pkg_add < /tmp/mx-pkgs; fi; r=$?; "
|
||||
"rm -f /tmp/mx-pkgs; exit $r'",
|
||||
games ? "../games.list" : "") == 0;
|
||||
"rm -f /tmp/mx-pkgs; exit $r'", lists) == 0;
|
||||
(void)run_program(RUN_SILENT | RUN_ERROR_OK, "/sbin/umount %s", tgt);
|
||||
(void)run_program(RUN_SILENT | RUN_ERROR_OK, "rmdir %s", tgt);
|
||||
return ok;
|
||||
@@ -150,7 +157,7 @@ makronix_extras(void)
|
||||
char dir[MAXPATHLEN];
|
||||
const char *mnt = "/mnt2";
|
||||
int want, n = 0, m, sel, tries;
|
||||
bool games;
|
||||
bool games, museum;
|
||||
|
||||
/*
|
||||
* The extra programs are part of the userland of Makronix, not an option:
|
||||
@@ -169,7 +176,8 @@ makronix_extras(void)
|
||||
"/sbin/mount -rt cd9660 /dev/%s %s", cdrom_dev, mnt) == 0)
|
||||
mnt2_mounted = 1;
|
||||
|
||||
/* Makronix Games is the one choice here (Konrad, 2026-11-13); yes by default */
|
||||
/* Makronix Games (yes by default, Konrad 2026-11-13) and the Museum
|
||||
* (Konrad 2026-11-16, offered the same way). */
|
||||
/*
|
||||
* The text above the menu, the menu without a title: ask_yesno(MSG)
|
||||
* makes the whole message the menu's title, and a title wider than
|
||||
@@ -179,6 +187,8 @@ makronix_extras(void)
|
||||
*/
|
||||
msg_display(MSG_games_ask);
|
||||
games = ask_yesno(NULL);
|
||||
msg_display(MSG_museum_ask);
|
||||
museum = ask_yesno(NULL);
|
||||
|
||||
/*
|
||||
* The package CDs in their order, each installed from the drive before
|
||||
@@ -216,7 +226,7 @@ makronix_extras(void)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!install_from(dir, games)) {
|
||||
if (!install_from(dir, games, museum)) {
|
||||
hit_enter_to_continue(MSG_extras_failed, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1815,3 +1815,10 @@ RetroArch mit seinen Emulatoren (NES, SNES, Mega Drive, Game Boy,
|
||||
PlayStation, N64 und mehr), ScummVM mit Beneath a Steel Sky und Flight of
|
||||
the Amazon Queen, und Tux Racer. Sie kommen vom Installationsmedium.}
|
||||
|
||||
message museum_ask
|
||||
{Makronix Museum installieren?
|
||||
|
||||
IRIX 6.5.29, SunOS 4.1.4, Mac OS 9.2 und Mac OS X 10.4 Tiger als
|
||||
fertige QEMU-Maschinen. Der Emulator kommt vom Installationsmedium;
|
||||
die Betriebssystem-Medien bleiben bei Ihnen.}
|
||||
|
||||
@@ -1751,3 +1751,10 @@ RetroArch with its emulators (NES, SNES, Mega Drive, Game Boy, PlayStation,
|
||||
N64 and more), ScummVM with Beneath a Steel Sky and Flight of the Amazon
|
||||
Queen, and Tux Racer. They come from the installation medium.}
|
||||
|
||||
message museum_ask
|
||||
{Install Makronix Museum?
|
||||
|
||||
IRIX 6.5.29, SunOS 4.1.4, Mac OS 9.2 and Mac OS X 10.4 Tiger as
|
||||
ready-made QEMU machines. The emulator comes from the installation
|
||||
medium; the operating system media stay with you.}
|
||||
|
||||
@@ -1790,3 +1790,10 @@ RetroArch con sus emuladores (NES, SNES, Mega Drive, Game Boy, PlayStation,
|
||||
N64 y más), ScummVM con Beneath a Steel Sky y Flight of the Amazon Queen,
|
||||
y Tux Racer. Vienen del medio de instalación.}
|
||||
|
||||
message museum_ask
|
||||
{Instalar Makronix Museum?
|
||||
|
||||
IRIX 6.5.29, SunOS 4.1.4, Mac OS 9.2 y Mac OS X 10.4 Tiger como
|
||||
maquinas QEMU listas. El emulador viene del medio de instalacion;
|
||||
los medios de los sistemas operativos son suyos.}
|
||||
|
||||
@@ -1823,3 +1823,10 @@ RetroArch avec ses
|
||||
N64 et d'autres), ScummVM avec Beneath a Steel Sky et Flight of the Amazon
|
||||
Queen, et Tux Racer. Ils viennent du support d'installation.}
|
||||
|
||||
message museum_ask
|
||||
{Installer Makronix Museum ?
|
||||
|
||||
IRIX 6.5.29, SunOS 4.1.4, Mac OS 9.2 et Mac OS X 10.4 Tiger comme
|
||||
machines QEMU pretes. L'emulateur vient du support d'installation ;
|
||||
les supports des systemes restent a vous.}
|
||||
|
||||
@@ -1730,3 +1730,10 @@ RetroArch z emulatorami (NES, SNES, Mega Drive, Game Boy, PlayStation, N64
|
||||
i inne), ScummVM z Beneath a Steel Sky i Flight of the Amazon Queen oraz
|
||||
Tux Racer. Pochodz± z no¶nika instalacyjnego.}
|
||||
|
||||
message museum_ask
|
||||
{Zainstalowac Makronix Museum?
|
||||
|
||||
IRIX 6.5.29, SunOS 4.1.4, Mac OS 9.2 i Mac OS X 10.4 Tiger jako
|
||||
gotowe maszyny QEMU. Emulator pochodzi z nosnika instalacyjnego;
|
||||
nosniki systemow operacyjnych zostaja u uzytkownika.}
|
||||
|
||||
@@ -1756,3 +1756,10 @@ RetroArch com os seus emuladores (NES, SNES, Mega Drive, Game Boy,
|
||||
PlayStation, N64 e mais), ScummVM com Beneath a Steel Sky e Flight of the
|
||||
Amazon Queen, e Tux Racer. Vêm do meio de instalação.}
|
||||
|
||||
message museum_ask
|
||||
{Instalar o Makronix Museum?
|
||||
|
||||
IRIX 6.5.29, SunOS 4.1.4, Mac OS 9.2 e Mac OS X 10.4 Tiger como
|
||||
maquinas QEMU prontas. O emulador vem do meio de instalacao;
|
||||
os meios dos sistemas operacionais ficam com voce.}
|
||||
|
||||
+8
-2
@@ -1,7 +1,8 @@
|
||||
#!/bin/sh
|
||||
# License: CNCL 1.0 (Could Not Care Less), see LICENSE at the top of the tree.
|
||||
# cd3.sh -- the install CDs after the second: binary packages (Firefox,
|
||||
# Thunderbird, QEMU, PulseAudio, CUPS, ...), on as many CDs as they need.
|
||||
# Thunderbird, QEMU for the museum, PulseAudio, CUPS, ...), on as many CDs as
|
||||
# they need.
|
||||
#
|
||||
# usage: cd3.sh [stage]
|
||||
# stage only the directory build/cd3 with all the packages (for the DVD:
|
||||
@@ -77,6 +78,7 @@ summary=$PKGS/pkg_summary.gz
|
||||
# desktop.list the files of this medium that the desktop needs: the
|
||||
# packages of kind repo and fetch and their dependencies
|
||||
# games.list the same for Makronix Games (kind games)
|
||||
# museum.list the same for Makronix Museum (kind museum)
|
||||
#
|
||||
# The closure is taken by PKGPATH through the summary (the name of a package
|
||||
# is not the last part of its path: net/samba4 is samba-4.x), in dependency
|
||||
@@ -112,13 +114,17 @@ lists()
|
||||
desk=$({ "$TOP/tools/pkglist.sh" repo; "$TOP/tools/pkglist.sh" fetch; } | \
|
||||
awk -v b="$bin" 'BEGIN{n=split(b,a," "); for(i=1;i<=n;i++) if(a[i]!="") drop[a[i]]=1} !($0 in drop)' | tr '\n' ' ')
|
||||
games=$("$TOP/tools/pkglist.sh" games | tr '\n' ' ')
|
||||
museum=$("$TOP/tools/pkglist.sh" museum | tr '\n' ' ')
|
||||
closure "$desk" | while read -r f; do
|
||||
if [ -f "$1/All/$f" ]; then echo "$f"; fi
|
||||
done > "$1/desktop.list"
|
||||
closure "$games" | while read -r f; do
|
||||
if [ -f "$1/All/$f" ]; then echo "$f"; fi
|
||||
done > "$1/games.list"
|
||||
zcat "$summary" | awk -v want="$desk $games" '
|
||||
closure "$museum" | while read -r f; do
|
||||
if [ -f "$1/All/$f" ]; then echo "$f"; fi
|
||||
done > "$1/museum.list"
|
||||
zcat "$summary" | awk -v want="$desk $games $museum" '
|
||||
BEGIN { n = split(want, w, " "); for (i = 1; i <= n; i++) ok[w[i]] = 1 }
|
||||
/^PKGNAME=/ { name = substr($0, 9) }
|
||||
/^PKGPATH=/ { if (substr($0, 9) in ok) { sub(/-[0-9][^-]*$/, "", name); print name } }
|
||||
|
||||
@@ -13,8 +13,9 @@
|
||||
# compiling (rust, llvm, ...) for nothing a patch of ours changes. What
|
||||
# Makronix patches or what is not published is built (tools/userland.sh).
|
||||
#
|
||||
# What is wanted is named in packages.list, the lines of kind "fetch"
|
||||
# (tools/pkglist.sh fetch -n; the name is the last part of the PKGPATH).
|
||||
# What is wanted is named in packages.list, the lines of kind "fetch",
|
||||
# "games" and "museum" (tools/pkglist.sh; the name is the last part of the
|
||||
# PKGPATH).
|
||||
# A package the project does not publish for the platform is reported and
|
||||
# skipped, not an error: thunderbird has no aarch64 binary in 11.0_2026Q3.
|
||||
#
|
||||
@@ -104,7 +105,7 @@ best()
|
||||
# of its path (net/samba4 is samba-4.x, sysutils/py-borgbackup py313-...);
|
||||
# the newest package of that path, as a pattern for the closure below
|
||||
: > "$tmp/want"
|
||||
for p in $("$TOP/tools/pkglist.sh" fetch; "$TOP/tools/pkglist.sh" games); do
|
||||
for p in $("$TOP/tools/pkglist.sh" fetch; "$TOP/tools/pkglist.sh" games; "$TOP/tools/pkglist.sh" museum); do
|
||||
n=$(awk -F'\t' -v p="$p" '$5 == p { print $1 }' "$tmp/index" |
|
||||
LC_ALL=C sort -V | tail -1)
|
||||
if [ -n "$n" ]; then echo "$n" >> "$tmp/want"; else echo "${p##*/}" >> "$tmp/want"; fi
|
||||
|
||||
+7
-4
@@ -3,7 +3,7 @@
|
||||
#
|
||||
# pkglist.sh -- the packages of packages.list, by kind
|
||||
#
|
||||
# usage: pkglist.sh set|repo|fetch|bin|sysroot|games|built|all [-n]
|
||||
# usage: pkglist.sh set|repo|fetch|bin|sysroot|games|museum|built|all [-n]
|
||||
#
|
||||
# set the packages of the "makronix" set (no second word)
|
||||
# repo the packages of the media's repository ("repo")
|
||||
@@ -14,6 +14,9 @@
|
||||
# sysroot the same as bin: what tools/userland.sh puts into the sysroot
|
||||
# games the NetBSD project's binaries of the games group ("games"):
|
||||
# Makronix Games, which sysinst offers on its own (extras.c)
|
||||
# museum the NetBSD project's binaries of the museum group ("museum"):
|
||||
# Makronix Museum, offered the same way; the museum program itself
|
||||
# is in the base system (src/usr.bin/museum)
|
||||
# built set and repo: what is built here
|
||||
# all every line
|
||||
#
|
||||
@@ -28,8 +31,8 @@ set -eu
|
||||
TOP=$(cd "$(dirname "$0")/.." && pwd)
|
||||
KIND=${1:-}
|
||||
case $KIND in
|
||||
set|repo|fetch|bin|sysroot|games|built|all) ;;
|
||||
*) echo "usage: ${0##*/} set|repo|fetch|bin|sysroot|games|built|all [-n]" >&2; exit 2 ;;
|
||||
set|repo|fetch|bin|sysroot|games|museum|built|all) ;;
|
||||
*) echo "usage: ${0##*/} set|repo|fetch|bin|sysroot|games|museum|built|all [-n]" >&2; exit 2 ;;
|
||||
esac
|
||||
|
||||
LIST=${PACKAGES_LIST:-$TOP/packages.list}
|
||||
@@ -38,7 +41,7 @@ awk -v kind="$KIND" -v names="${2:-}" -v arch="${ARCH:-amd64}" '
|
||||
{
|
||||
if ($3 ~ /^@/ && arch != "all" && substr($3, 2) != arch) next
|
||||
k = ($2 == "") ? "set" : $2
|
||||
if (k != "set" && k != "repo" && k != "fetch" && k != "bin" && k != "games") {
|
||||
if (k != "set" && k != "repo" && k != "fetch" && k != "bin" && k != "games" && k != "museum") {
|
||||
print "pkglist: " $1 ": unknown kind \"" k "\"" > "/dev/stderr"
|
||||
bad = 1
|
||||
next
|
||||
|
||||
Reference in new issue
Block a user