Commit 5d6ce5a2 authored by Kaarle Ritvanen's avatar Kaarle Ritvanen

update-kernel: destination directory argument

parent 12a01f73
...@@ -14,17 +14,23 @@ SIGNALS="HUP INT TERM" ...@@ -14,17 +14,23 @@ SIGNALS="HUP INT TERM"
SCRIPT=update-kernel SCRIPT=update-kernel
VIRTUAL=.tmp-$SCRIPT VIRTUAL=.tmp-$SCRIPT
while read MOUNT; do
set -- $MOUNT DESTDIR=$1
[ $2 = /.modloop ] || continue MNTDIR=
DESTDIR=$(dirname $(losetup $1 | cut -d " " -f 3))
MNTDIR=$(dirname $DESTDIR) if [ -z "$DESTDIR" ]; then
break while read MOUNT; do
done < /proc/mounts set -- $MOUNT
[ $2 = /.modloop ] || continue
if [ -z "$MNTDIR" ]; then DESTDIR=$(dirname $(losetup $1 | cut -d " " -f 3))
echo "Module loopback device not mounted" >&2 MNTDIR=$(dirname $DESTDIR)
exit 1 break
done < /proc/mounts
if [ -z "$MNTDIR" ]; then
echo "Module loopback device not mounted" >&2
exit 1
fi
fi fi
remount() { remount() {
...@@ -83,14 +89,18 @@ mkinitfs -q -F "$features squashfs" -b $ROOT -o $STAGING/$FLAVOR.gz $KVER ...@@ -83,14 +89,18 @@ 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
ignore_sigs if [ "$MNTDIR" ]; then
remount -w ignore_sigs
remount -w
rm -f "$DESTDIR/$MODIMG"
fi
rm -f $DESTDIR/$MODIMG mv $STAGING/* "$DESTDIR"
mv $STAGING/* $DESTDIR
set +e if [ "$MNTDIR" ]; then
sync set +e
remount -r sync
remount -r
fi
exit 0 exit 0
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