Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

script: terminate compile rootfs when no ap deamen. #123

Merged
merged 1 commit into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading