Files
makronix/tools/install-simple.sh
T
lotherk 1529fce6db $Makronix$ in the files that carry it, and afpfs-ng's archive back
Two things, both found by reading the whole list of files that call
themselves pkgsrc's.

1. The header.  `ext/AGENTS.md` now says what the rule is: a file Makronix
   wrote carries `#\t$Makronix$' in its first lines, a file taken from pkgsrc
   keeps pkgsrc's `$NetBSD: <file>,v <rev> ... Exp $' (the revision says where
   it came from), and the unfilled `$NetBSD$' is neither -- it is pkgsrc's
   recipe skeleton before the revision is set.  Three files carried it:

   - ext/src/mcde/pkgsrc-motif/buildlink3.mk, ours throughout
     (MCDE_MOTIF_BUILDLINK3_MK, BUILDLINK_TREE mcde-motif, PKGSRCDIR
     ../../x11/mcde-motif) -- committed there, pushed to kropa.
   - PINS: makronix-pins.sh write now writes the header with it, check
     still matches.
   - distfiles.lst: cmd_list writes three `#' lines; every reader goes
     through list_lines() (verify, fetch, stage, the superset merge) and
     install-simple.sh skips them, so a comment cannot be read as a package
     path.  afpfs-ng keeps `$NetBSD: Makefile,v ... wiz Exp $' in its recipe:
     that file is upstream's, unchanged (diff against
     pkgsrc/filesystems/afpfs-ng is empty), not the template.

2. afpfs-ng's tarball was missing from distfiles.lst.  gen_list dropped every
   recipe under ext/ -- written when all of them build from their tree -- but
   afpfs-ng still builds from afpfs-ng-0.8.1.tar.gz, so the source set
   carried a recipe whose distfile it did not.  The filter now drops only a
   recipe with `DISTFILES= # empty' (the eight that build from ext/src/<name>)
   and keeps the one with an archive.  distfiles.lst: 2088 archives.

   install-simple.sh counted `stage's fork lines on top of distfiles.lst; that
   command is gone (nothing is fetched or staged for a tree recipe), the
   archive now counts in distfiles.lst itself.

Tested: tools/test-tools.sh 42 ok, 0 bad (six cases added: the header rule
over ext/src/*/pkgsrc*, distfiles.lst's header, four fields a line, afpfs-ng
present).  makronix-pins.sh check matches; makronix-distfiles.sh list, verify,
check, stage all green; stage carries distfiles/afpfs-ng-0.8.1.tar.gz and none
of the tree recipes; bmake -C pkgsrc/wm/mcde -V MOTIFLIB still resolves through
mcde-motif's buildlink3.mk.
2026-11-24 03:19:19 +00:00

495 lines
21 KiB
Bash
Executable File

#!/bin/sh
# License: CNCL 1.0 (Could Not Care Less), see LICENSE at the top of the tree.
# install-simple.sh -- install Makronix from the CD in the simple mode, boot it.
#
# usage: install-simple.sh [-f bios] [-d diskimage]
#
# Drives sysinst on the serial console through tools/vmsh.sh: language, the
# installer, the installation profile (Desktop), the disk, the last chance;
# then it
# answers whatever sysinst still asks, one prompt at a time, by looking at what
# the console printed since the last key. When sysinst reboots, the disk is
# booted on its own, root logs in, and the result is checked.
#
# It sends the same keys a person would, in the same order, and prints every
# prompt it answered: the list is the evidence of how many questions the
# simple mode still asks. The logs of both phases are kept in build/logs/.
#
# Exit status: 0 all checks passed, 1 anything else. The medium is the CD
# that `make iso' built (vmsh.sh start -I); nothing in the build is touched.
set -u
TOP=${TOP:-$(cd "$(dirname "$0")/.." && pwd)}
# Tests do not run beside a build (make test/cdtest hold the lock).
"$TOP/tools/build-lock.sh" --check || exit 1
# the version of the release, as newvers.sh reads it
VER=$(cat "$TOP/src/sys/conf/makronix-release")
V=$TOP/tools/vmsh.sh
# VMD=/another/dir runs beside another session's VM (vmsh.sh reads VMDIR)
VMD=${VMD:-$TOP/build/vmsession}
VMDIR=$VMD; export VMDIR
FW=bios
DISK=$VMD/disk-install-simple.qcow2
DAY=$(date +%Y-%m-%d)
# the second install CD, for the set that is not on the first (make iso)
CD2=$TOP/build/obj/releasedir/images/Makronix-$VER-amd64-cd2.iso
# the third, with the extra programs (firefox, thunderbird, qemu)
CD3=$TOP/build/obj/releasedir/images/Makronix-$VER-amd64-cd3.iso
CD4=$TOP/build/obj/releasedir/images/Makronix-$VER-amd64-cd4.iso
CD5=$TOP/build/obj/releasedir/images/Makronix-$VER-amd64-cd5.iso
# the source DVD, its own medium (make isosrc); the install DVD has no sources
# an existing copy wins: a `make release' in another session removes
# RELEASEDIR/images while the test runs (measured 2026-11-15)
CDSRC=${CDSRC:-$TOP/build/obj/releasedir/images/Makronix-$VER-amd64-source.iso}
DVDISO=${DVDISO:-$TOP/build/obj/releasedir/images/Makronix-$VER-amd64-dvd.iso}
SRCDVD=no
USBGZ= # -U: the install image of make usb (.img.gz)
BOOTONLY=no # -B: stop at the disk menu and check it (a smoke test of the medium)
NOLAST= # -n DISK: say no at the last chance on a layer over DISK (t0064)
BASEDISK= # -n/-b DISK: the target is a copy-on-write layer over DISK
TAG=simple
UPW=mx-test-password-1 # the password of root and of the user, in the test
# for a machine that is kept (the build VM): MX_VMOPTS="-s 64G -m 10G -c 8 -p 2222",
# MX_HOST names it; the later options of vmsh.sh start win over the earlier
VMOPTS=${MX_VMOPTS:-}
HOST=${MX_HOST:-mxtest}
usage()
{
echo "usage: ${0##*/} [-B] [-S | -U image.img[.gz]] [-p minimal|desktop|full]" >&2
echo " [-f bios|uefi] [-d diskimage]" >&2
echo " -B boot only: go to the disk menu, check it, stop" >&2
echo " -p the installation profile (default: desktop; full with -S/-U)" >&2
echo " -n disk.qcow2 answer no at the last chance on a copy of an installed disk" >&2
echo " and check that its partition table is still there" >&2
echo " -b disk install over a copy of DISK (a disk that carries old partition maps)" >&2
echo " -U install from the USB stick image (make usb, raw or .gz), attached as a USB stick" >&2
echo " -S install from the install DVD with the full profile; the sources" >&2
echo " come from the source DVD (make isosrc) when sysinst asks for it," >&2
echo " and the test checks that they were installed" >&2
exit 1
}
PROFILE= # minimal, desktop or full; empty: desktop (full with -S/-U)
while getopts BSU:p:f:d:n:b: ch; do
case $ch in
S) SRCDVD=yes; TAG=src ;;
B) BOOTONLY=yes ;;
U) USBGZ=$OPTARG; TAG=usb ;;
p) PROFILE=$OPTARG ;;
f) FW=$OPTARG ;;
d) DISK=$OPTARG ;;
n) NOLAST=$OPTARG; BASEDISK=$OPTARG; TAG=nolast ;;
b) BASEDISK=$OPTARG ;;
*) usage ;;
esac
done
case $PROFILE in
'')
# The CD carries no sources (desktop); the DVD and the stick do (full).
if [ $SRCDVD = yes ] || [ -n "${USBGZ:-}" ]; then
PROFILE=full
else
PROFILE=desktop
fi
;;
minimal|desktop|full) TAG=$PROFILE ;;
*) usage ;;
esac
LOG1=$TOP/build/logs/install-$TAG-$FW-install-$DAY.log
LOG2=$TOP/build/logs/install-$TAG-$FW-boot-$DAY.log
asked=
nasked=0
nextcd=0
die()
{
echo "FAIL: $*"
$V show 14
cp "$VMD/console.log" "$TOP/build/logs/install-simple-$FW-failed-$DAY.log" 2>/dev/null
$V stop >/dev/null
exit 1
}
# wait for a screen, then give it a moment to finish drawing
step()
{
$V wait "$1" "$2" > /dev/null || die "waiting for '$1'"
sleep 1
}
# A menu key: the letter selects and activates in one keypress (sysinst's
# menus, like the language menu: a, b, c ...). No RETURN.
key()
{
$V send "$1"
sleep 1
asked="$asked $1"
nasked=$((nasked + 1))
}
rm -f "$DISK"
# -n: the disk is a copy-on-write layer over a disk that carries a partition
# table (a finished installation), so "no" at the last chance can show that
# the table is still there; the base stays untouched
if [ -n "$BASEDISK" ]; then
[ -r "$BASEDISK" ] || die "no disk $BASEDISK to start from (-n, -b)"
case $BASEDISK in *.raw|*.img) bfmt=raw ;; *) bfmt=qcow2 ;; esac
qemu-img create -q -f qcow2 -F $bfmt -b "$(cd "$(dirname "$BASEDISK")" && pwd)/${BASEDISK##*/}" "$DISK" ||
die "qemu-img create over $BASEDISK"
fi
$V stop > /dev/null 2>&1
if [ $SRCDVD = yes ]; then
DVD=$DVDISO
$V start -i "$DVD" -d "$DISK" -f "$FW" -s 30G $VMOPTS || exit 1
elif [ -n "$USBGZ" ]; then
# the stick is a raw image; vmsh.sh -U attaches it with snapshot=on, so
# the file stays as it was unpacked
case $USBGZ in
*.gz) STICK=$TOP/build/vm/usb-stick.img
gzip -dc "$USBGZ" > "$STICK" || exit 1 ;;
*) STICK=$USBGZ ;; # raw: used as it is
esac
$V start -U "$STICK" -d "$DISK" -f "$FW" -s 40G $VMOPTS || exit 1
elif [ "$FW" = uefi ]; then
# a copy of CD 1 whose loader talks on com0 (tools/cd-com0.sh says why)
"$TOP/tools/cd-com0.sh" "$TOP/build/obj/releasedir/images/Makronix-$VER-amd64.iso" "$TOP/build/vm/cd1-com0.iso" || exit 1
$V start -i "$TOP/build/vm/cd1-com0.iso" -d "$DISK" -f "$FW" -s 20G $VMOPTS || exit 1
else
$V start -I -d "$DISK" -f "$FW" -s 20G $VMOPTS || exit 1
fi
# The media choose their console themselves (console=auto). The
# UEFI loader takes a serial port only if a key is pressed on it within seven
# seconds (sys/arch/i386/stand/efiboot/eficons.c); a person at a terminal does
# that, the test does it here: Enter once a second until the loader has spoken.
# The BIOS loader needs no key (modem lines are enough).
if [ "$FW" = uefi ]; then
i=0
while [ $i -lt 600 ] && ! grep -a -q 'Makronix' "$VMD/console.log" 2>/dev/null; do
sleep 1
# the key goes in through the (virtual) keyboard: the loader looks at the
# console input, and a key on the serial line did not count (screen dump,
# 2026-11-08: the installer came up on VGA)
echo "sendkey ret" | socat - "UNIX-CONNECT:$VMD/mon" > /dev/null 2>&1
i=$((i + 1))
done
fi
# ---- the fixed part: language, installer, mode, disk, last chance ----
# The installer that runs from the CD asks for the terminal type; the one that
# runs from the RAM disk (the first CD) has it set already and shows the
# language menu at once.
step 'Terminal type|Installation messages in English' 400
case $($V since) in
*'Terminal type'*) $V send '\r' ;;
esac
step 'Installation messages in English' 60; key a # language
step 'Thank you for choosing Makronix' 30; $V send '\r' # welcome: OK
step 'Install Makronix to hard disk' 30; key a # main menu
step 'Shall we continue' 30; key b # yes
case $PROFILE in
minimal) profilekey=a ;; # base and core, no /usr/pkg
desktop) profilekey=b ;; # the desktop, without sources
full) profilekey=c ;; # the desktop and the source set
esac
step 'Select the installation profile' 30; key $profilekey
step 'Encrypt the disk' 30; key a # no
step 'Available disks' 30
if [ $BOOTONLY = yes ]; then
# The disk menu lists the machine's disks. The target (wd0) must be there;
# the medium the installer runs from must not be, a CD never, a USB stick
# neither (sysinst offered the stick once, 2026-11-08: disks.c
# is_root_wedge_parent).
s=$($V since)
echo "$s" | tail -8
fail=0
case $s in *': wd0'*|*'a: wd0'*) echo "PASS: the target disk wd0 is offered" ;; *) echo "FAIL: wd0 is not offered"; fail=1 ;; esac
case $s in *': sd0'*) echo "FAIL: the stick (sd0) is offered as a target"; fail=1 ;; *) echo "PASS: no sd0 among the targets" ;; esac
case $s in *': cd0'*) echo "FAIL: the CD (cd0) is offered as a target"; fail=1 ;; *) echo "PASS: no cd0 among the targets" ;; esac
$V stop > /dev/null
exit $fail
fi
key a # the disk
step 'ready to install Makronix on your hard disk' 120
if [ -n "$NOLAST" ]; then
# "no" at the last chance: nothing may have been written. The disk had
# a GPT with root and swap (the finished installation it is layered
# on); sysinst returns to its main menu, the shell shows the table.
# (tasksd t0064: the simple mode destroyed it before this question.)
key a # no
step 'Exit Install System' 60; key x
step '#' 60
$V send 'echo GPTPARTS=$(gpt show wd0 2>/dev/null | grep -c "GPT part")\r'
step 'GPTPARTS=' 30
out=$($V since)
cp "$VMD/console.log" "$LOG1"
$V stop > /dev/null
if echo "$out" | grep -a -q 'GPTPARTS=2'; then
echo "PASS: \"no\" at the last chance left the partition table (2 GPT partitions)"
echo "logs: ${LOG1#$TOP/}"
exit 0
fi
echo "FAIL: after \"no\" at the last chance: $(echo "$out" | grep -a 'GPTPARTS=' | tail -1)"
echo "logs: ${LOG1#$TOP/}"
exit 1
fi
key b # last chance: yes
# ---- the rest: answer what is asked, until sysinst reboots ----
# rounds of the screen loop, a little over two seconds each: about 55
# minutes. The USB stick is read through qemu's usb-storage, much slower
# than the CD/DVD: on 2026-11-11 its install was still unpacking msrc.tgz
# (626 MB) after 1500 rounds (build/logs/test-install-usb-2026-11-11.log),
# while the DVD's had finished; it gets twice as long.
ROUNDS=1500
[ -n "$USBGZ" ] && ROUNDS=3000
i=0
while [ $i -lt $ROUNDS ]; do
# -no-reboot: qemu exits when sysinst reboots, perhaps before the line is printed
kill -0 "$(cat "$VMD/qemu.pid" 2>/dev/null)" 2>/dev/null || break
s=$($V since)
case $s in
*'rebooting...'*) break ;;
*'Reboot the computer'*) key d ;;
*'Finished configuring'*) key x ;;
*'Not now, continue'*) key x ;;
# extras.c asks once for the games group and once for the museum
# (2026-11-18: the museum question was not answered and the test hung)
*'Install Makronix Games'*) key a ;;
# the museum's title is cut by the screen handling ("...qqqj(B Museum?"),
# so its text names it (2026-11-18: the test hung on this question)
*'Install Makronix Museum'*|*'Tiger as ready-made'*) key a ;;
# sysinst asks for the next CD with the menu "Next CD": first the second
# (the makronix set), then the third (the extra programs). The test counts
# the menus; it does not read the sentence above them, which `vmsh since'
# does not always have (measured 2026-11-07: the test hung at the prompt).
*'Next CD'*)
if [ $SRCDVD = yes ]; then
# the full profile: the source set is on its own DVD, and
# the makronix set follows it -- on the install DVD, as do
# the packages (the set is binary/sets/makronix.tar.xz)
if [ "$nextcd" -eq 0 ]; then
cd=$CDSRC
else
cd=$DVD
fi
nextcd=$((nextcd + 1))
else
nextcd=$((nextcd + 1))
# CD 2, then the CDs with the packages: CD 3, and CD 4, ...
# when the packages need more than one
cd=$(eval echo "\$CD$((nextcd + 1))")
fi
[ -r "$cd" ] || die "no disc for the next-CD prompt: $cd"
$V cd "$cd" || die "changing the CD"
sleep 5
key a ;;
# the questions of the simple mode's last step (setup.c)
*'Name of this computer'*)
$V send "$HOST\\r"; asked="$asked <hostname>"; nasked=$((nasked + 1)) ;;
# since 2026-11-09 the network, root and the user come from the entries
# of the configuration menu (configmenu.c, net.c, passwd -l)
*'Which network device'*)
key a; asked="$asked <netdev>"; nasked=$((nasked + 1)) ;;
*'Network media type'*|*'Your host name'*|*'Your DNS domain'*|*'Your name server'*)
$V send '\r'; asked="$asked <net-enter>"; nasked=$((nasked + 1)) ;;
*'Perform autoconfiguration'*|*'Are they OK'*|*'installed in /etc'*)
key a; asked="$asked <net-yes>"; nasked=$((nasked + 1)) ;;
*'continue the install process anyway'*)
key a ;;
*'problem in setting up the network'*)
key b ;;
*'choose the timezone'*)
key x ;; # the default (UTC) stays
*'Retype new password'*|*'New password'*)
$V send "$UPW\\r"; asked="$asked <pw>"; nasked=$((nasked + 1)) ;;
*'Username to add'*)
$V send 'tester\r'; asked="$asked <login>"; nasked=$((nasked + 1)) ;;
*'add this user to group wheel'*)
key a; asked="$asked <wheel>"; nasked=$((nasked + 1)) ;;
*'/bin/ksh'*)
key b; asked="$asked <shell>"; nasked=$((nasked + 1)) ;;
*'Hit enter to continue'*)
$V send '\r'; asked="$asked <enter>"; nasked=$((nasked + 1)) ;;
*'Install from'*|*'Bootblocks selection'*|*'correct geometry'*|*'Select your distribution'*)
die "the simple mode asked something it should not: $(echo "$s" | tail -3)" ;;
esac
sleep 2
i=$((i + 1))
done
[ $i -lt $ROUNDS ] || die "sysinst did not finish within the time limit"
cp "$VMD/console.log" "$LOG1"
sleep 3
$V stop > /dev/null
echo "prompts answered by the test (keys): $nasked --$asked"
grep -a -c 'Sets selected' "$LOG1" > /dev/null && grep -a -o 'Sets selected [0-9]*' "$LOG1" | head -1
# ---- second boot: the installed disk on its own ----
$V start -d "$DISK" -f "$FW" $VMOPTS || exit 1
step 'login:' 300
$V send 'root\r'
step 'Password:' 30
$V send "$UPW\\r"
sleep 3
$V send 'echo READYX\r'
step '^READYX' 30
# The checks go into a file, line by line: one terminal line holds 1024
# bytes and the whole check is longer (measured 2026-11-07: the line was cut
# and "ENDCHK" never came). Only the output of the last send is kept.
$V send 'cat > /tmp/chk.sh <<"EOF"\r'
$V send 'echo CHK\r'
$V send 'id tester\r'
# only the account sysinst created gets wheel and operator (setup.c): not
# nobody, not the daemon users of pkg_add
$V send 'echo PRIVOTHER=$(for u in $(cut -d: -f1,3 /etc/passwd | grep -E ":[1-5][0-9]{3,4}$" | cut -d: -f1 | grep -vx tester); do id -Gn $u; done | grep -cw -e wheel -e operator)\r'
$V send 'hostname\r'
$V send 'grep -E "^(dtlogin|ntpd|dhcpcd|sshd|npf|mdnsd|dbus|cupsd)=" /etc/rc.conf\r'
$V send 'test -s /etc/npf.conf && echo NPF_CONF\r'
$V send 'echo NPF_RULES=$(/sbin/npfctl show 2>/dev/null | grep -c block)\r'
$V send 'echo ROOTSSH=$(grep -c "^PermitRootLogin yes" /etc/ssh/sshd_config)\r'
$V send 'echo NSS=$(grep -c "^hosts: files mdnsd dns" /etc/nsswitch.conf)\r'
$V send 'echo MDNSD=$(ps ax | grep -c "[m]dnsd")\r'
# each lookup of the .local name can wait for mDNS without a network; the
# 30 rounds outlasted the 300 s for ENDCHK (2026-11-18), so one is 5 s at most
$V send 'i=0; while [ $i -lt 30 ]; do n=$(timeout 5 getent hosts $(hostname).local | wc -l); [ $n -ge 1 ] && break; sleep 2; i=$((i+1)); done; echo MDNS_NAME=$n\r'
$V send 'echo DBUS=$(ps ax | grep -c "[d]bus-daemon")\r'
$V send 'echo CUPSD=$(ps ax | grep -c "[c]upsd")\r'
$V send 'echo PULSE=$(/usr/pkg/bin/pulseaudio --version)\r'
$V send 'echo PKGCONF=$(grep -c "^PKG_PATH=" /etc/pkg_install.conf)\r'
$V send 'echo DAILYVULN=$(grep -c "^fetch_pkg_vulnerabilities=YES" /etc/daily.conf)\r'
$V send 'test -x /etc/rc.d/dtlogin && echo DT_RC\r'
$V send 'test -L /etc/localtime && echo TZLINK\r'
$V send 'echo DTL=$(ps ax | grep -c "[d]tlogin")\r'
if [ "$PROFILE" != minimal ]; then
$V send 'i=0; while [ $i -lt 30 ]; do n=$(ps ax | grep -c -e "[X]org" -e "X11R7/bin/[X] "); [ $n -ge 1 ] && break; sleep 2; i=$((i+1)); done; echo XORG=$n\r'
$V send 'grep "^(EE)" /var/log/Xorg.0.log; echo XLOG_END\r'
else
$V send 'echo XORG=0\r'
fi
$V send 'test -f /etc/mtree/set.base && echo BASE_SET\r'
$V send 'test -f /etc/mtree/set.makronix && echo SET_OK || echo NO_SET\r'
$V send 'test -x /usr/pkg/dt/bin/dtwm && echo CDE_OK || echo NO_CDE\r'
$V send 'test -d /usr/pkg && echo PKGDIR || echo NO_PKGDIR\r'
$V send 'echo SSHD=$(ps ax | grep -c "[s]shd")\r'
$V send 'gpt show wd0 | grep -c "GPT part"\r'
$V send 'df / | tail -1\r'
$V send 'test -d /usr/src/src/sys && test -f /usr/src/src/build.sh && echo SRC_OK || echo NO_SRC\r'
$V send 'test -f /usr/src/PINS && test -f /usr/src/pkgsrc/Makefile && echo MXSRC_OK\r'
$V send 'echo DISTFILES=$(find /usr/src/distfiles -type f | wc -l)\r'
$V send 'cat /usr/src/PINS\r'
$V send 'echo PKGS\r'
$V send '/usr/sbin/pkg_info -K /usr/pkg/pkgdb | grep -E "^(firefox|thunderbird|qemu|pulseaudio|cups)-"\r'
$V send '/usr/pkg/bin/qemu-system-aarch64 --version | head -1\r'
$V send 'test -x /usr/pkg/lib/firefox/firefox && echo FF_OK\r'
$V send 'EOF\r'
$V send 'sh /tmp/chk.sh; echo ENDCHK\r'
step '^ENDCHK' 300
out=$($V since)
cp "$VMD/console.log" "$LOG2"
$V stop > /dev/null
rc=0
# wanted NAME: is NAME a binary package the media carry (packages.list: repo, fetch,
# tools/cd3.sh)? Its checks run only then; otherwise one SKIP line says why.
wanted()
{
{ "$TOP/tools/pkglist.sh" repo -n; "$TOP/tools/pkglist.sh" fetch -n; } | grep -qx -- "$1" && return 0
echo "SKIP: $1 is not on the media (packages.list: repo, fetch)"
return 1
}
check()
{
if echo "$out" | grep -a -q "$1"; then
echo "PASS: $2"
else
echo "FAIL: $2"
rc=1
fi
}
echo "PASS: login: prompt reached on the installed disk"
check '(tester).*(wheel).*(operator)' "the user is in wheel and operator (and the other groups)"
check "^$HOST" "the host name is the one that was asked for"
check '^sshd=YES' "sshd is enabled in rc.conf"
check '^SSHD=[1-9]' "sshd is running"
check '^npf=YES' "the firewall (npf) is enabled in rc.conf"
check '^NPF_CONF' "/etc/npf.conf is in place"
check '^NPF_RULES=[1-9]' "the firewall is loaded and blocks (npfctl show)"
check '^ROOTSSH=1' "root may log in with the password (PermitRootLogin yes)"
check '^mdnsd=YES' "mdnsd is enabled in rc.conf"
check '^NSS=1' "nsswitch.conf asks mdnsd for hosts"
check '^MDNSD=[1-9]' "mdnsd is running"
check '^MDNS_NAME= *[1-9]' "the computer's own name.local resolves (getent hosts)"
check '^dhcpcd=YES' "dhcpcd is enabled in rc.conf"
check '^TZLINK' "/etc/localtime is set (the time zone question was answered)"
check '^PKGCONF=1' "pkg_add has a repository (/etc/pkg_install.conf PKG_PATH)"
check '^DAILYVULN=1' "daily fetches the package vulnerabilities (/etc/daily.conf)"
check '(tester).*wsrc' "the user is in wsrc (may write /usr/src)"
check '^PRIVOTHER=0' "no other account (nobody, daemon users) is in wheel or operator"
check '^BASE_SET' "the base set is installed (/etc/mtree/set.base)"
check '^ntpd=YES' "ntpd is enabled in rc.conf"
check '^2$' "the GPT carries two partitions (root and swap)"
check '/dev/dk0' "root is on a wedge of the new GPT"
if [ "$PROFILE" = minimal ]; then
echo "profile: minimal (base and core, no /usr/pkg, no desktop)"
check '^NO_SET' "no makronix set (/etc/mtree/set.makronix is absent)"
check '^NO_PKGDIR' "no /usr/pkg (no makronix userland)"
check '^NO_CDE' "no CDE (/usr/pkg/dt/bin/dtwm is absent)"
check '^NO_SRC' "no /usr/src (no source set)"
check '^DTL=0' "no dtlogin after the boot"
check '^XORG=0' "no X server after the boot"
if echo "$out" | grep -a -q '^firefox-'; then
echo "FAIL: the minimal profile installed firefox"
rc=1
else
echo "PASS: no extra packages in the minimal profile"
fi
else
echo "profile: $PROFILE"
check '^dtlogin=YES' "dtlogin is enabled in rc.conf"
{ wanted pulseaudio || wanted cups; } && check '^dbus=YES' "dbus is enabled in rc.conf"
{ wanted pulseaudio || wanted cups; } && check '^DBUS=[1-9]' "dbus-daemon is running"
wanted cups && check '^cupsd=YES' "cupsd is enabled in rc.conf"
wanted cups && check '^CUPSD=[1-9]' "cupsd is running"
wanted pulseaudio && check '^pulseaudio-' "pulseaudio is installed (pkg_info)"
wanted cups && check '^cups-' "cups is installed (pkg_info)"
wanted pulseaudio && check '^PULSE=pulseaudio' "pulseaudio runs (--version)"
check '^DT_RC' "/etc/rc.d/dtlogin is in place"
check '^DTL=[1-9]' "dtlogin is running after the boot"
check '^XORG=[1-9]' "the X server (Xorg) is running after the boot"
check '^SET_OK' "/etc/mtree/set.makronix exists (the makronix set was installed)"
check '^CDE_OK' "/usr/pkg/dt/bin/dtwm exists (CDE)"
wanted firefox && check '^firefox-154' "firefox is installed (pkg_info)"
wanted thunderbird && check '^thunderbird-154' "thunderbird is installed (pkg_info)"
wanted qemu && check '^qemu-11' "qemu is installed (pkg_info)"
wanted qemu && check '^QEMU emulator version' "qemu runs (qemu-system-aarch64 --version)"
wanted firefox && check '^FF_OK' "the firefox program is there"
if [ $SRCDVD = yes ] || [ -n "${USBGZ:-}" ]; then # the DVD and the stick
check '^SRC_OK' "/usr/src holds the tree (src/sys, src/build.sh)"
check '^MXSRC_OK' "/usr/src has PINS and pkgsrc"
# `#' lines are the file's header (tools/makronix-distfiles.sh list)
want=$(grep -v '^#' "$TOP/distfiles.lst" | cut -d' ' -f2 | sort -u | wc -l | tr -d ' ')
check "DISTFILES= *$want\$" "all $want Makronix distfiles are in /usr/src/distfiles"
check "^src $(cat "$TOP/src/BASE")" "PINS on the disk names the upstream base of this tree"
else
if echo "$out" | grep -a -q '^SRC_OK'; then
echo "FAIL: the CD installed source sets, it does not carry them"
rc=1
else
echo "PASS: no source sets from the CD (it does not carry them)"
fi
fi
fi
echo "logs: ${LOG1#$TOP/} ${LOG2#$TOP/}"
exit $rc