diff options
| author | Christian Schlüter <chschlue@gmail.com> | 2018-07-17 08:32:30 +0200 |
|---|---|---|
| committer | Christian Schlüter <chschlue@gmail.com> | 2018-07-17 08:32:30 +0200 |
| commit | e918d6d0b6b0b0cdf3ea8d9d9e9305e1a4eaa6e0 (patch) | |
| tree | 09f8ed2787094b4e205e1f8f26bf9cafdd405742 | |
| parent | e196f6caec6243d07a16f29136c317937166a099 (diff) | |
Fix resizerootfs string manipulation
Works with several usb devices plugged in on first boot.
| -rwxr-xr-x | rpi3-resizerootfs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/rpi3-resizerootfs b/rpi3-resizerootfs index 37a0b40..217c20c 100755 --- a/rpi3-resizerootfs +++ b/rpi3-resizerootfs @@ -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 ,+ |
