aboutsummaryrefslogtreecommitdiff
path: root/mkroot/tar-for-web.sh
blob: c31b2888c9140d9543ec2297b0c72d19e322e85f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash

# tar up completed system images to send to website, with READMEs

rm -f root/toybox-* root/*.tgz
for i in root/*/fs/bin/toybox
do
  cp $i root/toybox-$(echo $i | sed 's@root/\([^/]*\)/.*@\1@') || exit 1
done

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 || exit 1
done

# Generate 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 each 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

if [ $# -eq 2 ]
then
  scp root/toybox-* "$1/$2/" &&
  scp root/*.tgz root/README "$1/mkroot/$2/"
fi