64035ac463
Prepare for better device categorization by moving everything to testing subdir first. [skip-ci]: chicken-egg problem: passing pmaports CI depends on pmbootstrap MR depends on this MR Related: postmarketos#16
25 lines
500 B
Bash
25 lines
500 B
Bash
#!/bin/sh
|
|
. /etc/deviceinfo
|
|
. ./init_functions.sh
|
|
|
|
mount_loopback_device() {
|
|
loopback_img=postmarketOS.img
|
|
partitions="/dev/mmcblk0p29 /dev/mmcblk0p30 /dev/mmcblk0p31"
|
|
|
|
mkdir /tmpmnt
|
|
for part in $partitions; do
|
|
mount -o ro $part /tmpmnt
|
|
|
|
if [ -f "/tmpmnt/$loopback_img" ]; then
|
|
mount -o remount,rw /tmpmnt
|
|
loopback_device=$(losetup -f)
|
|
losetup $loopback_device "/tmpmnt/$loopback_img"
|
|
kpartx -afs $loopback_device
|
|
return 0
|
|
fi
|
|
|
|
umount /tmpmnt
|
|
done
|
|
}
|
|
|
|
mount_loopback_device
|