-
Notifications
You must be signed in to change notification settings - Fork 337
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Script to tar up mkroot output for web page, with top level README.
- Loading branch information
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Use ./run-qemu.sh to boot system image to a shell prompt, "exit" when done. | ||
|
||
Additional arguments to run-qemu.sh are QEMU arguments, | ||
$KARGS contains additional linux kernel arguments. For example: | ||
|
||
KARGS=quiet ./run-qemu.sh -hda docs/linux-fullconfig | ||
# cat /dev/?da | ||
# exit | ||
|
||
To extract the root filesystem from cpio.gz and chroot into it | ||
|
||
( mkdir fs && cd fs && zcat ../initramfs.cpio.gz | cpio -i -d -H newc ) | ||
chroot fs /init | ||
|
||
To recreate the initramfs.cpio.gz from fs directory | ||
|
||
( cd fs && find . -printf '%P\n' | cpio -o -H newc -R +0:+0 | gzip ) \ | ||
> initramfs.cpio.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
# tar up completed system images to send to website, with READMEs | ||
|
||
for i in root/*/run-qemu.sh | ||
do | ||
i=${i%/run-qemu.sh} j=${i#root/} | ||
[ ! -e "$i" ] && continue | ||
# Add README, don't include "fs" dir (you can extract it from cpio.gz) | ||
cp mkroot/README.root $i/docs/README && | ||
tar cvzfC $i.tgz root --exclude=fs $j || break | ||
done | ||
|
||
# Add top level README | ||
KVERS=$(toybox sed -n '3s@# Linux/[^ ]* \(.*\) Kernel Configuration@\1@p' root/*/docs/linux-fullconfig) | ||
cat > root/README << EOF | ||
Bootable system images created by: | ||
mkroot/mkroot.sh LINUX=~/linux CROSS=allnonstop | ||
Each system image is built from two packages: toybox and Linux. | ||
Run the ./qemu-*.sh script in the tarball to boot the system | ||
to a shell prompt under qemu. Run the "exit" command to shut down the | ||
virtual system and exit the emulator. | ||
See https://landley.net/toybox/FAQ.html#mkroot for details. | ||
Built from mkroot $(git describe --tags), and Linux $KVERS with patches in linux-patches/ | ||
EOF | ||
|
||
# scp root/*.tgz root/README website:dir |