mirror of
https://git.yoctoproject.org/poky
synced 2026-02-09 18:23:02 +01:00
When booting from an initrd disk, or when the kernel config option DEVTMPFS_MOUNT isn't provided, /dev/ will not be mounted at boot. This small addition will check if /dev/ is "useful", and if not, will mount devtmpfs if the kernel provides it. With this change, it is possible to set an initscripts style image type to "cpio.gz" and boot it as initrd. Without this change, the image won't work properly because of the missing devices. (From OE-Core rev: a1cfb8a2691ed36700c96cbc1a0e744494294d2b) Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
28 lines
782 B
Bash
28 lines
782 B
Bash
#!/bin/sh
|
|
### BEGIN INIT INFO
|
|
# Provides: mountvirtfs
|
|
# Required-Start:
|
|
# Required-Stop:
|
|
# Default-Start: S
|
|
# Default-Stop:
|
|
# Short-Description: Mount kernel virtual file systems.
|
|
# Description: Mount initial set of virtual filesystems the kernel
|
|
# provides and that are required by everything.
|
|
### END INIT INFO
|
|
|
|
if [ -e /proc ] && ! [ -e /proc/mounts ]; then
|
|
mount -t proc proc /proc
|
|
fi
|
|
|
|
if [ -e /sys ] && grep -q sysfs /proc/filesystems && ! [ -e /sys/class ]; then
|
|
mount -t sysfs sysfs /sys
|
|
fi
|
|
|
|
if [ -e /sys/kernel/debug ] && grep -q debugfs /proc/filesystems; then
|
|
mount -t debugfs debugfs /sys/kernel/debug
|
|
fi
|
|
|
|
if ! [ -e /dev/zero ] && [ -e /dev ] && grep -q devtmpfs /proc/filesystems; then
|
|
mount -n -t devtmpfs devtmpfs /dev
|
|
fi
|