How to make device-files static in nfsroot

32 views
Skip to first unread message

Ankur Tank

unread,
May 13, 2016, 12:57:41 AM5/13/16
to BeagleBoard

we are using beaglebone black based custom board,


We have programming station[desktop PC just naming it] where we have configured tftpboot and nfsroot(network rfs).
And Last init script( programming init script in /etc/init.d/ folder) flashes freshly manufactured board.


Programming script does following steps,
1. Partition emmc(using parted)
2. format partitions
3. Write bootloader, kernel and root file system.


nfsroot folder contains all static device files under /dev/ folder with respect to partitions structure. i.e. it contains /dev/mmcblk0, /dev/mmcblk0p1, /dev/mmcblk0p2 .. etc.

when we observed the directory /dev/ during partitioning process of emmc we see that /dev/mmcblk0p1, /dev/mmcblk0p2 .. gets deleted and after partitioning is done device files are created again.

This all works fine when we are flashing one device on that programming station.


However this fails when try flashing multiple devices on the programming station, reason being when one device's emmc is being partitioned other device's emmc's partitions are being formatted one by one.

Sometimes second device doesn't find device file(e.g. /dev/mmbclk0p15) it is looking at while formatting the partition, So programming fails.


so my question is, is there anyway to prevent deletion of the device file when emmc is being partitioned ? is there a kernel configuration which stops device file creation/deletion ?


Any other suggestion/pointers?

Charles Steinkuehler

unread,
May 13, 2016, 9:26:23 AM5/13/16
to beagl...@googlegroups.com
On 5/12/2016 11:57 PM, Ankur Tank wrote:
>
> so my question is, is there anyway to prevent deletion of the device file when
> emmc is being partitioned ? is there a kernel configuration which stops device
> file creation/deletion ?

Play with your udev rules.

> Any other suggestion/pointers?

You could go "old school":

Disable udev and use mknod to create static device entries in /dev (or
leave udev enabled and put your device nodes somewhere else like
/mydev). You can also name them whatever you want (perhaps rootfs,
data, or similar), the existing names are just a convention.

This can be cumbersome (and potentially quite confusing) in a dynamic
environment, but if you're just running an automated programming
script you should be fine.

--
Charles Steinkuehler
cha...@steinkuehler.net

Ankur Tank

unread,
May 24, 2016, 7:10:33 AM5/24/16
to BeagleBoard
Hi Charles,

Thank you for reply,
I was on vacation so I couldn't reply this, apologies for the same

We are using mdev 

We have statically created the device files under /dev directory but they get deleted when parted partitions the emmc.

Let me try it with mdev disabled and see if that helps.

Thank you,

Regards,
Ankur

Ankur Tank

unread,
Jun 1, 2016, 5:32:33 AM6/1/16
to BeagleBoard
Hi Charles,

I seems your solution is working.
I don't see device file being deleted when mdev daemon is not running.
Only thing pending is testing with multiple device, however I am confident that it would work fine.

Thank you,

Regards,
Ankur

On Friday, 13 May 2016 18:56:23 UTC+5:30, Charles Steinkuehler wrote:
Reply all
Reply to author
Forward
0 new messages