update-kernel fails on RPi with util-linux installed
After creating modloop squashfs image it stops with
mount: mount point (/media/mmcblk0p1 does not exist
The problem lies in loop device detection (update-kernel:133):
With busybox (normal behavior):
# losetup /dev/loop0
/dev/loop0: 0 /media/mmcblk0p1/boot/modloop-rpi2
DESTDIR is /media/mmcblk0p1/boot/modloop-rpi2
With util-linux:
# losetup /dev/loop0
/dev/loop/0: [45825]:443 (/media/mmcblk0p1/boot/modloop-rpi2)
DESTDIR is (/media/mmcblk0p1/boot/modloop-rpi2 as pointed out in the error message.
Easy fix: Prepend losetup with busybox, thus:
DESTDIR=$(dirname $(busybox losetup $1 | cut -d " " -f 3))
(from redmine: issue id 6517, created on 2016-12-05, closed on 2016-12-22)
- Changesets:
- Revision bd4e2c5b0a11f09502f9bb9a6d842019a2fb7705 by Timo Teräs on 2016-12-07T10:08:03Z:
update-kernel: use busybox's losetup always
fixes #6517
The output format of util-linux losetup is different, and there's
no easy way to get uniform output from these two implementations.
- Revision 2de46c6c by Timo Teräs on 2016-12-07T10:10:30Z:
main/alpine-conf: use busybox losetup always
fixes #6517