Skip to content

Commit

Permalink
script: terminate compile rootfs when no ap deamen.
Browse files Browse the repository at this point in the history
1. modify compile rootfs way to found no ap deamen problem.
2. rootfs use mdev to update /dev

Signed-off-by: dong.yang <[email protected]>
  • Loading branch information
p7salon authored and xingxg2022 committed Oct 16, 2024
1 parent 223799a commit f0ba54f
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 0 deletions.
42 changes: 42 additions & 0 deletions ramdisk/rootfs_202405/etc/init.d/S10mdev
Original file line number Diff line number Diff line change
@@ -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 $?
39 changes: 39 additions & 0 deletions ramdisk/rootfs_202405/etc/mdev.conf
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 2 additions & 0 deletions scripts/envsetup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down

0 comments on commit f0ba54f

Please sign in to comment.