diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 40ac27a..0d17dca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -178,6 +178,18 @@ jobs: if command -v busybox >/dev/null; then WARDEN_TEST_SH="busybox sh" bash qemu/tests/init-chain-test.sh fi + - name: rig debug shell works without cttyhack (flare-edge#2210) + # The panel's BusyBox has no cttyhack; warden.shell then opens the + # console tty itself. Once more under busybox sh, the rig's own shell. + run: | + bash qemu/tests/console-shell-test.sh + if command -v busybox >/dev/null; then + WARDEN_TEST_SH="busybox sh" bash qemu/tests/console-shell-test.sh + fi + - name: panel BusyBox config and build helpers (flare-edge#2210) + # panel.config carries the image's applet patch, the rig fragment only + # changes linking, Kconfig rewrites and applet drift are caught: offline. + run: bash qemu/tests/busybox-panel-test.sh - name: ui-drive.sh / ui-shot.sh UI start wait regression test (flare-edge#2295) # The console line that means "UI started" differs between a direct # start and a shipped init chain boot; every marker is checked @@ -247,6 +259,21 @@ jobs: run: bash qemu/mkinitramfs.sh - name: build A/B disk image run: bash qemu/mkimage.sh + - name: cache panel BusyBox source + uses: actions/cache@v4 + with: + path: qemu/out/busybox-1.37.0.tar.bz2 + key: busybox-src-1.37.0 + - name: build the panel BusyBox and check it against the bench capture (flare-edge#2210) + # The image's BusyBox version, applet config and Buildroot patches, + # linked static (qemu/build-busybox.sh). Its applet list and every + # applet's --help must equal the panel's own binary's (captured on + # bench a), run here through qemu-user. Then an initramfs with it. + run: | + sudo apt-get install -y -qq gcc-arm-linux-gnueabihf qemu-user + bash qemu/build-busybox.sh + QEMU_USER="qemu-arm" bash qemu/tests/busybox-panel-help.sh + RIG_BUSYBOX=panel bash qemu/mkinitramfs.sh kernel-symbols: # The symbol gate (rebuild M0, kernel_symbols_exist): expand the real @@ -433,6 +460,11 @@ jobs: bash qemu/mkinitramfs.sh bash qemu/tests/boot-smoke.sh \ "$RUNNER_TEMP/kbuild-out/linux-6.18.46/arch/arm/boot/zImage" + # Once more with the panel's BusyBox (RIG_BUSYBOX=panel, flare-edge#2210). + OUT="$RUNNER_TEMP/panel-rig" RIG_BUSYBOX=panel bash qemu/mkinitramfs.sh + bash qemu/tests/boot-smoke.sh \ + "$RUNNER_TEMP/kbuild-out/linux-6.18.46/arch/arm/boot/zImage" \ + "$RUNNER_TEMP/panel-rig/initramfs.cpio.gz" # Best-effort: the build IS the gate. Uploading the zImage/dtb to GitHub # artifact storage can fail on an account-wide storage-quota hit (recalculated # every 6-12h) that has nothing to do with this build. Don't red-X a good diff --git a/qemu/README.md b/qemu/README.md index 983ada5..56921d0 100644 --- a/qemu/README.md +++ b/qemu/README.md @@ -54,7 +54,8 @@ screenshot from here is not evidence about a 5.10 panel's Wi-Fi page. WORK=$HOME/kbuild-out CROSS_COMPILE=arm-linux-gnueabihf- \ WARDEN_KCONFIG_FRAGMENT=qemu/configs/virt.fragment bash build/build-kernel.sh -# 2. initramfs (sha256-pinned static busybox + qemu/rootfs/) and A/B disk +# 2. initramfs (sha256-pinned static busybox + qemu/rootfs/) and A/B disk; +# RIG_BUSYBOX=panel builds the image's own BusyBox instead (qemu/busybox/) bash qemu/mkinitramfs.sh bash qemu/mkimage.sh # options: --portal-url --state K=V --fw-version @@ -136,6 +137,9 @@ All take the virt-fragment ``; `FLARE_EDGE=` where noted. | `rootfs-overlay.sh` | - | offline, no VM: `mkimage.sh`'s `ROOTFS_OVERLAY` hook lays a directory of panel files (flare-edge's S03warden-accounts, S99lvgl, warden-ui-run) over the rootfs of both slots with their modes kept, beside the skeleton's own files; without it there is no `/etc/init.d`; an overlay that is not a directory, names anything but `etc/` and `usr/` at its top, or holds a symlink fails closed and writes no image; `ui-drive.sh --init-chain` refuses a missing directory or one without `etc/init.d/S99lvgl` before boot | | `init-chain-test.sh` | - | offline, no VM: `warden_init_chain` (rootfs/etc/warden-lib.sh) starts the executable `S*` scripts of a number range in name order, names a failing one and goes on, and counts them; `warden_rig_bus_owners` hands a bus credential to its account only when the rootfs has it; sbin/init runs S00-S09 before the bus and S10-S99 instead of the direct UI start on a `warden.initchain` boot (flare-edge #2210) | | `run-sh-args-test.sh` | - | offline, no VM: a fake `qemu-system-arm` captures run.sh's own argv and pins the ctl/rs485 pci-serial ordering contract rootfs/sbin/init's ttyS0-vs-ttyS1 alias depends on -- the ctl device always enumerates before rs485, warden.ctl only lands on the cmdline when --ctl is given, and an rs485 pci-serial device (real or null-backed) is always present so the port count never shifts | +| `busybox-panel-test.sh` | - | offline, no VM: the panel BusyBox inputs (qemu/busybox/). panel.config carries every setting of the image's applet patch, rig.fragment changes only STATIC, USE_BB_PWD_GRP and USE_BB_SHADOW, a Kconfig rewrite of any setting and an applet the panel lacks fail the build, applets.txt and help.txt agree, and RIG_BUSYBOX refuses an unknown value or a prebuilt `BUSYBOX` (flare-edge#2210) | +| `busybox-panel-help.sh [BIN]` | an ARM runner (binfmt or `QEMU_USER=qemu-arm`) | the built panel BusyBox against the bench capture: its applet list and every applet's `--help` equal the panel's own binary's. CI runs it in qemu-tools after `build-busybox.sh` | +| `console-shell-test.sh` | - | offline, no VM: `warden_console_shell` (warden.shell) runs `setsid cttyhack sh` where cttyhack exists, else `setsid -c sh` on the console tty read from sysfs (the panel BusyBox has no cttyhack), else a plain sh. CI runs it under bash's `sh` and busybox `sh` | | `ctl-bridge-test.sh` | - | offline, no VM: runs the control bridge (`warden_ctl_bridge` in rootfs/etc/warden-lib.sh) against a fake warden-ui that answers some commands late. A reply slower than the old 5 s bound still arrives (the bound is now 30 s, `WARDEN_CTL_WAIT_S`), a timeout answers `bridge: no reply from warden-ui ...` (qmp.py raises it as a rig fault), and a timed-out command's late reply is drained instead of being read as the next command's answer (flare-edge #1448). A fake `wthctl` stands in for the hook client behind `@hookdoc`/`@hook` (flare-edge #2054): the pieces join into one request whose args are used once, only plain words reach the client, and a missing client or a request with no reply answers a `bridge:` line. CI runs it under bash's `sh` and busybox `sh` | | `init-rig-bus-test.sh` | - | offline, no VM: `warden_rig_bus` in rootfs/etc/warden-lib.sh against stub brokers. No broker in the payload creates nothing; a broker that listens gets the panel's layout (the `bus.sock` link, a 0400 64-hex credential per bus user, a config without password file, ACL or plugin); a broker that exits or never listens is reported within the bound; init starts the bus before the payload daemons. `WARDEN_TEST_MOSQUITTO_DIR` adds a real mosquitto carrying one message between two users logged in by credential file (flare-edge #1754) | | watchdog (`run.sh --watchdog`) | - | arm `/dev/watchdog`, don't pet: the VM resets ~30 s later (verified) | diff --git a/qemu/build-busybox.sh b/qemu/build-busybox.sh new file mode 100644 index 0000000..9374799 --- /dev/null +++ b/qemu/build-busybox.sh @@ -0,0 +1,179 @@ +#!/usr/bin/env bash +# Build the rig's panel BusyBox: the image's BusyBox version with the image's +# applet config, linked static for the rig's initramfs (flare-edge#2210). +# +# build-busybox.sh +# +# Env: +# OUT output dir (default qemu/out); the binary lands at +# $OUT/busybox-armv7l-panel, its input key next to it +# CROSS_COMPILE cross toolchain prefix (default arm-linux-gnueabihf-) +# BB_SRC_TARBALL a local busybox-$BB_SRC_VER.tar.bz2 (skips the download; +# still verified against BB_SRC_SHA256) +# JOBS make -j (default: nproc, at most 4) +# +# The inputs are pinned, not the output: the source tarball by sha256 and the +# configuration by the committed files in qemu/busybox/. Compilers differ +# between hosts, so one host's binary hash means nothing on another; the +# output is checked by its applet list instead (qemu/busybox/applets.txt, the +# same list as flare-edge tests/fixtures/panel-busybox-applets.txt). A rebuild +# is skipped when the input key (tarball, config files, compiler version) +# matches the cached binary's. +# +# FAILS CLOSED: no cross compiler, a bad tarball, a configuration that the +# BusyBox Kconfig rewrites (a symbol the version does not know), an applet +# list that differs, or a dynamically linked result is an error, never a +# fallback to the multiarch binary. +set -euo pipefail + +QEMU_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +BB_DIR="$QEMU_DIR/busybox" + +BB_SRC_VER=1.37.0 +BB_SRC_URL="https://busybox.net/downloads/busybox-${BB_SRC_VER}.tar.bz2" +# From https://busybox.net/downloads/busybox-1.37.0.tar.bz2.sha256, the same +# pin as Buildroot 2025.02.8 package/busybox/busybox.hash. +BB_SRC_SHA256=3311dff32e746499f4df0d5df04d7eb396382d7e108bb9250e7b519b837043a4 + +# shellcheck source=qemu/lib.sh disable=SC1091 +. "$QEMU_DIR/lib.sh" + +# Write the panel config with every fragment line applied: the symbol's old +# setting (set or "is not set") is dropped and the fragment's line appended. +# Usage: bb_apply_fragment PANEL_CONFIG FRAGMENT > .config +bb_apply_fragment() { + local panel="$1" frag="$2" line sym pat="" + while IFS= read -r line; do + case "$line" in ''|'#'*) continue ;; esac + sym="${line%%=*}" + case "$sym" in + CONFIG_*) ;; + *) echo "FATAL: bad fragment line: '$line'" >&2; return 1 ;; + esac + pat="${pat}|^${sym}=|^# ${sym} is not set\$" + done < "$frag" + if [ -n "$pat" ]; then + grep -Ev "${pat#|}" "$panel" || true + else + cat "$panel" + fi + grep -Ev '^(#|$)' "$frag" +} + +# The settings of a config file, one per line, sorted: "SYM=value" for a set +# symbol and "SYM is not set" for an unset one. Comments and the header are +# dropped, so two configs compare by what they configure. +bb_settings() { + sed -n -e 's/^\(CONFIG_[A-Za-z0-9_]*=.*\)$/\1/p' \ + -e 's/^# \(CONFIG_[A-Za-z0-9_]*\) is not set$/\1 is not set/p' "$1" | LC_ALL=C sort +} + +# Fail when Kconfig changed any setting of the config it was given (WANT) +# while writing GOT: a symbol this BusyBox version does not know, or one whose +# dependencies are unmet, would otherwise be dropped without a word. +bb_check_config() { + local want="$1" got="$2" d + if ! d="$(diff <(bb_settings "$want") <(bb_settings "$got"))"; then + echo "FATAL: the BusyBox $BB_SRC_VER Kconfig rewrote the panel config (< given, > written):" >&2 + printf '%s\n' "$d" >&2 + return 1 + fi +} + +# Compare the applet names in a busybox.links file (one install path per line) +# with the committed list. Usage: bb_check_applets LINKS APPLETS_TXT +bb_check_applets() { + local links="$1" want="$2" d + if ! d="$(diff <(LC_ALL=C sort -u "$want") <(sed 's|.*/||' "$links" | LC_ALL=C sort -u))"; then + echo "FATAL: the built BusyBox applet list differs from $want (< want, > built):" >&2 + printf '%s\n' "$d" >&2 + return 1 + fi +} + +# The cache key: everything the binary is built from. +bb_input_key() { + local cc="$1" + { + echo "busybox $BB_SRC_VER $BB_SRC_SHA256" + sha256sum "$BB_DIR/panel.config" "$BB_DIR/rig.fragment" "$BB_DIR/applets.txt" \ + "$BB_DIR"/patches/*.patch | awk '{print $1}' + echo "$cc" + "${cc}gcc" --version | head -n 1 + } | sha256sum | awk '{print $1}' +} + +bb_main() { + local out="${OUT:-$QEMU_DIR/out}" cc="${CROSS_COMPILE:-arm-linux-gnueabihf-}" + local jobs="${JOBS:-}" bin key src scratch tar + bin="$out/busybox-armv7l-panel" + command -v "${cc}gcc" >/dev/null || { + echo "FATAL: no ${cc}gcc on PATH (apt-get install gcc-arm-linux-gnueabihf, or set CROSS_COMPILE)" >&2 + exit 1 + } + if [ -z "$jobs" ]; then + jobs="$(nproc)"; [ "$jobs" -le 4 ] || jobs=4 + fi + mkdir -p "$out" + key="$(bb_input_key "$cc")" + if [ -f "$bin" ] && [ "$(cat "$bin.key" 2>/dev/null)" = "$key" ]; then + qemu_log "panel busybox up to date ($bin)" + return + fi + + tar="${BB_SRC_TARBALL:-$out/busybox-${BB_SRC_VER}.tar.bz2}" + qemu_fetch_verified "$BB_SRC_URL" "$BB_SRC_SHA256" "$tar" "busybox ${BB_SRC_VER} source" + + scratch="$(mktemp -d "${TMPDIR:-/tmp}/warden-busybox.XXXXXX")" + # Expanded now on purpose: the trap must remove this run's directory. + # shellcheck disable=SC2064 + trap "rm -rf '$scratch'" EXIT + tar -xjf "$tar" -C "$scratch" + src="$scratch/busybox-${BB_SRC_VER}" + [ -d "$src" ] || { echo "FATAL: $tar has no busybox-${BB_SRC_VER}/" >&2; exit 1; } + # Buildroot's patches for this version, as the image applies them. + local p + for p in "$BB_DIR"/patches/*.patch; do + patch -d "$src" -p1 -s --no-backup-if-mismatch < "$p" || { + echo "FATAL: $p does not apply to busybox $BB_SRC_VER" >&2 + exit 1 + } + done + + bb_apply_fragment "$BB_DIR/panel.config" "$BB_DIR/rig.fragment" > "$scratch/want.config" + cp "$scratch/want.config" "$src/.config" + # Fixed time stamps so two builds with one compiler give one binary. + export SOURCE_DATE_EPOCH=0 KCONFIG_NOTIMESTAMP=1 KBUILD_BUILD_TIMESTAMP="1970-01-01" + export KBUILD_BUILD_USER=warden KBUILD_BUILD_HOST=rig + # oldconfig with no terminal: a symbol missing from the config would stop + # at a prompt and read EOF; the settings check below names it either way. + make -C "$src" -s CROSS_COMPILE="$cc" oldconfig "$scratch/oldconfig.log" 2>&1 || { + cat "$scratch/oldconfig.log" >&2 + echo "FATAL: make oldconfig failed" >&2 + exit 1 + } + bb_check_config "$scratch/want.config" "$src/.config" + qemu_log "building busybox $BB_SRC_VER (panel config, static, ${cc}gcc, -j$jobs)" + make -C "$src" -s -j"$jobs" CROSS_COMPILE="$cc" busybox busybox.links >"$scratch/make.log" 2>&1 || { + tail -n 40 "$scratch/make.log" >&2 + echo "FATAL: busybox build failed" >&2 + exit 1 + } + bb_check_applets "$src/busybox.links" "$BB_DIR/applets.txt" + if "${cc}readelf" -l "$src/busybox" | grep -q 'INTERP'; then + echo "FATAL: the built busybox is dynamically linked (CONFIG_STATIC not applied)" >&2 + exit 1 + fi + "${cc}readelf" -h "$src/busybox" | grep -q 'Machine:.*ARM' || { + echo "FATAL: the built busybox is not an ARM binary" >&2 + exit 1 + } + install -m 0755 "$src/busybox" "$bin.tmp" + mv -f "$bin.tmp" "$bin" + printf '%s\n' "$key" > "$bin.key" + qemu_log "panel busybox: $bin ($(sha256sum "$bin" | awk '{print $1}'))" +} + +if [ "${BASH_SOURCE[0]}" = "$0" ]; then + bb_main "$@" +fi diff --git a/qemu/busybox/README.md b/qemu/busybox/README.md new file mode 100644 index 0000000..bb1a2ca --- /dev/null +++ b/qemu/busybox/README.md @@ -0,0 +1,28 @@ +# The panel's BusyBox, for the rig + +`RIG_BUSYBOX=panel` (qemu/lib.sh) makes the rig run the image's own BusyBox +instead of the busybox.net 1.31.0 multiarch binary, so a script that calls an +applet or option the panel lacks fails in the rig as it fails on a panel +(flare-edge#2210; #1903 `setpriv --reuid`, #2002 `stat`, #1349 `flock -w`). +`qemu/build-busybox.sh` builds it; the default stays `multiarch` until the +flare-edge QEMU jobs switch over. + +| File | What it is | +|---|---| +| `panel.config` | The image's BusyBox 1.37.0 configuration. Made from Buildroot 2025.02.8 `package/busybox/busybox.config` (the vendor SDK's base; its header matches the `a/` side of the applet patch), with `luckfox-sdk-patches/buildroot/patches/0001-busybox-applets.patch` applied and then `yes "" \| make oldconfig` in busybox-1.37.0, as Buildroot does for a config written for an older version (it adds TIME64, GETFATTR, FIND_EXEC_OK, IP_LINK_CAN and UDHCPD_BOOTP at their defaults and drops ASH_SLEEP). The time stamp line is dropped. | +| `rig.fragment` | The rig's only differences: a static link, and BusyBox's own passwd, group and shadow readers (a static glibc binary cannot load NSS modules). Neither adds or removes an applet or option. | +| `patches/` | Buildroot 2025.02.8's `package/busybox/*.patch`, applied in order like the image build does (one of them is what makes `tc` build with current kernel headers). Commit-message text was changed to ASCII; the diffs are unchanged. | +| `applets.txt` | `busybox --list` of the panel (bench a, image 417a66b), the same as flare-edge `tests/fixtures/panel-busybox-applets.txt`. The build fails when its applet list differs. | +| `help.txt` | `busybox --help` of every applet of the panel, the same as flare-edge `tests/fixtures/panel-busybox-help.txt` (flare-edge `tools/bench/busybox-help/capture.sh`). `qemu/tests/busybox-panel-help.sh` compares the built binary with it. | + +The Buildroot fixups in `busybox.mk` that depend on the image's Buildroot +options (mdev, init, watchdog, less flags, crypt SHA) are not applied here; +the applet list and the per-applet help check would show any of them that +changed an applet or an option. When the image's BusyBox changes, update +`panel.config` and `patches/` the same way and re-capture `applets.txt` and +`help.txt` from a panel. + +The inputs are pinned (source tarball sha256, these files); the output is not, +because each host's compiler gives a different binary. The cache key in +`$OUT/busybox-armv7l-panel.key` covers the tarball, these files and the +compiler version. diff --git a/qemu/busybox/applets.txt b/qemu/busybox/applets.txt new file mode 100644 index 0000000..954b563 --- /dev/null +++ b/qemu/busybox/applets.txt @@ -0,0 +1,282 @@ +[ +[[ +addgroup +adduser +ar +arch +arp +arping +ascii +ash +awk +base32 +base64 +basename +bc +blkid +bunzip2 +bzcat +cat +chattr +chgrp +chmod +chown +chroot +chrt +chvt +cksum +clear +cmp +cp +cpio +crc32 +crond +crontab +cut +date +dc +dd +deallocvt +delgroup +deluser +devmem +df +diff +dirname +dmesg +dnsd +dnsdomainname +dos2unix +du +dumpkmap +echo +egrep +eject +env +ether-wake +expr +factor +fallocate +false +fbset +fdflush +fdformat +fdisk +fgrep +find +flock +fold +free +freeramdisk +fsck +fsfreeze +fstrim +fuser +getfattr +getopt +getty +grep +gunzip +gzip +halt +hdparm +head +hexdump +hexedit +hostid +hostname +hwclock +i2cdetect +i2cdump +i2cget +i2cset +i2ctransfer +id +ifconfig +ifdown +ifup +inetd +init +insmod +install +ip +ipaddr +ipcrm +ipcs +iplink +ipneigh +iproute +iprule +iptunnel +kill +killall +killall5 +klogd +last +less +link +linux32 +linux64 +linuxrc +ln +loadfont +loadkmap +logger +login +logname +losetup +ls +lsattr +lsmod +lsof +lspci +lsscsi +lsusb +lzcat +lzma +lzopcat +makedevs +md5sum +mdev +mesg +microcom +mim +mkdir +mkdosfs +mke2fs +mkfifo +mknod +mkpasswd +mkswap +mktemp +modprobe +more +mount +mountpoint +mt +mv +nameif +netstat +nice +nl +nohup +nologin +nproc +nslookup +nuke +od +openvt +partprobe +passwd +paste +patch +pidof +ping +pipe_progress +pivot_root +poweroff +printenv +printf +ps +pwd +rdate +readlink +readprofile +realpath +reboot +renice +reset +resize +resume +rfkill +rm +rmdir +rmmod +route +run-init +run-parts +runlevel +sed +seedrng +seq +setarch +setconsole +setfattr +setkeycodes +setlogcons +setpriv +setserial +setsid +sh +sha1sum +sha256sum +sha3sum +sha512sum +shred +sleep +sort +start-stop-daemon +strings +stty +su +sulogin +svc +svok +swapoff +swapon +switch_root +sync +sysctl +syslogd +tail +tar +tc +tee +telnet +telnetd +test +tftp +time +top +touch +tr +traceroute +tree +true +truncate +ts +tsort +tty +ubirename +udhcpc +uevent +umount +uname +uniq +unix2dos +unlink +unlzma +unlzop +unxz +unzip +uptime +usleep +uudecode +uuencode +vconfig +vi +vlock +w +watch +watchdog +wc +wget +which +who +whoami +xargs +xxd +xz +xzcat +yes +zcat diff --git a/qemu/busybox/help.txt b/qemu/busybox/help.txt new file mode 100644 index 0000000..3fa3805 --- /dev/null +++ b/qemu/busybox/help.txt @@ -0,0 +1,2218 @@ +# image: VERSION=0.17.79-rc BUILD_DATE=2026-10-28 GIT_COMMIT=417a66b FLAVOR=release KERNEL=6.18.46 KCONFIG_SHA256=7de6e4896da603e0993db36a261796abbb040fd6ac3733a39d163762e4fda27f SDK=/home/noah/projects/flare-edge/sdk +# busybox: BusyBox v1.37.0 (2026-09-29 00:26:09 UTC) multi-call binary. +# +== [ +== [[ +== addgroup +Usage: addgroup [-g GID] [-S] GROUP +Add a group + -g GID Group id + -S Create a system group +== adduser +Usage: adduser [OPTIONS] USER [GROUP] +Create new user, or add USER to GROUP + -h DIR Home directory + -g GECOS GECOS field + -s SHELL Login shell + -G GRP Group + -S Create a system user + -D Don't assign a password + -H Don't create home directory + -u UID User id + -k SKEL Skeleton directory (/etc/skel) +== ar +Usage: ar x|p|t|r [-ov] ARCHIVE [FILE]... +Extract or list FILEs from an ar archive, or create it + x Extract + p Extract to stdout + t List + r Create + -o Restore mtime + -v Verbose +== arch +Usage: arch +Print system architecture +== arp +Usage: arp +[-vn] [-H HWTYPE] [-i IF] -a [HOSTNAME] +[-v] [-i IF] -d HOSTNAME [pub] +[-v] [-H HWTYPE] [-i IF] -s HOSTNAME HWADDR [temp] +[-v] [-H HWTYPE] [-i IF] -s HOSTNAME HWADDR [netmask MASK] pub +[-v] [-H HWTYPE] [-i IF] -Ds HOSTNAME IFACE [netmask MASK] pub +Manipulate ARP cache + -a Display (all) hosts + -d Delete ARP entry + -s Set new entry + -v Verbose + -n Don't resolve names + -i IF Network interface + -D Read HWADDR from IFACE + -A,-p AF Protocol family + -H HWTYPE Hardware address type +== arping +Usage: arping [-fqbDUA] [-c CNT] [-w TIMEOUT] [-I IFACE] [-s SRC_IP] DST_IP +Send ARP requests/replies + -f Quit on first ARP reply + -q Quiet + -b Keep broadcasting, don't go unicast + -D Exit with 1 if DST_IP replies + -U Unsolicited ARP mode, update your neighbors + -A ARP answer mode, update your neighbors + -c N Stop after sending N ARP requests + -w TIMEOUT Seconds to wait for ARP reply + -I IFACE Interface to use (default eth0) + -s SRC_IP Sender IP address + DST_IP Target IP address +== ascii +No help available +== ash +Usage: ash [-il] [-|+Cabefmnuvx] [-|+o OPT]... [-c 'SCRIPT' [ARG0 ARGS] | FILE ARGS | -s ARGS] +Unix shell interpreter +== awk +Usage: awk [OPTIONS] [AWK_PROGRAM] [FILE]... + -v VAR=VAL Set variable + -F SEP Use SEP as field separator + -f/-E FILE Read program from FILE + -e AWK_PROGRAM +== base32 +Usage: base32 [-d] [-w COL] [FILE] +Base32 encode or decode FILE to standard output + -d Decode data + -w COL Wrap lines at COL (default 76, 0 disables) +== base64 +Usage: base64 [-d] [-w COL] [FILE] +Base64 encode or decode FILE to standard output + -d Decode data + -w COL Wrap lines at COL (default 76, 0 disables) +== basename +Usage: basename FILE [SUFFIX] | -a FILE... | -s SUFFIX FILE... +Strip directory path and SUFFIX from FILE + -a All arguments are FILEs + -s SUFFIX Remove SUFFIX (implies -a) +== bc +Usage: bc [-sqlw] [FILE]... +Arbitrary precision calculator + -q Quiet + -l Load standard library + -s Be POSIX compatible + -w Warn if extensions are used +$BC_LINE_LENGTH changes output width +== blkid +Usage: blkid [BLOCKDEV]... +Print UUIDs of all filesystems +== bunzip2 +Usage: bunzip2 [-cfk] [FILE]... +Decompress FILEs (or stdin) + -c Write to stdout + -f Force + -k Keep input files + -t Test integrity +== bzcat +Usage: bzcat [FILE]... +Decompress to stdout +== cat +Usage: cat [-nbvteA] [FILE]... +Print FILEs to stdout + -n Number output lines + -b Number nonempty lines + -v Show nonprinting characters as ^x or M-x + -t ...and tabs as ^I + -e ...and end lines with $ + -A Same as -vte +== chattr +Usage: chattr [-R] [-v VERSION] [-p PROJID] [-+=AacDdijsStTu] FILE... +Change ext2 file attributes + -R Recurse + -v NUM Set version/generation number + -p NUM Set project number +Modifiers: + -,+,= Remove/add/set attributes +Attributes: + A No atime + a Append only + C No copy-on-write + c Compressed + D Synchronous dir updates + d Don't backup with dump + E Encrypted + e File uses extents + F Case-insensitive dir + I Indexed dir + i Immutable + j Write data to journal first + N File is stored in inode + P Hierarchical project ID dir + S Synchronous file updates + s Zero storage when deleted + T Top of dir hierarchy + t Don't tail-merge with other files + u Allow undelete + V Verity +== chgrp +Usage: chgrp [-RhLHPcvf]... GROUP FILE... +Change the group membership of FILEs to GROUP + -h Affect symlinks instead of symlink targets + -L Traverse all symlinks to directories + -H Traverse symlinks on command line only + -P Don't traverse symlinks (default) + -R Recurse + -c List changed files + -v Verbose + -f Hide errors +== chmod +Usage: chmod [-Rcvf] MODE[,MODE]... FILE... +MODE is octal number (bit pattern sstrwxrwxrwx) or [ugoa]{+|-|=}[rwxXst] + -R Recurse + -c List changed files + -v Verbose + -f Hide errors +== chown +Usage: chown [-RhLHPcvf]... USER[:[GRP]] FILE... +Change the owner and/or group of FILEs to USER and/or GRP + -h Affect symlinks instead of symlink targets + -L Traverse all symlinks to directories + -H Traverse symlinks on command line only + -P Don't traverse symlinks (default) + -R Recurse + -c List changed files + -v Verbose + -f Hide errors +== chroot +Usage: chroot NEWROOT [PROG ARGS] +Run PROG with root directory set to NEWROOT +== chrt +Usage: chrt -m | -p [PRIO] PID | [-rfobi] PRIO PROG ARGS +Change scheduling priority and class for a process + -m Show min/max priorities + -p Operate on PID + -r Set SCHED_RR class + -f Set SCHED_FIFO class + -o Set SCHED_OTHER class + -b Set SCHED_BATCH class + -i Set SCHED_IDLE class +== chvt +Usage: chvt N +Change the foreground virtual terminal to /dev/ttyN +== cksum +Usage: cksum FILE... +Calculate CRC32 checksum of FILEs +== clear +Usage: clear +Clear screen +== cmp +Usage: cmp [-ls] [-n NUM] FILE1 [FILE2 [SKIP1 [SKIP2]]] +Compare FILE1 with FILE2 (or stdin) + -l Write the byte numbers (decimal) and values (octal) + for all differing bytes + -s Quiet + -n NUM Compare at most NUM bytes +== cp +Usage: cp [-arPLHpfinlsTu] SOURCE DEST +or: cp [-arPLHpfinlsu] SOURCE... { -t DIRECTORY | DIRECTORY } +Copy SOURCEs to DEST + -a Same as -dpR + -R,-r Recurse + -d,-P Preserve symlinks (default if -R) + -L Follow all symlinks + -H Follow symlinks on command line + -p Preserve file attributes if possible + -f Overwrite + -i Prompt before overwrite + -n Don't overwrite + -l,-s Create (sym)links + -T Refuse to copy if DEST is a directory + -t DIR Copy all SOURCEs into DIR + -u Copy only newer files +== cpio +Usage: cpio [-dmvu] [-F FILE] [-R USER[:GRP]] [-ti] [EXTR_FILE]... +Extract (-i) or list (-t) files from a cpio archive on stdin +Main operation mode: + -t List + -i Extract EXTR_FILEs (or all) +Options: + -d Make leading directories + -m Restore mtime + -v Verbose + -u Overwrite + -F FILE Input (-t,-i,-p) or output (-o) file + -R USER[:GRP] Set owner of created files + -L Dereference symlinks + -0 NUL terminated input +== crc32 +Usage: crc32 FILE... +Calculate CRC32 checksum of FILEs +== crond +Usage: crond [-fbS] [-l N] [-L LOGFILE] [-c DIR] + -f Foreground + -b Background (default) + -S Log to syslog (default) + -l N Set log level. Most verbose 0, default 8 + -L FILE Log to FILE + -c DIR Cron dir. Default:/var/spool/cron/crontabs +== crontab +Usage: crontab [-c DIR] [-u USER] [-ler]|[FILE] + -c Crontab directory + -u User + -l List crontab + -e Edit crontab + -r Delete crontab + FILE Replace crontab by FILE ('-': stdin) +== cut +Usage: cut [OPTIONS] [FILE]... +Print selected fields from FILEs to stdout + -b LIST Output only bytes from LIST + -c LIST Output only characters from LIST + -d SEP Field delimiter for input (default -f TAB, -F run of whitespace) + -O SEP Field delimeter for output (default = -d for -f, one space for -F) + -D Don't sort/collate sections or match -fF lines without delimeter + -f LIST Print only these fields (-d is single char) + -F LIST Print only these fields (-d is regex) + -s Output only lines containing delimiter + -n Ignored +== date +Usage: date [OPTIONS] [+FMT] [[-s] TIME] +Display time (using +FMT), or set time + -u Work in UTC (don't convert to local time) + [-s] TIME Set time to TIME + -d TIME Display TIME, not 'now' + -D FMT FMT (strptime format) for -s/-d TIME conversion + -r FILE Display last modification time of FILE + -R Output RFC-2822 date + -I[SPEC] Output ISO-8601 date + SPEC=date (default), hours, minutes, seconds or ns +Recognized TIME formats: + @seconds_since_1970 + hh:mm[:ss] + [YYYY.]MM.DD-hh:mm[:ss] + YYYY-MM-DD hh:mm[:ss] + [[[[[YY]YY]MM]DD]hh]mm[.ss] + 'date TIME' form accepts MMDDhhmm[[YY]YY][.ss] instead +== dc +Usage: dc [-x] [-eSCRIPT]... [-fFILE]... [FILE]... +Tiny RPN calculator. Operations: +Arithmetic: + - * / % ^ +~ - divide with remainder +| - modular exponentiation +v - square root +p - print top of the stack without popping +f - print entire stack +k - pop the value and set precision +i - pop the value and set input radix +o - pop the value and set output radix +Examples: dc -e'2 2 + p' -> 4, dc -e'8 8 * 2 2 + / p' -> 16 +== dd +Usage: dd [if=FILE] [of=FILE] [ibs=N obs=N/bs=N] [count=N] [skip=N] [seek=N] + [conv=notrunc|noerror|sync|fsync] + [iflag=skip_bytes|count_bytes|fullblock|direct] [oflag=seek_bytes|append|direct] +Copy a file with converting and formatting + if=FILE Read from FILE instead of stdin + of=FILE Write to FILE instead of stdout + bs=N Read and write N bytes at a time + ibs=N Read N bytes at a time + obs=N Write N bytes at a time + count=N Copy only N input blocks + skip=N Skip N input blocks + seek=N Skip N output blocks + conv=notrunc Don't truncate output file + conv=noerror Continue after read errors + conv=sync Pad blocks with zeros + conv=fsync Physically write data out before finishing + conv=swab Swap every pair of bytes + iflag=skip_bytes skip=N is in bytes + iflag=count_bytes count=N is in bytes + oflag=seek_bytes seek=N is in bytes + iflag=direct O_DIRECT input + oflag=direct O_DIRECT output + iflag=fullblock Read full blocks + oflag=append Open output in append mode + status=noxfer Suppress rate output + status=none Suppress all output +N may be suffixed by c (1), w (2), b (512), kB (1000), k (1024), MB, M, GB, G +== deallocvt +Usage: deallocvt [N] +Deallocate unused virtual terminal /dev/ttyN +== delgroup +Usage: delgroup GROUP +Delete group GROUP from the system +== deluser +Usage: deluser [--remove-home] USER +Delete USER from the system +== devmem +Usage: devmem ADDRESS [WIDTH [VALUE]] +Read/write from physical address + ADDRESS Address to act upon + WIDTH Width (8/16/...) + VALUE Data to be written +== df +Usage: df [-PkmhT] [-t TYPE] [FILESYSTEM]... +Print filesystem usage statistics + -P POSIX output format + -k 1024-byte blocks (default) + -m 1M-byte blocks + -h Human readable (e.g. 1K 243M 2G) + -T Print filesystem type + -t TYPE Print only mounts of this type +== diff +Usage: diff [-abBdiNqrTstw] [-L LABEL] [-S FILE] [-U LINES] FILE1 FILE2 +Compare files line by line and output the differences between them. +This implementation supports unified diffs only. + -a Treat all files as text + -b Ignore changes in the amount of whitespace + -B Ignore changes whose lines are all blank + -d Try hard to find a smaller set of changes + -i Ignore case differences + -L Use LABEL instead of the filename in the unified header + -N Treat absent files as empty + -q Output only whether files differ + -r Recurse + -S Start with FILE when comparing directories + -T Make tabs line up by prefixing a tab when necessary + -s Report when two files are the same + -t Expand tabs to spaces in output + -U Output LINES lines of context + -w Ignore all whitespace +== dirname +Usage: dirname FILENAME +Strip non-directory suffix from FILENAME +== dmesg +Usage: dmesg [-cr] [-n LEVEL] [-s SIZE] +Print or control the kernel ring buffer + -c Clear ring buffer after printing + -n LEVEL Set console logging level + -s SIZE Buffer size + -r Print raw message buffer +== dnsd +Usage: dnsd [-dvs] [-c CONFFILE] [-t TTL_SEC] [-p PORT] [-i ADDR] +Small static DNS server daemon + -c FILE Config file + -t SEC TTL + -p PORT Listen on PORT + -i ADDR Listen on ADDR + -d Daemonize + -v Verbose + -s Send successful replies only. Use this if you want + to use /etc/resolv.conf with two nameserver lines: + nameserver DNSD_SERVER + nameserver NORMAL_DNS_SERVER +== dnsdomainname +No help available +== dos2unix +Usage: dos2unix [-ud] [FILE] +Convert FILE in-place from DOS to Unix format. +When no file is given, use stdin/stdout. + -u dos2unix + -d unix2dos +== du +Usage: du [-aHLdclsxhmk] [FILE]... +Summarize disk space used for FILEs (or directories) + -a Show file sizes too + -b Apparent size (including holes) + -L Follow all symlinks + -H Follow symlinks on command line + -d N Limit output to directories (and files with -a) of depth < N + -c Show grand total + -l Count sizes many times if hard linked + -s Display only a total for each argument + -x Skip directories on different filesystems + -h Sizes in human readable format (e.g., 1K 243M 2G) + -m Sizes in megabytes + -k Sizes in kilobytes (default) +== dumpkmap +Usage: dumpkmap > keymap +Print a binary keyboard translation table to stdout +== echo +== egrep +No help available +== eject +Usage: eject [-t] [-T] [DEVICE] +Eject DEVICE or default /dev/cdrom + -t Close tray + -T Open/close tray (toggle) +== env +Usage: env [-i0] [-u NAME]... [-] [NAME=VALUE]... [PROG ARGS] +Print current environment or run PROG after setting up environment + -, -i Start with empty environment + -0 NUL terminated output + -u NAME Remove variable from environment +== ether-wake +Usage: ether-wake [-b] [-i IFACE] [-p aa:bb:cc:dd[:ee:ff]/a.b.c.d] MAC +Send a magic packet to wake up sleeping machines. +MAC must be a station address (00:11:22:33:44:55) or +a hostname with a known 'ethers' entry. + -b Broadcast the packet + -i IFACE Interface to use (default eth0) + -p PASSWORD Append four or six byte PASSWORD to the packet +== expr +Usage: expr EXPRESSION +Print the value of EXPRESSION +EXPRESSION may be: + ARG1 | ARG2 ARG1 if it is neither null nor 0, otherwise ARG2 + ARG1 & ARG2 ARG1 if neither argument is null or 0, otherwise 0 + ARG1 < ARG2 1 if ARG1 is less than ARG2, else 0. Similarly: + ARG1 <= ARG2 + ARG1 = ARG2 + ARG1 != ARG2 + ARG1 >= ARG2 + ARG1 > ARG2 + ARG1 + ARG2 Sum of ARG1 and ARG2. Similarly: + ARG1 - ARG2 + ARG1 * ARG2 + ARG1 / ARG2 + ARG1 % ARG2 + STRING : REGEXP Anchored pattern match of REGEXP in STRING + match STRING REGEXP Same as STRING : REGEXP + substr STRING POS LEN Substring of STRING, POS counts from 1 + index STRING CHARS Index in STRING where any CHARS is found, or 0 + length STRING Length of STRING + quote TOKEN Interpret TOKEN as a string, even if + it is a keyword like 'match' or an + operator like '/' + (EXPRESSION) Value of EXPRESSION +Beware that many operators need to be escaped or quoted for shells. +Comparisons are arithmetic if both ARGs are numbers, else +lexicographical. Pattern matches return the string matched between +\( and \) or null; if \( and \) are not used, they return the number +of characters matched or 0. +== factor +Usage: factor [NUMBER]... +Print prime factors +== fallocate +Usage: fallocate [-o OFS] -l LEN FILE +Preallocate space for FILE + -o OFS Offset of range + -l LEN Length of range +== false +== fbset +Usage: fbset [OPTIONS] [MODE] +Show and modify frame buffer settings +== fdflush +Usage: fdflush DEVICE +Force floppy disk drive to detect disk change +== fdformat +Usage: fdformat [-n] DEVICE +Format floppy disk + -n Don't verify after format +== fdisk +Usage: fdisk [-ul] [-C CYLINDERS] [-H HEADS] [-S SECTORS] [-b SSZ] DISK +Change partition table + -u Start and End are in sectors (instead of cylinders) + -l Show partition table for each DISK, then exit + -b 2048 (for certain MO disks) use 2048-byte sectors + -C CYLINDERS Set number of cylinders/heads/sectors + -H HEADS Typically 255 + -S SECTORS Typically 63 +== fgrep +No help available +== find +Usage: find [-HL] [PATH]... [OPTIONS] [ACTIONS] +Search for files and perform actions on them. +First failed action stops processing of current file. +Defaults: PATH is current directory, action is '-print' + -L,-follow Follow symlinks + -H ...on command line only + -xdev Don't descend directories on other filesystems + -maxdepth N Descend at most N levels. -maxdepth 0 applies + actions to command line arguments only + -mindepth N Don't act on first N levels + -depth Act on directory *after* traversing it +Actions: + ( ACTIONS ) Group actions for -o / -a + ! ACT Invert ACT's success/failure + ACT1 [-a] ACT2 If ACT1 fails, stop, else do ACT2 + ACT1 -o ACT2 If ACT1 succeeds, stop, else do ACT2 + Note: -a has higher priority than -o + -name PATTERN Match file name (w/o directory name) to PATTERN + -iname PATTERN Case insensitive -name + -path PATTERN Match path to PATTERN + -ipath PATTERN Case insensitive -path + -regex PATTERN Match path to regex PATTERN + -type X File type is X (one of: f,d,l,b,c,s,p) + -executable File is executable + -perm MASK At least one mask bit (+MASK), all bits (-MASK), + or exactly MASK bits are set in file's mode + -mtime DAYS mtime is greater than (+N), less than (-N), + or exactly N days in the past + -atime DAYS atime +N/-N/N days in the past + -ctime DAYS ctime +N/-N/N days in the past + -mmin MINS mtime is greater than (+N), less than (-N), + or exactly N minutes in the past + -amin MINS atime +N/-N/N minutes in the past + -cmin MINS ctime +N/-N/N minutes in the past + -newer FILE mtime is more recent than FILE's + -samefile FILE File is same as FILE + -user NAME/ID File is owned by given user + -group NAME/ID File is owned by given group + -size N[bck] File size is N (c:bytes,k:kbytes,b:512 bytes(def.)) + +/-N: file size is bigger/smaller than N + -empty Match empty file/directory + -prune If current file is directory, don't descend into it +If none of the following actions is specified, -print is assumed + -print Print file name + -print0 Print file name, NUL terminated + -exec CMD ARG ; Run CMD with all instances of {} replaced by + file name. Fails if CMD exits with nonzero + -exec CMD ARG + Run CMD with {} replaced by list of file names + -ok CMD ARG ; Prompt and run CMD with {} replaced + -quit Exit +== flock +Usage: flock [-sxun] FD | { FILE [-c] PROG ARGS } +[Un]lock file descriptor, or lock FILE, run PROG + -s Shared lock + -x Exclusive lock (default) + -u Unlock FD + -n Fail rather than wait +== fold +Usage: fold [-bs] [-w WIDTH] [FILE]... +Wrap input lines in FILEs (or stdin), writing to stdout + -b Count bytes rather than columns + -s Break at spaces + -w Use WIDTH columns instead of 80 +== free +Usage: free [-bkmgh] +Display free and used memory +== freeramdisk +Usage: freeramdisk DEVICE +Free all memory used by the specified ramdisk +== fsck +Usage: fsck [-ANPRTV] [-t FSTYPE] [FS_OPTS] [BLOCKDEV]... +Check and repair filesystems + -A Walk /etc/fstab and check all filesystems + -N Don't execute, just show what would be done + -P With -A, check filesystems in parallel + -R With -A, skip the root filesystem + -T Don't show title on startup + -V Verbose + -t TYPE List of filesystem types to check +== fsfreeze +Usage: fsfreeze --[un]freeze MOUNTPOINT +Flush and halt writes to MOUNTPOINT +== fstrim +Usage: fstrim [OPTIONS] MOUNTPOINT + -o OFFSET Offset in bytes to discard from + -l LEN Bytes to discard + -m MIN Minimum extent length + -v Print number of discarded bytes +== fuser +Usage: fuser [-msk46] [-SIGNAL] FILE or PORT/PROTO +Find processes which use FILEs or PORTs + -m Find processes which use same fs as FILEs + -4,-6 Search only IPv4/IPv6 space + -s Don't display PIDs + -k Kill found processes + -SIGNAL Signal to send (default: KILL) +== getfattr +Usage: getfattr [-h] {-d|-n ATTR} FILE... +Get extended attributes + -h Do not follow symlinks + -d Dump all attributes + -n ATTR Get attribute ATTR +== getopt +Usage: getopt [OPTIONS] [--] OPTSTRING PARAMS + -a Allow long options starting with single - + -l LOPT[,...] Long options to recognize + -n PROGNAME The name under which errors are reported + -o OPTSTRING Short options to recognize + -q No error messages on unrecognized options + -Q No normal output + -s SHELL Set shell quoting conventions + -T Version test (exits with 4) + -u Don't quote output +Example: +O=`getopt -l bb: -- ab:c:: "$@"` || exit 1 +eval set -- "$O" +while true; do + case "$1" in + -a) echo A; shift;; + -b|--bb) echo "B:'$2'"; shift 2;; + -c) case "$2" in + "") echo C; shift 2;; + *) echo "C:'$2'"; shift 2;; + esac;; + --) shift; break;; + *) echo Error; exit 1;; + esac +done +== getty +Usage: getty [OPTIONS] BAUD_RATE[,BAUD_RATE]... TTY [TERMTYPE] +Open TTY, prompt for login name, then invoke /bin/login + -h Enable hardware RTS/CTS flow control + -L Set CLOCAL (ignore Carrier Detect state) + -m Get baud rate from modem's CONNECT status message + -n Don't prompt for login name + -w Wait for CR or LF before sending /etc/issue + -i Don't display /etc/issue + -f ISSUE_FILE Display ISSUE_FILE instead of /etc/issue + -l LOGIN Invoke LOGIN instead of /bin/login + -t SEC Terminate after SEC if no login name is read + -I INITSTR Send INITSTR before anything else + -H HOST Log HOST into the utmp file as the hostname +BAUD_RATE of 0 leaves it unchanged +== grep +Usage: grep [-HhnlLoqvsrRiwFE] [-m N] [-A|B|C N] { PATTERN | -e PATTERN... | -f FILE... } [FILE]... +Search for PATTERN in FILEs (or stdin) + -H Add 'filename:' prefix + -h Do not add 'filename:' prefix + -n Add 'line_no:' prefix + -l Show only names of files that match + -L Show only names of files that don't match + -c Show only count of matching lines + -o Show only the matching part of line + -q Quiet. Return 0 if PATTERN is found, 1 otherwise + -v Select non-matching lines + -s Suppress open and read errors + -r Recurse + -R Recurse and dereference symlinks + -i Ignore case + -w Match whole words only + -x Match whole lines only + -F PATTERN is a literal (not regexp) + -E PATTERN is an extended regexp + -m N Match up to N times per file + -A N Print N lines of trailing context + -B N Print N lines of leading context + -C N Same as '-A N -B N' + -e PTRN Pattern to match + -f FILE Read pattern from file +== gunzip +Usage: gunzip [-cfkt] [FILE]... +Decompress FILEs (or stdin) + -c Write to stdout + -f Force + -k Keep input files + -t Test integrity +== gzip +Usage: gzip [-cfkdt] [FILE]... +Compress FILEs (or stdin) + -d Decompress + -c Write to stdout + -f Force + -k Keep input files + -t Test integrity +== halt +Usage: halt [-d DELAY] [-nfw] +Halt the system + -d SEC Delay interval + -n Do not sync + -f Force (don't go through init) + -w Only write a wtmp record +== hdparm +Usage: hdparm [OPTIONS] [DEVICE] + -a Get/set fs readahead + -A Set drive read-lookahead flag (0/1) + -b Get/set bus state (0 == off, 1 == on, 2 == tristate) + -B Set Advanced Power Management setting (1-255) + -c Get/set IDE 32-bit IO setting + -C Check IDE power mode status + -D Enable/disable drive defect-mgmt + -f Flush buffer cache for device on exit + -g Display drive geometry + -h Display terse usage information + -i Display drive identification + -I Detailed/current information directly from drive + -k Get/set keep_settings_over_reset flag (0/1) + -K Set drive keep_features_over_reset flag (0/1) + -L Set drive doorlock (0/1) (removable harddisks only) + -m Get/set multiple sector count + -n Get/set ignore-write-errors flag (0/1) + -p Set PIO mode on IDE interface chipset (0,1,2,3,4,...) + -P Set drive prefetch count + -Q Get/set DMA tagged-queuing depth (if supported) + -r Get/set readonly flag (DANGEROUS to set) + -S Set standby (spindown) timeout + -t Perform device read timings + -T Perform cache read timings + -u Get/set unmaskirq flag (0/1) + -v Defaults; same as -mcudkrag for IDE drives + -V Display program version and exit immediately + -W Set drive write-caching flag (0/1) (DANGEROUS) + -X Set IDE xfer mode (DANGEROUS) + -y Put IDE drive in standby mode + -Y Put IDE drive to sleep + -Z Disable Seagate auto-powersaving mode + -z Reread partition table +== head +Usage: head [OPTIONS] [FILE]... +Print first 10 lines of FILEs (or stdin). +With more than one FILE, precede each with a filename header. + -n N[bkm] Print first N lines + -n -N[bkm] Print all except N last lines + -c [-]N[bkm] Print first N bytes + (b:*512 k:*1024 m:*1024^2) + -q Never print headers + -v Always print headers +== hexdump +Usage: hexdump [-bcdoxCv] [-e FMT] [-f FMT_FILE] [-n LEN] [-s OFS] [FILE]... +Display FILEs (or stdin) in a user specified format + -b 1-byte octal display + -c 1-byte character display + -d 2-byte decimal display + -o 2-byte octal display + -x 2-byte hex display + -C hex+ASCII 16 bytes per line + -v Show all (no dup folding) + -e FORMAT_STR Example: '16/1 "%02x|""\n"' + -f FORMAT_FILE + -n LENGTH Show only first LENGTH bytes + -s OFFSET Skip OFFSET bytes +== hexedit +Usage: hexedit FILE +Edit FILE in hexadecimal +== hostid +Usage: hostid +Print out a unique 32-bit identifier for the machine +== hostname +Usage: hostname [-sidf] [HOSTNAME | -F FILE] +Show or set hostname or DNS domain name + -s Short + -i Addresses for the hostname + -d DNS domain name + -f Fully qualified domain name + -F FILE Use FILE's content as hostname +== hwclock +Usage: hwclock [-ul] [-f DEV] [-s|-w|--systz|--param-get PARAM|--param-set PARAM=VAL] +Show or set hardware clock (RTC) + -f DEV Use this device (e.g. /dev/rtc2) + -u Assume RTC is kept in UTC + -l Assume RTC is kept in local time + (if neither is given, read from /var/lib/hwclock/adjtime) + -s Set system time from RTC + -w Set RTC from system time + --systz Set in-kernel timezone, correct system time + if RTC is kept in local time + --param-get PARAM Get RTC parameter + --param-set PARAM=VAL Set RTC parameter +== i2cdetect +Usage: i2cdetect -l | -F I2CBUS | [-ya] [-q|-r] I2CBUS [FIRST LAST] +Detect I2C chips + -l List installed buses + -F BUS# List functionalities on this bus + -y Disable interactive mode + -a Force scanning of non-regular addresses + -q Use smbus quick write commands for probing (default) + -r Use smbus read byte commands for probing + FIRST and LAST limit probing range +== i2cdump +Usage: i2cdump [-fy] [-r FIRST-LAST] BUS ADDR [MODE] +Examine I2C registers + I2CBUS I2C bus number + ADDRESS 0x03-0x77 +MODE is: + b Byte (default) + w Word + W Word on even register addresses + i I2C block + s SMBus block + c Consecutive byte + Append p for SMBus PEC + -f Force access + -y Disable interactive mode + -r Limit the number of registers being accessed +== i2cget +Usage: i2cget [-fy] BUS CHIP-ADDRESS [DATA-ADDRESS [MODE]] +Read from I2C/SMBus chip registers + I2CBUS I2C bus number + ADDRESS 0x03-0x77 +MODE is: + b Read byte data (default) + w Read word data + c Write byte/read byte + Append p for SMBus PEC + -f Force access + -y Disable interactive mode +== i2cset +Usage: i2cset [-fy] [-m MASK] BUS CHIP-ADDRESS DATA-ADDRESS [VALUE] ... [MODE] +Set I2C registers + I2CBUS I2C bus number + ADDRESS 0x03-0x77 +MODE is: + c Byte, no value + b Byte data (default) + w Word data + i I2C block data + s SMBus block data + Append p for SMBus PEC + -f Force access + -y Disable interactive mode + -r Read back and compare the result + -m MASK Mask specifying which bits to write +== i2ctransfer +Usage: i2ctransfer [-fay] I2CBUS { rLENGTH[@ADDR] | wLENGTH[@ADDR] DATA...}... +Read/write I2C data in one transfer + -f Force access to busy addresses + -a Force access to non-regular addresses + -y Disable interactive mode +== id +Usage: id [-ugGnr] [USER] +Print information about USER or the current user + -u User ID + -g Group ID + -G Supplementary group IDs + -n Print names instead of numbers + -r Print real ID instead of effective ID +== ifconfig +Usage: ifconfig [-a] [IFACE] [ADDRESS] +Configure a network interface + [add ADDRESS[/PREFIXLEN]] + [del ADDRESS[/PREFIXLEN]] + [[-]broadcast [ADDRESS]] [[-]pointopoint [ADDRESS]] + [netmask ADDRESS] [dstaddr ADDRESS] + [outfill NN] [keepalive NN] + [hw ether|infiniband ADDRESS] [metric NN] [mtu NN] + [[-]trailers] [[-]arp] [[-]allmulti] + [multicast] [[-]promisc] [txqueuelen NN] [[-]dynamic] + [mem_start NN] [io_addr NN] [irq NN] + [up|down] ... +== ifdown +Usage: ifdown [-nmvf] [-i FILE] -a | IFACE... + -a Deconfigure all interfaces + -i FILE Use FILE instead of /etc/network/interfaces + -n Dry run + (note: doesn't disable mappings) + -m Don't run any mappings + -v Print out what would happen before doing it + -f Force +== ifup +Usage: ifup [-nmvf] [-i FILE] -a | IFACE... + -a Configure all interfaces + -i FILE Use FILE instead of /etc/network/interfaces + -n Dry run + (note: doesn't disable mappings) + -m Don't run any mappings + -v Print out what would happen before doing it + -f Force +== inetd +Usage: inetd [-fe] [-q N] [-R N] [CONFFILE] +Listen for network connections and launch programs + -f Run in foreground + -e Log to stderr + -q N Socket listen queue (default 128) + -R N Pause services after N connects/min + (default 0 - disabled) + Default CONFFILE is /etc/inetd.conf +== init +Usage: init +Init is the first process started during boot. It never exits. +It (re)spawns children according to /etc/inittab. +Signals: +HUP: reload /etc/inittab +TSTP: stop respawning until CONT +QUIT: re-exec another init +USR1/TERM/USR2/INT: run halt/reboot/poweroff/Ctrl-Alt-Del script +== insmod +Usage: insmod FILE [SYMBOL=VALUE]... +Load kernel module +== install +Usage: install [-cdDsp] [-o USER] [-g GRP] [-m MODE] [-t DIR] [SOURCE]... DEST +Copy files and set attributes + -c Just copy (default) + -d Create directories + -D Create leading target directories + -s Strip symbol table + -p Preserve date + -o USER Set ownership + -g GRP Set group ownership + -m MODE Set permissions + -t DIR Install to DIR +== ip +Usage: ip [OPTIONS] address|route|link|tunnel|neigh|rule [ARGS] +OPTIONS := -f[amily] inet|inet6|link | -o[neline] +ip addr add|del IFADDR dev IFACE | show|flush [dev IFACE] [to PREFIX] +ip route list|flush|add|del|change|append|replace|test ROUTE +ip link set IFACE [up|down] [arp on|off] [multicast on|off] + [promisc on|off] [mtu NUM] [name NAME] [qlen NUM] [address MAC] + [master IFACE | nomaster] [netns PID] [type TYPE ARGS] +ip tunnel add|change|del|show [NAME] + [mode ipip|gre|sit] [remote ADDR] [local ADDR] [ttl TTL] +ip neigh show|flush [to PREFIX] [dev DEV] [nud STATE] +ip rule [list] | add|del SELECTOR ACTION +== ipaddr +Usage: ipaddr add|del IFADDR dev IFACE | show|flush [dev IFACE] [to PREFIX] +ipaddr add|change|replace|delete dev IFACE [CONFFLAG-LIST] IFADDR + IFADDR := PREFIX | ADDR peer PREFIX [broadcast ADDR|+|-] + [anycast ADDR] [label STRING] [scope SCOPE] + PREFIX := ADDR[/MASK] + SCOPE := [host|link|global|NUMBER] + CONFFLAG-LIST := [CONFFLAG-LIST] CONFFLAG + CONFFLAG := [noprefixroute] +ipaddr show|flush [dev IFACE] [scope SCOPE] [to PREFIX] [label PATTERN] +== ipcrm +Usage: ipcrm [-MQS key] [-mqs id] +Upper-case options MQS remove an object by shmkey value. +Lower-case options remove an object by shmid value. + -mM Remove memory segment after last detach + -qQ Remove message queue + -sS Remove semaphore +== ipcs +Usage: ipcs [[-smq] -i SHMID] | [[-asmq] [-tcplu]] + -i ID Show specific resource +Resource specification: + -m Shared memory segments + -q Message queues + -s Semaphore arrays + -a All (default) +Output format: + -t Time + -c Creator + -p Pid + -l Limits + -u Summary +== iplink +Usage: iplink set IFACE [up|down] [arp on|off] [multicast on|off] + [promisc on|off] [mtu NUM] [name NAME] [qlen NUM] [address MAC] + [master IFACE | nomaster] [netns PID] [type TYPE ARGS] +iplink add [link IFACE] IFACE [address MAC] type TYPE [ARGS] +iplink delete IFACE type TYPE [ARGS] + TYPE ARGS := vlan VLANARGS | vrf table NUM | can CANARGS + VLANARGS := id VLANID [protocol 802.1q|802.1ad] [reorder_hdr on|off] + [gvrp on|off] [mvrp on|off] [loose_binding on|off] + CANARGS := [bitrate BITRATE [sample-point SAMPLE-POINT]] | + [tq TQ prop-seg PROP_SEG phase-seg1 PHASE-SEG1 + phase-seg2 PHASE-SEG2 [sjw SJW]] + [dbitrate BITRATE [dsample-point SAMPLE-POINT]] | + [dtq TQ dprop-seg PROP_SEG dphase-seg1 PHASE-SEG1 + dphase-seg2 PHASE-SEG2 [dsjw SJW]] + [loopback on|off] [listen-only on|off] [triple-sampling on|off] + [one-shot on|off] [berr-reporting on|off] + [fd on|off] [fd-non-iso on|off] [presume-ack on|off] + [restart-ms TIME-MS] [restart] + [termination 0..65535] +iplink show [IFACE] +== ipneigh +Usage: ipneigh show|flush [to PREFIX] [dev DEV] [nud STATE] +== iproute +Usage: iproute list|flush|add|del|change|append|replace|test ROUTE +iproute list|flush SELECTOR + SELECTOR := [root PREFIX] [match PREFIX] [proto RTPROTO] + PREFIX := default|ADDR[/MASK] +iproute get ADDR [from ADDR iif IFACE] + [oif IFACE] [tos TOS] +iproute add|del|change|append|replace|test ROUTE + ROUTE := NODE_SPEC [INFO_SPEC] + NODE_SPEC := PREFIX [table TABLE_ID] [proto RTPROTO] [scope SCOPE] [metric METRIC] + INFO_SPEC := NH OPTIONS + NH := [via [inet|inet6] ADDR] [dev IFACE] [src ADDR] [onlink] + OPTIONS := [mtu [lock] NUM] [advmss [lock] NUM] +== iprule +Usage: iprule [list] | add|del SELECTOR ACTION + SELECTOR := [from PREFIX] [to PREFIX] [tos TOS] [fwmark FWMARK[/MASK]] + [dev IFACE] [pref NUMBER] + ACTION := [table TABLE_ID] [nat ADDR] + [prohibit|reject|unreachable] + [realms [SRCREALM/]DSTREALM] + TABLE_ID := [local|main|default|NUMBER] +== iptunnel +Usage: iptunnel add|change|del|show [NAME] + [mode ipip|gre|sit] [remote ADDR] [local ADDR] [ttl TTL] +iptunnel add|change|del|show [NAME] + [mode ipip|gre|sit] [remote ADDR] [local ADDR] + [[i|o]seq] [[i|o]key KEY] [[i|o]csum] + [ttl TTL] [tos TOS] [[no]pmtudisc] [dev PHYS_DEV] +== kill +Usage: kill [-l] [-SIG] PID... +Send a signal (default: TERM) to given PIDs + -l List all signal names and numbers +== killall +Usage: killall [-lq] [-SIG] PROCESS_NAME... +Send a signal (default: TERM) to given processes + -l List all signal names and numbers + -q Don't complain if no processes were killed +== killall5 +Usage: killall5 [-l] [-SIG] [-o PID]... +Send a signal (default: TERM) to all processes outside current session + -l List all signal names and numbers + -o PID Don't signal this PID +== klogd +Usage: klogd [-c N] [-n] +Log kernel messages to syslog + -c N Print to console messages more urgent than prio N (1-8) + -n Run in foreground +== last +Usage: last +Show listing of the last users that logged into the system +== less +Usage: less [-EFIMmNSRh~] [FILE]... +View FILE (or stdin) one screenful at a time + -E Quit once the end of a file is reached + -F Quit if entire file fits on first screen + -I Ignore case in all searches + -M,-m Display status line with line numbers + and percentage through the file + -N Prefix line number to each line + -S Truncate long lines + -R Remove color escape codes in input + -~ Suppress ~s displayed past EOF +== link +Usage: link FILE LINK +Create hard LINK to FILE +== linux32 +No help available +== linux64 +No help available +== linuxrc +No help available +== ln +Usage: ln [-sfnbtv] [-S SUF] TARGET... LINK|DIR +Create a link LINK or DIR/TARGET to the specified TARGET(s) + -s Make symlinks instead of hardlinks + -f Remove existing destinations + -n Don't dereference symlinks - treat like normal file + -b Make a backup of the target (if exists) before link operation + -S SUF Use suffix instead of ~ when making backup files + -T Treat LINK as a file, not DIR + -v Verbose +== loadfont +Usage: loadfont < font +Load a console font from stdin +== loadkmap +Usage: loadkmap < keymap +Load a binary keyboard translation table from stdin +== logger +Usage: logger [-s] [-t TAG] [-p PRIO] [MESSAGE] +Write MESSAGE (or stdin) to syslog + -s Log to stderr as well as the system log + -t TAG Log using the specified tag (defaults to user name) + -p PRIO Priority (number or FACILITY.LEVEL pair) +== login +Usage: login [-p] [-h HOST] [[-f] USER] +Begin a new session on the system + -f Don't authenticate (user already authenticated) + -h HOST Host user came from (for network logins) + -p Preserve environment +$LOGIN_TIMEOUT Seconds (default 60, 0 - disable) +== logname +Usage: logname +Print the name of the current user +== losetup +Usage: losetup [-rP] [-o OFS] {-f|LOOPDEV} FILE: associate loop devices + losetup -c LOOPDEV: reread file size + losetup -d LOOPDEV: disassociate + losetup -a: show status + losetup -f: show next free loop device + -o OFS Start OFS bytes into FILE + -P Scan for partitions + -r Read-only + -f Show/use next free loop device +== ls +Usage: ls [-1AaCxdLHRFplinshrSXvctu] [-w WIDTH] [FILE]... +List directory contents + -1 One column output + -a Include names starting with . + -A Like -a, but exclude . and .. + -x List by lines + -d List directory names, not contents + -L Follow symlinks + -H Follow symlinks on command line + -R Recurse + -p Append / to directory names + -F Append indicator (one of */=@|) to names + -l Long format + -i List inode numbers + -n List numeric UIDs and GIDs instead of names + -s List allocated blocks + -lc List ctime + -lu List atime + --full-time List full date/time + -h Human readable sizes (1K 243M 2G) + --group-directories-first + -S Sort by size + -X Sort by extension + -v Sort by version + -t Sort by mtime + -tc Sort by ctime + -tu Sort by atime + -r Reverse sort order + -w N Format N columns wide + --color[={always,never,auto}] +== lsattr +Usage: lsattr [-Radlpv] [FILE]... +List ext2 file attributes + -R Recurse + -a Include names starting with . + -d List directory names, not contents + -l List long flag names + -p List project ID + -v List version/generation number +== lsmod +Usage: lsmod +List loaded kernel modules +== lsof +Usage: lsof +Show all open files +== lspci +Usage: lspci [-mk] +List all PCI devices + -m Parsable output + -k Show driver +== lsscsi +No help available +== lsusb +No help available +== lzcat +Usage: lzcat [FILE]... +Decompress to stdout +== lzma +Usage: lzma -d [-cfk] [FILE]... +Decompress FILEs (or stdin) + -d Decompress + -c Write to stdout + -f Force + -k Keep input files + -t Test integrity +== lzopcat +Usage: lzopcat [-vF] [FILE]... + -v Verbose + -F Don't verify checksum +== makedevs +Usage: makedevs [-d device_table] rootdir +Create a range of special files as specified in a device table. +Device table entries take the form of: + +Where name is the file name, type can be one of: + f Regular file + d Directory + c Character device + b Block device + p Fifo (named pipe) +uid is the user id for the target file, gid is the group id for the +target file. The rest of the entries (major, minor, etc) apply to +to device special files. A '-' may be used for blank entries. +== md5sum +Usage: md5sum [-c[sw]] [FILE]... +Print or check MD5 checksums + -c Check sums against list in FILEs + -s Don't output anything, status code shows success + -w Warn about improperly formatted checksum lines +== mdev +Usage: mdev [-vS] { [-s] | [-df] } + -v Verbose + -S Log to syslog too + -s Scan /sys and populate /dev + -d Daemon, listen on netlink + -f Run in foreground +Bare mdev is a kernel hotplug helper. To activate it: + echo /sbin/mdev >/proc/sys/kernel/hotplug +It uses /etc/mdev.conf with lines + [-][ENV=regex;]...DEVNAME UID:GID PERM [>|=PATH]|[!] [@|$|*PROG] +where DEVNAME is device name regex, @major,minor[-minor2], or +environment variable regex. A common use of the latter is +to load modules for hotplugged devices: + $MODALIAS=.* 0:0 660 @modprobe "$MODALIAS" +If /dev/mdev.seq file exists, mdev will wait for its value +to match $SEQNUM variable. This prevents plug/unplug races. +To activate this feature, create empty /dev/mdev.seq at boot. +If /dev/mdev.log file exists, debug log will be appended to it. +== mesg +Usage: mesg [y|n] +Control write access to your terminal + y Allow write access to your terminal + n Disallow write access to your terminal +== microcom +Usage: microcom [-d DELAY_MS] [-t TIMEOUT_MS ] [-s SPEED] [-X] TTY +Copy bytes from stdin to TTY and from TTY to stdout + -d DELAY Wait up to DELAY ms for TTY output before sending + every next byte to it + -t TIMEOUT Exit if both stdin and TTY are silent for TIMEOUT ms + -s SPEED Set serial line to SPEED + -X Disable special meaning of NUL and Ctrl-X from stdin +== mim +Usage: mim [-f FILE] [SHELL_OPTIONS] [TARGET] ... +Run a script from a Makefile-like specification file + -f FILE Spec file (default Mimfile) +== mkdir +Usage: mkdir [-m MODE] [-p] DIRECTORY... +Create DIRECTORY + -m MODE Mode + -p No error if exists; make parent directories as needed +== mkdosfs +Usage: mkdosfs [-v] [-n LABEL] BLOCKDEV [KBYTES] +Make a FAT32 filesystem + -v Verbose + -n LBL Volume label +== mke2fs +Usage: mke2fs [-Fn] [-b BLK_SIZE] [-i INODE_RATIO] [-I INODE_SIZE] [-m RESERVED_PERCENT] [-L LABEL] BLOCKDEV [KBYTES] + -b BLK_SIZE Block size, bytes + -F Force + -i RATIO Max number of files is filesystem_size / RATIO + -I BYTES Inode size (min 128) + -L LBL Volume label + -m PERCENT Percent of blocks to reserve for admin + -n Dry run +== mkfifo +Usage: mkfifo [-m MODE] NAME +Create named pipe + -m MODE Mode (default a=rw) +== mknod +Usage: mknod [-m MODE] NAME TYPE [MAJOR MINOR] +Create a special file (block, character, or pipe) + -m MODE Creation mode (default a=rw) +TYPE: + b Block device + c or u Character device + p Named pipe (MAJOR MINOR must be omitted) +== mkpasswd +Usage: mkpasswd [-P FD] [-m TYPE] [-S SALT] [PASSWORD] [SALT] +Print crypt(3) hashed PASSWORD + -P N Read password from fd N + -m TYPE des,md5,sha256/512 (default md5) + -S SALT +== mkswap +Usage: mkswap [-L LBL] BLOCKDEV [KBYTES] +Prepare BLOCKDEV to be used as swap partition + -L LBL Label +== mktemp +Usage: mktemp [-dt] [-p DIR] [TEMPLATE] +Create a temporary file with name based on TEMPLATE and print its name. +TEMPLATE must end with XXXXXX (e.g. [/dir/]nameXXXXXX). +Without TEMPLATE, -t tmp.XXXXXX is assumed. + -d Make directory, not file + -q Fail silently on errors + -t Prepend base directory name to TEMPLATE + -p DIR Use DIR as a base directory (implies -t) + -u Do not create anything; print a name +Base directory is: -p DIR, else $TMPDIR, else /tmp +== modprobe +Usage: modprobe [-alrqvsD] MODULE [SYMBOL=VALUE]... + -a Load multiple MODULEs + -l List (MODULE is a pattern) + -r Remove MODULE (stacks) or do autoclean + -q Quiet + -v Verbose + -s Log to syslog + -D Show dependencies +== more +Usage: more [FILE]... +View FILE (or stdin) one screenful at a time +== mount +Usage: mount [OPTIONS] [-o OPT] DEVICE NODE +Mount a filesystem. Filesystem autodetection requires /proc. + -a Mount all filesystems in fstab + -r Read-only mount + -t FSTYPE[,...] Filesystem type(s) + -T FILE Read FILE instead of /etc/fstab + -O OPT Mount only filesystems with option OPT (-a only) +-o OPT: + loop Ignored (loop devices are autodetected) + [a]sync Writes are [a]synchronous + [no]atime Disable/enable updates to inode access times + [no]diratime Disable/enable atime updates to directories + [no]relatime Disable/enable atime updates relative to modification time + [no]dev (Dis)allow use of special device files + [no]exec (Dis)allow use of executable files + [no]suid (Dis)allow set-user-id-root programs + [r]shared Convert [recursively] to a shared subtree + [r]slave Convert [recursively] to a slave subtree + [r]private Convert [recursively] to a private subtree + [un]bindable Make mount point [un]able to be bind mounted + [r]bind Bind a file or directory [recursively] to another location + move Relocate an existing mount point + remount Remount a mounted filesystem, changing flags + ro Same as -r +There are filesystem-specific -o flags. +== mountpoint +Usage: mountpoint [-q] { [-dn] DIR | -x DEVICE } +Check if DIR is a mountpoint + -q Quiet + -d Print major:minor of the filesystem + -n Print device name of the filesystem + -x Print major:minor of DEVICE +== mt +Usage: mt [-f DEVICE] OPCODE VALUE +Control magnetic tape drive operation +Opcodes: +bsf bsfm bsr bss datacompression drvbuffer eof eom erase +fsf fsfm fsr fss load lock mkpart nop offline ras1 ras2 +ras3 reset retension rewind rewoffline seek setblk setdensity +setpart tell unload unlock weof wset +== mv +Usage: mv [-finT] SOURCE DEST +or: mv [-fin] SOURCE... { -t DIRECTORY | DIRECTORY } +Rename SOURCE to DEST, or move SOURCEs to DIRECTORY + -f Don't prompt before overwriting + -i Interactive, prompt before overwrite + -n Don't overwrite an existing file + -T Refuse to move if DEST is a directory + -t DIR Move all SOURCEs into DIR +== nameif +Usage: nameif [-s] [-c FILE] [IFNAME HWADDR]... +Rename network interface while it in the down state. +The device with address HWADDR is renamed to IFNAME. + -c FILE Configuration file (default: /etc/mactab) + -s Log to syslog +== netstat +Usage: netstat [-ral] [-tuwx] [-en] +Display networking information + -r Routing table + -a All sockets + -l Listening sockets + Else: connected sockets + -t TCP sockets + -u UDP sockets + -w Raw sockets + -x Unix sockets + Else: all socket types + -e Other/more information + -n Don't resolve names +== nice +Usage: nice [-n ADJUST] [PROG ARGS] +Change scheduling priority, run PROG + -n ADJUST Adjust priority by ADJUST +== nl +Usage: nl [OPTIONS] [FILE]... +Write FILEs to standard output with line numbers added + -b STYLE Which lines to number - a: all, t: nonempty, n: none + -i N Line number increment + -s STRING Use STRING as line number separator + -v N Start from N + -w N Width of line numbers +== nohup +Usage: nohup PROG ARGS +Run PROG immune to hangups, with output to a non-tty +== nologin +Usage: nologin +Politely refuse a login +== nproc +Usage: nproc [--all] [--ignore=N] +Print number of available CPUs + --all Number of installed CPUs + --ignore=N Exclude N CPUs +== nslookup +Usage: nslookup [-type=QUERY_TYPE] [-debug] HOST [DNS_SERVER] +Query DNS about HOST +QUERY_TYPE: soa,ns,a,aaaa,cname,mx,txt,ptr,srv,any +== nuke +Usage: nuke DIR... +Remove DIRs +== od +Usage: od [-abcdfhilovxs] [-t TYPE] [-A RADIX] [-N SIZE] [-j SKIP] [-S MINSTR] [-w WIDTH] [FILE]... +Print FILEs (or stdin) unambiguously, as octal bytes by default +== openvt +Usage: openvt [-c N] [-sw] [PROG ARGS] +Start PROG on a new virtual terminal + -c N Use specified VT + -s Switch to the VT + -w Wait for PROG to exit +== partprobe +Usage: partprobe DEVICE... +Ask kernel to rescan partition table +== passwd +Usage: passwd [-a ALG] [-dlu] [USER] +Change USER's password (default: current user) + -a ALG des,md5,sha256/512 (default md5) + -d Set password to '' + -l Lock (disable) account + -u Unlock (enable) account +== paste +Usage: paste [-d LIST] [-s] [FILE]... +Paste lines from each input file, separated with tab + -d LIST Use delimiters from LIST, not tab + -s Serial: one file at a time +== patch +Usage: patch [-RNE] [-p N] [-i DIFF] [ORIGFILE [PATCHFILE]] + -p N Strip N leading components from file names + -i DIFF Read DIFF instead of stdin + -R Reverse patch + -N Ignore already applied patches + -E Remove output files if they become empty + --dry-run Don't actually change files +== pidof +Usage: pidof [-s] [-o PID] [NAME]... +List PIDs of all processes with names that match NAMEs + -s Show only one PID + -o PID Omit given pid + Use %PPID to omit pid of pidof's parent +== ping +Usage: ping [OPTIONS] HOST +Send ICMP ECHO_REQUESTs to HOST + -c CNT Send only CNT pings + -s SIZE Send SIZE data bytes in packets (default 56) + -i SECS Interval + -A Ping as soon as reply is received + -t TTL Set TTL + -I IFACE/IP Source interface or IP address + -W SEC Seconds to wait for the first response (default 10) + (after all -c CNT packets are sent) + -w SEC Seconds until ping exits (default:infinite) + (can exit earlier with -c CNT) + -q Quiet, only display output at start/finish + -p HEXBYTE Payload pattern +== pipe_progress +No help available +== pivot_root +Usage: pivot_root NEW_ROOT PUT_OLD +Move the current root file system to PUT_OLD and make NEW_ROOT +the new root file system +== poweroff +Usage: poweroff [-d DELAY] [-nf] +Halt and shut off power + -d SEC Delay interval + -n Do not sync + -f Force (don't go through init) +== printenv +Usage: printenv [VARIABLE]... +Print environment VARIABLEs. +If no VARIABLE specified, print all. +== printf +Usage: printf FORMAT [ARG]... +Format and print ARG(s) according to FORMAT (a-la C printf) +== ps +Usage: ps [-o COL1,COL2=HEADER] +Show list of processes + -o COL1,COL2=HEADER Select columns for display +== pwd +Usage: pwd +Print the full filename of the current working directory +== rdate +Usage: rdate [-s/-p] HOST +Set and print time from HOST using RFC 868 + -s Only set system time + -p Only print time +== readlink +Usage: readlink [-fnv] FILE +Display the value of a symlink + -n Don't add newline + -f Canonicalize by following all symlinks + -v Verbose +== readprofile +Usage: readprofile [OPTIONS] + -m MAPFILE (Default: /boot/System.map) + -p PROFILE (Default: /proc/profile) + -M NUM Set the profiling multiplier to NUM + -i Print only info about the sampling step + -v Verbose + -a Print all symbols, even if count is 0 + -b Print individual histogram-bin counts + -s Print individual counters within functions + -r Reset all the counters (root only) + -n Disable byte order auto-detection +== realpath +Usage: realpath FILE... +Print absolute pathnames of FILEs +== reboot +Usage: reboot [-d DELAY] [-nf] +Reboot the system + -d SEC Delay interval + -n Do not sync + -f Force (don't go through init) +== renice +Usage: renice [-n] PRIORITY [[-p|g|u] ID...]... +Change scheduling priority of a running process + -n Add PRIORITY to current nice value + Without -n, nice value is set to PRIORITY + -p Process ids (default) + -g Process group ids + -u Process user names +== reset +Usage: reset +Reset terminal (ESC codes) and termios (signals, buffering, echo) +== resize +Usage: resize +Resize the screen +== resume +Usage: resume BLOCKDEV [OFFSET] +Restore system state from 'suspend-to-disk' data in BLOCKDEV +== rfkill +Usage: rfkill COMMAND [INDEX|TYPE] +Enable/disable wireless devices +Commands: + list [INDEX|TYPE] List current state + block INDEX|TYPE Disable device + unblock INDEX|TYPE Enable device + TYPE: all, wlan(wifi), bluetooth, uwb(ultrawideband), + wimax, wwan, gps, fm +== rm +Usage: rm [-irf] FILE... +Remove (unlink) FILEs + -i Always prompt before removing + -f Never prompt + -R,-r Recurse +== rmdir +Usage: rmdir [-p] DIRECTORY... +Remove DIRECTORY if it is empty + -p Include parents + --ignore-fail-on-non-empty +== rmmod +Usage: rmmod [-wfa] [MODULE]... +Unload kernel modules + -w Wait until the module is no longer used + -f Force unload + -a Remove all unused modules (recursively) +== route +Usage: route [-ne] [-A inet[6]] [{add|del} [-net|-host] TARGET [netmask MASK] + [gw GATEWAY] [metric N] [mss BYTES] [window BYTES] [reject] [IFACE]] +Show or edit kernel routing tables + -n Don't resolve names + -e Display other/more information + -A inet[6] Select address family +== run-init +Usage: run-init [-d CAP,CAP...] [-n] [-c CONSOLE_DEV] NEW_ROOT NEW_INIT [ARGS] +Free initramfs and switch to another root fs: +chroot to NEW_ROOT, delete all in /, move NEW_ROOT to /, +execute NEW_INIT. PID must be 1. NEW_ROOT must be a mountpoint. + -c DEV Reopen stdio to DEV after switch + -d CAPS Drop capabilities + -n Dry run +== run-parts +Usage: run-parts [-a ARG]... [-u UMASK] [--reverse] [--test] [--exit-on-error] DIRECTORY +Run a bunch of scripts in DIRECTORY + -a ARG Pass ARG as argument to scripts + -u UMASK Set UMASK before running scripts + --reverse Reverse execution order + --test Dry run + --exit-on-error Exit if a script exits with non-zero +== runlevel +Usage: runlevel [FILE] +Find the current and previous system runlevel +If no utmp FILE exists or if no runlevel record can be found, +print "unknown" +== sed +Usage: sed [-i[SFX]] [-nrE] [-f FILE]... [-e CMD]... [FILE]... +or: sed [-i[SFX]] [-nrE] CMD [FILE]... + -e CMD Add CMD to sed commands to be executed + -f FILE Add FILE contents to sed commands to be executed + -i[SFX] Edit files in-place (otherwise write to stdout) + Optionally back files up, appending SFX + -n Suppress automatic printing of pattern space + -r,-E Use extended regex syntax +If no -e or -f, the first non-option argument is the sed command string. +Remaining arguments are input files (stdin if none). +== seedrng +Usage: seedrng [-d DIR] [-n] +Seed the kernel RNG from seed files + -d DIR Use seed files in DIR (default: /var/lib/seedrng) + -n Do not credit randomness, even if creditable +== seq +Usage: seq [-w] [-s SEP] [FIRST [INC]] LAST +Print numbers from FIRST to LAST, in steps of INC. +FIRST, INC default to 1. + -w Pad with leading zeros + -s SEP String separator +== setarch +Usage: setarch PERSONALITY [-R] PROG ARGS +PERSONALITY may be: + linux32 Set 32bit uname emulation + linux64 Set 64bit uname emulation + -R Disable address space randomization +== setconsole +Usage: setconsole [-r] [DEVICE] +Make writes to /dev/console appear on DEVICE (default: /dev/tty). +Does not redirect kernel log output or reads from /dev/console. + -r Reset: writes to /dev/console go to kernel log tty(s) +== setfattr +Usage: setfattr [-h] -n|-x ATTR [-v VALUE] FILE... +Set extended attributes + -h Do not follow symlinks + -x ATTR Remove attribute ATTR + -n ATTR Set attribute ATTR to VALUE + -v VALUE (default: empty) +== setkeycodes +Usage: setkeycodes { SCANCODE KEYCODE }... +Modify kernel's scancode-to-keycode map, +allowing unusual keyboards to generate usable keycodes. +SCANCODE is either xx or e0xx (hexadecimal), KEYCODE is decimal. +== setlogcons +Usage: setlogcons [N] +Pin kernel output to VT console N. Default:0 (do not pin) +== setpriv +Usage: setpriv [OPTIONS] PROG ARGS +Run PROG with different privilege settings +-d,--dump Show current capabilities +--nnp,--no-new-privs Ignore setuid/setgid bits and file capabilities +--inh-caps CAP,CAP Set inheritable capabilities +--ambient-caps CAP,CAP Set ambient capabilities +== setserial +Usage: setserial [-abGvz] { DEVICE [PARAMETER [ARG]]... | -g DEVICE... } +Print or set serial port parameters + -a Print all + -b Print summary + -G Print as setserial PARAMETERs + -v Verbose + -z Zero out serial flags before setting + -g All args are device names +PARAMETERs: (* = takes ARG, ^ = can be turned off by preceding ^) + *port, *irq, *divisor, *uart, *baud_base, *close_delay, *closing_wait, + ^fourport, ^auto_irq, ^skip_test, ^sak, ^session_lockout, ^pgrp_lockout, + ^callout_nohup, ^split_termios, ^hup_notify, ^low_latency, autoconfig, + spd_normal, spd_hi, spd_vhi, spd_shi, spd_warp, spd_cust +ARG for uart: + unknown, 8250, 16450, 16550, 16550A, Cirrus, 16650, 16650V2, 16750, + 16950, 16954, 16654, 16850, RSA, NS16550A, XSCALE, RM9000, OCTEON, AR7, + U6_16550A +== setsid +Usage: setsid [-c] PROG ARGS +Run PROG in a new session. PROG will have no controlling terminal +and will not be affected by keyboard signals (^C etc). + -c Set controlling terminal to stdin +== sh +Usage: sh [-il] [-|+Cabefmnuvx] [-|+o OPT]... [-c 'SCRIPT' [ARG0 ARGS] | FILE ARGS | -s ARGS] +Unix shell interpreter +== sha1sum +Usage: sha1sum [-c[sw]] [FILE]... +Print or check SHA1 checksums + -c Check sums against list in FILEs + -s Don't output anything, status code shows success + -w Warn about improperly formatted checksum lines +== sha256sum +Usage: sha256sum [-c[sw]] [FILE]... +Print or check SHA256 checksums + -c Check sums against list in FILEs + -s Don't output anything, status code shows success + -w Warn about improperly formatted checksum lines +== sha3sum +Usage: sha3sum [-c[sw]] [-a BITS] [FILE]... +Print or check SHA3 checksums + -c Check sums against list in FILEs + -s Don't output anything, status code shows success + -w Warn about improperly formatted checksum lines + -a BITS 224 (default), 256, 384, 512 +== sha512sum +Usage: sha512sum [-c[sw]] [FILE]... +Print or check SHA512 checksums + -c Check sums against list in FILEs + -s Don't output anything, status code shows success + -w Warn about improperly formatted checksum lines +== shred +Usage: shred [-fuz] [-n N] [-s SIZE] FILE... +Overwrite/delete FILEs + -f Chmod to ensure writability + -s SIZE Size to write + -n N Overwrite N times (default 3) + -z Final overwrite with zeros + -u Remove file +== sleep +Usage: sleep [N]... +Pause for a time equal to the total of the args given, where each arg can +have an optional suffix of (s)econds, (m)inutes, (h)ours, or (d)ays +== sort +Usage: sort [-nrughMcszbdfiokt] [-o FILE] [-k START[.OFS][OPTS][,END[.OFS][OPTS]] [-t CHAR] [FILE]... +Sort lines of text + -o FILE Output to FILE + -c Check whether input is sorted + -b Ignore leading blanks + -f Ignore case + -i Ignore unprintable characters + -d Dictionary order (blank or alphanumeric only) + -n Sort numbers + -g General numerical sort + -h Sort human readable numbers (2K 1G) + -M Sort month + -V Sort version + -t CHAR Field separator + -k N[,M] Sort by Nth field + -r Reverse sort order + -s Stable (don't sort ties alphabetically) + -u Suppress duplicate lines + -z NUL terminated input and output +== start-stop-daemon +Usage: start-stop-daemon -S|-K [OPTIONS] [-- ARGS] +Search for matching processes, and then +-S: start a process unless a matching process is found +-K: stop all matching processes +Process matching: + -u USERNAME|UID Match only this user's processes + -n NAME Match processes with NAME + in comm field in /proc/PID/stat + -x EXECUTABLE Match processes with this command + in /proc/PID/cmdline + -p FILE Match a process with PID from FILE + All specified conditions must match +-S only: + -x EXECUTABLE Program to run + -a NAME Zeroth argument + -b Background + -O FILE Append stdout and stderr to FILE + -N N Change nice level + -c USER[:[GRP]] Change user/group + -d DIR Change to DIR + -m Write PID to pidfile specified by -p +-K only: + -s SIG Signal to send + -t Match only, exit with 0 if found +Other: + -o Exit with status 0 if nothing is done + -v Verbose + -q Quiet +== strings +Usage: strings [-fo] [-t o|d|x] [-n LEN] [FILE]... +Display printable strings in a binary file + -f Precede strings with filenames + -o Precede strings with octal offsets + -t o|d|x Precede strings with offsets in base 8/10/16 + -n LEN At least LEN characters form a string (default 4) +== stty +Usage: stty [-a|g] [-F DEVICE] [SETTING]... +Without arguments, prints baud rate, line discipline, +and deviations from stty sane + -F DEVICE Open device instead of stdin + -a Print all current settings in human-readable form + -g Print in stty-readable form + [SETTING] See manpage +== su +Usage: su [-lmp] [-s SH] [-] [USER [FILE ARGS | -c 'CMD' [ARG0 ARGS]]] +Run shell under USER (by default, root) + -,-l Clear environment, go to home dir, run shell as login shell + -p,-m Do not set new $HOME, $SHELL, $USER, $LOGNAME + -c CMD Command to pass to 'sh -c' + -s SH Shell to use instead of user's default +== sulogin +Usage: sulogin [-t N] [TTY] +Single user login + -p Start a login shell + -t SEC Timeout +== svc +Usage: svc [-udopchaitkx] SERVICE_DIR... +Control services monitored by runsv supervisor + -u If service is not running, start it; restart if it stops + -d If service is running, send TERM+CONT signals; do not restart it + -o Once: if service is not running, start it; do not restart it + -pchaitk Send STOP, CONT, HUP, ALRM, INT, TERM, KILL signal to service + -x Exit: runsv will exit as soon as the service is down +== svok +Usage: svok SERVICE_DIR +Check whether runsv supervisor is running. +Exit code is 0 if it does, 100 if it does not, +111 (with error message) if SERVICE_DIR does not exist. +== swapoff +Usage: swapoff [-a] [DEVICE] +Stop swapping on DEVICE + -a Stop swapping on all swap devices +== swapon +Usage: swapon [-a] [-e] [DEVICE] +Start swapping on DEVICE + -a Start swapping on all swap devices + -e Silently skip devices that do not exist +== switch_root +Usage: switch_root [-c CONSOLE_DEV] NEW_ROOT NEW_INIT [ARGS] +Free initramfs and switch to another root fs: +chroot to NEW_ROOT, delete all in /, move NEW_ROOT to /, +execute NEW_INIT. PID must be 1. NEW_ROOT must be a mountpoint. + -c DEV Reopen stdio to DEV after switch +== sync +Usage: sync +Write all buffered blocks to disk +== sysctl +Usage: sysctl [-enq] { -a | -p [FILE]... | [-w] [KEY[=VALUE]]... } +Show/set kernel parameters + -e Don't warn about unknown keys + -n Don't show key names + -q Quiet + -a Show all values + -p Set values from FILEs (default /etc/sysctl.conf) + -w Set values +== syslogd +Usage: syslogd [OPTIONS] +System logging utility +(this version of syslogd ignores /etc/syslog.conf) + -n Run in foreground + -R HOST[:PORT] Log to HOST:PORT (default PORT:514) + -L Log locally and via network (default is network only if -R) + -O FILE Log to FILE (default: /var/log/messages, stdout if -) + -s SIZE Max size (KB) before rotation (default 200KB, 0=off) + -b N N rotated logs to keep (default 1, max 99, 0=purge) + -l N Log only messages more urgent than prio N (1-8) + -S Smaller output + -t Strip client-generated timestamps +== tail +Usage: tail [OPTIONS] [FILE]... +Print last 10 lines of FILEs (or stdin) to. +With more than one FILE, precede each with a filename header. + -c [+]N[bkm] Print last N bytes + -n N[bkm] Print last N lines + -n +N[bkm] Start on Nth line and print the rest + (b:*512 k:*1024 m:*1024^2) + -q Never print headers + -v Always print headers + -f Print data as file grows + -F Same as -f, but keep retrying + -s SECONDS Wait SECONDS between reads with -f +== tar +Usage: tar c|x|t [-ahvokO] [-f TARFILE] [-C DIR] [-T FILE] [-X FILE] [LONGOPT]... [FILE]... +Create, extract, or list files from a tar file + c Create + x Extract + t List + -f FILE Name of TARFILE ('-' for stdin/out) + -C DIR Change to DIR before operation + -v Verbose + -O Extract to stdout + -o Don't restore user:group + -k Don't replace existing files + -a (De)compress based on extension + -h Follow symlinks + -T FILE File with names to include + -X FILE File with glob patterns to exclude + --exclude PATTERN Glob pattern to exclude + --overwrite Replace existing files + --strip-components NUM NUM of leading components to strip + --no-recursion Don't descend in directories + --numeric-owner Use numeric user:group + --no-same-permissions Don't restore access permissions + --to-command COMMAND Pipe files to COMMAND +== tc +Usage: tc OBJECT CMD [dev STRING] +OBJECT: qdisc|class|filter +CMD: add|del|change|replace|show +qdisc [handle QHANDLE] [root|ingress|parent CLASSID] + [[QDISC_KIND] [help|OPTIONS]] + QDISC_KIND := [p|b]fifo|tbf|prio|cbq|red|etc. +qdisc show [dev STRING] [ingress] +class [classid CLASSID] [root|parent CLASSID] + [[QDISC_KIND] [help|OPTIONS] ] +class show [ dev STRING ] [root|parent CLASSID] +filter [pref PRIO] [protocol PROTO] + [root|classid CLASSID] [handle FILTERID] + [[FILTER_TYPE] [help|OPTIONS]] +filter show [dev STRING] [root|parent CLASSID] +== tee +Usage: tee [-ai] [FILE]... +Copy stdin to each FILE, and also to stdout + -a Append to the given FILEs, don't overwrite + -i Ignore interrupt signals (SIGINT) +== telnet +Usage: telnet [-a] [-l USER] HOST [PORT] +Connect to telnet server + -a Automatic login with $USER variable + -l USER Automatic login as USER +== telnetd +Usage: telnetd [OPTIONS] +Handle incoming telnet connections + -l LOGIN Exec LOGIN on connect + -f ISSUE_FILE Display ISSUE_FILE instead of /etc/issue + -K Close connection as soon as login exits + (normally wait until all programs close slave pty) + -p PORT Port to listen on. Default 23 + -b ADDR[:PORT] Address to bind to + -F Run in foreground + -i Inetd mode + -w SEC Inetd 'wait' mode, linger time SEC + inetd.conf line: 23 stream tcp wait root telnetd telnetd -w10 + -S Log to syslog (implied by -i or without -F and -w) +== test +== tftp +Usage: tftp [OPTIONS] HOST [PORT] +Transfer a file from/to tftp server + -l FILE Local FILE + -r FILE Remote FILE + -g Get file + -p Put file + -b SIZE Transfer blocks in bytes +== time +Usage: time [-vpa] [-o FILE] PROG ARGS +Run PROG, display resource usage when it exits + -v Verbose + -p POSIX output format + -f FMT Custom format + -o FILE Write result to FILE + -a Append (else overwrite) +== top +Usage: top [-b] [-n COUNT] [-d SECONDS] +Show a view of process activity in real time. +Read the status of all processes from /proc each SECONDS +and show a screenful of them. +Keys: + N/M/P/T: sort by pid/mem/cpu/time + R: reverse sort + Q,^C: exit +Options: + -b Batch mode + -n N Exit after N iterations + -d SEC Delay between updates +== touch +Usage: touch [-cham] [-d DATE] [-t DATE] [-r FILE] FILE... +Update mtime of FILEs + -c Don't create files + -h Don't follow links + -a Change only atime + -m Change only mtime + -d DT Date/time to use + -t DT Date/time to use + -r FILE Use FILE's date/time +== tr +Usage: tr [-cds] STRING1 [STRING2] +Translate, squeeze, or delete characters from stdin, writing to stdout + -c Take complement of STRING1 + -d Delete input characters coded STRING1 + -s Squeeze multiple output characters of STRING2 into one character +== traceroute +Usage: traceroute [-Flnrv] [-f 1ST_TTL] [-m MAXTTL] [-q PROBES] [-p PORT] + [-t TOS] [-w WAIT_SEC] [-s SRC_IP] [-i IFACE] + [-z PAUSE_MSEC] HOST [BYTES] +Trace the route to HOST + -F Set don't fragment bit + -l Display TTL value of the returned packet + -n Print numeric addresses + -r Bypass routing tables, send directly to HOST + -f N First number of hops (default 1) + -m N Max number of hops + -q N Number of probes per hop (default 3) + -p N Base UDP port number used in probes + (default 33434) + -s IP Source address + -i IFACE Source interface + -t N Type-of-service in probe packets (default 0) + -w SEC Wait for a response (default 3) + -z MSEC Wait before each send +== tree +No help available +== true +== truncate +Usage: truncate [-c] -s SIZE FILE... +Truncate FILEs to SIZE + -c Do not create files + -s SIZE +== ts +Usage: ts [-is] [STRFTIME] +Pipe stdin to stdout, add timestamp to each line + -s Time since start + -i Time since previous line +== tsort +Usage: tsort [FILE] +Topological sort +== tty +Usage: tty [-s] +Print file name of stdin's terminal + -s Print nothing, only return exit status +== ubirename +Usage: ubirename UBI_DEVICE OLD_VOLNAME NEW_VOLNAME [OLD2 NEW2]... +Rename UBI volumes on UBI_DEVICE +== udhcpc +Usage: udhcpc [-fbqRB] [-a[MSEC]] [-t N] [-T SEC] [-A SEC|-n] + [-i IFACE] [-s PROG] [-p PIDFILE] + [-oC] [-r IP] [-V VENDOR] [-F NAME] [-x OPT:VAL]... [-O OPT]... + -i IFACE Interface to use (default eth0) + -s PROG Run PROG at DHCP events (default /usr/share/udhcpc/default.script) + -p FILE Create pidfile + -B Request broadcast replies + -t N Send up to N discover packets (default 3) + -T SEC Pause between packets (default 3) + -A SEC Wait if lease is not obtained (default 20) + -b Background if lease is not obtained + -n Exit if lease is not obtained + -q Exit after obtaining lease + -R Release IP on exit + -f Run in foreground + -S Log to syslog too + -a[MSEC] Validate offered address with ARP ping + -r IP Request this IP address + -o Don't request any options (unless -O is given) + -O OPT Request option OPT from server (cumulative) + -x OPT:VAL Include option OPT in sent packets (cumulative) + Examples of string, numeric, and hex byte opts: + -x hostname:bbox - option 12 + -x lease:3600 - option 51 (lease time) + -x 0x3d:0100BEEFC0FFEE - option 61 (client id) + -x 14:'"dumpfile"' - option 14 (shell-quoted) + -F NAME Ask server to update DNS mapping for NAME + -V VENDOR Vendor identifier (default 'udhcp VERSION') + -C Don't send MAC as client identifier +Signals: + USR1 Renew lease + USR2 Release lease +== uevent +Usage: uevent [PROG ARGS] +uevent runs PROG for every netlink notification. +PROG's environment contains data passed from the kernel. +Typical usage (daemon for dynamic device node creation): + # uevent mdev & mdev -s +== umount +Usage: umount [-rlfda] [-t FSTYPE] FILESYSTEM|DIRECTORY +Unmount filesystems + -a Unmount all filesystems + -r Remount devices read-only if mount is busy + -l Lazy umount (detach filesystem) + -f Force umount (i.e., unreachable NFS server) + -d Free loop device if it has been used + -t FSTYPE[,...] Unmount only these filesystem type(s) +== uname +Usage: uname [-amnrspvio] +Print system information + -a Print all + -m Machine (hardware) type + -n Hostname + -r Kernel release + -s Kernel name (default) + -p Processor type + -v Kernel version + -i Hardware platform + -o OS name +== uniq +Usage: uniq [-cduiz] [-f,s,w N] [FILE [OUTFILE]] +Discard duplicate lines + -c Prefix lines by the number of occurrences + -d Only print duplicate lines + -u Only print unique lines + -i Ignore case + -z NUL terminated output + -f N Skip first N fields + -s N Skip first N chars (after any skipped fields) + -w N Compare N characters in line +== unix2dos +Usage: unix2dos [-ud] [FILE] +Convert FILE in-place from Unix to DOS format. +When no file is given, use stdin/stdout. + -u dos2unix + -d unix2dos +== unlink +Usage: unlink FILE +Delete FILE by calling unlink() +== unlzma +Usage: unlzma [-cfk] [FILE]... +Decompress FILEs (or stdin) + -c Write to stdout + -f Force + -k Keep input files + -t Test integrity +== unlzop +Usage: unlzop [-cfUvF] [FILE]... + -c Write to stdout + -f Force + -U Delete input files + -t Test integrity + -v Verbose + -F Don't verify checksum +== unxz +Usage: unxz [-cfk] [FILE]... +Decompress FILEs (or stdin) + -c Write to stdout + -f Force + -k Keep input files + -t Test integrity +== unzip +Usage: unzip [-lnojpqK] FILE[.zip] [FILE]... [-x FILE]... [-d DIR] +Extract FILEs from ZIP archive + -l List contents (with -q for short form) + -n Never overwrite files (default: ask) + -o Overwrite + -j Do not restore paths + -p Write to stdout + -t Test + -q Quiet + -K Do not clear SUID bit + -x FILE Exclude FILEs + -d DIR Extract into DIR +== uptime +Usage: uptime +Display the time since the last boot +== usleep +Usage: usleep N +Pause for N microseconds +== uudecode +Usage: uudecode [-o OUTFILE] [INFILE] +Uudecode a file +Finds OUTFILE in uuencoded source unless -o is given +== uuencode +Usage: uuencode [-m] [FILE] STORED_FILENAME +Uuencode FILE (or stdin) to stdout + -m Use base64 encoding per RFC1521 +== vconfig +Usage: vconfig COMMAND [OPTIONS] +Create and remove virtual ethernet devices + add IFACE VLAN_ID + rem VLAN_NAME + set_flag IFACE 0|1 VLAN_QOS + set_egress_map VLAN_NAME SKB_PRIO VLAN_QOS + set_ingress_map VLAN_NAME SKB_PRIO VLAN_QOS + set_name_type NAME_TYPE +== vi +Usage: vi [-c CMD] [-R] [-H] [FILE]... +Edit FILE + -c CMD Initial command to run ($EXINIT and ~/.exrc also available) + -R Read-only + -H List available features +== vlock +Usage: vlock [-a] +Lock a virtual terminal. A password is required to unlock. + -a Lock all VTs +== w +Usage: w +Show who is logged on +== watch +Usage: watch [-n SEC] [-t] PROG ARGS +Run PROG periodically + -n SEC Period (default 2) + -t Don't print header +== watchdog +Usage: watchdog [-t N[ms]] [-T N[ms]] [-F] DEV +Periodically write to watchdog device DEV + -T N Reboot after N seconds if not reset (default 60) + -t N Reset every N seconds (default 30) + -F Run in foreground +Use 500ms to specify period in milliseconds +== wc +Usage: wc [-clwL] [FILE]... +Count lines, words, and bytes for FILEs (or stdin) + -c Count bytes + -l Count newlines + -w Count words + -L Print longest line length +== wget +Usage: wget [-cqS] [--spider] [-O FILE] [-o LOGFILE] [--header STR] + [--post-data STR | --post-file FILE] [-Y on/off] + [-P DIR] [-U AGENT] [-T SEC] URL... +Retrieve files via HTTP or FTP + --spider Only check URL existence: $? is 0 if exists + --header STR Add STR (of form 'header: value') to headers + --post-data STR Send STR using POST method + --post-file FILE Send FILE using POST method + -c Continue retrieval of aborted transfer + -q Quiet + -P DIR Save to DIR (default .) + -S Show server response + -T SEC Network read timeout is SEC seconds + -O FILE Save to FILE ('-' for stdout) + -o LOGFILE Log messages to FILE + -U STR Use STR for User-Agent header + -Y on/off Use proxy +== which +Usage: which [-a] COMMAND... +Locate COMMAND + -a Show all matches +== who +Usage: who [-aH] +Show who is logged on + -a Show all + -H Print column headers +== whoami +Usage: whoami +Print the user name associated with the current effective user id +== xargs +Usage: xargs [OPTIONS] [PROG ARGS] +Run PROG on every item given by stdin + -0 NUL terminated input + -a FILE Read from FILE instead of stdin + -o Reopen stdin as /dev/tty + -r Don't run command if input is empty + -t Print the command on stderr before execution + -E STR,-e[STR] STR stops input processing + -I STR Replace STR within PROG ARGS with input line + -n N Pass no more than N args to PROG + -s N Pass command line of no more than N bytes + -P N Run up to N PROGs in parallel + -x Exit if size is exceeded +== xxd +Usage: xxd [-pri] [-g N] [-c N] [-l LEN] [-s OFS] [-o OFS] [FILE] +Hex dump FILE (or stdin) + -g N Bytes per group + -c N Bytes per line + -p Show only hex bytes, assumes -c30 + -i C include file style + -l LENGTH Show only first LENGTH bytes + -s OFFSET Skip OFFSET bytes + -o OFFSET Add OFFSET to displayed offset + -r Reverse (with -p, assumes no offsets in input) +== xz +Usage: xz -d [-cfk] [FILE]... +Decompress FILEs (or stdin) + -d Decompress + -c Write to stdout + -f Force + -k Keep input files + -t Test integrity +== xzcat +Usage: xzcat [FILE]... +Decompress to stdout +== yes +Usage: yes [STRING] +Repeatedly print a line with STRING, or 'y' +== zcat +Usage: zcat [FILE]... +Decompress to stdout diff --git a/qemu/busybox/panel.config b/qemu/busybox/panel.config new file mode 100644 index 0000000..c46d4f2 --- /dev/null +++ b/qemu/busybox/panel.config @@ -0,0 +1,1231 @@ +# +# Automatically generated make config: don't edit +# Busybox version: 1.37.0 +# (time stamp dropped: see qemu/busybox/README.md) +# +CONFIG_HAVE_DOT_CONFIG=y + +# +# Settings +# +CONFIG_DESKTOP=y +# CONFIG_EXTRA_COMPAT is not set +# CONFIG_FEDORA_COMPAT is not set +CONFIG_INCLUDE_SUSv2=y +CONFIG_LONG_OPTS=y +CONFIG_SHOW_USAGE=y +CONFIG_FEATURE_VERBOSE_USAGE=y +# CONFIG_FEATURE_COMPRESS_USAGE is not set +CONFIG_LFS=y +CONFIG_TIME64=y +# CONFIG_PAM is not set +CONFIG_FEATURE_DEVPTS=y +CONFIG_FEATURE_UTMP=y +CONFIG_FEATURE_WTMP=y +# CONFIG_FEATURE_PIDFILE is not set +CONFIG_PID_FILE_PATH="" +CONFIG_BUSYBOX=y +CONFIG_FEATURE_SHOW_SCRIPT=y +CONFIG_FEATURE_INSTALLER=y +# CONFIG_INSTALL_NO_USR is not set +CONFIG_FEATURE_SUID=y +# CONFIG_FEATURE_SUID_CONFIG is not set +# CONFIG_FEATURE_SUID_CONFIG_QUIET is not set +# CONFIG_FEATURE_PREFER_APPLETS is not set +CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe" +# CONFIG_SELINUX is not set +# CONFIG_FEATURE_CLEAN_UP is not set +CONFIG_FEATURE_SYSLOG_INFO=y +CONFIG_FEATURE_SYSLOG=y + +# +# Build Options +# +# CONFIG_STATIC is not set +# CONFIG_PIE is not set +# CONFIG_NOMMU is not set +# CONFIG_BUILD_LIBBUSYBOX is not set +# CONFIG_FEATURE_LIBBUSYBOX_STATIC is not set +# CONFIG_FEATURE_INDIVIDUAL is not set +# CONFIG_FEATURE_SHARED_BUSYBOX is not set +CONFIG_CROSS_COMPILER_PREFIX="" +CONFIG_SYSROOT="" +CONFIG_EXTRA_CFLAGS="" +CONFIG_EXTRA_LDFLAGS="" +CONFIG_EXTRA_LDLIBS="" +# CONFIG_USE_PORTABLE_CODE is not set +# CONFIG_STACK_OPTIMIZATION_386 is not set +CONFIG_STATIC_LIBGCC=y + +# +# Installation Options ("make install" behavior) +# +CONFIG_INSTALL_APPLET_SYMLINKS=y +# CONFIG_INSTALL_APPLET_HARDLINKS is not set +# CONFIG_INSTALL_APPLET_SCRIPT_WRAPPERS is not set +# CONFIG_INSTALL_APPLET_DONT is not set +# CONFIG_INSTALL_SH_APPLET_SYMLINK is not set +# CONFIG_INSTALL_SH_APPLET_HARDLINK is not set +# CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER is not set +CONFIG_PREFIX="./_install" + +# +# Debugging Options +# +# CONFIG_DEBUG is not set +# CONFIG_DEBUG_PESSIMIZE is not set +# CONFIG_DEBUG_SANITIZE is not set +# CONFIG_UNIT_TEST is not set +# CONFIG_WERROR is not set +# CONFIG_WARN_SIMPLE_MSG is not set +CONFIG_NO_DEBUG_LIB=y +# CONFIG_DMALLOC is not set +# CONFIG_EFENCE is not set + +# +# Library Tuning +# +# CONFIG_FEATURE_USE_BSS_TAIL is not set +CONFIG_FLOAT_DURATION=y +CONFIG_FEATURE_RTMINMAX=y +CONFIG_FEATURE_RTMINMAX_USE_LIBC_DEFINITIONS=y +CONFIG_FEATURE_BUFFERS_USE_MALLOC=y +# CONFIG_FEATURE_BUFFERS_GO_ON_STACK is not set +# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set +CONFIG_PASSWORD_MINLEN=6 +CONFIG_MD5_SMALL=1 +CONFIG_SHA1_SMALL=3 +CONFIG_SHA1_HWACCEL=y +CONFIG_SHA256_HWACCEL=y +CONFIG_SHA3_SMALL=1 +CONFIG_FEATURE_NON_POSIX_CP=y +# CONFIG_FEATURE_VERBOSE_CP_MESSAGE is not set +CONFIG_FEATURE_USE_SENDFILE=y +CONFIG_FEATURE_COPYBUF_KB=4 +CONFIG_MONOTONIC_SYSCALL=y +CONFIG_IOCTL_HEX2STR_ERROR=y +CONFIG_FEATURE_EDITING=y +CONFIG_FEATURE_EDITING_MAX_LEN=1024 +CONFIG_FEATURE_EDITING_VI=y +CONFIG_FEATURE_EDITING_HISTORY=999 +CONFIG_FEATURE_EDITING_SAVEHISTORY=y +# CONFIG_FEATURE_EDITING_SAVE_ON_EXIT is not set +CONFIG_FEATURE_REVERSE_SEARCH=y +CONFIG_FEATURE_TAB_COMPLETION=y +# CONFIG_FEATURE_USERNAME_COMPLETION is not set +CONFIG_FEATURE_EDITING_FANCY_PROMPT=y +CONFIG_FEATURE_EDITING_WINCH=y +# CONFIG_FEATURE_EDITING_ASK_TERMINAL is not set +# CONFIG_LOCALE_SUPPORT is not set +# CONFIG_UNICODE_SUPPORT is not set +# CONFIG_UNICODE_USING_LOCALE is not set +# CONFIG_FEATURE_CHECK_UNICODE_IN_ENV is not set +CONFIG_SUBST_WCHAR=0 +CONFIG_LAST_SUPPORTED_WCHAR=0 +# CONFIG_UNICODE_COMBINING_WCHARS is not set +# CONFIG_UNICODE_WIDE_WCHARS is not set +# CONFIG_UNICODE_BIDI_SUPPORT is not set +# CONFIG_UNICODE_NEUTRAL_TABLE is not set +# CONFIG_UNICODE_PRESERVE_BROKEN is not set +# CONFIG_LOOP_CONFIGURE is not set +# CONFIG_NO_LOOP_CONFIGURE is not set +CONFIG_TRY_LOOP_CONFIGURE=y + +# +# Applets +# + +# +# Archival Utilities +# +# CONFIG_FEATURE_SEAMLESS_XZ is not set +# CONFIG_FEATURE_SEAMLESS_LZMA is not set +# CONFIG_FEATURE_SEAMLESS_BZ2 is not set +# CONFIG_FEATURE_SEAMLESS_GZ is not set +# CONFIG_FEATURE_SEAMLESS_Z is not set +CONFIG_AR=y +# CONFIG_FEATURE_AR_LONG_FILENAMES is not set +CONFIG_FEATURE_AR_CREATE=y +# CONFIG_UNCOMPRESS is not set +CONFIG_GUNZIP=y +CONFIG_ZCAT=y +CONFIG_FEATURE_GUNZIP_LONG_OPTIONS=y +CONFIG_BUNZIP2=y +CONFIG_BZCAT=y +CONFIG_UNLZMA=y +CONFIG_LZCAT=y +CONFIG_LZMA=y +CONFIG_UNXZ=y +CONFIG_XZCAT=y +CONFIG_XZ=y +# CONFIG_BZIP2 is not set +CONFIG_BZIP2_SMALL=0 +CONFIG_FEATURE_BZIP2_DECOMPRESS=y +CONFIG_CPIO=y +# CONFIG_FEATURE_CPIO_O is not set +# CONFIG_FEATURE_CPIO_P is not set +# CONFIG_FEATURE_CPIO_IGNORE_DEVNO is not set +# CONFIG_FEATURE_CPIO_RENUMBER_INODES is not set +# CONFIG_DPKG is not set +# CONFIG_DPKG_DEB is not set +CONFIG_GZIP=y +# CONFIG_FEATURE_GZIP_LONG_OPTIONS is not set +CONFIG_GZIP_FAST=0 +# CONFIG_FEATURE_GZIP_LEVELS is not set +CONFIG_FEATURE_GZIP_DECOMPRESS=y +# CONFIG_LZOP is not set +CONFIG_UNLZOP=y +CONFIG_LZOPCAT=y +# CONFIG_LZOP_COMPR_HIGH is not set +# CONFIG_RPM is not set +# CONFIG_RPM2CPIO is not set +CONFIG_TAR=y +CONFIG_FEATURE_TAR_LONG_OPTIONS=y +CONFIG_FEATURE_TAR_CREATE=y +# CONFIG_FEATURE_TAR_AUTODETECT is not set +CONFIG_FEATURE_TAR_FROM=y +# CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY is not set +# CONFIG_FEATURE_TAR_OLDSUN_COMPATIBILITY is not set +CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y +CONFIG_FEATURE_TAR_TO_COMMAND=y +# CONFIG_FEATURE_TAR_UNAME_GNAME is not set +# CONFIG_FEATURE_TAR_NOPRESERVE_TIME is not set +# CONFIG_FEATURE_TAR_SELINUX is not set +CONFIG_UNZIP=y +CONFIG_FEATURE_UNZIP_CDF=y +CONFIG_FEATURE_UNZIP_BZIP2=y +CONFIG_FEATURE_UNZIP_LZMA=y +CONFIG_FEATURE_UNZIP_XZ=y +# CONFIG_FEATURE_LZMA_FAST is not set + +# +# Coreutils +# +CONFIG_FEATURE_VERBOSE=y + +# +# Common options for date and touch +# +CONFIG_FEATURE_TIMEZONE=y + +# +# Common options for cp and mv +# +CONFIG_FEATURE_PRESERVE_HARDLINKS=y + +# +# Common options for df, du, ls +# +CONFIG_FEATURE_HUMAN_READABLE=y +CONFIG_BASENAME=y +CONFIG_CAT=y +CONFIG_FEATURE_CATN=y +CONFIG_FEATURE_CATV=y +CONFIG_CHGRP=y +CONFIG_CHMOD=y +CONFIG_CHOWN=y +# CONFIG_FEATURE_CHOWN_LONG_OPTIONS is not set +CONFIG_CHROOT=y +CONFIG_CKSUM=y +CONFIG_CRC32=y +# CONFIG_COMM is not set +CONFIG_CP=y +# CONFIG_FEATURE_CP_LONG_OPTIONS is not set +# CONFIG_FEATURE_CP_REFLINK is not set +CONFIG_CUT=y +CONFIG_FEATURE_CUT_REGEX=y +CONFIG_DATE=y +CONFIG_FEATURE_DATE_ISOFMT=y +# CONFIG_FEATURE_DATE_NANO is not set +CONFIG_FEATURE_DATE_COMPAT=y +CONFIG_DD=y +CONFIG_FEATURE_DD_SIGNAL_HANDLING=y +# CONFIG_FEATURE_DD_THIRD_STATUS_LINE is not set +CONFIG_FEATURE_DD_IBS_OBS=y +CONFIG_FEATURE_DD_STATUS=y +CONFIG_DF=y +# CONFIG_FEATURE_DF_FANCY is not set +CONFIG_FEATURE_SKIP_ROOTFS=y +CONFIG_DIRNAME=y +CONFIG_DOS2UNIX=y +CONFIG_UNIX2DOS=y +CONFIG_DU=y +CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K=y +CONFIG_ECHO=y +CONFIG_FEATURE_FANCY_ECHO=y +CONFIG_ENV=y +# CONFIG_EXPAND is not set +# CONFIG_UNEXPAND is not set +CONFIG_EXPR=y +CONFIG_EXPR_MATH_SUPPORT_64=y +CONFIG_FACTOR=y +CONFIG_FALSE=y +CONFIG_FOLD=y +CONFIG_HEAD=y +CONFIG_FEATURE_FANCY_HEAD=y +CONFIG_HOSTID=y +CONFIG_ID=y +# CONFIG_GROUPS is not set +CONFIG_INSTALL=y +CONFIG_FEATURE_INSTALL_LONG_OPTIONS=y +CONFIG_LINK=y +CONFIG_LN=y +CONFIG_LOGNAME=y +CONFIG_LS=y +CONFIG_FEATURE_LS_FILETYPES=y +CONFIG_FEATURE_LS_FOLLOWLINKS=y +CONFIG_FEATURE_LS_RECURSIVE=y +CONFIG_FEATURE_LS_WIDTH=y +CONFIG_FEATURE_LS_SORTFILES=y +CONFIG_FEATURE_LS_TIMESTAMPS=y +CONFIG_FEATURE_LS_USERNAME=y +CONFIG_FEATURE_LS_COLOR=y +CONFIG_FEATURE_LS_COLOR_IS_DEFAULT=y +CONFIG_MD5SUM=y +CONFIG_SHA1SUM=y +CONFIG_SHA256SUM=y +CONFIG_SHA512SUM=y +CONFIG_SHA3SUM=y + +# +# Common options for md5sum, sha1sum, sha256sum, sha512sum, sha3sum +# +CONFIG_FEATURE_MD5_SHA1_SUM_CHECK=y +CONFIG_MKDIR=y +CONFIG_MKFIFO=y +CONFIG_MKNOD=y +CONFIG_MKTEMP=y +CONFIG_MV=y +CONFIG_NICE=y +CONFIG_NL=y +CONFIG_NOHUP=y +CONFIG_NPROC=y +CONFIG_OD=y +CONFIG_PASTE=y +CONFIG_PRINTENV=y +CONFIG_PRINTF=y +CONFIG_PWD=y +CONFIG_READLINK=y +CONFIG_FEATURE_READLINK_FOLLOW=y +CONFIG_REALPATH=y +CONFIG_RM=y +CONFIG_RMDIR=y +CONFIG_SEQ=y +CONFIG_SHRED=y +# CONFIG_SHUF is not set +CONFIG_SLEEP=y +CONFIG_FEATURE_FANCY_SLEEP=y +CONFIG_SORT=y +CONFIG_FEATURE_SORT_BIG=y +# CONFIG_FEATURE_SORT_OPTIMIZE_MEMORY is not set +# CONFIG_SPLIT is not set +# CONFIG_FEATURE_SPLIT_FANCY is not set +# CONFIG_STAT is not set +# CONFIG_FEATURE_STAT_FORMAT is not set +# CONFIG_FEATURE_STAT_FILESYSTEM is not set +CONFIG_STTY=y +# CONFIG_SUM is not set +CONFIG_SYNC=y +# CONFIG_FEATURE_SYNC_FANCY is not set +# CONFIG_FSYNC is not set +# CONFIG_TAC is not set +CONFIG_TAIL=y +CONFIG_FEATURE_FANCY_TAIL=y +CONFIG_TEE=y +CONFIG_FEATURE_TEE_USE_BLOCK_IO=y +CONFIG_TEST=y +CONFIG_TEST1=y +CONFIG_TEST2=y +CONFIG_FEATURE_TEST_64=y +# CONFIG_TIMEOUT is not set +CONFIG_TOUCH=y +CONFIG_FEATURE_TOUCH_SUSV3=y +CONFIG_TR=y +CONFIG_FEATURE_TR_CLASSES=y +CONFIG_FEATURE_TR_EQUIV=y +CONFIG_TRUE=y +CONFIG_TRUNCATE=y +CONFIG_TSORT=y +CONFIG_TTY=y +CONFIG_UNAME=y +CONFIG_UNAME_OSNAME="GNU/Linux" +CONFIG_BB_ARCH=y +CONFIG_UNIQ=y +CONFIG_UNLINK=y +CONFIG_USLEEP=y +CONFIG_UUDECODE=y +CONFIG_BASE32=y +CONFIG_BASE64=y +CONFIG_UUENCODE=y +CONFIG_WC=y +# CONFIG_FEATURE_WC_LARGE is not set +CONFIG_WHO=y +CONFIG_W=y +# CONFIG_USERS is not set +CONFIG_WHOAMI=y +CONFIG_YES=y + +# +# Console Utilities +# +CONFIG_CHVT=y +CONFIG_CLEAR=y +CONFIG_DEALLOCVT=y +CONFIG_DUMPKMAP=y +# CONFIG_FGCONSOLE is not set +# CONFIG_KBD_MODE is not set +CONFIG_LOADFONT=y +# CONFIG_SETFONT is not set +# CONFIG_FEATURE_SETFONT_TEXTUAL_MAP is not set +CONFIG_DEFAULT_SETFONT_DIR="" + +# +# Common options for loadfont and setfont +# +CONFIG_FEATURE_LOADFONT_PSF2=y +CONFIG_FEATURE_LOADFONT_RAW=y +CONFIG_LOADKMAP=y +CONFIG_OPENVT=y +CONFIG_RESET=y +CONFIG_RESIZE=y +CONFIG_FEATURE_RESIZE_PRINT=y +CONFIG_SETCONSOLE=y +# CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS is not set +CONFIG_SETKEYCODES=y +CONFIG_SETLOGCONS=y +# CONFIG_SHOWKEY is not set + +# +# Debian Utilities +# +CONFIG_PIPE_PROGRESS=y +CONFIG_RUN_PARTS=y +CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS=y +# CONFIG_FEATURE_RUN_PARTS_FANCY is not set +CONFIG_START_STOP_DAEMON=y +CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS=y +CONFIG_FEATURE_START_STOP_DAEMON_FANCY=y +CONFIG_WHICH=y + +# +# klibc-utils +# +# CONFIG_MINIPS is not set +CONFIG_NUKE=y +CONFIG_RESUME=y +CONFIG_RUN_INIT=y + +# +# Editors +# +CONFIG_AWK=y +# CONFIG_FEATURE_AWK_LIBM is not set +CONFIG_FEATURE_AWK_GNU_EXTENSIONS=y +CONFIG_CMP=y +CONFIG_DIFF=y +# CONFIG_FEATURE_DIFF_LONG_OPTIONS is not set +CONFIG_FEATURE_DIFF_DIR=y +# CONFIG_ED is not set +CONFIG_PATCH=y +CONFIG_SED=y +CONFIG_VI=y +CONFIG_FEATURE_VI_MAX_LEN=4096 +CONFIG_FEATURE_VI_8BIT=y +CONFIG_FEATURE_VI_COLON=y +CONFIG_FEATURE_VI_COLON_EXPAND=y +CONFIG_FEATURE_VI_YANKMARK=y +CONFIG_FEATURE_VI_SEARCH=y +# CONFIG_FEATURE_VI_REGEX_SEARCH is not set +CONFIG_FEATURE_VI_USE_SIGNALS=y +CONFIG_FEATURE_VI_DOT_CMD=y +CONFIG_FEATURE_VI_READONLY=y +CONFIG_FEATURE_VI_SETOPTS=y +CONFIG_FEATURE_VI_SET=y +CONFIG_FEATURE_VI_WIN_RESIZE=y +CONFIG_FEATURE_VI_ASK_TERMINAL=y +CONFIG_FEATURE_VI_UNDO=y +CONFIG_FEATURE_VI_UNDO_QUEUE=y +CONFIG_FEATURE_VI_UNDO_QUEUE_MAX=256 +CONFIG_FEATURE_VI_VERBOSE_STATUS=y +CONFIG_FEATURE_ALLOW_EXEC=y + +# +# Finding Utilities +# +CONFIG_FIND=y +CONFIG_FEATURE_FIND_PRINT0=y +CONFIG_FEATURE_FIND_MTIME=y +CONFIG_FEATURE_FIND_ATIME=y +CONFIG_FEATURE_FIND_CTIME=y +CONFIG_FEATURE_FIND_MMIN=y +CONFIG_FEATURE_FIND_AMIN=y +CONFIG_FEATURE_FIND_CMIN=y +CONFIG_FEATURE_FIND_PERM=y +CONFIG_FEATURE_FIND_TYPE=y +CONFIG_FEATURE_FIND_EXECUTABLE=y +CONFIG_FEATURE_FIND_XDEV=y +CONFIG_FEATURE_FIND_MAXDEPTH=y +CONFIG_FEATURE_FIND_NEWER=y +# CONFIG_FEATURE_FIND_INUM is not set +CONFIG_FEATURE_FIND_SAMEFILE=y +CONFIG_FEATURE_FIND_EXEC=y +CONFIG_FEATURE_FIND_EXEC_PLUS=y +CONFIG_FEATURE_FIND_EXEC_OK=y +CONFIG_FEATURE_FIND_USER=y +CONFIG_FEATURE_FIND_GROUP=y +CONFIG_FEATURE_FIND_NOT=y +CONFIG_FEATURE_FIND_DEPTH=y +CONFIG_FEATURE_FIND_PAREN=y +CONFIG_FEATURE_FIND_SIZE=y +CONFIG_FEATURE_FIND_PRUNE=y +CONFIG_FEATURE_FIND_QUIT=y +# CONFIG_FEATURE_FIND_DELETE is not set +CONFIG_FEATURE_FIND_EMPTY=y +CONFIG_FEATURE_FIND_PATH=y +CONFIG_FEATURE_FIND_REGEX=y +# CONFIG_FEATURE_FIND_CONTEXT is not set +# CONFIG_FEATURE_FIND_LINKS is not set +CONFIG_GREP=y +CONFIG_EGREP=y +CONFIG_FGREP=y +CONFIG_FEATURE_GREP_CONTEXT=y +CONFIG_XARGS=y +# CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION is not set +CONFIG_FEATURE_XARGS_SUPPORT_QUOTES=y +CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT=y +CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM=y +CONFIG_FEATURE_XARGS_SUPPORT_REPL_STR=y +CONFIG_FEATURE_XARGS_SUPPORT_PARALLEL=y +CONFIG_FEATURE_XARGS_SUPPORT_ARGS_FILE=y + +# +# Init Utilities +# +# CONFIG_BOOTCHARTD is not set +# CONFIG_FEATURE_BOOTCHARTD_BLOATED_HEADER is not set +# CONFIG_FEATURE_BOOTCHARTD_CONFIG_FILE is not set +CONFIG_HALT=y +CONFIG_POWEROFF=y +CONFIG_REBOOT=y +CONFIG_FEATURE_WAIT_FOR_INIT=y +# CONFIG_FEATURE_CALL_TELINIT is not set +CONFIG_TELINIT_PATH="" +CONFIG_INIT=y +CONFIG_LINUXRC=y +CONFIG_FEATURE_USE_INITTAB=y +CONFIG_FEATURE_KILL_REMOVED=y +CONFIG_FEATURE_KILL_DELAY=0 +CONFIG_FEATURE_INIT_SCTTY=y +CONFIG_FEATURE_INIT_SYSLOG=y +CONFIG_FEATURE_INIT_QUIET=y +# CONFIG_FEATURE_INIT_COREDUMPS is not set +CONFIG_INIT_TERMINAL_TYPE="linux" +CONFIG_FEATURE_INIT_MODIFY_CMDLINE=y + +# +# Login/Password Management Utilities +# +CONFIG_FEATURE_SHADOWPASSWDS=y +# CONFIG_USE_BB_PWD_GRP is not set +# CONFIG_USE_BB_SHADOW is not set +CONFIG_USE_BB_CRYPT=y +CONFIG_USE_BB_CRYPT_SHA=y +# CONFIG_ADD_SHELL is not set +# CONFIG_REMOVE_SHELL is not set +CONFIG_ADDGROUP=y +# CONFIG_FEATURE_ADDUSER_TO_GROUP is not set +CONFIG_ADDUSER=y +# CONFIG_FEATURE_CHECK_NAMES is not set +CONFIG_LAST_ID=60000 +CONFIG_FIRST_SYSTEM_ID=100 +CONFIG_LAST_SYSTEM_ID=999 +# CONFIG_CHPASSWD is not set +CONFIG_FEATURE_DEFAULT_PASSWD_ALGO="md5" +# CONFIG_CRYPTPW is not set +CONFIG_MKPASSWD=y +CONFIG_DELUSER=y +CONFIG_DELGROUP=y +# CONFIG_FEATURE_DEL_USER_FROM_GROUP is not set +CONFIG_GETTY=y +CONFIG_LOGIN=y +# CONFIG_LOGIN_SESSION_AS_CHILD is not set +# CONFIG_LOGIN_SCRIPTS is not set +CONFIG_FEATURE_NOLOGIN=y +CONFIG_FEATURE_SECURETTY=y +CONFIG_PASSWD=y +CONFIG_FEATURE_PASSWD_WEAK_CHECK=y +CONFIG_SU=y +CONFIG_FEATURE_SU_SYSLOG=y +CONFIG_FEATURE_SU_CHECKS_SHELLS=y +# CONFIG_FEATURE_SU_BLANK_PW_NEEDS_SECURE_TTY is not set +CONFIG_SULOGIN=y +CONFIG_VLOCK=y + +# +# Linux Ext2 FS Progs +# +CONFIG_CHATTR=y +CONFIG_FSCK=y +CONFIG_LSATTR=y +# CONFIG_TUNE2FS is not set + +# +# Linux Module Utilities +# +# CONFIG_MODPROBE_SMALL is not set +# CONFIG_DEPMOD is not set +CONFIG_INSMOD=y +CONFIG_LSMOD=y +CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT=y +# CONFIG_MODINFO is not set +CONFIG_MODPROBE=y +# CONFIG_FEATURE_MODPROBE_BLACKLIST is not set +CONFIG_RMMOD=y + +# +# Options common to multiple modutils +# +CONFIG_FEATURE_CMDLINE_MODULE_OPTIONS=y +# CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED is not set +# CONFIG_FEATURE_2_4_MODULES is not set +# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set +# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set +# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set +# CONFIG_FEATURE_INSMOD_LOAD_MAP is not set +# CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL is not set +CONFIG_FEATURE_CHECK_TAINTED_MODULE=y +# CONFIG_FEATURE_INSMOD_TRY_MMAP is not set +CONFIG_FEATURE_MODUTILS_ALIAS=y +CONFIG_FEATURE_MODUTILS_SYMBOLS=y +CONFIG_DEFAULT_MODULES_DIR="/lib/modules" +CONFIG_DEFAULT_DEPMOD_FILE="modules.dep" + +# +# Linux System Utilities +# +# CONFIG_ACPID is not set +# CONFIG_FEATURE_ACPID_COMPAT is not set +# CONFIG_BLKDISCARD is not set +CONFIG_BLKID=y +# CONFIG_FEATURE_BLKID_TYPE is not set +# CONFIG_BLOCKDEV is not set +# CONFIG_CAL is not set +CONFIG_CHRT=y +CONFIG_DMESG=y +CONFIG_FEATURE_DMESG_PRETTY=y +CONFIG_EJECT=y +# CONFIG_FEATURE_EJECT_SCSI is not set +CONFIG_FALLOCATE=y +# CONFIG_FATATTR is not set +CONFIG_FBSET=y +CONFIG_FEATURE_FBSET_FANCY=y +CONFIG_FEATURE_FBSET_READMODE=y +CONFIG_FDFORMAT=y +CONFIG_FDISK=y +# CONFIG_FDISK_SUPPORT_LARGE_DISKS is not set +CONFIG_FEATURE_FDISK_WRITABLE=y +# CONFIG_FEATURE_AIX_LABEL is not set +# CONFIG_FEATURE_SGI_LABEL is not set +# CONFIG_FEATURE_SUN_LABEL is not set +# CONFIG_FEATURE_OSF_LABEL is not set +CONFIG_FEATURE_GPT_LABEL=y +CONFIG_FEATURE_FDISK_ADVANCED=y +# CONFIG_FINDFS is not set +CONFIG_FLOCK=y +CONFIG_FDFLUSH=y +CONFIG_FREERAMDISK=y +# CONFIG_FSCK_MINIX is not set +CONFIG_FSFREEZE=y +CONFIG_FSTRIM=y +CONFIG_GETOPT=y +CONFIG_FEATURE_GETOPT_LONG=y +CONFIG_HEXDUMP=y +# CONFIG_HD is not set +CONFIG_XXD=y +CONFIG_HWCLOCK=y +CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS=y +# CONFIG_IONICE is not set +CONFIG_IPCRM=y +CONFIG_IPCS=y +CONFIG_LAST=y +# CONFIG_FEATURE_LAST_FANCY is not set +CONFIG_LOSETUP=y +CONFIG_LSPCI=y +CONFIG_LSUSB=y +CONFIG_MDEV=y +CONFIG_FEATURE_MDEV_CONF=y +CONFIG_FEATURE_MDEV_RENAME=y +# CONFIG_FEATURE_MDEV_RENAME_REGEXP is not set +CONFIG_FEATURE_MDEV_EXEC=y +# CONFIG_FEATURE_MDEV_LOAD_FIRMWARE is not set +CONFIG_FEATURE_MDEV_DAEMON=y +CONFIG_MESG=y +CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP=y +CONFIG_MKE2FS=y +# CONFIG_MKFS_EXT2 is not set +# CONFIG_MKFS_MINIX is not set +# CONFIG_FEATURE_MINIX2 is not set +# CONFIG_MKFS_REISER is not set +CONFIG_MKDOSFS=y +# CONFIG_MKFS_VFAT is not set +CONFIG_MKSWAP=y +# CONFIG_FEATURE_MKSWAP_UUID is not set +CONFIG_MORE=y +CONFIG_MOUNT=y +# CONFIG_FEATURE_MOUNT_FAKE is not set +# CONFIG_FEATURE_MOUNT_VERBOSE is not set +# CONFIG_FEATURE_MOUNT_HELPERS is not set +# CONFIG_FEATURE_MOUNT_LABEL is not set +# CONFIG_FEATURE_MOUNT_NFS is not set +CONFIG_FEATURE_MOUNT_CIFS=y +CONFIG_FEATURE_MOUNT_FLAGS=y +CONFIG_FEATURE_MOUNT_FSTAB=y +CONFIG_FEATURE_MOUNT_OTHERTAB=y +CONFIG_MOUNTPOINT=y +CONFIG_NOLOGIN=y +# CONFIG_NOLOGIN_DEPENDENCIES is not set +# CONFIG_NSENTER is not set +CONFIG_PIVOT_ROOT=y +CONFIG_RDATE=y +# CONFIG_RDEV is not set +CONFIG_READPROFILE=y +CONFIG_RENICE=y +# CONFIG_REV is not set +# CONFIG_RTCWAKE is not set +# CONFIG_SCRIPT is not set +# CONFIG_SCRIPTREPLAY is not set +CONFIG_SETARCH=y +CONFIG_LINUX32=y +CONFIG_LINUX64=y +CONFIG_SETPRIV=y +CONFIG_FEATURE_SETPRIV_DUMP=y +CONFIG_FEATURE_SETPRIV_CAPABILITIES=y +CONFIG_FEATURE_SETPRIV_CAPABILITY_NAMES=y +CONFIG_SETSID=y +CONFIG_SWAPON=y +# CONFIG_FEATURE_SWAPON_DISCARD is not set +# CONFIG_FEATURE_SWAPON_PRI is not set +CONFIG_SWAPOFF=y +CONFIG_FEATURE_SWAPONOFF_LABEL=y +CONFIG_SWITCH_ROOT=y +# CONFIG_TASKSET is not set +# CONFIG_FEATURE_TASKSET_FANCY is not set +# CONFIG_FEATURE_TASKSET_CPULIST is not set +CONFIG_UEVENT=y +CONFIG_UMOUNT=y +CONFIG_FEATURE_UMOUNT_ALL=y +# CONFIG_UNSHARE is not set +# CONFIG_WALL is not set + +# +# Common options for mount/umount +# +CONFIG_FEATURE_MOUNT_LOOP=y +CONFIG_FEATURE_MOUNT_LOOP_CREATE=y +# CONFIG_FEATURE_MTAB_SUPPORT is not set +CONFIG_VOLUMEID=y + +# +# Filesystem/Volume identification +# +# CONFIG_FEATURE_VOLUMEID_BCACHE is not set +# CONFIG_FEATURE_VOLUMEID_BTRFS is not set +# CONFIG_FEATURE_VOLUMEID_CRAMFS is not set +CONFIG_FEATURE_VOLUMEID_EROFS=y +CONFIG_FEATURE_VOLUMEID_EXFAT=y +CONFIG_FEATURE_VOLUMEID_EXT=y +CONFIG_FEATURE_VOLUMEID_F2FS=y +CONFIG_FEATURE_VOLUMEID_FAT=y +# CONFIG_FEATURE_VOLUMEID_HFS is not set +# CONFIG_FEATURE_VOLUMEID_ISO9660 is not set +# CONFIG_FEATURE_VOLUMEID_JFS is not set +# CONFIG_FEATURE_VOLUMEID_LFS is not set +# CONFIG_FEATURE_VOLUMEID_LINUXRAID is not set +# CONFIG_FEATURE_VOLUMEID_LINUXSWAP is not set +# CONFIG_FEATURE_VOLUMEID_LUKS is not set +CONFIG_FEATURE_VOLUMEID_MINIX=y +# CONFIG_FEATURE_VOLUMEID_NILFS is not set +# CONFIG_FEATURE_VOLUMEID_NTFS is not set +# CONFIG_FEATURE_VOLUMEID_OCFS2 is not set +# CONFIG_FEATURE_VOLUMEID_REISERFS is not set +# CONFIG_FEATURE_VOLUMEID_ROMFS is not set +# CONFIG_FEATURE_VOLUMEID_SQUASHFS is not set +# CONFIG_FEATURE_VOLUMEID_SYSV is not set +CONFIG_FEATURE_VOLUMEID_UBIFS=y +# CONFIG_FEATURE_VOLUMEID_UDF is not set +# CONFIG_FEATURE_VOLUMEID_XFS is not set + +# +# Miscellaneous Utilities +# +# CONFIG_ADJTIMEX is not set +CONFIG_ASCII=y +# CONFIG_BBCONFIG is not set +# CONFIG_FEATURE_COMPRESS_BBCONFIG is not set +CONFIG_BC=y +CONFIG_DC=y +CONFIG_FEATURE_DC_BIG=y +# CONFIG_FEATURE_DC_LIBM is not set +CONFIG_FEATURE_BC_INTERACTIVE=y +CONFIG_FEATURE_BC_LONG_OPTIONS=y +# CONFIG_BEEP is not set +CONFIG_FEATURE_BEEP_FREQ=0 +CONFIG_FEATURE_BEEP_LENGTH_MS=0 +# CONFIG_CHAT is not set +# CONFIG_FEATURE_CHAT_NOFAIL is not set +# CONFIG_FEATURE_CHAT_TTY_HIFI is not set +# CONFIG_FEATURE_CHAT_IMPLICIT_CR is not set +# CONFIG_FEATURE_CHAT_SWALLOW_OPTS is not set +# CONFIG_FEATURE_CHAT_SEND_ESCAPES is not set +# CONFIG_FEATURE_CHAT_VAR_ABORT_LEN is not set +# CONFIG_FEATURE_CHAT_CLR_ABORT is not set +# CONFIG_CONSPY is not set +CONFIG_CROND=y +# CONFIG_FEATURE_CROND_D is not set +# CONFIG_FEATURE_CROND_CALL_SENDMAIL is not set +CONFIG_FEATURE_CROND_SPECIAL_TIMES=y +CONFIG_FEATURE_CROND_DIR="/var/spool/cron" +CONFIG_CRONTAB=y +# CONFIG_DEVFSD is not set +# CONFIG_DEVFSD_MODLOAD is not set +# CONFIG_DEVFSD_FG_NP is not set +# CONFIG_DEVFSD_VERBOSE is not set +# CONFIG_FEATURE_DEVFS is not set +CONFIG_DEVMEM=y +# CONFIG_FBSPLASH is not set +# CONFIG_FLASH_ERASEALL is not set +# CONFIG_FLASH_LOCK is not set +# CONFIG_FLASH_UNLOCK is not set +# CONFIG_FLASHCP is not set +CONFIG_GETFATTR=y +CONFIG_HDPARM=y +CONFIG_FEATURE_HDPARM_GET_IDENTITY=y +# CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF is not set +# CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF is not set +# CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET is not set +# CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF is not set +# CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA is not set +CONFIG_HEXEDIT=y +CONFIG_I2CGET=y +CONFIG_I2CSET=y +CONFIG_I2CDUMP=y +CONFIG_I2CDETECT=y +CONFIG_I2CTRANSFER=y +# CONFIG_INOTIFYD is not set +CONFIG_LESS=y +CONFIG_FEATURE_LESS_MAXLINES=9999999 +CONFIG_FEATURE_LESS_BRACKETS=y +CONFIG_FEATURE_LESS_FLAGS=y +CONFIG_FEATURE_LESS_TRUNCATE=y +# CONFIG_FEATURE_LESS_MARKS is not set +CONFIG_FEATURE_LESS_REGEXP=y +# CONFIG_FEATURE_LESS_WINCH is not set +# CONFIG_FEATURE_LESS_ASK_TERMINAL is not set +CONFIG_FEATURE_LESS_DASHCMD=y +# CONFIG_FEATURE_LESS_LINENUMS is not set +CONFIG_FEATURE_LESS_RAW=y +CONFIG_FEATURE_LESS_ENV=y +CONFIG_LSSCSI=y +CONFIG_MAKEDEVS=y +# CONFIG_FEATURE_MAKEDEVS_LEAF is not set +CONFIG_FEATURE_MAKEDEVS_TABLE=y +# CONFIG_MAN is not set +CONFIG_MICROCOM=y +CONFIG_MIM=y +CONFIG_MT=y +# CONFIG_NANDWRITE is not set +# CONFIG_NANDDUMP is not set +CONFIG_PARTPROBE=y +# CONFIG_RAIDAUTORUN is not set +# CONFIG_READAHEAD is not set +CONFIG_RFKILL=y +CONFIG_RUNLEVEL=y +# CONFIG_RX is not set +CONFIG_SEEDRNG=y +CONFIG_SETFATTR=y +CONFIG_SETSERIAL=y +CONFIG_STRINGS=y +CONFIG_TIME=y +CONFIG_TREE=y +CONFIG_TS=y +# CONFIG_TTYSIZE is not set +# CONFIG_UBIATTACH is not set +# CONFIG_UBIDETACH is not set +# CONFIG_UBIMKVOL is not set +# CONFIG_UBIRMVOL is not set +# CONFIG_UBIRSVOL is not set +# CONFIG_UBIUPDATEVOL is not set +CONFIG_UBIRENAME=y +# CONFIG_VOLNAME is not set +CONFIG_WATCHDOG=y +# CONFIG_FEATURE_WATCHDOG_OPEN_TWICE is not set + +# +# Networking Utilities +# +CONFIG_FEATURE_IPV6=y +# CONFIG_FEATURE_UNIX_LOCAL is not set +CONFIG_FEATURE_PREFER_IPV4_ADDRESS=y +# CONFIG_VERBOSE_RESOLUTION_ERRORS is not set +# CONFIG_FEATURE_ETC_NETWORKS is not set +# CONFIG_FEATURE_ETC_SERVICES is not set +CONFIG_FEATURE_HWIB=y +# CONFIG_FEATURE_TLS_SHA1 is not set +CONFIG_ARP=y +CONFIG_ARPING=y +# CONFIG_BRCTL is not set +# CONFIG_FEATURE_BRCTL_FANCY is not set +# CONFIG_FEATURE_BRCTL_SHOW is not set +CONFIG_DNSD=y +CONFIG_ETHER_WAKE=y +# CONFIG_FTPD is not set +# CONFIG_FEATURE_FTPD_WRITE is not set +# CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST is not set +# CONFIG_FEATURE_FTPD_AUTHENTICATION is not set +# CONFIG_FTPGET is not set +# CONFIG_FTPPUT is not set +# CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS is not set +CONFIG_HOSTNAME=y +CONFIG_DNSDOMAINNAME=y +# CONFIG_HTTPD is not set +CONFIG_FEATURE_HTTPD_PORT_DEFAULT=0 +# CONFIG_FEATURE_HTTPD_RANGES is not set +# CONFIG_FEATURE_HTTPD_SETUID is not set +# CONFIG_FEATURE_HTTPD_BASIC_AUTH is not set +# CONFIG_FEATURE_HTTPD_AUTH_MD5 is not set +# CONFIG_FEATURE_HTTPD_CGI is not set +# CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR is not set +# CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV is not set +# CONFIG_FEATURE_HTTPD_ENCODE_URL_STR is not set +# CONFIG_FEATURE_HTTPD_ERROR_PAGES is not set +# CONFIG_FEATURE_HTTPD_PROXY is not set +# CONFIG_FEATURE_HTTPD_GZIP is not set +# CONFIG_FEATURE_HTTPD_ETAG is not set +# CONFIG_FEATURE_HTTPD_LAST_MODIFIED is not set +# CONFIG_FEATURE_HTTPD_DATE is not set +# CONFIG_FEATURE_HTTPD_ACL_IP is not set +CONFIG_IFCONFIG=y +CONFIG_FEATURE_IFCONFIG_STATUS=y +CONFIG_FEATURE_IFCONFIG_SLIP=y +CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ=y +CONFIG_FEATURE_IFCONFIG_HW=y +# CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS is not set +# CONFIG_IFENSLAVE is not set +# CONFIG_IFPLUGD is not set +CONFIG_IFUP=y +CONFIG_IFDOWN=y +CONFIG_IFUPDOWN_IFSTATE_PATH="/var/run/ifstate" +CONFIG_FEATURE_IFUPDOWN_IP=y +CONFIG_FEATURE_IFUPDOWN_IPV4=y +CONFIG_FEATURE_IFUPDOWN_IPV6=y +CONFIG_FEATURE_IFUPDOWN_MAPPING=y +# CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP is not set +CONFIG_INETD=y +CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO=y +CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD=y +CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME=y +CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME=y +CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN=y +# CONFIG_FEATURE_INETD_RPC is not set +CONFIG_IP=y +CONFIG_IPADDR=y +CONFIG_IPLINK=y +CONFIG_IPROUTE=y +CONFIG_IPTUNNEL=y +CONFIG_IPRULE=y +CONFIG_IPNEIGH=y +CONFIG_FEATURE_IP_ADDRESS=y +CONFIG_FEATURE_IP_LINK=y +CONFIG_FEATURE_IP_LINK_CAN=y +CONFIG_FEATURE_IP_ROUTE=y +CONFIG_FEATURE_IP_ROUTE_DIR="/etc/iproute2" +CONFIG_FEATURE_IP_TUNNEL=y +CONFIG_FEATURE_IP_RULE=y +CONFIG_FEATURE_IP_NEIGH=y +# CONFIG_FEATURE_IP_RARE_PROTOCOLS is not set +# CONFIG_IPCALC is not set +# CONFIG_FEATURE_IPCALC_LONG_OPTIONS is not set +# CONFIG_FEATURE_IPCALC_FANCY is not set +# CONFIG_FAKEIDENTD is not set +CONFIG_NAMEIF=y +# CONFIG_FEATURE_NAMEIF_EXTENDED is not set +# CONFIG_NBDCLIENT is not set +# CONFIG_NC is not set +# CONFIG_NETCAT is not set +# CONFIG_NC_SERVER is not set +# CONFIG_NC_EXTRA is not set +# CONFIG_NC_110_COMPAT is not set +CONFIG_NETSTAT=y +# CONFIG_FEATURE_NETSTAT_WIDE is not set +# CONFIG_FEATURE_NETSTAT_PRG is not set +CONFIG_NSLOOKUP=y +CONFIG_FEATURE_NSLOOKUP_BIG=y +CONFIG_FEATURE_NSLOOKUP_LONG_OPTIONS=y +# CONFIG_NTPD is not set +# CONFIG_FEATURE_NTPD_SERVER is not set +# CONFIG_FEATURE_NTPD_CONF is not set +# CONFIG_FEATURE_NTP_AUTH is not set +CONFIG_PING=y +# CONFIG_PING6 is not set +CONFIG_FEATURE_FANCY_PING=y +# CONFIG_PSCAN is not set +CONFIG_ROUTE=y +# CONFIG_SLATTACH is not set +# CONFIG_SSL_CLIENT is not set +CONFIG_TC=y +CONFIG_FEATURE_TC_INGRESS=y +# CONFIG_TCPSVD is not set +# CONFIG_UDPSVD is not set +CONFIG_TELNET=y +CONFIG_FEATURE_TELNET_TTYPE=y +CONFIG_FEATURE_TELNET_AUTOLOGIN=y +CONFIG_FEATURE_TELNET_WIDTH=y +CONFIG_TELNETD=y +CONFIG_FEATURE_TELNETD_STANDALONE=y +CONFIG_FEATURE_TELNETD_PORT_DEFAULT=23 +CONFIG_FEATURE_TELNETD_INETD_WAIT=y +CONFIG_TFTP=y +# CONFIG_FEATURE_TFTP_PROGRESS_BAR is not set +CONFIG_FEATURE_TFTP_HPA_COMPAT=y +# CONFIG_TFTPD is not set +CONFIG_FEATURE_TFTP_GET=y +CONFIG_FEATURE_TFTP_PUT=y +CONFIG_FEATURE_TFTP_BLOCKSIZE=y +# CONFIG_TFTP_DEBUG is not set +# CONFIG_TLS is not set +CONFIG_TRACEROUTE=y +# CONFIG_TRACEROUTE6 is not set +# CONFIG_FEATURE_TRACEROUTE_VERBOSE is not set +# CONFIG_FEATURE_TRACEROUTE_USE_ICMP is not set +# CONFIG_TUNCTL is not set +# CONFIG_FEATURE_TUNCTL_UG is not set +CONFIG_VCONFIG=y +CONFIG_WGET=y +CONFIG_FEATURE_WGET_LONG_OPTIONS=y +CONFIG_FEATURE_WGET_STATUSBAR=y +CONFIG_FEATURE_WGET_FTP=y +CONFIG_FEATURE_WGET_AUTHENTICATION=y +CONFIG_FEATURE_WGET_TIMEOUT=y +# CONFIG_FEATURE_WGET_HTTPS is not set +# CONFIG_FEATURE_WGET_OPENSSL is not set +# CONFIG_WHOIS is not set +# CONFIG_ZCIP is not set +# CONFIG_UDHCPD is not set +# CONFIG_FEATURE_UDHCPD_BOOTP is not set +# CONFIG_FEATURE_UDHCPD_BASE_IP_ON_MAC is not set +# CONFIG_FEATURE_UDHCPD_WRITE_LEASES_EARLY is not set +CONFIG_DHCPD_LEASES_FILE="" +# CONFIG_DUMPLEASES is not set +# CONFIG_DHCPRELAY is not set +CONFIG_UDHCPC=y +CONFIG_FEATURE_UDHCPC_ARPING=y +CONFIG_FEATURE_UDHCPC_SANITIZEOPT=y +CONFIG_UDHCPC_DEFAULT_SCRIPT="/usr/share/udhcpc/default.script" +CONFIG_UDHCPC6_DEFAULT_SCRIPT="" +# CONFIG_UDHCPC6 is not set +# CONFIG_FEATURE_UDHCPC6_RFC3646 is not set +# CONFIG_FEATURE_UDHCPC6_RFC4704 is not set +# CONFIG_FEATURE_UDHCPC6_RFC4833 is not set +# CONFIG_FEATURE_UDHCPC6_RFC5970 is not set + +# +# Common options for DHCP applets +# +CONFIG_UDHCPC_DEFAULT_INTERFACE="eth0" +# CONFIG_FEATURE_UDHCP_PORT is not set +CONFIG_UDHCP_DEBUG=0 +CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80 +CONFIG_FEATURE_UDHCP_RFC3397=y +CONFIG_FEATURE_UDHCP_8021Q=y +CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-t1 -A3 -b -R -O search -O staticroutes" + +# +# Print Utilities +# +# CONFIG_LPD is not set +# CONFIG_LPR is not set +# CONFIG_LPQ is not set + +# +# Mail Utilities +# +CONFIG_FEATURE_MIME_CHARSET="" +# CONFIG_MAKEMIME is not set +# CONFIG_POPMAILDIR is not set +# CONFIG_FEATURE_POPMAILDIR_DELIVERY is not set +# CONFIG_REFORMIME is not set +# CONFIG_FEATURE_REFORMIME_COMPAT is not set +# CONFIG_SENDMAIL is not set + +# +# Process Utilities +# +# CONFIG_FEATURE_FAST_TOP is not set +# CONFIG_FEATURE_SHOW_THREADS is not set +CONFIG_FREE=y +CONFIG_FUSER=y +# CONFIG_IOSTAT is not set +CONFIG_KILL=y +CONFIG_KILLALL=y +CONFIG_KILLALL5=y +CONFIG_LSOF=y +# CONFIG_MPSTAT is not set +# CONFIG_NMETER is not set +# CONFIG_PGREP is not set +# CONFIG_PKILL is not set +CONFIG_PIDOF=y +CONFIG_FEATURE_PIDOF_SINGLE=y +CONFIG_FEATURE_PIDOF_OMIT=y +# CONFIG_PMAP is not set +# CONFIG_POWERTOP is not set +# CONFIG_FEATURE_POWERTOP_INTERACTIVE is not set +CONFIG_PS=y +# CONFIG_FEATURE_PS_WIDE is not set +# CONFIG_FEATURE_PS_LONG is not set +# CONFIG_FEATURE_PS_TIME is not set +# CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS is not set +# CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS is not set +# CONFIG_PSTREE is not set +# CONFIG_PWDX is not set +# CONFIG_SMEMCAP is not set +CONFIG_BB_SYSCTL=y +CONFIG_TOP=y +CONFIG_FEATURE_TOP_INTERACTIVE=y +CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE=y +CONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS=y +# CONFIG_FEATURE_TOP_SMP_CPU is not set +# CONFIG_FEATURE_TOP_DECIMALS is not set +# CONFIG_FEATURE_TOP_SMP_PROCESS is not set +# CONFIG_FEATURE_TOPMEM is not set +CONFIG_UPTIME=y +# CONFIG_FEATURE_UPTIME_UTMP_SUPPORT is not set +CONFIG_WATCH=y + +# +# Runit Utilities +# +# CONFIG_CHPST is not set +# CONFIG_SETUIDGID is not set +# CONFIG_ENVUIDGID is not set +# CONFIG_ENVDIR is not set +# CONFIG_SOFTLIMIT is not set +# CONFIG_RUNSV is not set +# CONFIG_RUNSVDIR is not set +# CONFIG_FEATURE_RUNSVDIR_LOG is not set +# CONFIG_SV is not set +CONFIG_SV_DEFAULT_SERVICE_DIR="" +CONFIG_SVC=y +CONFIG_SVOK=y +# CONFIG_SVLOGD is not set +# CONFIG_CHCON is not set +# CONFIG_GETENFORCE is not set +# CONFIG_GETSEBOOL is not set +# CONFIG_LOAD_POLICY is not set +# CONFIG_MATCHPATHCON is not set +# CONFIG_RUNCON is not set +# CONFIG_SELINUXENABLED is not set +# CONFIG_SESTATUS is not set +# CONFIG_SETENFORCE is not set +# CONFIG_SETFILES is not set +# CONFIG_FEATURE_SETFILES_CHECK_OPTION is not set +# CONFIG_RESTORECON is not set +# CONFIG_SETSEBOOL is not set + +# +# Shells +# +CONFIG_SH_IS_ASH=y +# CONFIG_SH_IS_HUSH is not set +# CONFIG_SH_IS_NONE is not set +# CONFIG_BASH_IS_ASH is not set +# CONFIG_BASH_IS_HUSH is not set +CONFIG_BASH_IS_NONE=y +CONFIG_SHELL_ASH=y +CONFIG_ASH=y +CONFIG_ASH_OPTIMIZE_FOR_SIZE=y +CONFIG_ASH_INTERNAL_GLOB=y +CONFIG_ASH_BASH_COMPAT=y +# CONFIG_ASH_BASH_SOURCE_CURDIR is not set +CONFIG_ASH_BASH_NOT_FOUND_HOOK=y +CONFIG_ASH_JOB_CONTROL=y +CONFIG_ASH_ALIAS=y +CONFIG_ASH_RANDOM_SUPPORT=y +CONFIG_ASH_EXPAND_PRMT=y +CONFIG_ASH_IDLE_TIMEOUT=y +# CONFIG_ASH_MAIL is not set +CONFIG_ASH_ECHO=y +CONFIG_ASH_PRINTF=y +CONFIG_ASH_TEST=y +CONFIG_ASH_HELP=y +CONFIG_ASH_GETOPTS=y +CONFIG_ASH_CMDCMD=y +# CONFIG_CTTYHACK is not set +# CONFIG_HUSH is not set +# CONFIG_SHELL_HUSH is not set +# CONFIG_HUSH_BASH_COMPAT is not set +# CONFIG_HUSH_BRACE_EXPANSION is not set +# CONFIG_HUSH_BASH_SOURCE_CURDIR is not set +# CONFIG_HUSH_LINENO_VAR is not set +# CONFIG_HUSH_INTERACTIVE is not set +# CONFIG_HUSH_SAVEHISTORY is not set +# CONFIG_HUSH_JOB is not set +# CONFIG_HUSH_TICK is not set +# CONFIG_HUSH_IF is not set +# CONFIG_HUSH_LOOPS is not set +# CONFIG_HUSH_CASE is not set +# CONFIG_HUSH_FUNCTIONS is not set +# CONFIG_HUSH_LOCAL is not set +# CONFIG_HUSH_RANDOM_SUPPORT is not set +# CONFIG_HUSH_MODE_X is not set +# CONFIG_HUSH_ECHO is not set +# CONFIG_HUSH_PRINTF is not set +# CONFIG_HUSH_TEST is not set +# CONFIG_HUSH_HELP is not set +# CONFIG_HUSH_EXPORT is not set +# CONFIG_HUSH_EXPORT_N is not set +# CONFIG_HUSH_READONLY is not set +# CONFIG_HUSH_KILL is not set +# CONFIG_HUSH_WAIT is not set +# CONFIG_HUSH_COMMAND is not set +# CONFIG_HUSH_TRAP is not set +# CONFIG_HUSH_TYPE is not set +# CONFIG_HUSH_TIMES is not set +# CONFIG_HUSH_READ is not set +# CONFIG_HUSH_SET is not set +# CONFIG_HUSH_UNSET is not set +# CONFIG_HUSH_ULIMIT is not set +# CONFIG_HUSH_UMASK is not set +# CONFIG_HUSH_GETOPTS is not set +# CONFIG_HUSH_MEMLEAK is not set + +# +# Options common to all shells +# +CONFIG_FEATURE_SH_MATH=y +CONFIG_FEATURE_SH_MATH_64=y +CONFIG_FEATURE_SH_MATH_BASE=y +CONFIG_FEATURE_SH_EXTRA_QUIET=y +# CONFIG_FEATURE_SH_STANDALONE is not set +# CONFIG_FEATURE_SH_NOFORK is not set +CONFIG_FEATURE_SH_READ_FRAC=y +# CONFIG_FEATURE_SH_HISTFILESIZE is not set +CONFIG_FEATURE_SH_EMBEDDED_SCRIPTS=y + +# +# System Logging Utilities +# +CONFIG_KLOGD=y +CONFIG_FEATURE_KLOGD_KLOGCTL=y +CONFIG_LOGGER=y +# CONFIG_LOGREAD is not set +# CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING is not set +CONFIG_SYSLOGD=y +CONFIG_FEATURE_ROTATE_LOGFILE=y +CONFIG_FEATURE_REMOTE_LOG=y +# CONFIG_FEATURE_SYSLOGD_DUP is not set +# CONFIG_FEATURE_SYSLOGD_CFG is not set +# CONFIG_FEATURE_SYSLOGD_PRECISE_TIMESTAMPS is not set +CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=256 +# CONFIG_FEATURE_IPC_SYSLOG is not set +CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=0 +# CONFIG_FEATURE_KMSG_SYSLOG is not set diff --git a/qemu/busybox/patches/0001-networking-libiproute-use-linux-if_packet.h-instead-.patch b/qemu/busybox/patches/0001-networking-libiproute-use-linux-if_packet.h-instead-.patch new file mode 100644 index 0000000..76d9a37 --- /dev/null +++ b/qemu/busybox/patches/0001-networking-libiproute-use-linux-if_packet.h-instead-.patch @@ -0,0 +1,37 @@ +From e1690453cd84c798ca88cc4370710f65da86d986 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Sat, 5 Oct 2013 15:55:06 +0200 +Subject: [PATCH] networking/libiproute: use instead of + + +The musl C library doesn't provide the since the +corresponding kernel headers already provides the +necessary definitions. Replacing by + also removes the need to include + + +This commit fixes the build of iplink with the musl C library. + +Signed-off-by: Thomas Petazzoni +[Gustavo: update for busybox 1.22.0] +Signed-off-by: Petr Vorel +--- + networking/libiproute/iplink.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/networking/libiproute/iplink.c b/networking/libiproute/iplink.c +index 37ed114bc..bc526d89c 100644 +--- a/networking/libiproute/iplink.c ++++ b/networking/libiproute/iplink.c +@@ -7,7 +7,7 @@ + */ + #include + /*#include - not needed? */ +-#include ++#include + #include + + #include +-- +2.48.1 + diff --git a/qemu/busybox/patches/0002-Makefile.flags-strip-non-l-arguments-returned-by-pkg.patch b/qemu/busybox/patches/0002-Makefile.flags-strip-non-l-arguments-returned-by-pkg.patch new file mode 100644 index 0000000..040b0b2 --- /dev/null +++ b/qemu/busybox/patches/0002-Makefile.flags-strip-non-l-arguments-returned-by-pkg.patch @@ -0,0 +1,32 @@ +From df20ae1280a2601a4c233ec12372d1e17db21e96 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Mon, 25 Nov 2013 22:51:53 +0100 +Subject: [PATCH] Makefile.flags: strip non -l arguments returned by pkg-config + +Signed-off-by: Thomas Petazzoni +[yann.morin.1998@free.fr: refresh for 1.29.0] +[petr.vorel@gmail.com: refresh for 1.32.0] +Signed-off-by: "Yann E. MORIN" +Signed-off-by: Petr Vorel +--- + Makefile.flags | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/Makefile.flags b/Makefile.flags +index 97cb4dca2..92a9063d9 100644 +--- a/Makefile.flags ++++ b/Makefile.flags +@@ -181,7 +181,9 @@ ifeq ($(CONFIG_SELINUX),y) + SELINUX_PC_MODULES = libselinux libsepol + $(eval $(call pkg_check_modules,SELINUX,$(SELINUX_PC_MODULES))) + CPPFLAGS += $(SELINUX_CFLAGS) +-LDLIBS += $(if $(SELINUX_LIBS),$(SELINUX_LIBS:-l%=%),$(SELINUX_PC_MODULES:lib%=%)) ++LDLIBS += $(if $(SELINUX_LIBS),\ ++ $(patsubst -l%,%,$(filter -l%,$(SELINUX_LIBS))),\ ++ $(SELINUX_PC_MODULES:lib%=%)) + endif + + ifeq ($(CONFIG_FEATURE_NSLOOKUP_BIG),y) +-- +2.48.1 + diff --git a/qemu/busybox/patches/0003-libbb-sockaddr2str-ensure-only-printable-characters-.patch b/qemu/busybox/patches/0003-libbb-sockaddr2str-ensure-only-printable-characters-.patch new file mode 100644 index 0000000..c7800b5 --- /dev/null +++ b/qemu/busybox/patches/0003-libbb-sockaddr2str-ensure-only-printable-characters-.patch @@ -0,0 +1,42 @@ +From 68eaf20d86d4fe0f16a914817217f386155157cc Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Mon, 19 Sep 2022 14:15:12 +0200 +Subject: [PATCH] libbb: sockaddr2str: ensure only printable characters are + returned for the hostname part + +CVE: CVE-2022-28391 +Signed-off-by: Ariadne Conill +Tested-by: Radoslav Kolev +Backport from ML: http://lists.busybox.net/pipermail/busybox/2022-July/089796.html +Signed-off-by: Quentin Schulz +--- + libbb/xconnect.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/libbb/xconnect.c b/libbb/xconnect.c +index 0e0b247b8..02c061e67 100644 +--- a/libbb/xconnect.c ++++ b/libbb/xconnect.c +@@ -497,8 +497,9 @@ static char* FAST_FUNC sockaddr2str(const struct sockaddr *sa, int flags) + ); + if (rc) + return NULL; ++ /* ensure host contains only printable characters */ + if (flags & IGNORE_PORT) +- return xstrdup(host); ++ return xstrdup(printable_string(host)); + #if ENABLE_FEATURE_IPV6 + if (sa->sa_family == AF_INET6) { + if (strchr(host, ':')) /* heh, it's not a resolved hostname */ +@@ -509,7 +510,7 @@ static char* FAST_FUNC sockaddr2str(const struct sockaddr *sa, int flags) + #endif + /* For now we don't support anything else, so it has to be INET */ + /*if (sa->sa_family == AF_INET)*/ +- return xasprintf("%s:%s", host, serv); ++ return xasprintf("%s:%s", printable_string(host), serv); + /*return xstrdup(host);*/ + } + +-- +2.48.1 + diff --git a/qemu/busybox/patches/0004-nslookup-sanitize-all-printed-strings-with-printable.patch b/qemu/busybox/patches/0004-nslookup-sanitize-all-printed-strings-with-printable.patch new file mode 100644 index 0000000..3396441 --- /dev/null +++ b/qemu/busybox/patches/0004-nslookup-sanitize-all-printed-strings-with-printable.patch @@ -0,0 +1,69 @@ +From 56b84c6efb9a06ae294eb92cf9634f70af443b0a Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Mon, 19 Sep 2022 14:15:12 +0200 +Subject: [PATCH] nslookup: sanitize all printed strings with printable_string + +Otherwise, terminal sequences can be injected, which enables various terminal injection +attacks from DNS results. + +CVE: CVE-2022-28391 +Signed-off-by: Ariadne Conill +Tested-by: Radoslav Kolev +Backport from ML: http://lists.busybox.net/pipermail/busybox/2022-July/089795.html +Signed-off-by: Quentin Schulz +--- + networking/nslookup.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/networking/nslookup.c b/networking/nslookup.c +index b67d354f7..79412477c 100644 +--- a/networking/nslookup.c ++++ b/networking/nslookup.c +@@ -784,7 +784,7 @@ static NOINLINE int parse_reply(const unsigned char *msg, size_t len) + //printf("Unable to uncompress domain: %s\n", strerror(errno)); + return -1; + } +- printf(format, ns_rr_name(rr), dname); ++ printf(format, ns_rr_name(rr), printable_string(dname)); + break; + + case ns_t_mx: +@@ -799,7 +799,7 @@ static NOINLINE int parse_reply(const unsigned char *msg, size_t len) + //printf("Cannot uncompress MX domain: %s\n", strerror(errno)); + return -1; + } +- printf("%s\tmail exchanger = %d %s\n", ns_rr_name(rr), n, dname); ++ printf("%s\tmail exchanger = %d %s\n", ns_rr_name(rr), n, printable_string(dname)); + break; + + case ns_t_txt: +@@ -811,7 +811,7 @@ static NOINLINE int parse_reply(const unsigned char *msg, size_t len) + if (n > 0) { + memset(dname, 0, sizeof(dname)); + memcpy(dname, ns_rr_rdata(rr) + 1, n); +- printf("%s\ttext = \"%s\"\n", ns_rr_name(rr), dname); ++ printf("%s\ttext = \"%s\"\n", ns_rr_name(rr), printable_string(dname)); + } + break; + +@@ -831,7 +831,7 @@ static NOINLINE int parse_reply(const unsigned char *msg, size_t len) + } + + printf("%s\tservice = %u %u %u %s\n", ns_rr_name(rr), +- ns_get16(cp), ns_get16(cp + 2), ns_get16(cp + 4), dname); ++ ns_get16(cp), ns_get16(cp + 2), ns_get16(cp + 4), printable_string(dname)); + break; + + case ns_t_soa: +@@ -860,7 +860,7 @@ static NOINLINE int parse_reply(const unsigned char *msg, size_t len) + return -1; + } + +- printf("\tmail addr = %s\n", dname); ++ printf("\tmail addr = %s\n", printable_string(dname)); + cp += n; + + printf("\tserial = %lu\n", ns_get32(cp)); +-- +2.48.1 + diff --git a/qemu/busybox/patches/0005-seedrng-fix-getrandom-detection-for-non-glibc-libc.patch b/qemu/busybox/patches/0005-seedrng-fix-getrandom-detection-for-non-glibc-libc.patch new file mode 100644 index 0000000..57caa44 --- /dev/null +++ b/qemu/busybox/patches/0005-seedrng-fix-getrandom-detection-for-non-glibc-libc.patch @@ -0,0 +1,106 @@ +From 9fed109be1f811069cb2f727e04c6996cd44b017 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rapha=C3=ABl=20M=C3=A9lotte?= +Date: Tue, 18 Apr 2023 15:54:43 +0200 +Subject: [PATCH] seedrng: fix getrandom() detection for non-glibc libc +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +glibc <= 2.24 does not provide getrandom(). A check for it has been +added in 200a9669fbf6f06894e4243cccc9fc11a1a6073a and fixed in +cb57abb46f06f4ede8d9ccbdaac67377fdf416cf. + +However, building with a libc other than glibc can lead to the same +problem as not every other libc has getrandom() either: + +- uClibc provides it from v1.0.2 onwards, but requires to define +_GNU_SOURCE (all versions - we already define it by default), and +stddef to be included first (when using uClibc < 1.0.35 - we already +include it through libbb.h). + +- musl libc has getrandom(), but only from version 1.1.20 onwards. As +musl does not provide __MUSL__ or version information, it's not +possible to check for it like we did for glibc. + +All of this makes it difficult (or impossible in case of musl) to +check what we need to do to have getrandom() based on each libc +versions. + +On top of that, getrandom() is also not available on older kernels. As +an example, when using a 3.10 kernel with uClibc 1.0.26, getrandom() +is declared so compiling works, but it fails at link time because +getrandom() is not defined. + +To make it easier, take a similar approach to what was done for the +crypt library: try to build a sample program to see if we have +getrandom(). To keep it compatible with different versions of +make (for reference see [1]), a variable for '#' is also introduced. + +Based on the new Makefile variable, we now either use the +libc-provided getrandom() when it's available, or use our own +implementation when it's not (like it was the case already for glibc < +2.25). + +This should fix compiling with many libc/kernel combinations. + +[1]: https://git.savannah.gnu.org/cgit/make.git/commit/?id=c6966b323811c37acedff05b576b907b06aea5f4 + +Signed-off-by: Raphael Melotte +Upstream: http://lists.busybox.net/pipermail/busybox/2023-May/090317.html +--- + Makefile.flags | 12 ++++++++++++ + miscutils/seedrng.c | 8 ++++---- + 2 files changed, 16 insertions(+), 4 deletions(-) + +diff --git a/Makefile.flags b/Makefile.flags +index 92a9063d9..c8f601308 100644 +--- a/Makefile.flags ++++ b/Makefile.flags +@@ -162,6 +162,18 @@ ifeq ($(RT_AVAILABLE),y) + LDLIBS += rt + endif + ++# GNU Make version 4.2.1 and earlier require number signs ('#') ++# inside function invocations to be escaped, while versions 4.3+ ++# require them to be unescaped. Use a variable for it so that it works ++# for both versions: ++C := \# ++# Not all libc versions have getrandom, so check for it: ++HAVE_GETRANDOM := $(shell printf '$Cdefine _GNU_SOURCE\n$Cinclude \n$Cinclude \nint main(void){char buf[256];\ngetrandom(buf,sizeof(buf),0);}' >bb_libtest.c; $(CC) $(CFLAGS) $(CFLAGS_busybox) -o /dev/null bb_libtest.c >/dev/null 2>&1 && echo "y"; rm bb_libtest.c) ++ ++ifeq ($(HAVE_GETRANDOM),y) ++CFLAGS += -DHAVE_GETRANDOM ++endif ++ + # libpam may use libpthread, libdl and/or libaudit. + # On some platforms that requires an explicit -lpthread, -ldl, -laudit. + # However, on *other platforms* it fails when some of those flags +diff --git a/miscutils/seedrng.c b/miscutils/seedrng.c +index 7a2331cb1..ba98f4d19 100644 +--- a/miscutils/seedrng.c ++++ b/miscutils/seedrng.c +@@ -44,8 +44,10 @@ + #include + #include + +-/* Fix up glibc <= 2.24 not having getrandom() */ +-#if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ <= 24 ++/* Fix up some libc (e.g. glibc <= 2.24) not having getrandom() */ ++#if defined HAVE_GETRANDOM ++#include ++#else /* No getrandom */ + #include + static ssize_t getrandom(void *buffer, size_t length, unsigned flags) + { +@@ -56,8 +58,6 @@ static ssize_t getrandom(void *buffer, size_t length, unsigned flags) + return -1; + # endif + } +-#else +-#include + #endif + + /* Apparently some headers don't ship with this yet. */ +-- +2.48.1 + diff --git a/qemu/busybox/patches/0006-menuconfig-GCC-failing-saying-ncurses-is-not-found.patch b/qemu/busybox/patches/0006-menuconfig-GCC-failing-saying-ncurses-is-not-found.patch new file mode 100644 index 0000000..5948744 --- /dev/null +++ b/qemu/busybox/patches/0006-menuconfig-GCC-failing-saying-ncurses-is-not-found.patch @@ -0,0 +1,38 @@ +From 7f0bb7f69f38298971aa8153d3fbe9b1fdda8ae7 Mon Sep 17 00:00:00 2001 +From: ctxnop +Date: Sun, 26 Jan 2025 20:59:20 +0100 +Subject: [PATCH] menuconfig: GCC failing saying ncurses is not found + +Newer GCC increased diagnostics levels resulting in considering the +test code to be invalid. The resulting message was misleading, saying +that ncurses was not found, while the check failed for an unrelated +reason which was hidden because GCC stderr was redirected to +/dev/null. + +Signed-off-by: ctxnop +Upstream: http://lists.busybox.net/pipermail/busybox/2024-July/090840.html +[Fiona: rephrased commit message for clarity] +Signed-off-by: Fiona Klute (WIWA) +--- + scripts/kconfig/lxdialog/check-lxdialog.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh +index 5075ebf2d..08e4da3de 100755 +--- a/scripts/kconfig/lxdialog/check-lxdialog.sh ++++ b/scripts/kconfig/lxdialog/check-lxdialog.sh +@@ -45,9 +45,9 @@ trap "rm -f $tmp" 0 1 2 3 15 + + # Check if we can link to ncurses + check() { +- $cc -x c - -o $tmp 2>/dev/null <<'EOF' ++ $cc -x c - -o $tmp <<'EOF' + #include CURSES_LOC +-main() {} ++int main() { return 0; } + EOF + if [ $? != 0 ]; then + echo " *** Unable to find the ncurses libraries or the" 1>&2 +-- +2.48.1 + diff --git a/qemu/busybox/patches/0007-tc-Fix-compilation-with-Linux-v6.8-rc1.patch b/qemu/busybox/patches/0007-tc-Fix-compilation-with-Linux-v6.8-rc1.patch new file mode 100644 index 0000000..c7968de --- /dev/null +++ b/qemu/busybox/patches/0007-tc-Fix-compilation-with-Linux-v6.8-rc1.patch @@ -0,0 +1,70 @@ +From 1dbb3073a3a8856b9446b882f797be1bb2e21a26 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= +Date: Mon, 23 Sep 2024 18:56:00 +0200 +Subject: [PATCH] tc: Fix compilation with Linux v6.8-rc1 + +Linux v6.8-rc1 removed the definitions related to CBQ: +https://github.com/torvalds/linux/commit/33241dca486264193ed68167c8eeae1fb197f3df +making tc fail to build. +Add some #ifdefs to handle this missing support. + +Upstream: http://lists.busybox.net/pipermail/busybox/2024-March/090678.html +Bug report: https://bugs.busybox.net/show_bug.cgi?id=15931 + +Signed-off-by: Bernd Kuhls +--- + networking/tc.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/networking/tc.c b/networking/tc.c +index 3a79fd2d9..d08fd1359 100644 +--- a/networking/tc.c ++++ b/networking/tc.c +@@ -231,6 +231,13 @@ static int cbq_parse_opt(int argc, char **argv, struct nlmsghdr *n) + return 0; + } + #endif ++ ++#ifndef TCA_CBQ_MAX ++/* ++ * Linux v6.8-rc1~131^2~60^2^2 removed the uapi definitions for CBQ. ++ * See https://git.kernel.org/linus/33241dca48626 ++ */ ++#else + static int cbq_print_opt(struct rtattr *opt) + { + struct rtattr *tb[TCA_CBQ_MAX+1]; +@@ -322,6 +329,7 @@ static int cbq_print_opt(struct rtattr *opt) + done: + return 0; + } ++#endif + + static FAST_FUNC int print_qdisc( + const struct sockaddr_nl *who UNUSED_PARAM, +@@ -372,8 +380,10 @@ static FAST_FUNC int print_qdisc( + int qqq = index_in_strings(_q_, name); + if (qqq == 0) { /* pfifo_fast aka prio */ + prio_print_opt(tb[TCA_OPTIONS]); ++#ifdef TCA_CBQ_MAX + } else if (qqq == 1) { /* class based queuing */ + cbq_print_opt(tb[TCA_OPTIONS]); ++#endif + } else { + /* don't know how to print options for this qdisc */ + printf("(options for %s)", name); +@@ -442,9 +452,11 @@ static FAST_FUNC int print_class( + int qqq = index_in_strings(_q_, name); + if (qqq == 0) { /* pfifo_fast aka prio */ + /* nothing. */ /*prio_print_opt(tb[TCA_OPTIONS]);*/ ++#ifdef TCA_CBQ_MAX + } else if (qqq == 1) { /* class based queuing */ + /* cbq_print_copt() is identical to cbq_print_opt(). */ + cbq_print_opt(tb[TCA_OPTIONS]); ++#endif + } else { + /* don't know how to print options for this class */ + printf("(options for %s)", name); +-- +2.48.1 + diff --git a/qemu/busybox/patches/0008-awk.c-fix-CVE-2023-42366-bug-15874.patch b/qemu/busybox/patches/0008-awk.c-fix-CVE-2023-42366-bug-15874.patch new file mode 100644 index 0000000..f973223 --- /dev/null +++ b/qemu/busybox/patches/0008-awk.c-fix-CVE-2023-42366-bug-15874.patch @@ -0,0 +1,43 @@ +From 88f8a046f27cb81ccc30d038465e963b8300cf1b Mon Sep 17 00:00:00 2001 +From: Valery Ushakov +Date: Wed, 24 Jan 2024 22:24:41 +0300 +Subject: [PATCH] awk.c: fix CVE-2023-42366 (bug #15874) + +Make sure we don't read past the end of the string in next_token() +when backslash is the last character in an (invalid) regexp. +a fix and issue reported in bugzilla + +https://bugs.busybox.net/show_bug.cgi?id=15874 + +Upstream-Status: Submitted [http://lists.busybox.net/pipermail/busybox/2024-May/090766.html] + +CVE: CVE-2023-42366 +Signed-off-by: Khem Raj +[Thomas: https://git.openembedded.org/openembedded-core/tree/meta/recipes-core/busybox/busybox/0001-awk.c-fix-CVE-2023-42366-bug-15874.patch?id=e0ff4813b1cf4df0d851c857d57fb88d7db51bdd] +Upstream: http://lists.busybox.net/pipermail/busybox/2024-May/090766.html +Signed-off-by: Thomas Petazzoni +--- + editors/awk.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/editors/awk.c b/editors/awk.c +index 64e752f4b..222e6298d 100644 +--- a/editors/awk.c ++++ b/editors/awk.c +@@ -1234,9 +1234,11 @@ static uint32_t next_token(uint32_t expected) + s[-1] = bb_process_escape_sequence((const char **)&pp); + if (*p == '\\') + *s++ = '\\'; +- if (pp == p) ++ if (pp == p) { ++ if (*p == '\0') ++ syntax_error(EMSG_UNEXP_EOS); + *s++ = *p++; +- else ++ } else + p = pp; + } + } +-- +2.48.1 + diff --git a/qemu/busybox/patches/0009-hwclock-Check-for-SYS_settimeofday-before-calling-sy.patch b/qemu/busybox/patches/0009-hwclock-Check-for-SYS_settimeofday-before-calling-sy.patch new file mode 100644 index 0000000..1e95fae --- /dev/null +++ b/qemu/busybox/patches/0009-hwclock-Check-for-SYS_settimeofday-before-calling-sy.patch @@ -0,0 +1,54 @@ +From 0583f8eda94f97e15e371e12458877b738439e8c Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sun, 7 Mar 2021 17:30:24 -0800 +Subject: [PATCH] hwclock: Check for SYS_settimeofday before calling syscall + +Some newer architectures e.g. RISCV32 have 64bit time_t from get go and +thusly do not have gettimeofday_time64/settimeofday_time64 implemented +therefore check for SYS_settimeofday definition before making the +syscall. Fixes build for riscv32 and it will bail out at runtime. + +Upstream-Status: Submitted [http://lists.busybox.net/pipermail/busybox/2021-March/088583.html] +Signed-off-by: Khem Raj +Upstream: http://lists.busybox.net/pipermail/busybox/2021-March/088583.html +[Thomas: this issue has been discussed on the musl mailing list, and +the musl developers' opinion is that Busybox is wrong: +https://www.openwall.com/lists/musl/2024/03/03/2 +https://www.openwall.com/lists/musl/2024/04/07/2. The correct fix +isn't clear, and in the mean time, the patch from Khem turns the build +issue into a runtime error only on the problematic architecture, which +seems like a reasonable trade-off] +Signed-off-by: Thomas Petazzoni +--- + util-linux/hwclock.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/util-linux/hwclock.c b/util-linux/hwclock.c +index c3fd0eb57..dea9c9a55 100644 +--- a/util-linux/hwclock.c ++++ b/util-linux/hwclock.c +@@ -132,6 +132,7 @@ static void show_clock(const char **pp_rtcname, int utc) + + static void set_kernel_tz(const struct timezone *tz) + { ++ int ret = 1; + #if LIBC_IS_MUSL + /* musl libc does not pass tz argument to syscall + * because "it's deprecated by POSIX, therefore it's fine +@@ -140,9 +141,11 @@ static void set_kernel_tz(const struct timezone *tz) + #if !defined(SYS_settimeofday) && defined(SYS_settimeofday_time32) + # define SYS_settimeofday SYS_settimeofday_time32 + #endif +- int ret = syscall(SYS_settimeofday, NULL, tz); ++#if defined(SYS_settimeofday) ++ ret = syscall(SYS_settimeofday, NULL, tz); ++#endif + #else +- int ret = settimeofday(NULL, tz); ++ ret = settimeofday(NULL, tz); + #endif + if (ret) + bb_simple_perror_msg_and_die("settimeofday"); +-- +2.48.1 + diff --git a/qemu/busybox/patches/0010-libbb-sha-add-missing-sha-NI-guard.patch b/qemu/busybox/patches/0010-libbb-sha-add-missing-sha-NI-guard.patch new file mode 100644 index 0000000..54aab81 --- /dev/null +++ b/qemu/busybox/patches/0010-libbb-sha-add-missing-sha-NI-guard.patch @@ -0,0 +1,54 @@ +From bba9e99026a3dafe75f608459533e0b6d8cf3874 Mon Sep 17 00:00:00 2001 +From: Andre Przywara +Date: Tue, 10 Sep 2024 14:32:46 +0100 +Subject: [PATCH] libbb/sha: add missing sha-NI guard +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The ENABLE_SHA1_HWACCEL Kconfig symbol is meant to be archicture +agnostic, so can be enabled regardless of whether your build +architecture provides hardware acceleration or not. At the moment only +x86 implements this, so every piece of optimised code should be guarded +by both ENABLE_SHA1_HWACCEL and (__x86_64__ || __i386__). This is missing +at one place, so compiling for arm64 breaks when ENABLE_SHA1_HWACCEL is +enabled: +================================ +libbb/hash_md5_sha.c: In function 'sha1_end': +libbb/hash_md5_sha.c:1316:28: error: 'sha1_process_block64_shaNI' undeclared (first use in this function); did you mean 'sha1_process_block64'? + 1316 | || ctx->process_block == sha1_process_block64_shaNI + | ^~~~~~~~~~~~~~~~~~~~~~~~~~ + | sha1_process_block64 +libbb/hash_md5_sha.c:1316:28: note: each undeclared identifier is reported only once for each function it appears in +make[1]: *** [scripts/Makefile.build:197: libbb/hash_md5_sha.o] Error 1 +make: *** [Makefile:744: libbb] Error 2 +================================ + +Add the missing guards around the call to sha1_process_block64_shaNI to +fix the build on other architectures with ENABLE_SHA1_HWACCEL enabled. + +Change-Id: I40bba388422625f4230abf15a5de23e1fdc654fc +Signed-off-by: Andre Przywara +Upstream: https://lists.busybox.net/pipermail/busybox/2024-September/090899.html +Signed-off-by: Thomas Petazzoni +--- + libbb/hash_md5_sha.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/libbb/hash_md5_sha.c b/libbb/hash_md5_sha.c +index 57a801459..75a61c32c 100644 +--- a/libbb/hash_md5_sha.c ++++ b/libbb/hash_md5_sha.c +@@ -1313,7 +1313,9 @@ unsigned FAST_FUNC sha1_end(sha1_ctx_t *ctx, void *resbuf) + hash_size = 8; + if (ctx->process_block == sha1_process_block64 + #if ENABLE_SHA1_HWACCEL ++# if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) + || ctx->process_block == sha1_process_block64_shaNI ++# endif + #endif + ) { + hash_size = 5; +-- +2.48.1 + diff --git a/qemu/busybox/patches/0011-syslogd-fix-wrong-OPT_locallog-flag-detection.patch b/qemu/busybox/patches/0011-syslogd-fix-wrong-OPT_locallog-flag-detection.patch new file mode 100644 index 0000000..1dfd6f3 --- /dev/null +++ b/qemu/busybox/patches/0011-syslogd-fix-wrong-OPT_locallog-flag-detection.patch @@ -0,0 +1,37 @@ +From 34d331d642c3312e1c04e4650f547f1a67abee24 Mon Sep 17 00:00:00 2001 +From: Andrej Valek +Date: Wed, 16 Oct 2024 10:15:08 +0200 +Subject: [PATCH] syslogd: fix wrong OPT_locallog flag detection + +The OPT_locallog was set on "option_mask32" but checked on local +"opts" variable. While this flag it's used on multiple places can't be +has to be used with "option_mask32". Without this change syslogd +is more-less unusable while no messages are logged locally. + +Signed-off-by: Andrej Valek +Upstream: https://lists.busybox.net/pipermail/busybox/2024-October/090969.html +[Thomas: this was reported as beeing needed by Bernd Kuhls at +https://lore.kernel.org/buildroot/pan$de0bb$35c5a64$ca9b6f21$2408ff40@ID-313208.user.individual.net/, +but also on the Busybox mailing list at +https://lists.busybox.net/pipermail/busybox/2023-September/090499.html] +Signed-off-by: Thomas Petazzoni +--- + sysklogd/syslogd.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c +index 7558051f0..fa03aa280 100644 +--- a/sysklogd/syslogd.c ++++ b/sysklogd/syslogd.c +@@ -1179,7 +1179,7 @@ int syslogd_main(int argc UNUSED_PARAM, char **argv) + } + } + #endif +- if (!ENABLE_FEATURE_REMOTE_LOG || (opts & OPT_locallog)) { ++ if (!ENABLE_FEATURE_REMOTE_LOG || (option_mask32 & OPT_locallog)) { + recvbuf[sz] = '\0'; /* ensure it *is* NUL terminated */ + split_escape_and_log(recvbuf, sz); + } +-- +2.48.1 + diff --git a/qemu/busybox/rig.fragment b/qemu/busybox/rig.fragment new file mode 100644 index 0000000..67a49b8 --- /dev/null +++ b/qemu/busybox/rig.fragment @@ -0,0 +1,11 @@ +# The rig's only differences from the panel's BusyBox config (panel.config). +# Each line replaces the panel's setting for the same symbol. They change how +# the binary links and looks up names, not which applets or options exist: +# STATIC: the rig's initramfs has no shared libc, the panel's rootfs does. +# USE_BB_PWD_GRP, USE_BB_SHADOW: a static glibc binary cannot load the NSS +# modules getpwnam() needs, so BusyBox reads /etc/passwd, /etc/group and +# /etc/shadow itself (the panel's uClibc-ng reads the same files). +# qemu/tests/busybox-panel-test.sh refuses any other symbol here. +CONFIG_STATIC=y +CONFIG_USE_BB_PWD_GRP=y +CONFIG_USE_BB_SHADOW=y diff --git a/qemu/lib.sh b/qemu/lib.sh index 375213c..b9e7d65 100644 --- a/qemu/lib.sh +++ b/qemu/lib.sh @@ -7,30 +7,19 @@ BB_URL="https://busybox.net/downloads/binaries/${BB_VER}-defconfig-multiarch-mus qemu_log() { printf '\033[36m== %s\033[0m\n' "$*"; } -# Fetch (or accept via $BUSYBOX) the pinned static armv7 busybox and verify it -# against qemu/busybox.sha256. FAILS CLOSED: a missing pin refuses to build, -# never silently skips verification, mirroring build/build-kernel.sh's -# tarball handling. Sets $BB to the verified binary's path. -qemu_get_busybox() { - local sha_file="$QEMU_DIR/busybox.sha256" - local out="${OUT:-$QEMU_DIR/out}" - mkdir -p "$out" - BB="${BUSYBOX:-$out/busybox-armv7l}" - # Pin first: a missing pin refuses BEFORE downloading, same ordering as - # build/fetch-kernel-tarball.sh. - [ -f "$sha_file" ] || { - echo "FATAL: no pinned sha256 for busybox (expected $sha_file): refusing to build from an unverified binary" >&2 - exit 1 - } - local want got - want="$(cat "$sha_file")" - if [ -f "$BB" ]; then - got="$(sha256sum "$BB" | awk '{print $1}')" +# Download URL to DEST and verify it against the sha256 WANT. A DEST that +# already matches is kept. FAILS CLOSED: three bounded attempts, then exit 1; +# a mismatching download never lands at DEST. +# Usage: qemu_fetch_verified URL WANT DEST LABEL +qemu_fetch_verified() { + local url="$1" want="$2" dest="$3" label="$4" got + if [ -f "$dest" ]; then + got="$(sha256sum "$dest" | awk '{print $1}')" if [ "$want" = "$got" ]; then - qemu_log "busybox sha256 verified" + qemu_log "$label sha256 verified" return fi - qemu_log "cached busybox failed verification; fetching a clean copy" + qemu_log "cached $label failed verification; fetching a clean copy" fi # Every attempt is bounded: a server that answers and then stalls would @@ -40,27 +29,69 @@ qemu_get_busybox() { # shorten them through the environment. local stall="${BB_FETCH_STALL_SECS:-20}" max="${BB_FETCH_MAX_SECS:-60}" local delay="${BB_FETCH_RETRY_DELAY:-5}" - local attempt tmp="${BB}.download.$$" + local attempt tmp="${dest}.download.$$" rm -f "$tmp" for attempt in 1 2 3; do - qemu_log "downloading $BB_URL (attempt $attempt/3)" + qemu_log "downloading $url (attempt $attempt/3)" if curl --retry 1 --retry-delay "$delay" --retry-connrefused \ --connect-timeout "$stall" --speed-limit 1024 --speed-time "$stall" \ - --max-time "$max" -fSL "$BB_URL" -o "$tmp"; then + --max-time "$max" -fSL "$url" -o "$tmp"; then got="$(sha256sum "$tmp" | awk '{print $1}')" if [ "$want" = "$got" ]; then - mv -f "$tmp" "$BB" - qemu_log "busybox sha256 verified" + mv -f "$tmp" "$dest" + qemu_log "$label sha256 verified" return fi - echo "busybox sha256 mismatch on attempt $attempt: want $want got $got" >&2 + echo "$label sha256 mismatch on attempt $attempt: want $want got $got" >&2 fi rm -f "$tmp" done - echo "FATAL: could not fetch pinned busybox after 3 verified attempts" >&2 + echo "FATAL: could not fetch pinned $label after 3 verified attempts" >&2 exit 1 } +# Provide the rig's static armv7 busybox and set $BB to its path. +# +# RIG_BUSYBOX picks which one (flare-edge#2210): +# multiarch (default) the busybox.net $BB_VER defconfig-multiarch-musl +# binary, fetched (or accepted via $BUSYBOX) and +# verified against qemu/busybox.sha256 +# panel the image's BusyBox version and applet config, built +# from source by qemu/build-busybox.sh (needs a cross +# compiler; checked by its applet list, see there) +# FAILS CLOSED: a missing pin refuses to build, never silently skips +# verification, mirroring build/build-kernel.sh's tarball handling; an +# unknown RIG_BUSYBOX, or $BUSYBOX with the panel build, is refused. +qemu_get_busybox() { + local out="${OUT:-$QEMU_DIR/out}" + mkdir -p "$out" + case "${RIG_BUSYBOX:-multiarch}" in + multiarch) ;; + panel) + [ -z "${BUSYBOX:-}" ] || { + echo "FATAL: BUSYBOX=$BUSYBOX names a prebuilt binary; RIG_BUSYBOX=panel builds its own (unset one of them)" >&2 + exit 1 + } + OUT="$out" bash "$QEMU_DIR/build-busybox.sh" + BB="$out/busybox-armv7l-panel" + return + ;; + *) + echo "FATAL: RIG_BUSYBOX must be multiarch or panel, not '${RIG_BUSYBOX}'" >&2 + exit 1 + ;; + esac + local sha_file="$QEMU_DIR/busybox.sha256" + BB="${BUSYBOX:-$out/busybox-armv7l}" + # Pin first: a missing pin refuses BEFORE downloading, same ordering as + # build/fetch-kernel-tarball.sh. + [ -f "$sha_file" ] || { + echo "FATAL: no pinned sha256 for busybox (expected $sha_file): refusing to build from an unverified binary" >&2 + exit 1 + } + qemu_fetch_verified "$BB_URL" "$(cat "$sha_file")" "$BB" busybox +} + # Stage the shared rootfs skeleton (qemu/rootfs/ + busybox) into $1. # Requires qemu_get_busybox to have run (uses $BB). qemu_stage_rootfs() { diff --git a/qemu/mkimage.sh b/qemu/mkimage.sh index 83c2741..1f766c8 100755 --- a/qemu/mkimage.sh +++ b/qemu/mkimage.sh @@ -16,6 +16,8 @@ # the busybox skeleton; slot B keeps the skeleton as a known-good fallback. # Env: # BUSYBOX path to a local busybox binary (skips the download; still verified) +# RIG_BUSYBOX multiarch (default) or panel: the image's own BusyBox, built by +# qemu/build-busybox.sh (see qemu/busybox/README.md) # OUT output dir (default: qemu/out); image at $OUT/disk.img # PAYLOAD_DIR the directory whose binaries land in /usr/bin of both slots # (default qemu/payload). Lets one run boot its own payload set diff --git a/qemu/mkinitramfs.sh b/qemu/mkinitramfs.sh index a167ef9..ff11e9d 100755 --- a/qemu/mkinitramfs.sh +++ b/qemu/mkinitramfs.sh @@ -5,6 +5,8 @@ # # Env: # BUSYBOX path to a local busybox binary (skips the download; still verified) +# RIG_BUSYBOX multiarch (default) or panel: the image's own BusyBox, built by +# qemu/build-busybox.sh (see qemu/busybox/README.md) # OUT output dir (default: qemu/out); initramfs at $OUT/initramfs.cpio.gz # EXTRA_DIR a directory merged into the initramfs root (a test's scripts and # static binaries; init runs one on warden.run=) diff --git a/qemu/rootfs/etc/warden-lib.sh b/qemu/rootfs/etc/warden-lib.sh index 3fa5d35..95c3f10 100644 --- a/qemu/rootfs/etc/warden-lib.sh +++ b/qemu/rootfs/etc/warden-lib.sh @@ -54,6 +54,27 @@ warden_trap_power_signals() { trap 'echo "init: halt requested"; sync; ${WARDEN_POWEROFF_CMD:-poweroff -f}' USR1 } +# The warden.shell interactive shell, on the console's real tty so it gets +# job control. BusyBox's cttyhack does that where it is built in; the panel's +# BusyBox (qemu/build-busybox.sh, RIG_BUSYBOX=panel) has no cttyhack, so the +# tty is read from sysfs (the last console listed is /dev/console's) and +# setsid -c makes it the controlling terminal (flare-edge#2210). +# WARDEN_CONSOLE_ACTIVE and WARDEN_DEV_DIR point the host test at stand-ins. +warden_console_shell() { + if command -v cttyhack >/dev/null 2>&1; then + setsid cttyhack sh + return + fi + _wcs_tty="$(cat "${WARDEN_CONSOLE_ACTIVE:-/sys/class/tty/console/active}" 2>/dev/null)" + _wcs_tty="${_wcs_tty##* }" + if [ -n "$_wcs_tty" ] && [ -c "${WARDEN_DEV_DIR:-/dev}/$_wcs_tty" ]; then + setsid -c sh <>"${WARDEN_DEV_DIR:-/dev}/$_wcs_tty" >&0 2>&1 + else + echo "warden.shell: no console tty found; shell without job control" + sh + fi +} + # Idle forever in a way a trapped signal interrupts at once: a foreground # `sleep` would hold the trap until it returned, up to an hour later. warden_idle_forever() { diff --git a/qemu/rootfs/init b/qemu/rootfs/init index 2a701cf..741b1ab 100755 --- a/qemu/rootfs/init +++ b/qemu/rootfs/init @@ -75,7 +75,9 @@ fi if grep -qw warden.shell /proc/cmdline; then echo "warden.shell: interactive shell (exit to power off)" - setsid cttyhack sh + # shellcheck source=qemu/rootfs/etc/warden-lib.sh disable=SC1091 + . /etc/warden-lib.sh + warden_console_shell fi poweroff -f diff --git a/qemu/rootfs/sbin/init b/qemu/rootfs/sbin/init index 4834d35..8a197ac 100755 --- a/qemu/rootfs/sbin/init +++ b/qemu/rootfs/sbin/init @@ -48,7 +48,7 @@ mount_fatal() { echo "WARDEN-QEMU-MOUNT-FAILED $1" if grep -qw warden.shell /proc/cmdline; then echo "warden.shell: post-mortem shell (exit powers off)" - setsid cttyhack sh + warden_console_shell fi poweroff -f fi @@ -231,7 +231,7 @@ fi if grep -qw warden.shell /proc/cmdline; then echo "warden.shell: interactive shell (exit powers off)" - setsid cttyhack sh + warden_console_shell poweroff -f fi diff --git a/qemu/tests/busybox-panel-help.sh b/qemu/tests/busybox-panel-help.sh new file mode 100644 index 0000000..e48d721 --- /dev/null +++ b/qemu/tests/busybox-panel-help.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +# Check a built panel BusyBox against the bench capture (flare-edge#2210): +# its applet list must equal qemu/busybox/applets.txt and every applet's +# --help text must equal qemu/busybox/help.txt, which lists the options each +# applet of the panel's own binary accepts. The binary is ARM: the host runs +# it through binfmt, or through $QEMU_USER (e.g. qemu-arm) when set. +# +# bash qemu/tests/busybox-panel-help.sh [BIN] (default qemu/out/busybox-armv7l-panel) +set -euo pipefail +HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +BB_DIR="$HERE/../busybox" +BIN="${1:-$HERE/../out/busybox-armv7l-panel}" +[ -x "$BIN" ] || { echo "FATAL: no busybox binary at $BIN (run qemu/build-busybox.sh)" >&2; exit 1; } +export LC_ALL=C +SCRATCH="$(mktemp -d "${TMPDIR:-/tmp}/bb-panel-help.XXXXXX")" +trap 'rm -rf "$SCRATCH"' EXIT +# Word splitting is wanted: QEMU_USER may carry arguments. +# shellcheck disable=SC2206 +RUN=(${QEMU_USER:-} "$BIN") + +"${RUN[@]}" --list | sort > "$SCRATCH/list.txt" || { + echo "FATAL: $BIN does not run here (no binfmt for ARM? set QEMU_USER=qemu-arm)" >&2 + exit 1 +} +if ! diff -u <(sort "$BB_DIR/applets.txt") "$SCRATCH/list.txt"; then + echo "FAIL: the applet list differs from qemu/busybox/applets.txt (- panel, + built)" >&2 + exit 1 +fi +# Same shape as flare-edge tools/bench/busybox-help/capture.sh: the banner +# line (version and build date) and blank lines dropped. +while IFS= read -r a; do + echo "== $a" + "${RUN[@]}" "$a" --help 2>&1 | sed 1d | sed '/^$/d' || true +done < "$SCRATCH/list.txt" > "$SCRATCH/help.txt" +if ! diff -u <(grep -v '^#' "$BB_DIR/help.txt") "$SCRATCH/help.txt"; then + echo "FAIL: --help differs from the panel's (qemu/busybox/help.txt; - panel, + built)" >&2 + exit 1 +fi +echo "busybox-panel-help: $(wc -l < "$SCRATCH/list.txt") applets, list and --help equal to the panel's" diff --git a/qemu/tests/busybox-panel-test.sh b/qemu/tests/busybox-panel-test.sh new file mode 100644 index 0000000..f1d2c57 --- /dev/null +++ b/qemu/tests/busybox-panel-test.sh @@ -0,0 +1,141 @@ +#!/usr/bin/env bash +# Offline checks for the rig's panel BusyBox inputs (qemu/busybox/, +# qemu/build-busybox.sh, RIG_BUSYBOX in qemu/lib.sh), flare-edge#2210. No +# compiler, network or VM: the build helpers run against small stand-in files. +# +# bash qemu/tests/busybox-panel-test.sh +set -uo pipefail +HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +QEMU_DIR="$(cd "$HERE/.." && pwd)" +REPO="$(cd "$QEMU_DIR/.." && pwd)" +BB_DIR="$QEMU_DIR/busybox" +SCRATCH="$(mktemp -d "${TMPDIR:-/tmp}/bb-panel-test.XXXXXX")" +trap 'rm -rf "$SCRATCH"' EXIT +FAIL=0 +pass() { printf '[PASS] %s\n' "$1"; } +fail() { printf '[FAIL] %s\n' "$1"; FAIL=1; } +export LC_ALL=C + +# shellcheck source=qemu/build-busybox.sh disable=SC1091 +. "$QEMU_DIR/build-busybox.sh" +# The sourced script sets -e for its own run; these checks report each failure. +set +e + +# 1. Every setting the image's applet patch makes is in the panel config. +PATCH="$REPO/luckfox-sdk-patches/buildroot/patches/0001-busybox-applets.patch" +missing="$(sed -n -e 's/^+\(CONFIG_[A-Za-z0-9_]*=.*\)$/\1/p' \ + -e 's/^+\(# CONFIG_[A-Za-z0-9_]* is not set\)$/\1/p' "$PATCH" | + while IFS= read -r l; do grep -qxF -- "$l" "$BB_DIR/panel.config" || printf '%s\n' "$l"; done)" +n="$(grep -cE '^\+(CONFIG_|# CONFIG_)' "$PATCH")" +if [ "$n" -gt 0 ] && [ -z "$missing" ]; then + pass "panel.config carries all $n settings of the image's applet patch" +else + fail "panel.config lacks settings of $PATCH: ${missing:-none read}" +fi + +# 2. The rig differs from the panel only in linking and name lookup. +got="$(grep -Ev '^(#|$)' "$BB_DIR/rig.fragment" | sed 's/=.*//' | sort | tr '\n' ' ')" +if [ "$got" = "CONFIG_STATIC CONFIG_USE_BB_PWD_GRP CONFIG_USE_BB_SHADOW " ]; then + pass "rig.fragment sets only STATIC, USE_BB_PWD_GRP and USE_BB_SHADOW" +else + fail "rig.fragment sets symbols beyond linking and name lookup: $got" +fi + +# 3. Applying the fragment replaces exactly its symbols. +bb_apply_fragment "$BB_DIR/panel.config" "$BB_DIR/rig.fragment" > "$SCRATCH/rig.config" +d="$(diff <(bb_settings "$BB_DIR/panel.config") <(bb_settings "$SCRATCH/rig.config"))" +want_d="$(printf '%s\n' '< CONFIG_STATIC is not set' '< CONFIG_USE_BB_PWD_GRP is not set' \ + '< CONFIG_USE_BB_SHADOW is not set' '> CONFIG_STATIC=y' '> CONFIG_USE_BB_PWD_GRP=y' \ + '> CONFIG_USE_BB_SHADOW=y')" +if [ "$(grep -E '^[<>]' <<<"$d" | sort)" = "$want_d" ]; then + pass "the rig config is the panel config with the three fragment lines" +else + fail "the rig config differs from the panel config by: $d" +fi +printf 'CONFIG_A=y\n# CONFIG_B is not set\nCONFIG_C="x"\n' > "$SCRATCH/p.config" +printf '# note\nNOT_A_SYMBOL=y\n' > "$SCRATCH/bad.fragment" +if ! bb_apply_fragment "$SCRATCH/p.config" "$SCRATCH/bad.fragment" >/dev/null 2>"$SCRATCH/frag.err" && + grep -q 'bad fragment line' "$SCRATCH/frag.err"; then + pass "a fragment line that is not CONFIG_* is refused" +else + fail "a bad fragment line was accepted" +fi + +# 4. A Kconfig rewrite of any setting fails and names it. +cp "$SCRATCH/p.config" "$SCRATCH/same.config" +printf '#\n# a header\n' >> "$SCRATCH/same.config" +if bb_check_config "$SCRATCH/p.config" "$SCRATCH/same.config" 2>/dev/null; then + pass "a config that only gained comments passes the rewrite check" +else + fail "the rewrite check failed a config with the same settings" +fi +printf 'CONFIG_A=y\nCONFIG_C="x"\n' > "$SCRATCH/dropped.config" +if ! bb_check_config "$SCRATCH/p.config" "$SCRATCH/dropped.config" 2>"$SCRATCH/cfg.err" && + grep -q 'CONFIG_B is not set' "$SCRATCH/cfg.err"; then + pass "a setting Kconfig dropped fails the rewrite check, named" +else + fail "a dropped setting passed the rewrite check" +fi + +# 5. The applet check compares names, not install paths. +printf 'b\na\n' > "$SCRATCH/applets.txt" +printf '/bin/a\n/usr/sbin/b\n' > "$SCRATCH/ok.links" +printf '/bin/a\n/usr/sbin/b\n/usr/bin/timeout\n' > "$SCRATCH/extra.links" +if bb_check_applets "$SCRATCH/ok.links" "$SCRATCH/applets.txt" 2>/dev/null; then + pass "the same applets under install paths pass" +else + fail "matching applets failed the applet check" +fi +if ! bb_check_applets "$SCRATCH/extra.links" "$SCRATCH/applets.txt" 2>"$SCRATCH/app.err" && + grep -q '> timeout' "$SCRATCH/app.err"; then + pass "an applet the panel lacks fails the applet check, named" +else + fail "an extra applet passed the applet check" +fi + +# 6. The two bench fixtures agree: applets.txt is help.txt's applet list. +if [ -s "$BB_DIR/applets.txt" ] && [ -z "$(sort "$BB_DIR/applets.txt" | uniq -d)" ] && + [ "$(sort "$BB_DIR/applets.txt")" = "$(sed -n 's/^== //p' "$BB_DIR/help.txt" | sort)" ]; then + pass "applets.txt ($(wc -l < "$BB_DIR/applets.txt") applets) matches help.txt" +else + fail "applets.txt and help.txt list different applets (or duplicates)" +fi + +# 7. RIG_BUSYBOX refusals, before any download or build. +run_get() { (QEMU_DIR="$QEMU_DIR" OUT="$SCRATCH/out" qemu_get_busybox) >/dev/null 2>"$SCRATCH/get.err"; } +if ! RIG_BUSYBOX=bogus run_get && grep -q 'RIG_BUSYBOX must be multiarch or panel' "$SCRATCH/get.err"; then + pass "an unknown RIG_BUSYBOX is refused" +else + fail "an unknown RIG_BUSYBOX was accepted" +fi +if ! RIG_BUSYBOX=panel BUSYBOX=/nonexistent run_get && grep -q 'names a prebuilt binary' "$SCRATCH/get.err"; then + pass "RIG_BUSYBOX=panel with BUSYBOX set is refused" +else + fail "RIG_BUSYBOX=panel accepted a prebuilt BUSYBOX" +fi + +# 8. No cross compiler: the build fails closed, it never falls back. +if ! CROSS_COMPILE=no-such-cross- OUT="$SCRATCH/out" bash "$QEMU_DIR/build-busybox.sh" >/dev/null 2>"$SCRATCH/cc.err" && + grep -q 'no no-such-cross-gcc on PATH' "$SCRATCH/cc.err" && [ ! -e "$SCRATCH/out/busybox-armv7l-panel" ]; then + pass "a missing cross compiler fails the build with no binary" +else + fail "the build did not fail closed without a cross compiler" +fi + +# 9. The Buildroot patches are there and every one is a patch. +np=0 +for p in "$BB_DIR"/patches/*.patch; do + grep -q '^+++ ' "$p" || fail "$p has no diff" + np=$((np + 1)) +done +if [ "$np" -eq 11 ]; then + pass "the 11 Buildroot 2025.02.8 busybox patches are present" +else + fail "expected 11 Buildroot busybox patches, found $np" +fi + +if [ "$FAIL" -ne 0 ]; then + echo "busybox-panel: FAILED" + exit 1 +fi +echo "busybox-panel: all checks passed" diff --git a/qemu/tests/console-shell-test.sh b/qemu/tests/console-shell-test.sh new file mode 100644 index 0000000..aa4301a --- /dev/null +++ b/qemu/tests/console-shell-test.sh @@ -0,0 +1,78 @@ +#!/usr/bin/env bash +# Offline test for warden_console_shell (qemu/rootfs/etc/warden-lib.sh), the +# warden.shell debug shell: with cttyhack it runs `setsid cttyhack sh` as +# before; without it (the panel's BusyBox, RIG_BUSYBOX=panel) it opens the +# console's tty from sysfs and runs `setsid -c sh` on it; with no tty it says +# so and runs a plain sh (flare-edge#2210). Stub commands record each call. +# +# bash qemu/tests/console-shell-test.sh (WARDEN_TEST_SH="busybox sh" for the rig's shell) +set -uo pipefail +HERE="$(cd "$(dirname "$0")" && pwd)" +LIB="$HERE/../rootfs/etc/warden-lib.sh" +SH="${WARDEN_TEST_SH:-sh}" +WORK="$(mktemp -d "${TMPDIR:-/tmp}/console-shell.XXXXXX")" || exit 1 +trap 'rm -rf "$WORK"' EXIT +FAIL=0 +pass() { printf '[PASS] %s\n' "$1"; } +fail() { printf '[FAIL] %s\n' "$1"; FAIL=1; } + +# Stubs: setsid and sh record their argv and where stdin points. +mkdir -p "$WORK/bin" "$WORK/bin-ctty" +for c in setsid sh; do + # The single-quoted text is the stub's own source. + # shellcheck disable=SC2016 + printf '#!/bin/sh\necho "%s $*" >> "$CALLS"\nreadlink /proc/self/fd/0 >> "$CALLS"\n' "$c" > "$WORK/bin/$c" + chmod 0755 "$WORK/bin/$c" +done +cp "$WORK/bin/setsid" "$WORK/bin/sh" "$WORK/bin-ctty/" +printf '#!/bin/sh\nexit 0\n' > "$WORK/bin-ctty/cttyhack" +chmod 0755 "$WORK/bin-ctty/cttyhack" + +# run_case : the calls the helper made. +# The helper runs with only the stub dir and the host's basic tools on PATH, +# so a host cttyhack (none expected) cannot leak in. +run_case() { + local calls="$WORK/calls.$RANDOM" + : > "$calls" + # $SH may carry arguments ("busybox sh"): split on purpose. + # shellcheck disable=SC2086 + CALLS="$calls" WARDEN_CONSOLE_ACTIVE="$2" WARDEN_DEV_DIR=/dev \ + $SH -c ". '$LIB'; PATH='$1':/usr/bin:/bin; warden_console_shell" < /dev/zero > "$WORK/out" 2>&1 + cat "$calls" +} + +printf 'tty1 null\n' > "$WORK/active" +got="$(run_case "$WORK/bin-ctty" "$WORK/active")" +if [ "$(head -n 1 <<<"$got")" = "setsid cttyhack sh" ]; then + pass "with cttyhack: setsid cttyhack sh" +else + fail "with cttyhack the helper ran: $got" +fi + +got="$(run_case "$WORK/bin" "$WORK/active")" +if [ "$got" = "$(printf 'setsid -c sh\n/dev/null')" ]; then + pass "without cttyhack: setsid -c sh on the last console tty (/dev/null stand-in)" +else + fail "without cttyhack the helper ran: $got" +fi + +got="$(run_case "$WORK/bin" "$WORK/no-such-active")" +if [ "$(head -n 1 <<<"$got")" = "sh " ] && grep -q 'no console tty found' "$WORK/out"; then + pass "no console tty: says so and runs a plain sh" +else + fail "with no console tty the helper ran: $got ($(cat "$WORK/out"))" +fi + +printf 'ttyNOPE\n' > "$WORK/active-bad" +got="$(run_case "$WORK/bin" "$WORK/active-bad")" +if [ "$(head -n 1 <<<"$got")" = "sh " ]; then + pass "a console name with no device node: plain sh, no setsid -c" +else + fail "a missing tty node ran: $got" +fi + +if [ "$FAIL" -ne 0 ]; then + echo "console-shell: FAILED" + exit 1 +fi +echo "console-shell: all checks passed" diff --git a/tests/mk-bootimg/run-ci-wiring-tests.sh b/tests/mk-bootimg/run-ci-wiring-tests.sh index 489cac1..059e9d4 100755 --- a/tests/mk-bootimg/run-ci-wiring-tests.sh +++ b/tests/mk-bootimg/run-ci-wiring-tests.sh @@ -41,6 +41,9 @@ scripts=( "tests/mk-bootimg/run-boot-img-validate-tests.sh" "tests/mk-bootimg/run-help-tests.sh" "tests/mk-bootimg/run-ci-wiring-tests.sh" + "qemu/tests/busybox-panel-test.sh" + "qemu/tests/busybox-panel-help.sh" + "qemu/tests/console-shell-test.sh" ) fail=0