aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorThayne Harbaugh <tharbaugh@lnxi.com>2005-01-07 21:42:25 -0800
committerLinus Torvalds <torvalds@evo.osdl.org>2005-01-07 21:42:25 -0800
commit7a2398ccd5341e56172e23489ebaffde61273e38 (patch)
tree5eb544d6d5ae5e60c07432a758206eae45dc360c /scripts
parent4ceaf32b6dd1b75834842b398ec6518d20249572 (diff)
downloadhistory-7a2398ccd5341e56172e23489ebaffde61273e38.tar.gz
[PATCH] gen_init_cpio symlink, pipe and socket support
This patch makes gen_init_cpio more complete by adding symlink, pipe and socket support. It updates scripts/gen_initramfs_list.sh to support the new types. The patch applies to the recent mm series that already have the updated gen_init_cpio and gen_initramfs_list.sh. From: William Lee Irwin III <wli@holomorphy.com> The rest of gen_init_cpio.c seems to cast the result of strlen() to handle this situation, so this patch follows suit while killing off size_t -related printk() warnings. Signed-off-by: William Irwin <wli@holomorphy.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/gen_initramfs_list.sh18
1 files changed, 15 insertions, 3 deletions
diff --git a/scripts/gen_initramfs_list.sh b/scripts/gen_initramfs_list.sh
index 2a697c37135ed2..79ccbd7cf27fa4 100644
--- a/scripts/gen_initramfs_list.sh
+++ b/scripts/gen_initramfs_list.sh
@@ -9,8 +9,6 @@
#
# The output is suitable for gen_init_cpio as found in usr/Makefile.
#
-# TODO: Add support for symlinks, sockets and pipes when gen_init_cpio
-# supports them.
simple_initramfs() {
cat <<-EOF
@@ -25,12 +23,19 @@ simple_initramfs() {
filetype() {
local argv1="$1"
- if [ -f "${argv1}" ]; then
+ # symlink test must come before file test
+ if [ -L "${argv1}" ]; then
+ echo "slink"
+ elif [ -f "${argv1}" ]; then
echo "file"
elif [ -d "${argv1}" ]; then
echo "dir"
elif [ -b "${argv1}" -o -c "${argv1}" ]; then
echo "nod"
+ elif [ -p "${argv1}" ]; then
+ echo "pipe"
+ elif [ -S "${argv1}" ]; then
+ echo "sock"
else
echo "invalid"
fi
@@ -52,6 +57,8 @@ print_mtime() {
parse() {
local location="$1"
local name="${location/${srcdir}//}"
+ # change '//' into '/'
+ name="${name//\/\///}"
local mode="$2"
local uid="$3"
local gid="$4"
@@ -79,6 +86,11 @@ parse() {
fi
str="${ftype} ${name} ${str} ${dev_type} ${maj} ${min}"
;;
+ "slink")
+ local target=$(LC_ALL=C ls -l "${location}" | \
+ gawk '{print $11}')
+ str="${ftype} ${name} ${target} ${str}"
+ ;;
*)
str="${ftype} ${name} ${str}"
;;