Commit 12c69966 authored by Kaarle Ritvanen's avatar Kaarle Ritvanen
Browse files

update-kernel: allow for spaces in tmp and mount point paths

parent 5d6ce5a2
...@@ -23,7 +23,7 @@ if [ -z "$DESTDIR" ]; then ...@@ -23,7 +23,7 @@ if [ -z "$DESTDIR" ]; then
set -- $MOUNT set -- $MOUNT
[ $2 = /.modloop ] || continue [ $2 = /.modloop ] || continue
DESTDIR=$(dirname $(losetup $1 | cut -d " " -f 3)) DESTDIR=$(dirname $(losetup $1 | cut -d " " -f 3))
MNTDIR=$(dirname $DESTDIR) MNTDIR=$(dirname "$DESTDIR")
break break
done < /proc/mounts done < /proc/mounts
...@@ -34,7 +34,7 @@ if [ -z "$DESTDIR" ]; then ...@@ -34,7 +34,7 @@ if [ -z "$DESTDIR" ]; then
fi fi
remount() { remount() {
mount $1 -o remount $MNTDIR mount $1 -o remount "$MNTDIR"
} }
...@@ -47,7 +47,7 @@ clean_up() { ...@@ -47,7 +47,7 @@ clean_up() {
ignore_sigs ignore_sigs
apk del -q $VIRTUAL apk del -q $VIRTUAL
rm -fr $TMPDIR rm -fr "$TMPDIR"
} }
trap clean_up EXIT $SIGNALS trap clean_up EXIT $SIGNALS
...@@ -63,7 +63,7 @@ TMPDIR=$(mktemp -dt $SCRIPT.XXXXXX) ...@@ -63,7 +63,7 @@ TMPDIR=$(mktemp -dt $SCRIPT.XXXXXX)
ROOT=$TMPDIR/root ROOT=$TMPDIR/root
_apk() { _apk() {
apk add -q -p $ROOT --no-scripts --arch $ARCH --keys-dir /etc/apk/keys \ apk add -q -p "$ROOT" --no-scripts --arch $ARCH --keys-dir /etc/apk/keys \
--repositories-file /etc/apk/repositories $* --repositories-file /etc/apk/repositories $*
} }
...@@ -72,21 +72,21 @@ _apk dahdi-linux dahdi-linux-$FLAVOR || : ...@@ -72,21 +72,21 @@ _apk dahdi-linux dahdi-linux-$FLAVOR || :
_apk xtables-addons-$FLAVOR || : _apk xtables-addons-$FLAVOR || :
KVER=$(ls $ROOT/lib/modules) KVER=$(ls "$ROOT/lib/modules")
depmod -b $ROOT $KVER depmod -b "$ROOT" $KVER
STAGING=$TMPDIR/boot STAGING=$TMPDIR/boot
MODLOOP=$TMPDIR/modloop MODLOOP=$TMPDIR/modloop
MODIMG=$FLAVOR.modloop.squashfs MODIMG=$FLAVOR.modloop.squashfs
mkdir $MODLOOP $STAGING mkdir "$MODLOOP" "$STAGING"
cp -a $ROOT/lib/modules $MODLOOP cp -a "$ROOT/lib/modules" "$MODLOOP"
cp -a $ROOT/lib/firmware $MODLOOP/modules cp -a "$ROOT/lib/firmware" "$MODLOOP/modules"
mksquashfs $MODLOOP $STAGING/$MODIMG -comp xz mksquashfs "$MODLOOP" "$STAGING/$MODIMG" -comp xz
mkinitfs -q -F "$features squashfs" -b $ROOT -o $STAGING/$FLAVOR.gz $KVER mkinitfs -q -F "$features squashfs" -b "$ROOT" -o "$STAGING/$FLAVOR.gz" $KVER
cp $ROOT/boot/vmlinuz-$FLAVOR $STAGING/$FLAVOR cp "$ROOT/boot/vmlinuz-$FLAVOR" "$STAGING/$FLAVOR"
if [ "$MNTDIR" ]; then if [ "$MNTDIR" ]; then
...@@ -95,7 +95,7 @@ if [ "$MNTDIR" ]; then ...@@ -95,7 +95,7 @@ if [ "$MNTDIR" ]; then
rm -f "$DESTDIR/$MODIMG" rm -f "$DESTDIR/$MODIMG"
fi fi
mv $STAGING/* "$DESTDIR" mv "$STAGING"/* "$DESTDIR"
if [ "$MNTDIR" ]; then if [ "$MNTDIR" ]; then
set +e set +e
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment