Expose USB tools in base runtime surfaces

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-04-21 16:15:17 +01:00
parent 684dbd5c5d
commit 19d39068cf
3 changed files with 14 additions and 7 deletions
@@ -114,7 +114,7 @@ sleep 1
rm -f "$log_file" rm -f "$log_file"
expect <<EOF expect <<EOF
log_user 0 log_user 1
log_file -noappend $log_file log_file -noappend $log_file
set timeout 1800 set timeout 1800
set send_slow {1 0.0} set send_slow {1 0.0}
@@ -125,6 +125,7 @@ send "root\r"
expect "assword:" expect "assword:"
send "password\r" send "password\r"
expect -re {Type 'help' for available commands\.} expect -re {Type 'help' for available commands\.}
expect -re {# }
send "rm -f /tmp/xhcid-test-hook\r" send "rm -f /tmp/xhcid-test-hook\r"
after 500 after 500
@@ -142,10 +143,8 @@ expect -re {Device on port [0-9\.]+ was attached}
send "\r" send "\r"
expect -re {# } expect -re {# }
set hid_scheme "usb.pci-0000-00-01.0_xhci" set hid_scheme "usb.pci-0000-00-01.0_xhci"
send "H=/tmp/xhcid-test-hook\r" set H "/tmp/xhcid-test-hook"
expect -re {# } set P "/scheme/\$hid_scheme/port\$hid_port"
send "P=/scheme/\$hid_scheme/port\$hid_port\r"
expect -re {# }
send "echo x > \$P/suspend\r" send "echo x > \$P/suspend\r"
expect -re {xhcid: suspended port [0-9\.]+} expect -re {xhcid: suspended port [0-9\.]+}
+3 -1
View File
@@ -5,6 +5,7 @@ same_as = "../base"
template = "custom" template = "custom"
dependencies = [ dependencies = [
"redoxfs", "redoxfs",
"ion",
] ]
script = """ script = """
BINS=( BINS=(
@@ -34,7 +35,7 @@ virt_bins()
x86_common_bins() x86_common_bins()
{ {
BINS+=(ahcid ided ps2d vesad) BINS+=(ahcid ehcid ohcid uhcid ided ps2d usbhidd usbscsid usbhubd xhcid vesad)
virt_bins virt_bins
} }
@@ -93,6 +94,7 @@ do
done done
cp "${COOKBOOK_SYSROOT}/usr/bin/redoxfs" "${COOKBOOK_BUILD}/initfs/bin" cp "${COOKBOOK_SYSROOT}/usr/bin/redoxfs" "${COOKBOOK_BUILD}/initfs/bin"
cp "${COOKBOOK_SYSROOT}/usr/bin/ion" "${COOKBOOK_BUILD}/initfs/bin"
ARCH="$(echo "${GNU_TARGET}" | cut -d - -f1)" ARCH="$(echo "${GNU_TARGET}" | cut -d - -f1)"
RUSTFLAGS="$RUSTFLAGS -Ctarget-feature=+crt-static -Clink-arg=-nostartfiles -Clink-arg=-nostdlib" cargo \ RUSTFLAGS="$RUSTFLAGS -Ctarget-feature=+crt-static -Clink-arg=-nostartfiles -Clink-arg=-nostdlib" cargo \
+7 -1
View File
@@ -21,7 +21,10 @@ done
--target "${TARGET}" \ --target "${TARGET}" \
${build_flags} ${build_flags}
cp -v \ cp -v \
"target/${TARGET}/${build_type}/smolnetd" \ "target/${TARGET}/${build_type}/netstack" \
"${COOKBOOK_STAGE}/usr/bin/netstack"
cp -v \
"target/${TARGET}/${build_type}/netstack" \
"${COOKBOOK_STAGE}/usr/bin/smolnetd" "${COOKBOOK_STAGE}/usr/bin/smolnetd"
# Drivers that are built on all architectures, and NOT in drivers-initfs # Drivers that are built on all architectures, and NOT in drivers-initfs
@@ -34,6 +37,9 @@ BINS=(
pcid-spawner pcid-spawner
rtl8139d rtl8139d
rtl8168d rtl8168d
ehcid
ohcid
uhcid
usbctl usbctl
usbhidd usbhidd
usbhubd usbhubd