CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
Attached to Project: CRUX-ARM
Opened by Jose V Beneyto - 2013-11-02
Last edited by Jose V Beneyto - 2013-11-26

FS#62 - initramfs: fix weird problems related to mdev

we have some weird problems related to mdev

1. the /etc/rc script required an extra 'mdev -s' invocation to find the install media

2. after use fdisk, we can see new device nodes for these new partitions

for problem 2 there is a guy who related the same here http://stackoverflow.com/questions/8313196/mdev-racing-when-creating-and-deleting-device-node

anyway a deep review of mdev from busybox should be made to avoid these weird errors

we can also take ideas from http://sepen.it.cx/crux/ports/crux-3.0/sepen/mdev/

Project Manager
Victor Martinez commented on Saturday, 02 November 2013, 02:05 GMT

Problem 2:
# fdisk -l /dev/mmcblk0

Disk /dev/mmcblk0: 988 MB, 988282880 bytes
31 heads, 61 sectors/track, 1020 cylinders
Units = cylinders of 1891 * 512 = 968192 bytes

      Device Boot      Start         End      Blocks  Id System

/dev/mmcblk0p1 1 264 249581+ 83 Linux

fdisk created second partition

# fdisk -l /dev/mmcblk0

Disk /dev/mmcblk0: 988 MB, 988282880 bytes
31 heads, 61 sectors/track, 1020 cylinders
Units = cylinders of 1891 * 512 = 968192 bytes

      Device Boot      Start         End      Blocks  Id System

/dev/mmcblk0p1 1 264 249581+ 83 Linux
/dev/mmcblk0p2 265 529 250557+ 83 Linux

# ls /dev/mmcblk0*
/dev/mmcblk0 /dev/mmcblk0p1

Project Manager
Victor Martinez commented on Saturday, 02 November 2013, 14:04 GMT

After changing /dev/pts mount and mdev¡s register as hotplug agent order in rc script as suggested in http://git.busybox.net/busybox/plain/docs/mdev.txt, mmc devices are detected correctly at boot time but we have problems with new created partitions yet.

# fdisk -l /dev/mmcblk0

Disk /dev/mmcblk0: 988 MB, 988282880 bytes
31 heads, 61 sectors/track, 1020 cylinders
Units = cylinders of 1891 * 512 = 968192 bytes

      Device Boot      Start         End      Blocks  Id System

/dev/mmcblk0p1 1 264 249581+ 83 Linux
/dev/mmcblk0p2 265 529 250557+ 83 Linux
/dev/mmcblk0p3 530 633 98332 83 Linux

# cat /proc/partitions
major minor #blocks name

179 0 965120 mmcblk0
179 1 249581 mmcblk0p1
179 2 250557 mmcblk0p2

Proposed patch: Sorts /dev/tmps mount, hotplug and mdev -s

diff –git a/filesystem/rc b/filesystem/rc
index 5b19485..f81c98a 100755
— a/filesystem/rc
+++ b/filesystem/rc
@@ -128,17 +128,17 @@ mount -a && \
mount -o remount,rw /
checkReturn

-echo -e -n " ${BOLD}${BLUE}*${NORM} Populating /dev via mdev... "
-mdev -s
+echo -e -n " ${BOLD}${BLUE}*${NORM} Creating and mounting /dev/pts... "
+mkdir /dev/pts
+mount -t devpts devpts /dev/pts
checkReturn

echo -e -n " ${BOLD}${BLUE}*${NORM} Registering mdev as hotplug agent... "
echo "/bin/mdev" > /proc/sys/kernel/hotplug
checkReturn

-echo -e -n " ${BOLD}${BLUE}*${NORM} Creating and mounting /dev/pts... "
-mkdir /dev/pts
-mount -t devpts devpts /dev/pts
+echo -e -n " ${BOLD}${BLUE}*${NORM} Populating /dev via mdev... "
+mdev -s
checkReturn

echo -e -n " ${BOLD}${BLUE}*${NORM} Starting kernel log daemon... "
@@ -159,9 +159,6 @@ echo -e -n " ${BOLD}${BLUE}*${NORM} Saving boot messages... "
dmesg > /var/log/boot
checkReturn

-# run mdev again to fix issues with mmc devices. yeah, it is weird but worked
-mdev -s
-
echo -e " ${BOLD}${BLUE}*${NORM} Trying to find and mount the media installer..."
find_and_mount_media

Project Manager
Jose V Beneyto commented on Tuesday, 19 November 2013, 17:48 GMT

or we can just add this script I wrote for mdev port: http://sepen.it.cx/crux/ports/crux-3.0/sepen/mdev/start_mdev

Project Manager
Victor Martinez commented on Tuesday, 19 November 2013, 17:50 GMT

+1

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing