Fix resizerootfs string manipulation

Works with several usb devices plugged in on first boot.
This commit is contained in:
Christian Schlüter 2018-07-17 08:32:30 +02:00
parent e196f6caec
commit e918d6d0b6
No known key found for this signature in database
GPG Key ID: 00E1F218F5280355
1 changed files with 4 additions and 3 deletions

View File

@ -1,8 +1,9 @@
#!/bin/sh
roottmp=$(lsblk -l -o MAJ:MIN,MOUNTPOINT | grep '/$')
rootpart=/dev/block/${roottmp% /}
rootdev=${rootpart%:*}:0
roottmp=$(lsblk -l -o NAME,MOUNTPOINT | grep '/$')
rootpart=/dev/${roottmp%% */}
rootdev=${rootpart%2}
rootdev=${rootdev%p}
flock $rootdev sfdisk -f $rootdev -N 2 <<EOF
,+