@reallroboto/qbbox 0.1.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/bin/qemu-img +0 -0
- package/bundle/bin/qemu-system-aarch64 +4 -0
- package/bundle/bin/wimlib-imagex +0 -0
- package/bundle/lib/libcharset.1.dylib +0 -0
- package/bundle/lib/libfdt.1.dylib +0 -0
- package/bundle/lib/libglib-2.0.0.dylib +0 -0
- package/bundle/lib/libgmp.10.dylib +0 -0
- package/bundle/lib/libhogweed.6.dylib +0 -0
- package/bundle/lib/libiconv.2.dylib +0 -0
- package/bundle/lib/libintl.8.dylib +0 -0
- package/bundle/lib/libnettle.8.dylib +0 -0
- package/bundle/lib/libntfs-3g.91.dylib +0 -0
- package/bundle/lib/libpcre2-8.0.dylib +0 -0
- package/bundle/lib/libpixman-1.0.dylib +0 -0
- package/bundle/lib/libresolv.9.dylib +0 -0
- package/bundle/lib/libslirp.0.dylib +0 -0
- package/bundle/lib/libwim.15.dylib +0 -0
- package/bundle/sbom.cdx.json +225 -0
- package/bundle/share/qbbox/firmware.fd +4 -0
- package/bundle/share/qemu/edk2-arm-vars.fd +4 -0
- package/bundle/share/qemu/efi-virtio.rom +0 -0
- package/bundle/share/qemu/keymaps/ar +1034 -0
- package/bundle/share/qemu/keymaps/bepo +1025 -0
- package/bundle/share/qemu/keymaps/cz +1081 -0
- package/bundle/share/qemu/keymaps/da +1080 -0
- package/bundle/share/qemu/keymaps/de +1078 -0
- package/bundle/share/qemu/keymaps/de-ch +1080 -0
- package/bundle/share/qemu/keymaps/en-gb +1079 -0
- package/bundle/share/qemu/keymaps/en-us +991 -0
- package/bundle/share/qemu/keymaps/es +1079 -0
- package/bundle/share/qemu/keymaps/et +989 -0
- package/bundle/share/qemu/keymaps/fi +1054 -0
- package/bundle/share/qemu/keymaps/fo +1081 -0
- package/bundle/share/qemu/keymaps/fr +1081 -0
- package/bundle/share/qemu/keymaps/fr-be +1080 -0
- package/bundle/share/qemu/keymaps/fr-ca +1012 -0
- package/bundle/share/qemu/keymaps/fr-ch +1080 -0
- package/bundle/share/qemu/keymaps/hr +1081 -0
- package/bundle/share/qemu/keymaps/hu +1080 -0
- package/bundle/share/qemu/keymaps/is +1081 -0
- package/bundle/share/qemu/keymaps/it +1084 -0
- package/bundle/share/qemu/keymaps/ja +995 -0
- package/bundle/share/qemu/keymaps/lt +1079 -0
- package/bundle/share/qemu/keymaps/lv +1054 -0
- package/bundle/share/qemu/keymaps/mk +991 -0
- package/bundle/share/qemu/keymaps/nl +1081 -0
- package/bundle/share/qemu/keymaps/no +1095 -0
- package/bundle/share/qemu/keymaps/pl +1085 -0
- package/bundle/share/qemu/keymaps/pt +1078 -0
- package/bundle/share/qemu/keymaps/pt-br +1078 -0
- package/bundle/share/qemu/keymaps/ru +992 -0
- package/bundle/share/qemu/keymaps/sl +285 -0
- package/bundle/share/qemu/keymaps/sv +255 -0
- package/bundle/share/qemu/keymaps/th +991 -0
- package/bundle/share/qemu/keymaps/tr +1074 -0
- package/firmware/edk2.config +2 -2
- package/package.json +5 -4
- package/qbbox +91 -81
- package/Brewfile +0 -14
package/firmware/edk2.config
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
#
|
|
3
3
|
# QEMU 11.1.2 roms/edk2-build.config, build armvirt.aa64, copied as is except
|
|
4
4
|
# the output name and no pad step: edk2-build.py pads with GNU truncate, which
|
|
5
|
-
# macOS lacks;
|
|
6
|
-
# build directory
|
|
5
|
+
# macOS lacks; scripts/build pads to 64 MiB itself. Paths resolve from the
|
|
6
|
+
# build directory scripts/build runs it in.
|
|
7
7
|
|
|
8
8
|
[opts.common]
|
|
9
9
|
NETWORK_HTTP_BOOT_ENABLE = TRUE
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reallroboto/qbbox",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"bin": {
|
|
6
6
|
"qbbox": "qbbox"
|
|
7
7
|
},
|
|
8
8
|
"files": [
|
|
9
9
|
"qbbox",
|
|
10
|
-
"Brewfile",
|
|
11
10
|
"guest",
|
|
12
11
|
"qemu",
|
|
13
12
|
"firmware",
|
|
14
|
-
"golden"
|
|
13
|
+
"golden",
|
|
14
|
+
"bundle"
|
|
15
15
|
],
|
|
16
16
|
"os": [
|
|
17
17
|
"darwin"
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
"node": ">=26"
|
|
24
24
|
},
|
|
25
25
|
"qbbox": {
|
|
26
|
-
"qb": "0.1"
|
|
26
|
+
"qb": "0.1",
|
|
27
|
+
"qemu": "11.1.2"
|
|
27
28
|
},
|
|
28
29
|
"publishConfig": {
|
|
29
30
|
"access": "public"
|
package/qbbox
CHANGED
|
@@ -1,26 +1,34 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
# qbbox: one disposable QBD Box on the operator Mac. QEMU+HVF, Windows 11 Arm, online, Mac + private ranges blocked.
|
|
3
|
-
# qbbox firmware build the UEFI firmware with the patched ramfb driver
|
|
4
|
-
# qbbox qemu build qemu-system-aarch64 with the 60 fps display patch
|
|
5
3
|
# qbbox golden build the Golden from the media cache + Windows Update, unattended
|
|
6
4
|
# qbbox up boot the Box; first boot creates its overlay on the Golden
|
|
7
5
|
# qbbox qbd install the QBD trial in the running Box, QBD updater blocked
|
|
8
6
|
# qbbox sdk unpack qbxmlops170.xml from the SDK installer in the running Box, SDK not installed
|
|
9
7
|
# qbbox push-qb copy the qb installed on the Mac (or --from <tarball>) into the running Box
|
|
10
8
|
# qbbox destroy power off the Box and delete its overlay
|
|
9
|
+
# qbbox --version print the qbbox version, the packaged QEMU version, and the firmware SHA-256
|
|
11
10
|
set -euo pipefail
|
|
12
11
|
|
|
13
12
|
# Package dir, also when started through the npm bin symlink.
|
|
14
13
|
repo=$(dirname "$(/bin/realpath "$0")")
|
|
15
14
|
home=$HOME/.qbbox
|
|
16
15
|
media=$home/media
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
# Packaged QEMU + qemu-img (scripts/build), its -L data, and the UEFI firmware, all from the same build and QEMU
|
|
17
|
+
# tarball; wimlib-imagex from the same build lock.
|
|
18
|
+
qemu=$repo/bundle/bin/qemu-system-aarch64
|
|
19
|
+
qemu_img=$repo/bundle/bin/qemu-img
|
|
20
|
+
wimlib=$repo/bundle/bin/wimlib-imagex
|
|
21
|
+
share=$repo/bundle/share/qemu
|
|
22
|
+
firmware=$repo/bundle/share/qbbox/firmware.fd
|
|
23
|
+
# Machine type of a Golden without golden.machine: QEMU 11.1.2 `virt` = DEFINE_VIRT_MACHINE_AS_LATEST(11, 1).
|
|
24
|
+
legacy_machine=virt-11.1
|
|
20
25
|
# Display mode, seen over VNC: firmware and Windows (viogpudo) take it from virtio-gpu. Golden runs at 200 %, so
|
|
21
26
|
# 1512×945 logical, as an RDP session on a Retina Mac.
|
|
22
27
|
xres=3024 yres=1890
|
|
23
|
-
|
|
28
|
+
key=$home/id_ed25519
|
|
29
|
+
# Only the qbbox key: -F none reads no SSH config, whose IdentityFile (Host *) IdentitiesOnly would still offer.
|
|
30
|
+
ssh_opts=(-F none -i "$key" -o IdentitiesOnly=yes -o BatchMode=yes -o ConnectTimeout=5
|
|
31
|
+
-o "UserKnownHostsFile=$home/known_hosts" -o StrictHostKeyChecking=accept-new)
|
|
24
32
|
|
|
25
33
|
die() { echo "qbbox: $*" >&2; exit 1; }
|
|
26
34
|
|
|
@@ -41,13 +49,25 @@ need() {
|
|
|
41
49
|
[ -z "$3" ] || sha_ok "$3" "$file" || die "SHA-256 mismatch: $file; delete it to fetch again"
|
|
42
50
|
}
|
|
43
51
|
|
|
44
|
-
#
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
52
|
+
# prereqs: runtime tools neither macOS nor the package ships.
|
|
53
|
+
prereqs() {
|
|
54
|
+
[ "$(uname -sm)" = "Darwin arm64" ] || die "missing macOS arm64"
|
|
55
|
+
node -e 'process.exit(+process.versions.node.split(".")[0] < 26 ? 1 : 0)' 2>/dev/null || die "missing node >= 26"
|
|
56
|
+
command -v npm >/dev/null || die "missing npm"
|
|
57
|
+
# macOS /usr/bin/python3 without Xcode Command Line Tools is a stub that only offers their install: run it.
|
|
58
|
+
python3 -c '' 2>/dev/null || die "missing python3"
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
# box_key: the qbbox Box SSH key, created if missing; its public key in authorized_keys (operator keys optional).
|
|
62
|
+
box_key() {
|
|
63
|
+
local keys=$home/authorized_keys
|
|
64
|
+
[ -e "$key" ] || ssh-keygen -q -t ed25519 -N '' -C qbbox -f "$key"
|
|
65
|
+
[ -e "$key.pub" ] || ssh-keygen -y -f "$key" >"$key.pub"
|
|
66
|
+
touch "$keys"
|
|
67
|
+
chmod 600 "$key" "$key.pub" "$keys"
|
|
68
|
+
# A last line without newline would join the appended key.
|
|
69
|
+
[ ! -s "$keys" ] || [ -z "$(tail -c 1 "$keys")" ] || echo >>"$keys"
|
|
70
|
+
grep -qxF "$(cat "$key.pub")" "$keys" || cat "$key.pub" >>"$keys"
|
|
51
71
|
}
|
|
52
72
|
|
|
53
73
|
# win11_iso: Windows 11 Arm64 ISO, en-US, fetched through the API the Microsoft download page calls, as Rufus'
|
|
@@ -96,6 +116,28 @@ win11_iso() {
|
|
|
96
116
|
need win11arm.iso "" "$(cat "$iso.sha256")"
|
|
97
117
|
}
|
|
98
118
|
|
|
119
|
+
# bundled: the packaged QEMU, qemu-img, wimlib-imagex, their dylibs, the -L data, and the firmware are present and
|
|
120
|
+
# signed; else stop before QEMU crashes.
|
|
121
|
+
bundled() {
|
|
122
|
+
local f
|
|
123
|
+
for f in "$qemu" "$qemu_img" "$wimlib" "$repo"/bundle/lib/*.dylib "$share/edk2-arm-vars.fd" "$share/efi-virtio.rom" "$firmware"; do
|
|
124
|
+
# Data files under share/ carry no signature.
|
|
125
|
+
if [ ! -f "$f" ] || { [[ $f != "$repo"/bundle/share/* ]] && ! /usr/bin/codesign --verify --strict "$f" 2>/dev/null; }; then
|
|
126
|
+
die "broken package: $f; reinstall @reallroboto/qbbox"
|
|
127
|
+
fi
|
|
128
|
+
done
|
|
129
|
+
# A missing dylib: dyld aborts QEMU. Subshell with exit, not exec: bash reports the abort into /dev/null.
|
|
130
|
+
("$qemu" --version; exit) >/dev/null 2>&1 || die "broken package: $qemu; reinstall @reallroboto/qbbox"
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
version() {
|
|
134
|
+
bundled
|
|
135
|
+
node -p '"qbbox " + require(process.argv[1]).version' "$repo/package.json"
|
|
136
|
+
# From the binary, not package.json: the QEMU a job runs on.
|
|
137
|
+
"$qemu" --version | sed -n '1s/^QEMU emulator version \([^ ]*\).*/qemu \1/p'
|
|
138
|
+
echo "firmware $(/usr/bin/shasum -a 256 "$firmware" | cut -d" " -f1)"
|
|
139
|
+
}
|
|
140
|
+
|
|
99
141
|
qmp() { printf '{"execute":"qmp_capabilities"}\n%s\n' "$1" | nc -U -w 2 "$home/qmp.sock" | tail -1; }
|
|
100
142
|
running() { [ -e "$home/qemu.pid" ] && kill -0 "$(cat "$home/qemu.pid")" 2>/dev/null; }
|
|
101
143
|
# QEMU deletes its pidfile on exit: callers read the pid first.
|
|
@@ -118,18 +160,17 @@ wait_for() {
|
|
|
118
160
|
done
|
|
119
161
|
}
|
|
120
162
|
|
|
121
|
-
# boot <disk> [QEMU args]: start <disk>.qcow2 with <disk>.vars.fd in the background.
|
|
163
|
+
# boot <disk> <machine> [QEMU args]: start <disk>.qcow2 with <disk>.vars.fd on machine type <machine>, in the background.
|
|
122
164
|
boot() {
|
|
123
|
-
local disk=$1; shift
|
|
165
|
+
local disk=$1 machine=$2; shift 2
|
|
124
166
|
! running || die "a Box is already running (pid $(cat "$home/qemu.pid"))"
|
|
125
|
-
[ -x "$home/qemu-system-aarch64" ] || die "no QEMU build: run qbbox qemu"
|
|
126
167
|
rm -f "$home/qmp.sock"
|
|
127
|
-
# -L: keymaps (VNC)
|
|
168
|
+
# -L: keymaps (VNC), virtio-net-pci option ROM from the packaged QEMU build.
|
|
128
169
|
# Online: the guest block list (golden/setup.ps1) keeps the guest off the Mac (10.0.2.2) and private ranges.
|
|
129
170
|
# ipv6=off: the block list covers IPv4 only; the slirp IPv6 host alias fec0::2 would need its own rules.
|
|
130
|
-
"$
|
|
131
|
-
-machine
|
|
132
|
-
-drive if=pflash,format=raw,unit=0,readonly=on,file="$
|
|
171
|
+
"$qemu" -L "$share" -nodefaults -name "qbbox-$disk" \
|
|
172
|
+
-machine "$machine",highmem=on,gic-version=3 -accel hvf -cpu host -smp 6,sockets=1,cores=6,threads=1 -m 8192 \
|
|
173
|
+
-drive if=pflash,format=raw,unit=0,readonly=on,file="$firmware" \
|
|
133
174
|
-drive if=pflash,format=raw,unit=1,file="$home/$disk.vars.fd" \
|
|
134
175
|
-device virtio-gpu-pci,xres=$xres,yres=$yres \
|
|
135
176
|
-device qemu-xhci,id=xhci,p2=8,p3=8 -device usb-kbd,bus=xhci.0 -device usb-tablet,bus=xhci.0 \
|
|
@@ -145,57 +186,16 @@ boot() {
|
|
|
145
186
|
qmp "{\"execute\":\"change-vnc-password\",\"arguments\":{\"password\":\"$(head -c 8 "$home/password")\"}}" >/dev/null
|
|
146
187
|
}
|
|
147
188
|
|
|
148
|
-
qemu_src() { need qemu-11.1.2.tar.xz https://download.qemu.org/qemu-11.1.2.tar.xz 731b5681e4bb18be313231579b8efd0296c5b015fa36dc533874b639ba838016; }
|
|
149
|
-
|
|
150
|
-
firmware() {
|
|
151
|
-
deps
|
|
152
|
-
qemu_src
|
|
153
|
-
local build=$home/build jobs
|
|
154
|
-
jobs=$(sysctl -n hw.ncpu)
|
|
155
|
-
rm -rf "$build" && mkdir -p "$build"
|
|
156
|
-
# Only edk2 and its build driver from the QEMU tree; the edk2 tree carries its submodules.
|
|
157
|
-
/usr/bin/bsdtar -xf "$media/qemu-11.1.2.tar.xz" -C "$build" --strip-components 2 qemu-11.1.2/roms/edk2 qemu-11.1.2/roms/edk2-build.py
|
|
158
|
-
cp "$repo/firmware/QemuRamfb.c" "$repo/firmware/QemuRamfbDxe.inf" "$build/edk2/OvmfPkg/QemuRamfbDxe/"
|
|
159
|
-
# C host tools only (BaseTools' Python tests need a bare `python`). The macOS SDK already
|
|
160
|
-
# defines UINT8_MAX etc.; BaseTools builds with -Werror.
|
|
161
|
-
make -C "$build/edk2/BaseTools/Source/C" -j"$jobs" CC=/usr/bin/clang CXX=/usr/bin/clang++ EXTRA_OPTFLAGS=-Wno-error >/dev/null
|
|
162
|
-
(cd "$build" && PATH="$llvm/bin:/opt/homebrew/bin:/usr/bin:/bin:/usr/sbin:/sbin" \
|
|
163
|
-
CLANGDWARF_BIN="$llvm/bin/" IASL_PREFIX=/opt/homebrew/bin/ PYTHON_COMMAND=python3 \
|
|
164
|
-
python3 edk2-build.py --config "$repo/firmware/edk2.config" --core edk2 --match armvirt.aa64 \
|
|
165
|
-
--toolchain CLANGDWARF --jobs "$jobs")
|
|
166
|
-
# QEMU's virt pflash takes exactly 64 MiB.
|
|
167
|
-
python3 -c 'import os, sys; os.truncate(sys.argv[1], 64 << 20)' "$build/out/qbbox-aarch64-code.fd"
|
|
168
|
-
mv "$build/out/qbbox-aarch64-code.fd" "$home/firmware.fd"
|
|
169
|
-
rm -rf "$build"
|
|
170
|
-
echo "firmware: $home/firmware.fd"
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
qemu() {
|
|
174
|
-
deps
|
|
175
|
-
qemu_src
|
|
176
|
-
# QEMU's configure needs Python >= 3.11 (tomllib); the Xcode python3 is 3.9.
|
|
177
|
-
local build=$home/build python=/opt/homebrew/bin/python3.14
|
|
178
|
-
rm -rf "$build" && mkdir -p "$build"
|
|
179
|
-
# roms/ = firmware sources, not needed for the emulator.
|
|
180
|
-
/usr/bin/bsdtar -xf "$media/qemu-11.1.2.tar.xz" -C "$build" --strip-components 1 --exclude qemu-11.1.2/roms
|
|
181
|
-
patch -d "$build" -p1 -s <"$repo/qemu/0001-ui-60fps-display-refresh.patch"
|
|
182
|
-
# Only what boot() uses (nettle: DES for the VNC password); glib, pixman, libslirp, nettle, dtc from Homebrew.
|
|
183
|
-
# The build signs the binary with the HVF entitlement.
|
|
184
|
-
(cd "$build" && ./configure --python="$python" --target-list=aarch64-softmmu --without-default-features \
|
|
185
|
-
--disable-docs --enable-hvf --enable-vnc --enable-slirp --enable-pixman --enable-nettle --enable-fdt=system \
|
|
186
|
-
--extra-cflags=-I/opt/homebrew/include --extra-ldflags=-L/opt/homebrew/lib >/dev/null)
|
|
187
|
-
ninja -C "$build/build" qemu-system-aarch64 >/dev/null
|
|
188
|
-
mv "$build/build/qemu-system-aarch64" "$home/qemu-system-aarch64"
|
|
189
|
-
rm -rf "$build"
|
|
190
|
-
"$home/qemu-system-aarch64" --version | head -1
|
|
191
|
-
}
|
|
192
|
-
|
|
193
189
|
golden() {
|
|
194
|
-
|
|
195
|
-
|
|
190
|
+
bundled
|
|
191
|
+
# The machine type `virt` stands for in the packaged QEMU: recorded, so a later QEMU boots this Golden on the same
|
|
192
|
+
# hardware (QBD trial hardware ID).
|
|
193
|
+
local machine
|
|
194
|
+
machine=$("$qemu" -machine help | sed -n 's/^virt .*(alias of \(virt-[0-9.]*\))$/\1/p')
|
|
195
|
+
[ -n "$machine" ] || die "broken package: $qemu names no virt machine; reinstall @reallroboto/qbbox"
|
|
196
196
|
[ ! -e "$home/golden.qcow2" ] || die "golden.qcow2 exists; delete it to rebuild"
|
|
197
197
|
[ ! -e "$home/box.qcow2" ] || die "the Box overlay depends on the Golden: run qbbox destroy first"
|
|
198
|
-
|
|
198
|
+
box_key
|
|
199
199
|
win11_iso
|
|
200
200
|
# virtio-win publishes no hash: pin from the first download, 2026-10-18.
|
|
201
201
|
need virtio-win-0.1.302.iso https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/virtio-win-0.1.302-1/virtio-win-0.1.302.iso 303f7ae40dad495d6ae474fdc571df58958a4dbc5c37a522d80f9a203867949d
|
|
@@ -237,18 +237,18 @@ golden() {
|
|
|
237
237
|
iso=$(diskutil image attach --nobrowse --readOnly "$media/win11arm.iso" | tail -1 | cut -f3)
|
|
238
238
|
(cd "$iso" && /usr/bin/bsdtar -c -f - --exclude ./sources/install.wim --no-xattrs --no-mac-metadata .) |
|
|
239
239
|
/usr/bin/bsdtar -x -f - -C "$vol" --no-xattrs --no-mac-metadata --no-same-owner --no-same-permissions
|
|
240
|
-
wimlib
|
|
240
|
+
"$wimlib" split "$iso/sources/install.wim" "$vol/sources/install.swm" 3800
|
|
241
241
|
hdiutil detach -quiet "$iso"
|
|
242
242
|
hdiutil detach -quiet "$dev"
|
|
243
243
|
# diskutil writes MBR disk signature 0; WinPE then sees the disk with no partitions.
|
|
244
244
|
printf '\x51\x42\x42\x58' | dd of="$img" bs=1 seek=440 conv=notrunc 2>/dev/null
|
|
245
245
|
|
|
246
|
-
|
|
246
|
+
"$qemu_img" create -q -f qcow2 "$home/golden.qcow2" 64G
|
|
247
247
|
cp "$share/edk2-arm-vars.fd" "$home/golden.vars.fd"
|
|
248
248
|
# A new Golden has new SSH host keys.
|
|
249
249
|
rm -f "$home/known_hosts"
|
|
250
250
|
# Empty target first: firmware falls through to the installer; after Setup's reboot, Windows boots.
|
|
251
|
-
boot golden \
|
|
251
|
+
boot golden "$machine" \
|
|
252
252
|
-drive if=none,id=installer,format=raw,readonly=on,file="$img" \
|
|
253
253
|
-device nvme,serial=qbinst,drive=installer,bootindex=2 \
|
|
254
254
|
-drive if=none,id=cfg,media=cdrom,readonly=on,file="$home/cfg.iso" \
|
|
@@ -301,30 +301,38 @@ golden() {
|
|
|
301
301
|
chmod 444 "$home/golden.qcow2" "$home/golden.vars.fd"
|
|
302
302
|
# Golden built online with the guest block list + Windows Update policy, both checked above: up needs it.
|
|
303
303
|
touch "$home/golden.online"
|
|
304
|
+
rm -f "$home/golden.machine"
|
|
305
|
+
echo "$machine" >"$home/golden.machine"
|
|
306
|
+
chmod 444 "$home/golden.machine"
|
|
304
307
|
# Written last: up takes it as the mark of a finished Golden.
|
|
305
308
|
(cd "$home" && /usr/bin/shasum -a 256 golden.qcow2 golden.vars.fd >golden.sha256)
|
|
306
309
|
echo "golden: $home/golden.qcow2"
|
|
307
310
|
}
|
|
308
311
|
|
|
309
312
|
up() {
|
|
310
|
-
|
|
313
|
+
bundled
|
|
311
314
|
[ -e "$home/golden.sha256" ] || die "no finished Golden: run qbbox golden"
|
|
312
315
|
# A Golden built before the online Box has no guest block list.
|
|
313
316
|
[ -e "$home/golden.online" ] || die "Golden predates the online Box: rebuild it (docs/golden.md#rebuild)"
|
|
317
|
+
local machine=$legacy_machine machines
|
|
318
|
+
[ ! -e "$home/golden.machine" ] || machine=$(cat "$home/golden.machine")
|
|
319
|
+
# Captured first: grep -q would end the pipe early (pipefail).
|
|
320
|
+
machines=$("$qemu" -machine help | awk '{print $1}')
|
|
321
|
+
grep -qxF "$machine" <<<"$machines" || die "Golden needs machine $machine; rebuild Golden"
|
|
314
322
|
if [ ! -e "$home/box.qcow2" ]; then
|
|
315
|
-
|
|
323
|
+
"$qemu_img" create -q -f qcow2 -b "$home/golden.qcow2" -F qcow2 "$home/box.qcow2"
|
|
316
324
|
cp "$home/golden.vars.fd" "$home/box.vars.fd"
|
|
317
325
|
chmod 644 "$home/box.vars.fd"
|
|
318
326
|
fi
|
|
319
|
-
boot box
|
|
327
|
+
boot box "$machine"
|
|
320
328
|
wait_for 600 guest exit
|
|
321
|
-
echo "Box up: ssh -p 2222 qb@127.0.0.1 · RDP 127.0.0.1:3389 · VNC 127.0.0.1:5900"
|
|
329
|
+
echo "Box up: ssh ${ssh_opts[*]} -p 2222 qb@127.0.0.1 · RDP 127.0.0.1:3389 · VNC 127.0.0.1:5900"
|
|
322
330
|
}
|
|
323
331
|
|
|
324
332
|
qbd() {
|
|
325
333
|
running || die "no Box running: run qbbox up"
|
|
326
|
-
# Intuit publishes no hash and replaces "Latest":
|
|
327
|
-
need QuickBooksEnterprise24Trial.exe https://dlm2.download.intuit.com/akdlm/SBD/QuickBooks/2024/Latest/QuickBooksEnterprise24Trial.exe
|
|
334
|
+
# Intuit publishes no hash and replaces "Latest": re-pinned 2026-11-22 (Authenticode Intuit, Inc. valid; 34.0.4022.3401).
|
|
335
|
+
need QuickBooksEnterprise24Trial.exe https://dlm2.download.intuit.com/akdlm/SBD/QuickBooks/2024/Latest/QuickBooksEnterprise24Trial.exe fea365d0728557d575fa09f5e8c5e0fa345090472d414f31140b60a69ecb2753
|
|
328
336
|
local qbd=$media/qbd
|
|
329
337
|
if [ ! -d "$qbd" ]; then
|
|
330
338
|
# The trial is a 7-Zip SFX: stub, config, then the 7z archive. bsdtar reads the archive once cut out.
|
|
@@ -385,7 +393,6 @@ push_qb() {
|
|
|
385
393
|
/usr/bin/tar -xzf "$from" -C "$tmp" || die "not an npm tarball: $from"
|
|
386
394
|
src=$tmp/package
|
|
387
395
|
else
|
|
388
|
-
command -v npm >/dev/null || die "missing npm: install Node, or pass --from <tarball>"
|
|
389
396
|
src="$(npm root -g)/@reallroboto/qb"
|
|
390
397
|
fi
|
|
391
398
|
[ -e "$src/bin/qb.js" ] || die "no qb package: npm install -g @reallroboto/qb, or pass --from <tarball>"
|
|
@@ -421,7 +428,10 @@ destroy() {
|
|
|
421
428
|
}
|
|
422
429
|
|
|
423
430
|
case ${1-} in
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
431
|
+
golden | up | qbd | sdk) prereqs; "$1" ;;
|
|
432
|
+
# No prerequisite: a Box must always stop.
|
|
433
|
+
destroy) destroy ;;
|
|
434
|
+
--version) prereqs; version ;;
|
|
435
|
+
push-qb) prereqs; shift; push_qb "$@" ;;
|
|
436
|
+
*) sed -n '2,9s/^# \{0,1\}//p' "$0" >&2; exit 2 ;;
|
|
427
437
|
esac
|
package/Brewfile
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# qbbox build tools and the QEMU runtime: `qbbox` installs what is missing (brew bundle).
|
|
2
|
-
brew "qemu" # keymaps and edk2 vars (-L), qemu-img
|
|
3
|
-
brew "llvm" # firmware: clang
|
|
4
|
-
brew "lld" # firmware: ld.lld
|
|
5
|
-
brew "acpica" # firmware: iasl
|
|
6
|
-
brew "ninja" # qemu build
|
|
7
|
-
brew "pkgconf" # qemu build
|
|
8
|
-
brew "python@3.14" # qemu configure needs Python >= 3.11
|
|
9
|
-
brew "glib" # qemu runtime
|
|
10
|
-
brew "pixman" # qemu runtime
|
|
11
|
-
brew "libslirp" # qemu runtime: user network
|
|
12
|
-
brew "nettle" # qemu runtime: VNC password
|
|
13
|
-
brew "dtc" # qemu runtime: device tree
|
|
14
|
-
brew "wimlib" # golden: split install.wim
|