Mercurial > hg > aboriginal
view sources/toys/gen_initramfs_list.sh @ 1737:1acbe7e78d9d draft
Switch from bz2 to gz tarball output.
bz2 is slowly being replaced by lz variants, but gzip isn't going anywhere.
(It retains a niche as a streaming protocol, it's the 80/20 solution optimizing
for speed, low memory requirements, and simple compressor implementation.)
author | Rob Landley <rob@landley.net> |
---|---|
date | Fri, 20 Feb 2015 13:12:45 -0600 |
parents | 1277d5ae4507 |
children |
line wrap: on
line source
#!/bin/bash if [ ! -d "$1" ] then echo "usage: gen_initramfs_list.sh dirname" >&2 exit 1 fi LEN=$(echo $1 | wc -c) find "$1" | while read i do PERM=$(stat -c %a "$i") NAME="$(echo $i | cut -b ${LEN}-)" [ -z "$NAME" ] && continue if [ -L "$i" ] then echo "slink $NAME $(readlink "$i") $PERM 0 0" elif [ -f "$i" ] then echo "file $NAME $i $PERM 0 0" elif [ -d "$i" ] then echo "dir $NAME $PERM 0 0" fi done