@reallroboto/qbbox 0.0.0-stage → 0.1.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.
@@ -0,0 +1,37 @@
1
+ # edk2-build.py configuration for the qbbox UEFI firmware.
2
+ #
3
+ # QEMU 11.1.2 roms/edk2-build.config, build armvirt.aa64, copied as is except
4
+ # the output name and no pad step: edk2-build.py pads with GNU truncate, which
5
+ # macOS lacks; `qbbox firmware` pads to 64 MiB itself. Paths resolve from the
6
+ # build directory `qbbox firmware` runs in.
7
+
8
+ [opts.common]
9
+ NETWORK_HTTP_BOOT_ENABLE = TRUE
10
+ NETWORK_IP6_ENABLE = TRUE
11
+ NETWORK_TLS_ENABLE = TRUE
12
+ NETWORK_ISCSI_ENABLE = TRUE
13
+ NETWORK_ALLOW_HTTP_CONNECTIONS = TRUE
14
+ TPM2_ENABLE = TRUE
15
+ TPM2_CONFIG_ENABLE = TRUE
16
+ TPM1_ENABLE = TRUE
17
+ CAVIUM_ERRATUM_27456 = TRUE
18
+
19
+ [opts.armvirt.silent]
20
+ DEBUG_PRINT_ERROR_LEVEL = 0x80000000
21
+
22
+ [pcds.nx.broken.shim.grub]
23
+ # grub.efi uses EfiLoaderData for code
24
+ PcdDxeNxMemoryProtectionPolicy = 0xC000000000007FD1
25
+ # shim.efi has broken MemAttr code
26
+ PcdUninstallMemAttrProtocol = TRUE
27
+
28
+ [build.armvirt.aa64]
29
+ desc = qbbox ArmVirt build, 64-bit (arm v8), high-resolution ramfb
30
+ conf = ArmVirtPkg/ArmVirtQemu.dsc
31
+ arch = AARCH64
32
+ opts = common
33
+ armvirt.silent
34
+ pcds = nx.broken.shim.grub
35
+ plat = ArmVirtQemu-AARCH64
36
+ dest = out
37
+ cpy1 = FV/QEMU_EFI.fd qbbox-aarch64-code.fd
@@ -0,0 +1,10 @@
1
+ @echo off
2
+ rem Windows Setup runs this as SYSTEM right before the first sign-in (copied here by the specialize pass).
3
+ for %%d in (D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
4
+ if exist %%d:\qbbox\setup.ps1 (
5
+ powershell.exe -NoProfile -ExecutionPolicy Bypass -File %%d:\qbbox\setup.ps1 > "%WINDIR%\Temp\qbbox-setup.log" 2>&1
6
+ goto :done
7
+ )
8
+ )
9
+ :done
10
+ exit /b 0
@@ -0,0 +1,97 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Golden: hardware-check bypass, Dynamic Update, Pro edition, local admin qb, SetupComplete hook (SiliconWin recipe). qbbox golden fills __PASSWORD__. -->
3
+ <unattend xmlns="urn:schemas-microsoft-com:unattend" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
4
+ <settings pass="windowsPE">
5
+ <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="arm64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
6
+ <SetupUILanguage><UILanguage>en-US</UILanguage></SetupUILanguage>
7
+ <InputLocale>0409:00000409</InputLocale><SystemLocale>en-US</SystemLocale><UILanguage>en-US</UILanguage><UserLocale>en-US</UserLocale>
8
+ </component>
9
+ <component name="Microsoft-Windows-Setup" processorArchitecture="arm64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
10
+ <RunSynchronous>
11
+ <RunSynchronousCommand wcm:action="add"><Order>1</Order><Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassTPMCheck /t REG_DWORD /d 1 /f</Path></RunSynchronousCommand>
12
+ <RunSynchronousCommand wcm:action="add"><Order>2</Order><Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassSecureBootCheck /t REG_DWORD /d 1 /f</Path></RunSynchronousCommand>
13
+ <RunSynchronousCommand wcm:action="add"><Order>3</Order><Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassRAMCheck /t REG_DWORD /d 1 /f</Path></RunSynchronousCommand>
14
+ <RunSynchronousCommand wcm:action="add"><Order>4</Order><Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassStorageCheck /t REG_DWORD /d 1 /f</Path></RunSynchronousCommand>
15
+ <RunSynchronousCommand wcm:action="add"><Order>5</Order><Path>reg.exe add "HKLM\SYSTEM\Setup\LabConfig" /v BypassCPUCheck /t REG_DWORD /d 1 /f</Path></RunSynchronousCommand>
16
+ </RunSynchronous>
17
+ <!-- Dynamic Update: Setup takes current setup + driver fixes online. -->
18
+ <DynamicUpdate><Enable>true</Enable><WillShowUI>Never</WillShowUI></DynamicUpdate>
19
+ <DiskConfiguration>
20
+ <WillShowUI>OnError</WillShowUI>
21
+ <Disk wcm:action="add">
22
+ <DiskID>0</DiskID>
23
+ <WillWipeDisk>true</WillWipeDisk>
24
+ <CreatePartitions>
25
+ <CreatePartition wcm:action="add"><Order>1</Order><Type>EFI</Type><Size>260</Size></CreatePartition>
26
+ <CreatePartition wcm:action="add"><Order>2</Order><Type>MSR</Type><Size>16</Size></CreatePartition>
27
+ <CreatePartition wcm:action="add"><Order>3</Order><Type>Primary</Type><Extend>true</Extend></CreatePartition>
28
+ </CreatePartitions>
29
+ <ModifyPartitions>
30
+ <ModifyPartition wcm:action="add"><Order>1</Order><PartitionID>1</PartitionID><Label>System</Label><Format>FAT32</Format></ModifyPartition>
31
+ <ModifyPartition wcm:action="add"><Order>2</Order><PartitionID>2</PartitionID></ModifyPartition>
32
+ <ModifyPartition wcm:action="add"><Order>3</Order><PartitionID>3</PartitionID><Label>Windows</Label><Letter>C</Letter><Format>NTFS</Format></ModifyPartition>
33
+ </ModifyPartitions>
34
+ </Disk>
35
+ </DiskConfiguration>
36
+ <ImageInstall>
37
+ <OSImage>
38
+ <InstallFrom><MetaData wcm:action="add"><Key>/IMAGE/NAME</Key><Value>Windows 11 Pro</Value></MetaData></InstallFrom>
39
+ <InstallTo><DiskID>0</DiskID><PartitionID>3</PartitionID></InstallTo>
40
+ <WillShowUI>OnError</WillShowUI>
41
+ </OSImage>
42
+ </ImageInstall>
43
+ <UserData>
44
+ <!-- Microsoft's generic Windows 11 Pro install key: selects the edition, does not activate. -->
45
+ <ProductKey><Key>VK7JG-NPHTM-C97JM-9MPGT-3V66T</Key><WillShowUI>OnError</WillShowUI></ProductKey>
46
+ <AcceptEula>true</AcceptEula>
47
+ <FullName>qb</FullName>
48
+ <Organization></Organization>
49
+ </UserData>
50
+ </component>
51
+ </settings>
52
+ <settings pass="specialize">
53
+ <component name="Microsoft-Windows-Deployment" processorArchitecture="arm64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
54
+ <RunSynchronous>
55
+ <RunSynchronousCommand wcm:action="add"><Order>1</Order><Path>cmd.exe /c "mkdir %WINDIR%\Setup\Scripts 2&gt;nul &amp; for %d in (D E F G H I J K L M N O P Q R S T U V W X Y Z) do @if exist %d:\qbbox\SetupComplete.cmd copy /y %d:\qbbox\SetupComplete.cmd %WINDIR%\Setup\Scripts\SetupComplete.cmd"</Path></RunSynchronousCommand>
56
+ <RunSynchronousCommand wcm:action="add"><Order>2</Order><Path>reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OOBE" /v BypassNRO /t REG_DWORD /d 1 /f</Path></RunSynchronousCommand>
57
+ </RunSynchronous>
58
+ </component>
59
+ <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="arm64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
60
+ <ComputerName>QBBOX</ComputerName>
61
+ <TimeZone>UTC</TimeZone>
62
+ </component>
63
+ </settings>
64
+ <settings pass="oobeSystem">
65
+ <component name="Microsoft-Windows-International-Core" processorArchitecture="arm64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
66
+ <InputLocale>0409:00000409</InputLocale><SystemLocale>en-US</SystemLocale><UILanguage>en-US</UILanguage><UserLocale>en-US</UserLocale>
67
+ </component>
68
+ <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="arm64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
69
+ <OOBE>
70
+ <HideEULAPage>true</HideEULAPage>
71
+ <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
72
+ <HideOnlineAccountScreens>true</HideOnlineAccountScreens>
73
+ <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
74
+ <HideLocalAccountScreen>true</HideLocalAccountScreen>
75
+ <ProtectYourPC>3</ProtectYourPC>
76
+ </OOBE>
77
+ <UserAccounts>
78
+ <LocalAccounts>
79
+ <LocalAccount wcm:action="add">
80
+ <Name>qb</Name>
81
+ <DisplayName>qb</DisplayName>
82
+ <Group>Administrators</Group>
83
+ <Password><Value>__PASSWORD__</Value><PlainText>true</PlainText></Password>
84
+ </LocalAccount>
85
+ </LocalAccounts>
86
+ </UserAccounts>
87
+ <!-- Autologon keeps a desktop session for the QuickBooks authorization dialog. -->
88
+ <AutoLogon>
89
+ <Enabled>true</Enabled>
90
+ <Username>qb</Username>
91
+ <LogonCount>9999999</LogonCount>
92
+ <Password><Value>__PASSWORD__</Value><PlainText>true</PlainText></Password>
93
+ </AutoLogon>
94
+ <TimeZone>UTC</TimeZone>
95
+ </component>
96
+ </settings>
97
+ </unattend>
@@ -0,0 +1,59 @@
1
+ # Golden setup: guest block list, VirtIO drivers, OpenSSH Server (key only, PowerShell shell), Node 26 ARM64,
2
+ # PowerShell 7 x64 for the Bridge, RDP, no sleep, display config reset.
3
+ $ErrorActionPreference = 'Stop'
4
+ $qbbox = Split-Path $PSCommandPath
5
+ $disc = Split-Path $qbbox
6
+
7
+ # Guest block list, first: the guest is online from Windows Setup on. Internet only: no Mac (slirp host alias
8
+ # 10.0.2.2 = Mac loopback: Chromium CDP, ssh tunnels), no LAN, no other non-internet IPv4 range; slirp DNS
9
+ # 10.0.2.3 stays open. Ranges, no allow exception: a block rule beats an allow rule.
10
+ $block = @{ Direction = 'Outbound'; Action = 'Block' }
11
+ New-NetFirewallRule -Name qbbox-block-private -DisplayName 'qbbox: block private ranges' @block -RemoteAddress 10.0.0.0-10.0.2.1,
12
+ 10.0.2.4-10.255.255.255, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16, 100.64.0.0/10 | Out-Null
13
+ New-NetFirewallRule -Name qbbox-block-mac-tcp -DisplayName 'qbbox: block Mac TCP' @block -Protocol TCP -RemoteAddress 10.0.2.2 | Out-Null
14
+ # UDP 67 open: DHCP renew goes to the slirp DHCP server, 10.0.2.2.
15
+ New-NetFirewallRule -Name qbbox-block-mac-udp -DisplayName 'qbbox: block Mac UDP' @block -Protocol UDP -RemoteAddress 10.0.2.2 -RemotePort 1-66, 68-65535 | Out-Null
16
+
17
+ pnputil /add-driver "$disc\`$WinPEDriver`$\*.inf" /subdirs /install
18
+
19
+ $msi = Start-Process msiexec -Wait -PassThru -ArgumentList '/i', "`"$qbbox\OpenSSH-ARM64.msi`"", '/qn', '/norestart'
20
+ if ($msi.ExitCode -ne 0) { throw "OpenSSH MSI exit $($msi.ExitCode)" }
21
+ New-ItemProperty HKLM:\SOFTWARE\OpenSSH -Name DefaultShell -Value "$env:WINDIR\System32\WindowsPowerShell\v1.0\powershell.exe" -PropertyType String -Force | Out-Null
22
+ New-Item -ItemType Directory -Force "$env:ProgramData\ssh" | Out-Null
23
+ Copy-Item "$qbbox\authorized_keys" "$env:ProgramData\ssh\administrators_authorized_keys"
24
+ # Files copied from the ISO keep ReadOnly.
25
+ (Get-Item "$env:ProgramData\ssh\administrators_authorized_keys").IsReadOnly = $false
26
+ icacls "$env:ProgramData\ssh\administrators_authorized_keys" /inheritance:r /grant 'Administrators:F' /grant 'SYSTEM:F'
27
+ # sshd ignores a key file other accounts can read.
28
+ if ($LASTEXITCODE -ne 0) { throw "icacls exit $LASTEXITCODE" }
29
+ if (-not (Get-NetFirewallRule -Name qbbox-sshd -ErrorAction SilentlyContinue)) {
30
+ New-NetFirewallRule -Name qbbox-sshd -DisplayName 'OpenSSH Server' -Protocol TCP -LocalPort 22 -Action Allow | Out-Null
31
+ }
32
+ Set-Service sshd -StartupType Automatic
33
+ # First start writes sshd_config; sshd keeps the first value of a keyword, so the prepended line wins.
34
+ Start-Service sshd
35
+ $sshdConfig = "$env:ProgramData\ssh\sshd_config"
36
+ Set-Content $sshdConfig (@('PasswordAuthentication no') + (Get-Content $sshdConfig))
37
+ Restart-Service sshd
38
+
39
+ # Operator display: RDP from Windows App, Retina 1:1 on any Mac; VNC on virtio-gpu stays as fallback.
40
+ Set-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server' fDenyTSConnections 0 -Type DWord
41
+ Enable-NetFirewallRule -Group '@FirewallAPI.dll,-28752'
42
+ # RDP caps a session at 30 fps; 15 ms frame interval = 60 fps cap, read at boot.
43
+ Set-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations' DWMFRAMEINTERVAL 15 -Type DWord
44
+
45
+ # Node zip holds one top folder (node-v26.x-win-arm64); PowerShell zip is flat.
46
+ Expand-Archive "$qbbox\node.zip" "$env:TEMP\node"
47
+ Move-Item (Get-ChildItem "$env:TEMP\node" -Directory)[0].FullName "$env:ProgramFiles\nodejs"
48
+ $path = [Environment]::GetEnvironmentVariable('Path', 'Machine')
49
+ [Environment]::SetEnvironmentVariable('Path', "$path;$env:ProgramFiles\nodejs", 'Machine')
50
+ Expand-Archive "$qbbox\pwsh.zip" "$env:ProgramFiles\PowerShell\7"
51
+
52
+ powercfg /hibernate off
53
+ powercfg /change standby-timeout-ac 0
54
+ powercfg /change hibernate-timeout-ac 0
55
+ powercfg /change monitor-timeout-ac 0
56
+ powercfg /change disk-timeout-ac 0
57
+
58
+ # Windows keeps the display mode it first saw; dropping the saved config makes it take the device mode at next boot.
59
+ Remove-Item HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\Configuration, HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\Connectivity -Recurse -Force -ErrorAction SilentlyContinue
@@ -0,0 +1,34 @@
1
+ # Install the QBD trial, 0 clicks, QBD updater blocked: QBD release = media pin. QuickBooks.msi needs only
2
+ # PARENTAPP=INSTALLMANAGER, the VC++ runtimes, and the keys from Setup.ini; setup.exe is skipped (it stopped
3
+ # with "Internet connection required" on the restricted Box, 2026-10-18).
4
+ $ErrorActionPreference = 'Stop'
5
+ $src = Split-Path $PSCommandPath
6
+ $qbupdate = 'C:\Program Files\Common Files\Intuit\QuickBooks\QBUpdate\qbupdate.exe'
7
+
8
+ # Before the install: the MSI starts QBUpdateMonitorService, which runs qbupdate.exe. A rule may name a missing program.
9
+ if (-not (Get-NetFirewallRule -Name qbbox-block-qbupdate -ErrorAction SilentlyContinue)) {
10
+ New-NetFirewallRule -Name qbbox-block-qbupdate -DisplayName 'qbbox: block QBD updater' -Direction Outbound -Action Block -Program $qbupdate | Out-Null
11
+ }
12
+
13
+ function Invoke-Installer($file, [string[]]$arguments) {
14
+ $p = Start-Process $file -ArgumentList $arguments -Wait -PassThru
15
+ # 1638: a newer runtime is already installed; 3010: reboot needed later.
16
+ if ($p.ExitCode -notin 0, 1638, 3010) { throw "$file exit $($p.ExitCode)" }
17
+ }
18
+
19
+ # CRT10 is left out: it hangs and the MSI does not need it.
20
+ Invoke-Installer msiexec.exe '/i', "`"$src\ThirdParty\CRT9\vc_red.msi`"", '/qn', '/norestart'
21
+ foreach ($exe in Get-ChildItem "$src\ThirdParty\CRT12\*.exe", "$src\ThirdParty\CRT14_1\*.exe") {
22
+ Invoke-Installer $exe.FullName '/install', '/quiet', '/norestart'
23
+ }
24
+
25
+ $ini = Get-Content "$src\QBooks\Setup.ini"
26
+ function Get-IniValue($key) { ($ini | Select-String "^$key=(.+)$").Matches[0].Groups[1].Value.Trim() }
27
+ Invoke-Installer msiexec.exe '/i', "`"$src\QBooks\QuickBooks.msi`"", '/qn', '/norestart', 'PARENTAPP=INSTALLMANAGER',
28
+ "QB_LICENSENUM=$(Get-IniValue QB_LICENSENUM)", "QB_PRODUCTNUM=$(Get-IniValue QB_PRODUCTNUM)", 'AgreeToLicense=Yes',
29
+ '/l*v', "`"$src\qbmsi.log`""
30
+ # qbupdate.exe elsewhere: the rule above blocks nothing.
31
+ if (-not (Test-Path $qbupdate)) { throw "missing $qbupdate" }
32
+
33
+ Get-ItemProperty HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\* |
34
+ Where-Object DisplayName -Like 'QuickBooks*' | ForEach-Object { "$($_.DisplayName) | $($_.DisplayVersion)" }
@@ -0,0 +1,14 @@
1
+ # Unpack qbxmlops170.xml from the SDK installer without installing the SDK.
2
+ # InstallShield `/a` = MSI administrative install: files into TARGETDIR, no product registered.
3
+ $ErrorActionPreference = 'Stop'
4
+ $src = Split-Path $PSCommandPath
5
+ $admin = "$src\admin"
6
+
7
+ try {
8
+ $p = Start-Process "$src\QBSDK170.exe" -ArgumentList '/a', '/s', "/v`"/qn TARGETDIR=\`"$admin\`"`"" -Wait -PassThru
9
+ if ($p.ExitCode -ne 0) { throw "QBSDK170.exe exit $($p.ExitCode)" }
10
+ Move-Item "$admin\program files\Intuit\IDN\QBSDK17.0\doc\qbxmlops170.xml" $src
11
+ } finally {
12
+ # The only trace outside $src: Windows Installer's source hash for the SDK ProductCode.
13
+ Remove-Item 'C:\Windows\Installer\SourceHash{1205B5AF-AD1E-49A9-8DEB-2229A6C74CFF}' -ErrorAction SilentlyContinue
14
+ }
@@ -0,0 +1,38 @@
1
+ # Windows Update, one round per run of task qbbox-wu (SYSTEM): the WUA downloader + installer refuse a remote
2
+ # caller, and an SSH session is remote. -Register, over SSH: create the task. A round writes qbbox-wu.json =
3
+ # found, resultCode (OperationResultCode), rebootRequired; plus error when the round threw.
4
+ param([switch]$Register)
5
+ $ErrorActionPreference = 'Stop'
6
+ $json = 'C:\Windows\Temp\qbbox-wu.json'
7
+
8
+ if ($Register) {
9
+ $action = New-ScheduledTaskAction -Execute powershell.exe -Argument "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`""
10
+ Register-ScheduledTask -TaskName qbbox-wu -User 'NT AUTHORITY\SYSTEM' -Action $action | Out-Null
11
+ return
12
+ }
13
+
14
+ $result = [ordered]@{ found = 0; resultCode = 0; rebootRequired = $false }
15
+ try {
16
+ $session = New-Object -ComObject Microsoft.Update.Session
17
+ $search = $session.CreateUpdateSearcher().Search("IsInstalled=0 and Type='Software' and IsHidden=0")
18
+ $result.found = $search.Updates.Count
19
+ $result.resultCode = $search.ResultCode
20
+ if ($search.Updates.Count -gt 0) {
21
+ foreach ($update in $search.Updates) { if (-not $update.EulaAccepted) { $update.AcceptEula() } }
22
+ $downloader = $session.CreateUpdateDownloader()
23
+ $downloader.Updates = $search.Updates
24
+ $downloader.Download() | Out-Null
25
+ $installer = $session.CreateUpdateInstaller()
26
+ $installer.Updates = $search.Updates
27
+ $install = $installer.Install()
28
+ $result.resultCode = $install.ResultCode
29
+ $result.rebootRequired = $install.RebootRequired
30
+ }
31
+ } catch {
32
+ # 4 = orcFailed: qbbox golden stops now, not at the end of its 2 h wait.
33
+ $result.resultCode = 4
34
+ $result.error = $_.Exception.Message
35
+ }
36
+ # Renamed into place: qbbox golden never reads a half-written file.
37
+ $result | ConvertTo-Json -Compress | Set-Content -Encoding ASCII "$json.part"
38
+ Move-Item -Force "$json.part" $json
package/package.json CHANGED
@@ -1,6 +1,31 @@
1
1
  {
2
2
  "name": "@reallroboto/qbbox",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "license": "UNLICENSED",
5
+ "bin": {
6
+ "qbbox": "qbbox"
7
+ },
8
+ "files": [
9
+ "qbbox",
10
+ "Brewfile",
11
+ "guest",
12
+ "qemu",
13
+ "firmware",
14
+ "golden"
15
+ ],
16
+ "os": [
17
+ "darwin"
18
+ ],
19
+ "cpu": [
20
+ "arm64"
21
+ ],
22
+ "engines": {
23
+ "node": ">=26"
24
+ },
25
+ "qbbox": {
26
+ "qb": "0.1"
27
+ },
28
+ "publishConfig": {
29
+ "access": "public"
30
+ }
31
+ }