b9874d0941
Add redbear-usb-storage-check in-guest binary that validates USB mass storage read and write I/O: discovers /scheme/disk/ devices, writes a test pattern to sector 2048, reads it back, verifies match, restores original content. Updates test-usb-storage-qemu.sh with write-proof verification step. Includes all accumulated Red Bear OS work: kernel patches, relibc patches, driver infrastructure, DRM/GPU, KDE recipes, firmware, validation tooling, build system hardening, and documentation.
134 lines
2.3 KiB
TOML
134 lines
2.3 KiB
TOML
# TODO Fix coreutils i18n/l10n behavior on Redox
|
|
# TODO Fix locale init bug on aarch64 before removing patches
|
|
# TODO https://github.com/uutils/coreutils/commit/e6f7ad06 broke locales on x86_64
|
|
[source]
|
|
git = "https://github.com/uutils/coreutils"
|
|
rev = "1f7c81f5d2d3e56c518349c0392158871a1ea9ec"
|
|
patches = [
|
|
"redox.patch"
|
|
]
|
|
|
|
[build]
|
|
template = "custom"
|
|
script = """
|
|
DYNAMIC_INIT
|
|
python3 - <<'PY'
|
|
import os
|
|
from pathlib import Path
|
|
|
|
tmp_dir = Path(os.environ["COOKBOOK_SOURCE"]) / "src/uu/sort/src/tmp_dir.rs"
|
|
text = tmp_dir.read_text()
|
|
text = text.replace('use std::sync::atomic::{AtomicBool, Ordering};\\n', '')
|
|
text = text.replace('use uucore::{\\n error::{UResult, USimpleError},\\n show_error, translate,\\n};\\n', 'use uucore::error::UResult;\\n')
|
|
text = text.replace(' path::{Path, PathBuf},\\n', ' path::PathBuf,\\n')
|
|
start = text.find('/// Remove the directory at `path` by deleting its child files and then itself.')
|
|
if start != -1:
|
|
end = text.find('\\n}\\n', start)
|
|
if end != -1:
|
|
text = text[:start] + text[end + 3:]
|
|
tmp_dir.write_text(text)
|
|
PY
|
|
# TODO: upstream changes, consider using feat_require_unix_core if relibc is ready?
|
|
CARGO_PROFILE_RELEASE_LTO=thin cookbook_cargo --no-default-features --features feat_os_unix_redox,kill --bin coreutils
|
|
|
|
BINS=(
|
|
'['
|
|
b2sum
|
|
b3sum
|
|
base32
|
|
base64
|
|
basename
|
|
basenc
|
|
cat
|
|
chmod
|
|
cksum
|
|
comm
|
|
cp
|
|
csplit
|
|
cut
|
|
date
|
|
dd
|
|
#df not working, use redox coreutils
|
|
dir
|
|
dircolors
|
|
dirname
|
|
du
|
|
echo
|
|
env
|
|
expand
|
|
expr
|
|
factor
|
|
false
|
|
fmt
|
|
fold
|
|
hashsum
|
|
head
|
|
join
|
|
install
|
|
kill
|
|
link
|
|
ln
|
|
ls
|
|
md5sum
|
|
mkdir
|
|
mktemp
|
|
more
|
|
mv
|
|
nl
|
|
nproc
|
|
numfmt
|
|
od
|
|
paste
|
|
pr
|
|
printenv
|
|
printf
|
|
ptx
|
|
pwd
|
|
readlink
|
|
realpath
|
|
rm
|
|
rmdir
|
|
seq
|
|
sha1sum
|
|
sha224sum
|
|
sha256sum
|
|
sha3-224sum
|
|
sha3-256sum
|
|
sha3-384sum
|
|
sha3-512sum
|
|
sha384sum
|
|
sha3sum
|
|
sha512sum
|
|
shake128sum
|
|
shake256sum
|
|
shred
|
|
shuf
|
|
sleep
|
|
sort
|
|
split
|
|
stat
|
|
sum
|
|
tac
|
|
tail
|
|
tee
|
|
test
|
|
touch
|
|
tr
|
|
true
|
|
truncate
|
|
tsort
|
|
unexpand
|
|
uname
|
|
uniq
|
|
unlink
|
|
vdir
|
|
wc
|
|
yes
|
|
)
|
|
|
|
for bin in "${BINS[@]}"
|
|
do
|
|
ln -sv coreutils "${COOKBOOK_STAGE}/usr/bin/$bin"
|
|
done
|
|
"""
|