Bug #271

blockhandler.sh looks for "removable" under $DEVPATH, but doesn't find it with Busybox 1.21.1

Added by Hammel over 3 years ago. Updated over 3 years ago.

Status:ClosedStart date:03 Feb 2014
Priority:ImmediateDue date:
Assignee:Hammel% Done:

100%

Category:04 - Root File System
Target version:0.8.0
Severity:01 - Critical

Description

This means that mmcblk0p2 is not mounted on boot after the upgrade to Busybox 1.21.1.

Associated revisions

Revision b3992f8f
Added by Hammel over 3 years ago

RM #271: Fixed blockhandler to work with Busybox 1.21.1 and Buildroot 2013.11.
Change the way blkid is used because it's now Busybox's version instead of Buildroot's (which went away).
Add special handling for mmc card when testing for "removable" fails.

Revision 253b771b
Added by Hammel over 3 years ago

RM #271: Better use of blkid to find file system type. Fixes use with /dev/sda1 (inserted usb stick).

History

#1 Updated by Hammel over 3 years ago

  • % Done changed from 0 to 20

I think the reason for this is that in 1.20.x the ACTION was empty so I have a special case handler for mmc mounting. In 1.21.1 the ACTION is add, which goes through a different part of the script. I'll have to move the mmc special handling into the "add" handler.

#2 Updated by Hammel over 3 years ago

  • % Done changed from 20 to 30

Another problem is that blkid is no longer available in 2013.11. This patch appears to have taken it out. There is a related patch that just defaults to using udev instead.

There doesn't appear to be an easy way to get blkid back from util-linux (which is what would normally build it) in Buildroot. Fortunately, Busybox 1.21.1 has a version that is not yet enabled. I can enable that and rebuild under Buildroot to see what happens.

Also, I may have fixed the problem with with not finding "removable". I need to test it on 2013.11 but that requires first rebuilding Busybox to get blkid so blockhandler.sh doesn't break on that issue.

#3 Updated by Hammel over 3 years ago

  • % Done changed from 30 to 40

Just rebuilding busybox with make buildroot-rebuild didn't work. I got all kinds of weird errors on the reboot of the target. I have to rebuild the entire rootfs.

#4 Updated by Hammel over 3 years ago

  • % Done changed from 40 to 50

I rebuilt the whole thing and tested it tonight only to find out I didn't enable the "Print filesystem type" option. Ugh. So I have to rebuild it all again.

#5 Updated by Hammel over 3 years ago

  • % Done changed from 50 to 70

Added missing blkid to Busybox. This was originally in Buildroot 2013.02 but was pulled from 2013.11. Adding it into Busybox was easy but you have to specifically ask for filesystem type support.

This fixes finding and mounting mmcblk0p1 by mdev. However, it blockhandler.sh no longer mounts sda1 when the usb stick is inserted. So I still need to fix that.

#6 Updated by Hammel over 3 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 70 to 100

The mechanism used to find the filesystem type from blkid output was incorrect. It was

ID_FS_TYPE=`blkid $RD| cut -f4 -d" " | sed 's/TYPE=//' | sed 's/"//g'`

But that cut was wrong. It works correctly (at least for current PiBox needs) like this

ID_FS_TYPE=`blkid $RD | sed 's/^.*TYPE=//' | sed 's/"//g'

So now blockhandler.sh works with Buildroot 2013.11 and Busybox 1.21.1 and both mmcblk0p1 and /dev/sda1 mount properly via mdev.

Closing issue.

Also available in: Atom PDF