mdev.txt: explain the meaning of a leading "-"
[oweals/busybox.git] / qemu_multiarch_testing / extract_uuencoded_binary.sh
1 #!/bin/sh
2 # Extract uuencoded and bzipped busybox binaries
3 # from system-image-*.log files
4
5 for logfile in system-image-*.log; do
6         grep -q '^begin 744 busybox.bz2' "$logfile" \
7         || { echo "No busybox.bz2 in $logfile"; continue; }
8
9         arch=${logfile%.log}
10         arch=${arch#system-image-}
11
12         test -e "busybox-$arch" \
13         && { echo "busybox-$arch exists, not overwriting"; continue; }
14
15         uudecode -o - "$logfile" | bunzip2 >"busybox-$arch" \
16         && chmod 755 "busybox-$arch"
17 done