Skip to content

Commit

Permalink
Firstrun was failing when booting from eMMC, changing detection method
Browse files Browse the repository at this point in the history
  • Loading branch information
igorpecovnik committed Apr 14, 2016
1 parent 561b728 commit 7b99cdc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/firstrun
Expand Up @@ -177,12 +177,12 @@ autodetect_sunxi() {

do_expand_rootfs() {
# get device node for boot media
DEVICE="/dev/"$(lsblk -idn -o NAME | grep mmcblk0)
DEVICE="/dev/"$(lsblk -idn -o NAME | grep -w mmcblk0)
if [ "${DEVICE}" = "/dev/" ]; then return ; fi
QUOTED_DEVICE=$(echo "${DEVICE}" | sed 's:/:\\\/:g')

# get count of partitions and their boundaries
PARTITIONS=$(( $(grep -c ${DEVICE##*/} /proc/partitions) - 1 ))
PARTITIONS=$(( $(grep -c ${DEVICE##*/}p /proc/partitions) ))
PARTSTART=$(parted ${DEVICE} unit s print -sm | tail -1 | cut -d: -f2 | sed 's/s//') # start of first partition
PARTEND=$(parted ${DEVICE} unit s print -sm | head -3 | tail -1 | cut -d: -f3 | sed 's/s//') # end of first partition
STARTFROM=$(( ${PARTEND} + 1 ))
Expand Down

0 comments on commit 7b99cdc

Please sign in to comment.