Skip to content
Snippets Groups Projects
Commit b3a1cb85 authored by Steven Shiau's avatar Steven Shiau
Browse files

A workaround to make sure /dev/mtd0 can be created

A workaround to make sure /dev/mtd0 can be created when memdisk is used.
This is due to sometimes "modprobe phram" can not successfully create /dev/mtd0.
Have to try several times.
Ref: https://gitlab.gnome.org/GNOME/gparted/issues/50#note_523831
     http://gparted-forum.surf4.info/viewtopic.php?pid=32784#p32784
parent ed2bc296
No related branches found
No related tags found
No related merge requests found
......@@ -57,8 +57,17 @@ Live ()
if [ $? -eq 0 ]
then
# We found a memdisk, set up phram
modprobe phram phram=memdisk,${MEMDISK}
modprobe phram phram=memdisk,${MEMDISK}
# Sometimes "modprobe phram" can not successfully create /dev/mtd0.
# Have to try several times.
while [ ! -c /dev/mtd0 ]; do
modprobe phram phram=memdisk,${MEMDISK}
sleep 0.2
if [ -c /dev/mtd0 ]; then
break
else
rmmod phram
fi
done
# Load mtdblock, the memdisk will be /dev/mtdblock0
modprobe mtdblock
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment