Skip to content

Commit

Permalink
initramfs: mount devtmpfs to fix race condition
Browse files Browse the repository at this point in the history
There is a race condition between mdev creating a device node (notified
by a linux uevent) and the init script mounting /boot.

We are using devtmpfs to fix this problem, as that way the device node
appears inmediately once it is created in kernel space.
  • Loading branch information
EmilioPeJu committed Sep 12, 2024
1 parent ef47480 commit 8f02a44
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions initramfs/init
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ IMAGEFILE=/boot/imagefile.cpio.gz


# Get our basic working environment up.
mount -t devtmpfs devtmpfs /dev
mount -t proc proc /proc
mount -t sysfs sysfs /sys
mdev -s


# This is called if something goes horribly wrong.
panic()
Expand Down Expand Up @@ -276,4 +275,5 @@ sync
umount /boot
umount /sys
umount /proc
umount /dev
exec switch_root -c /dev/console /rootfs /sbin/init

0 comments on commit 8f02a44

Please sign in to comment.