diff --git a/ramdisk/rootfs_202405/etc/init.d/S10mdev b/ramdisk/rootfs_202405/etc/init.d/S10mdev new file mode 100755 index 00000000..3c6f47c1 --- /dev/null +++ b/ramdisk/rootfs_202405/etc/init.d/S10mdev @@ -0,0 +1,42 @@ +#!/bin/sh +# +# Run the mdev daemon +# + +DAEMON="mdev" +PIDFILE="/var/run/$DAEMON.pid" + + +start() { + echo -n "Starting $DAEMON... " + start-stop-daemon -S -b -m -p $PIDFILE -x /sbin/mdev -- -df + [ $? -eq 0 ] && echo "OK" || echo "ERROR" + + # coldplug modules + find /sys/ -name modalias -print0 | \ + xargs -0 sort -u | \ + tr '\n' '\0' | \ + xargs -0 modprobe -abq +} + +stop() { + echo -n "Stopping $DAEMON... " + start-stop-daemon -K -p $PIDFILE + [ $? -eq 0 ] && echo "OK" || echo "ERROR" +} + +restart() { + stop + start +} + +case "$1" in + start|stop|restart) + "$1" + ;; + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 +esac + +exit $? diff --git a/ramdisk/rootfs_202405/etc/mdev.conf b/ramdisk/rootfs_202405/etc/mdev.conf new file mode 100644 index 00000000..eaece1b7 --- /dev/null +++ b/ramdisk/rootfs_202405/etc/mdev.conf @@ -0,0 +1,39 @@ +# null may already exist; therefore ownership has to be changed with command +null root:root 666 @chmod 666 $MDEV +zero root:root 666 +full root:root 666 +random root:root 444 +urandom root:root 444 +hwrandom root:root 444 +grsec root:root 660 + +kmem root:root 640 +mem root:root 640 +port root:root 640 +# console may already exist; therefore ownership has to be changed with command +console root:tty 600 @chmod 600 $MDEV +ptmx root:tty 666 +pty.* root:tty 660 + +# Typical devices +tty root:tty 666 +tty[0-9]* root:tty 660 +vcsa*[0-9]* root:tty 660 +ttyS[0-9]* root:root 660 +ttyUSB[0-9]* root:root 660 + +# alsa sound devices +snd/pcm.* root:audio 660 +snd/control.* root:audio 660 +snd/midi.* root:audio 660 +snd/seq root:audio 660 +snd/timer root:audio 660 + +# input stuff +input/event[0-9]+ root:root 640 +input/mice root:root 640 +input/mouse[0-9] root:root 640 +input/ts[0-9] root:root 600 + +# load modules +$MODALIAS=.* root:root 660 @modprobe "$MODALIAS" diff --git a/scripts/envsetup.sh b/scripts/envsetup.sh index 84014ca8..be43f4fe 100755 --- a/scripts/envsetup.sh +++ b/scripts/envsetup.sh @@ -969,6 +969,7 @@ function build_rv_ramdisk() cp $TPUV7_TP_DAEMON $RV_RAMDISK_DIR/build/$RAMDISK_CPU_TYPE/rootfs/ else echo "no ap daemon found" + return 1 fi # copy other non-generated files if [ -d $TPUV7_RUNTIME_DIR/cdmlib/overlay/tp ]; then @@ -984,6 +985,7 @@ function build_rv_ramdisk() cp $TPUV7_RUNTIME_DIR/build/asic/cdmlib/ap/tools/dump_memory/dump $RV_RAMDISK_DIR/build/ap/rootfs/ else echo "no ap daemon found" + return 1 fi fi