Skip to content

Commit

Permalink
- better way to find out rootpartition from rootdisk
Browse files Browse the repository at this point in the history
  • Loading branch information
Ognian committed Oct 13, 2020
1 parent e562ca5 commit 23ede0c
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions init.resizefs
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,7 @@ resize2fs $ROOTDEVICE
sleep 5

echo "== Setting proper init... =="
MMCROOT_REGEX="^(\/dev\/mmc)"
if [[ $ROOTDISK == $MMCROOT_REGEX ]]; then
ROOTPARTITION=${ROOTDISK}p1
else
ROOTPARTITION=${ROOTDISK}1
fi
ROOTPARTITION=$(lsblk -o NAME -lnp ${ROOTDISK} | awk 'NR==2')
if [ "$IMAGE_TYPE" = "raspberrypi" ]; then
mount ${ROOTPARTITION} /boot
sed -i 's# init=/sbin/init.resizefs# init=/sbin/init.preinit#' /boot/cmdline.txt
Expand Down

0 comments on commit 23ede0c

Please sign in to comment.