summaryrefslogtreecommitdiff
path: root/release/mkfsimage.sh
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1997-06-27 21:39:05 +0000
committerMiles Bader <miles@gnu.org>1997-06-27 21:39:05 +0000
commit36033fa0ceb63ce231c95f89a5f2c40a11f4da90 (patch)
tree37b2d8e66a1aeeea24b6f4ee21f8d9a6e9235b9c /release/mkfsimage.sh
parent74e132de56e96202e9117da1d6c080491fcb0be9 (diff)
Get rid of debugging noise.
Use the tar --same-owner option work around a bug with tar not preserving ownership when the current user isn't root. Don't pre-touch `makedev's.
Diffstat (limited to 'release/mkfsimage.sh')
-rw-r--r--release/mkfsimage.sh28
1 files changed, 19 insertions, 9 deletions
diff --git a/release/mkfsimage.sh b/release/mkfsimage.sh
index 055edb62..1b8a32b1 100644
--- a/release/mkfsimage.sh
+++ b/release/mkfsimage.sh
@@ -226,10 +226,8 @@ else
dst="$src";;
esac
-echo "1: OP=<$op>, SRC=<$src>, DST=<$dst>, ARGS=<${args[*]}>"
# Pop op & src off of args
set -- "${args[@]}"; shift 2; unset args; args=("$@")
-echo "2: OP=<$op>, SRC=<$src>, DST=<$dst>, ARGS=<${args[*]}>"
case $op in
copy)
@@ -257,13 +255,27 @@ echo "2: OP=<$op>, SRC=<$src>, DST=<$dst>, ARGS=<${args[*]}>"
eval $ECHO "'touch $STAGE/$dst'"
touch "$STAGE/$dst"
;;
+
makedev|settrans|copytrans)
- # delay translators until later.
- touch "$STAGE/$dst"
+ # delay translators until later, as tar can't copy them.
+
+ case $op in
+ settrans|copytrans)
+ # We create the node on which translators will be put so
+ # that the owner gets set correctly; this isn't necessary for
+ # device because MAKEDEV does all the work needed, and doing so
+ # would cause problems with device names that are really
+ # categories.
+ touch "$STAGE/$dst";;
+ esac
+
+ # Accunt for space used by the translator block
TRANS_BLOCKS=$(($TRANS_BLOCKS + 1))
-echo "3: OP=<$op>, SRC=<$src>, DST=<$dst>, ARGS=<${args[*]}>"
+
+ # Record the desired operation for a later pass
echo "$op $dst $src ${args[*]}" >> $TRANS_LIST
;;
+
''|'#')
;;
*)
@@ -279,7 +291,7 @@ echo "3: OP=<$op>, SRC=<$src>, DST=<$dst>, ARGS=<${args[*]}>"
) || exit $?
else
eval $ECHO "'# Copying all files using tar'"
- (cd $SRC; tar cf - .) | (cd $STAGE; tar xf -)
+ (cd $SRC; tar cf - .) | (cd $STAGE; tar -x --same-owner -p -f -)
fi
done
TREE="$STAGE"
@@ -317,19 +329,17 @@ eval "$MKFS $MKFS_Q '$IMAGE_TMP'" || exit 12
settrans -ac $MNT $FSTRANS $IMAGE_TMP || exit 13
eval $ECHO "'# Copying $TREE into filesystem...'"
-(cd $TREE; tar cf - .) | (cd $MNT; tar xf -)
+(cd $TREE; tar cf - .) | (cd $MNT; tar -x --same-owner -p -f -)
if [ -r "$TRANS_LIST" ]; then
# create any delayed translators
eval $ECHO "'# Creating translators...'"
cat "$TRANS_LIST" |
while read -a args; do
-echo "4: OP=<$op>, DST=<$dst>, ARGS=<${args[*]}>"
op="${args[0]}"
dst="${args[1]}"
src="${args[2]}"
set -- "${args[@]}"; shift 3; unset args; args=("$@")
-echo "5: OP=<$op>, DST=<$dst>, ARGS=<${args[*]}>"
case $op in
copytrans)