diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2014-01-01 01:25:17 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-01-06 11:13:57 +0000 |
commit | 63281708fab30adc4ca1a506deefbf8a54dcce6d (patch) | |
tree | bf6b9b48314909bd062f4fba473708065cbd6c81 /meta/recipes-devtools/e2fsprogs/e2fsprogs-1.42.8/populate-extfs.sh | |
parent | 5ddb7d4ebb135e288ab56b44aceabb3578ae9ed1 (diff) | |
download | poky-63281708fab30adc4ca1a506deefbf8a54dcce6d.tar.gz |
e2fsprogs: upgrade to 1.42.9
* Upgrade to 1.42.9
* Remove the following patches since they have been merged/fixed by
upstream:
- debugfs-extent-header.patch
- debugfs-sparse-copy.patch
- debugfs-too-short.patch
- e2fsprogs-fix-tests-f_extent_oobounds.patch
- fallocate.patch
* The populate-extfs.sh had been merged by the upstream, but I'd like to
go on using the previous one which is from our meta layer, they are a
little different, and the script would be dropped when we use the mke2fs
to populate the rootfs.
* Sumitted the patch for populate-extfs.sh (from Søren Holm) to upstream.
* Submitted fix-icache.patch to upstream, I wrongly thought it was not
applicable to the upstream, but it does.
* Join the do_install() and do_install_append() together.
(From OE-Core rev: 82cc941128f9eaf57c3a9a648fc58227f6c1956c)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/e2fsprogs/e2fsprogs-1.42.8/populate-extfs.sh')
-rw-r--r-- | meta/recipes-devtools/e2fsprogs/e2fsprogs-1.42.8/populate-extfs.sh | 96 |
1 files changed, 0 insertions, 96 deletions
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs-1.42.8/populate-extfs.sh b/meta/recipes-devtools/e2fsprogs/e2fsprogs-1.42.8/populate-extfs.sh deleted file mode 100644 index 7de720b115..0000000000 --- a/meta/recipes-devtools/e2fsprogs/e2fsprogs-1.42.8/populate-extfs.sh +++ /dev/null | |||
@@ -1,96 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | do_usage () { | ||
4 | cat << _EOF | ||
5 | Usage: populate-extfs.sh <source> <device> | ||
6 | Create an ext2/ext3/ext4 filesystem from a directory or file | ||
7 | |||
8 | source: The source directory or file | ||
9 | device: The target device | ||
10 | |||
11 | _EOF | ||
12 | exit 1 | ||
13 | } | ||
14 | |||
15 | [ $# -ne 2 ] && do_usage | ||
16 | |||
17 | SRCDIR=${1%%/} | ||
18 | DEVICE=$2 | ||
19 | DEBUGFS="debugfs" | ||
20 | |||
21 | { | ||
22 | CWD="/" | ||
23 | find $SRCDIR | while read FILE; do | ||
24 | TGT="${FILE##*/}" | ||
25 | DIR="${FILE#$SRCDIR}" | ||
26 | DIR="${DIR%$TGT}" | ||
27 | |||
28 | # Skip the root dir | ||
29 | [ ! -z "$DIR" ] || continue | ||
30 | [ ! -z "$TGT" ] || continue | ||
31 | |||
32 | if [ "$DIR" != "$CWD" ]; then | ||
33 | echo "cd $DIR" | ||
34 | CWD="$DIR" | ||
35 | fi | ||
36 | |||
37 | # Only stat once since stat is a time consuming command | ||
38 | STAT=$(stat -c "TYPE=\"%F\";DEVNO=\"0x%t 0x%T\";MODE=\"%f\";U=\"%u\";G=\"%g\"" "$FILE") | ||
39 | eval $STAT | ||
40 | |||
41 | case $TYPE in | ||
42 | "directory") | ||
43 | echo "mkdir $TGT" | ||
44 | ;; | ||
45 | "regular file" | "regular empty file") | ||
46 | echo "write \"$FILE\" \"$TGT\"" | ||
47 | ;; | ||
48 | "symbolic link") | ||
49 | LINK_TGT=$(readlink "$FILE") | ||
50 | echo "symlink \"$TGT\" \"$LINK_TGT\"" | ||
51 | ;; | ||
52 | "block special file") | ||
53 | echo "mknod \"$TGT\" b $DEVNO" | ||
54 | ;; | ||
55 | "character special file") | ||
56 | echo "mknod \"$TGT\" c $DEVNO" | ||
57 | ;; | ||
58 | "fifo") | ||
59 | echo "mknod \"$TGT\" p" | ||
60 | ;; | ||
61 | *) | ||
62 | echo "Unknown/unhandled file type '$TYPE' file: $FILE" 1>&2 | ||
63 | ;; | ||
64 | esac | ||
65 | |||
66 | # Set the file mode | ||
67 | echo "sif \"$TGT\" mode 0x$MODE" | ||
68 | |||
69 | # Set uid and gid | ||
70 | echo "sif \"$TGT\" uid $U" | ||
71 | echo "sif \"$TGT\" gid $G" | ||
72 | done | ||
73 | |||
74 | # Handle the hard links. | ||
75 | # Save the hard links to a file, use the inode number as the filename, for example: | ||
76 | # If a and b's inode number is 6775928, save a and b to /tmp/tmp.VrCwHh5gdt/6775928. | ||
77 | INODE_DIR=`mktemp -d` || exit 1 | ||
78 | for i in `find $SRCDIR -type f -links +1 -printf 'INODE=%i###FN=%p\n'`; do | ||
79 | eval `echo $i | sed 's$###$ $'` | ||
80 | echo ${FN#$SRCDIR} >>$INODE_DIR/$INODE | ||
81 | done | ||
82 | # Use the debugfs' ln and "sif links_count" to handle them. | ||
83 | for i in `ls $INODE_DIR`; do | ||
84 | # The link source | ||
85 | SRC=`head -1 $INODE_DIR/$i` | ||
86 | # Remove the files and link them again except the first one | ||
87 | for TGT in `sed -n -e '1!p' $INODE_DIR/$i`; do | ||
88 | echo "rm $TGT" | ||
89 | echo "ln $SRC $TGT" | ||
90 | done | ||
91 | LN_CNT=`cat $INODE_DIR/$i | wc -l` | ||
92 | # Set the links count | ||
93 | echo "sif $SRC links_count $LN_CNT" | ||
94 | done | ||
95 | rm -fr $INODE_DIR | ||
96 | } | $DEBUGFS -w -f - $DEVICE | ||