extract_uuencoded_binary.sh 464 B

1234567891011121314151617
  1. #!/bin/sh
  2. # Extract uuencoded and bzipped busybox binaries
  3. # from system-image-*.log files
  4. for logfile in system-image-*.log; do
  5. grep -q '^begin 744 busybox.bz2' "$logfile" \
  6. || { echo "No busybox.bz2 in $logfile"; continue; }
  7. arch=${logfile%.log}
  8. arch=${arch#system-image-}
  9. test -e "busybox-$arch" \
  10. && { echo "busybox-$arch exists, not overwriting"; continue; }
  11. uudecode -o - "$logfile" | bunzip2 >"busybox-$arch" \
  12. && chmod 755 "busybox-$arch"
  13. done