test $# -ge 2 || { echo "Syntax: $0 SRCTREE OBJTREE"; exit 1; }
# cd to objtree
-cd "$2" || { echo "Syntax: $0 SRCTREE OBJTREE"; exit 1; }
+cd -- "$2" || { echo "Syntax: $0 SRCTREE OBJTREE"; exit 1; }
srctree="$1"
find -type d | while read; do
- d="$REPLY"
-
- src="$srctree/$d/Kbuild.src"
- dst="$d/Kbuild"
- if test -f "$src"; then
- echo " CHK $dst"
-
- s=`sed -n 's@^//kbuild:@@p' "$srctree/$d"/*.c`
- echo "# DO NOT EDIT. This file is generated from Kbuild.src" >"$dst.$$.tmp"
- while read; do
- test x"$REPLY" = x"INSERT" && REPLY="$s"
- printf "%s\n" "$REPLY"
- done <"$src" >>"$dst.$$.tmp"
-
- if test -f "$dst" && cmp -s "$dst.$$.tmp" "$dst"; then
- rm "$dst.$$.tmp"
- else
- echo " GEN $dst"
- mv "$dst.$$.tmp" "$dst"
+ d="$REPLY"
+
+ src="$srctree/$d/Kbuild.src"
+ dst="$d/Kbuild"
+ if test -f "$src"; then
+ echo " CHK $dst"
+
+ s=`sed -n 's@^//kbuild:@@p' -- "$srctree/$d"/*.c`
+ echo "# DO NOT EDIT. This file is generated from Kbuild.src" >"$dst.$$.tmp"
+ while read; do
+ test x"$REPLY" = x"INSERT" && REPLY="$s"
+ printf "%s\n" "$REPLY"
+ done <"$src" >>"$dst.$$.tmp"
+
+ if test -f "$dst" && cmp -s "$dst.$$.tmp" "$dst"; then
+ rm -- "$dst.$$.tmp"
+ else
+ echo " GEN $dst"
+ mv -- "$dst.$$.tmp" "$dst"
+ fi
fi
- fi
-
- src="$srctree/$d/Config.src"
- dst="$d/Config.in"
- if test -f "$src"; then
- echo " CHK $dst"
-
- s=`sed -n 's@^//config:@@p' "$srctree/$d"/*.c`
- echo "# DO NOT EDIT. This file is generated from Config.src" >"$dst.$$.tmp"
- while read; do
- test x"$REPLY" = x"INSERT" && REPLY="$s"
- printf "%s\n" "$REPLY"
- done <"$src" >>"$dst.$$.tmp"
-
- if test -f "$dst" && cmp -s "$dst.$$.tmp" "$dst"; then
- rm "$dst.$$.tmp"
- else
- echo " GEN $dst"
- mv "$dst.$$.tmp" "$dst"
+
+ src="$srctree/$d/Config.src"
+ dst="$d/Config.in"
+ if test -f "$src"; then
+ echo " CHK $dst"
+
+ s=`sed -n 's@^//config:@@p' -- "$srctree/$d"/*.c`
+ echo "# DO NOT EDIT. This file is generated from Config.src" >"$dst.$$.tmp"
+ while read; do
+ test x"$REPLY" = x"INSERT" && REPLY="$s"
+ printf "%s\n" "$REPLY"
+ done <"$src" >>"$dst.$$.tmp"
+
+ if test -f "$dst" && cmp -s "$dst.$$.tmp" "$dst"; then
+ rm -- "$dst.$$.tmp"
+ else
+ echo " GEN $dst"
+ mv -- "$dst.$$.tmp" "$dst"
+ fi
fi
- fi
done
# env - PATH=$PATH: on some systems chroot binary won't otherwise be found
+optional STATIC
testing "mdev add /block/sda" \
"env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
ls -ln mdev.testdir/dev | $FILTER_LS" \
brw-rw---- 1 0 0 8,0 sda
" \
"" ""
+SKIP=
# continuing to use directory structure from prev test
rm -rf mdev.testdir/dev/*
echo ".* 1:1 666" >mdev.testdir/etc/mdev.conf
echo "sda 2:2 444" >>mdev.testdir/etc/mdev.conf
+optional STATIC FEATURE_MDEV_CONF
testing "mdev stops on first rule" \
"env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
ls -ln mdev.testdir/dev | $FILTER_LS" \
brw-rw-rw- 1 1 1 8,0 sda
" \
"" ""
+SKIP=
# continuing to use directory structure from prev test
rm -rf mdev.testdir/dev/*
echo "-.* 1:1 666" >mdev.testdir/etc/mdev.conf
echo "sda 2:2 444" >>mdev.testdir/etc/mdev.conf
+optional STATIC FEATURE_MDEV_CONF
testing "mdev does not stop on dash-rule" \
"env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
ls -ln mdev.testdir/dev | $FILTER_LS" \
br--r--r-- 1 2 2 8,0 sda
" \
"" ""
+SKIP=
# continuing to use directory structure from prev test
rm -rf mdev.testdir/dev/*
echo "\$MODALIAS=qw 1:1 666" >mdev.testdir/etc/mdev.conf
echo "\$MODALIAS=qw. 2:2 444" >>mdev.testdir/etc/mdev.conf
echo "\$MODALIAS=qw. 3:3 400" >>mdev.testdir/etc/mdev.conf
+optional STATIC FEATURE_MDEV_CONF
testing "mdev \$ENVVAR=regex match" \
"env - PATH=$PATH ACTION=add DEVPATH=/block/sda MODALIAS=qwe chroot mdev.testdir /mdev 2>&1;
ls -ln mdev.testdir/dev | $FILTER_LS" \
br--r--r-- 1 2 2 8,0 sda
" \
"" ""
+SKIP=
# continuing to use directory structure from prev test
rm -rf mdev.testdir/dev/*
echo "sda 0:0 444 >disk/scsiA" >mdev.testdir/etc/mdev.conf
-optional FEATURE_LS_RECURSIVE
+optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_RENAME FEATURE_LS_RECURSIVE
testing "mdev move/symlink rule '>bar/baz'" \
"env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
ls -lnR mdev.testdir/dev | $FILTER_LS2" \
# continuing to use directory structure from prev test
rm -rf mdev.testdir/dev/*
echo "sda 0:0 444 >disk/" >mdev.testdir/etc/mdev.conf
-optional FEATURE_LS_RECURSIVE
+optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_RENAME FEATURE_LS_RECURSIVE
testing "mdev move/symlink rule '>bar/'" \
"env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
ls -lnR mdev.testdir/dev | $FILTER_LS2" \
rm -rf mdev.testdir/dev/*
# here we complicate things by having non-matching group 1 and using %0
echo "s([0-9])*d([a-z]+) 0:0 644 >sd/%2_%0" >mdev.testdir/etc/mdev.conf
-optional FEATURE_LS_RECURSIVE
+optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_RENAME FEATURE_MDEV_RENAME_REGEXP FEATURE_LS_RECURSIVE
testing "mdev regexp substring match + replace" \
"env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
ls -lnR mdev.testdir/dev | $FILTER_LS2" \
# continuing to use directory structure from prev test
rm -rf mdev.testdir/dev/*
echo "sda 0:0 644 @echo @echo TEST" >mdev.testdir/etc/mdev.conf
-optional FEATURE_LS_RECURSIVE
+optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_EXEC FEATURE_LS_RECURSIVE
testing "mdev command" \
"env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
ls -lnR mdev.testdir/dev | $FILTER_LS" \
# continuing to use directory structure from prev test
rm -rf mdev.testdir/dev/*
echo "sda 0:0 644 =block/ @echo @echo TEST:\$MDEV" >mdev.testdir/etc/mdev.conf
-optional FEATURE_LS_RECURSIVE
+optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_RENAME FEATURE_MDEV_EXEC FEATURE_LS_RECURSIVE
testing "mdev move and command" \
"env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
ls -lnR mdev.testdir/dev | $FILTER_LS2" \
# continuing to use directory structure from prev test
rm -rf mdev.testdir/dev/*
echo "@8,0 0:1 644" >mdev.testdir/etc/mdev.conf
-optional FEATURE_LS_RECURSIVE
+optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_RENAME FEATURE_MDEV_RENAME_REGEXP FEATURE_LS_RECURSIVE
testing "mdev #maj,min and no explicit uid" \
"env - PATH=$PATH ACTION=add DEVPATH=/block/sda chroot mdev.testdir /mdev 2>&1;
ls -lnR mdev.testdir/dev | $FILTER_LS" \
echo "capi([0-9]) 0:0 0660 =capi20.0%1" >>mdev.testdir/etc/mdev.conf
echo "capi([0-9]*) 0:0 0660 =capi20.%1" >>mdev.testdir/etc/mdev.conf
# mdev invocation with DEVPATH=/class/tty/capi20 was deleting /dev/capi20
-optional FEATURE_LS_RECURSIVE
+optional STATIC FEATURE_MDEV_CONF FEATURE_MDEV_RENAME FEATURE_MDEV_RENAME_REGEXP FEATURE_LS_RECURSIVE
testing "move rule does not delete node with name == device_name" \
"\
env - PATH=$PATH ACTION=add DEVPATH=/class/tty/capi chroot mdev.testdir /mdev 2>&1;