aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic-2.6/patches
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2007-06-20 00:16:41 +0000
committerFelix Fietkau <nbd@openwrt.org>2007-06-20 00:16:41 +0000
commitb74715a0b68e7bb3037c446e1eabea9aa52b8c78 (patch)
tree8704191886acaad56c61635dac6f996dc5152cd4 /target/linux/generic-2.6/patches
parent000ae30f6f7f195adfd94da9df8699d08006f660 (diff)
downloadupstream-b74715a0b68e7bb3037c446e1eabea9aa52b8c78.tar.gz
upstream-b74715a0b68e7bb3037c446e1eabea9aa52b8c78.tar.bz2
upstream-b74715a0b68e7bb3037c446e1eabea9aa52b8c78.zip
add mini_fo fix from #1801
SVN-Revision: 7676
Diffstat (limited to 'target/linux/generic-2.6/patches')
-rw-r--r--target/linux/generic-2.6/patches/209-mini_fo.patch11
1 files changed, 1 insertions, 10 deletions
diff --git a/target/linux/generic-2.6/patches/209-mini_fo.patch b/target/linux/generic-2.6/patches/209-mini_fo.patch
index 5f354c55bc..35c9ec2f09 100644
--- a/target/linux/generic-2.6/patches/209-mini_fo.patch
+++ b/target/linux/generic-2.6/patches/209-mini_fo.patch
@@ -2115,7 +2115,7 @@ diff -urN linux-2.6.21.1.old/fs/mini_fo/fist.h linux-2.6.21.1.dev/fs/mini_fo/fis
diff -urN linux-2.6.21.1.old/fs/mini_fo/inode.c linux-2.6.21.1.dev/fs/mini_fo/inode.c
--- linux-2.6.21.1.old/fs/mini_fo/inode.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.21.1.dev/fs/mini_fo/inode.c 2007-05-26 21:01:26.164329720 +0200
-@@ -0,0 +1,1573 @@
+@@ -0,0 +1,1564 @@
+/*
+ * Copyright (c) 1997-2003 Erez Zadok
+ * Copyright (c) 2001-2003 Stony Brook University
@@ -2670,9 +2670,6 @@ diff -urN linux-2.6.21.1.old/fs/mini_fo/inode.c linux-2.6.21.1.dev/fs/mini_fo/in
+ down(&hidden_sto_dir_dentry->d_inode->i_sem);
+#endif
+
-+ /* avoid destroying the hidden inode if the file is in use */
-+ dget(hidden_sto_dentry);
-+
+ /* Delete an old WOL file contained in the storage dir */
+ meta_dentry = lookup_one_len(META_FILENAME,
+ hidden_sto_dentry,
@@ -2763,9 +2760,6 @@ diff -urN linux-2.6.21.1.old/fs/mini_fo/inode.c linux-2.6.21.1.dev/fs/mini_fo/in
+ down(&hidden_sto_dir_dentry->d_inode->i_sem);
+#endif
+
-+ /* avoid destroying the hidden inode if the file is in use */
-+ dget(hidden_sto_dentry);
-+
+ /* Delete an old WOL file contained in the storage dir */
+ meta_dentry = lookup_one_len(META_FILENAME,
+ hidden_sto_dentry,
@@ -2811,9 +2805,6 @@ diff -urN linux-2.6.21.1.old/fs/mini_fo/inode.c linux-2.6.21.1.dev/fs/mini_fo/in
+ down(&hidden_sto_dir_dentry->d_inode->i_sem);
+#endif
+
-+ /* avoid destroying the hidden inode if the file is in use */
-+ dget(hidden_sto_dentry);
-+
+ /* Delete an old WOL file contained in the storage dir */
+ meta_dentry = lookup_one_len(META_FILENAME,
+ hidden_sto_dentry,
.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#!/bin/sh

ubootenv=""
ubinize_param=""
kernel=""
rootfs=""
outfile=""
err=""

get_magic_word() {
	dd if=$1 bs=2 count=1 2>/dev/null | hexdump -v -n 2 -e '1/1 "%02x"'
}

is_ubifs() {
	if [ "$( get_magic_word $1 )" = "3118" ]; then
		echo "1"
	fi
}

ubivol() {
	volid=$1
	name=$2
	image=$3
	autoresize=$4
	echo "[$name]"
	echo "mode=ubi"
	echo "vol_id=$volid"
	echo "vol_type=dynamic"
	echo "vol_name=$name"
	if [ "$image" ]; then
		echo "image=$image"
	else
		echo "vol_size=1MiB"
	fi
	if [ "$autoresize" ]; then
		echo "vol_flags=autoresize"
	fi
}

ubilayout() {
	local vol_id=0
	local root_is_ubifs="$( is_ubifs "$2" )"
	if [ "$1" = "ubootenv" ]; then
		ubivol $vol_id ubootenv
		vol_id=$(( $vol_id + 1 ))
		ubivol $vol_id ubootenv2
		vol_id=$(( $vol_id + 1 ))
	fi
	if [ "$3" ]; then
		ubivol $vol_id kernel "$3"
		vol_id=$(( $vol_id + 1 ))
	fi
	ubivol $vol_id rootfs "$2" $root_is_ubifs
	vol_id=$(( $vol_id + 1 ))
	[ "$root_is_ubifs" ] || ubivol $vol_id rootfs_data "" 1
}

while [ "$1" ]; do
	case "$1" in
	"--uboot-env")
		ubootenv="ubootenv"
		shift
		continue
		;;
	"--kernel")
		kernel="$2"
		shift
		shift
		continue
		;;
	"-"*)
		ubinize_param="$@"
		break
		;;
	*)
		if [ ! "$rootfs" ]; then
			rootfs=$1
			shift
			continue
		fi
		if [ ! "$outfile" ]; then
			outfile=$1
			shift
			continue
		fi
		;;
	esac
done

if [ ! -r "$rootfs" -o ! -r "$kernel" -a ! "$outfile" ]; then
	echo "syntax: $0 [--uboot-env] [--kernel kernelimage] rootfs out [ubinize opts]"
	exit 1
fi

ubinize="$( which ubinize )"
if [ ! -x "$ubinize" ]; then
	echo "ubinize tool not found or not usable"
	exit 1
fi

ubinizecfg="$( mktemp )"
ubilayout "$ubootenv" "$rootfs" "$kernel" > "$ubinizecfg"

cat "$ubinizecfg"
ubinize -o "$outfile" $ubinize_param "$ubinizecfg"
err="$?"
[ ! -e "$outfile" ] && err=2
rm "$ubinizecfg"

exit $err