Merge pull request #17 from unasuke/loopdev

Use last loop device from `loopdev -l`
This commit is contained in:
Takumi Sueda 2021-05-06 09:14:17 +09:00 committed by GitHub
commit 682b8a44b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,7 +40,7 @@ sfdisk ${IMG} < ${WORK}/part.sfdisk
sudo kpartx -av ${IMG}
LOOPDEV=$(losetup -l | grep sd.img | grep -o 'loop.')
LOOPDEV=$(losetup -l | grep sd.img | grep -o 'loop.' | tail -n 1)
sudo mkfs.fat -F32 -v -I /dev/mapper/${LOOPDEV}p1
sudo mkfs.ext4 /dev/mapper/${LOOPDEV}p2