annotate sources/toys/gen_initramfs_list.sh @ 1458:60f1087591ac

Add ability to specify a package to rebuild to build.sh with REBUILD= (and then dependencies take it from there to the system image).
author Rob Landley <rob@landley.net>
date Thu, 20 Oct 2011 02:02:10 -0500
parents 1277d5ae4507
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
572
1277d5ae4507 Move bin/qemu-setup.sh to sbin/init.sh and do more work on initramfs packaging. (Doesn't work yet.)
Rob Landley <rob@landley.net>
parents:
diff changeset
1 #!/bin/bash
1277d5ae4507 Move bin/qemu-setup.sh to sbin/init.sh and do more work on initramfs packaging. (Doesn't work yet.)
Rob Landley <rob@landley.net>
parents:
diff changeset
2
1277d5ae4507 Move bin/qemu-setup.sh to sbin/init.sh and do more work on initramfs packaging. (Doesn't work yet.)
Rob Landley <rob@landley.net>
parents:
diff changeset
3 if [ ! -d "$1" ]
1277d5ae4507 Move bin/qemu-setup.sh to sbin/init.sh and do more work on initramfs packaging. (Doesn't work yet.)
Rob Landley <rob@landley.net>
parents:
diff changeset
4 then
1277d5ae4507 Move bin/qemu-setup.sh to sbin/init.sh and do more work on initramfs packaging. (Doesn't work yet.)
Rob Landley <rob@landley.net>
parents:
diff changeset
5 echo "usage: gen_initramfs_list.sh dirname" >&2
1277d5ae4507 Move bin/qemu-setup.sh to sbin/init.sh and do more work on initramfs packaging. (Doesn't work yet.)
Rob Landley <rob@landley.net>
parents:
diff changeset
6 exit 1
1277d5ae4507 Move bin/qemu-setup.sh to sbin/init.sh and do more work on initramfs packaging. (Doesn't work yet.)
Rob Landley <rob@landley.net>
parents:
diff changeset
7 fi
1277d5ae4507 Move bin/qemu-setup.sh to sbin/init.sh and do more work on initramfs packaging. (Doesn't work yet.)
Rob Landley <rob@landley.net>
parents:
diff changeset
8
1277d5ae4507 Move bin/qemu-setup.sh to sbin/init.sh and do more work on initramfs packaging. (Doesn't work yet.)
Rob Landley <rob@landley.net>
parents:
diff changeset
9 LEN=$(echo $1 | wc -c)
1277d5ae4507 Move bin/qemu-setup.sh to sbin/init.sh and do more work on initramfs packaging. (Doesn't work yet.)
Rob Landley <rob@landley.net>
parents:
diff changeset
10
1277d5ae4507 Move bin/qemu-setup.sh to sbin/init.sh and do more work on initramfs packaging. (Doesn't work yet.)
Rob Landley <rob@landley.net>
parents:
diff changeset
11 find "$1" | while read i
1277d5ae4507 Move bin/qemu-setup.sh to sbin/init.sh and do more work on initramfs packaging. (Doesn't work yet.)
Rob Landley <rob@landley.net>
parents:
diff changeset
12 do
1277d5ae4507 Move bin/qemu-setup.sh to sbin/init.sh and do more work on initramfs packaging. (Doesn't work yet.)
Rob Landley <rob@landley.net>
parents:
diff changeset
13 PERM=$(stat -c %a "$i")
1277d5ae4507 Move bin/qemu-setup.sh to sbin/init.sh and do more work on initramfs packaging. (Doesn't work yet.)
Rob Landley <rob@landley.net>
parents:
diff changeset
14 NAME="$(echo $i | cut -b ${LEN}-)"
1277d5ae4507 Move bin/qemu-setup.sh to sbin/init.sh and do more work on initramfs packaging. (Doesn't work yet.)
Rob Landley <rob@landley.net>
parents:
diff changeset
15
1277d5ae4507 Move bin/qemu-setup.sh to sbin/init.sh and do more work on initramfs packaging. (Doesn't work yet.)
Rob Landley <rob@landley.net>
parents:
diff changeset
16 [ -z "$NAME" ] && continue
1277d5ae4507 Move bin/qemu-setup.sh to sbin/init.sh and do more work on initramfs packaging. (Doesn't work yet.)
Rob Landley <rob@landley.net>
parents:
diff changeset
17
1277d5ae4507 Move bin/qemu-setup.sh to sbin/init.sh and do more work on initramfs packaging. (Doesn't work yet.)
Rob Landley <rob@landley.net>
parents:
diff changeset
18 if [ -L "$i" ]
1277d5ae4507 Move bin/qemu-setup.sh to sbin/init.sh and do more work on initramfs packaging. (Doesn't work yet.)
Rob Landley <rob@landley.net>
parents:
diff changeset
19 then
1277d5ae4507 Move bin/qemu-setup.sh to sbin/init.sh and do more work on initramfs packaging. (Doesn't work yet.)
Rob Landley <rob@landley.net>
parents:
diff changeset
20 echo "slink $NAME $(readlink "$i") $PERM 0 0"
1277d5ae4507 Move bin/qemu-setup.sh to sbin/init.sh and do more work on initramfs packaging. (Doesn't work yet.)
Rob Landley <rob@landley.net>
parents:
diff changeset
21 elif [ -f "$i" ]
1277d5ae4507 Move bin/qemu-setup.sh to sbin/init.sh and do more work on initramfs packaging. (Doesn't work yet.)
Rob Landley <rob@landley.net>
parents:
diff changeset
22 then
1277d5ae4507 Move bin/qemu-setup.sh to sbin/init.sh and do more work on initramfs packaging. (Doesn't work yet.)
Rob Landley <rob@landley.net>
parents:
diff changeset
23 echo "file $NAME $i $PERM 0 0"
1277d5ae4507 Move bin/qemu-setup.sh to sbin/init.sh and do more work on initramfs packaging. (Doesn't work yet.)
Rob Landley <rob@landley.net>
parents:
diff changeset
24 elif [ -d "$i" ]
1277d5ae4507 Move bin/qemu-setup.sh to sbin/init.sh and do more work on initramfs packaging. (Doesn't work yet.)
Rob Landley <rob@landley.net>
parents:
diff changeset
25 then
1277d5ae4507 Move bin/qemu-setup.sh to sbin/init.sh and do more work on initramfs packaging. (Doesn't work yet.)
Rob Landley <rob@landley.net>
parents:
diff changeset
26 echo "dir $NAME $PERM 0 0"
1277d5ae4507 Move bin/qemu-setup.sh to sbin/init.sh and do more work on initramfs packaging. (Doesn't work yet.)
Rob Landley <rob@landley.net>
parents:
diff changeset
27 fi
1277d5ae4507 Move bin/qemu-setup.sh to sbin/init.sh and do more work on initramfs packaging. (Doesn't work yet.)
Rob Landley <rob@landley.net>
parents:
diff changeset
28 done