path: root/board/synopsys
diff options
authorGravatar Evgeniy Didin <Evgeniy.Didin@synopsys.com>2018-06-19 14:30:52 +0300
committerGravatar Peter Korsgaard <peter@korsgaard.com>2018-06-19 13:52:12 +0200
commit2cdfa6c84951b25e805d329cb7bae833d333538f (patch)
treed648f4a79b1a2a0a03ab9527906cacbdcf8f19b0 /board/synopsys
parent8733193e6b744295f0f955b78a9323fb2615416c (diff)
synopsys/axs10x: Update /etc/inittab by post-build
To not maintain custom copy of inittab file lets adopt approach used in raspberrypi adding post-build script for synopsys/axs10x boards. Signed-off-by: Evgeniy Didin <didin@synopsys.com> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Cc: arc-buildroot@synopsys.com Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Diffstat (limited to 'board/synopsys')
2 files changed, 11 insertions, 42 deletions
diff --git a/board/synopsys/axs10x/fs-overlay/etc/inittab b/board/synopsys/axs10x/fs-overlay/etc/inittab
deleted file mode 100644
index 7412a27366..0000000000
--- a/board/synopsys/axs10x/fs-overlay/etc/inittab
+++ /dev/null
@@ -1,42 +0,0 @@
-# /etc/inittab
-# Copyright (C) 2001 Erik Andersen <andersen@codepoet.org>
-# Note: BusyBox init doesn't support runlevels. The runlevels field is
-# completely ignored by BusyBox init. If you want runlevels, use
-# sysvinit.
-# Format for each entry: <id>:<runlevels>:<action>:<process>
-# id == tty to run on, or empty for /dev/console
-# runlevels == ignored
-# action == one of sysinit, respawn, askfirst, wait, and once
-# process == program to run
-# Startup the system
-::sysinit:/bin/mount -t proc proc /proc
-::sysinit:/bin/mount -o remount,rw /
-::sysinit:/bin/mkdir -p /dev/pts /dev/shm
-::sysinit:/bin/mount -a
-::sysinit:/sbin/swapon -a
-null::sysinit:/bin/ln -sf /proc/self/fd /dev/fd
-null::sysinit:/bin/ln -sf /proc/self/fd/0 /dev/stdin
-null::sysinit:/bin/ln -sf /proc/self/fd/1 /dev/stdout
-null::sysinit:/bin/ln -sf /proc/self/fd/2 /dev/stderr
-::sysinit:/bin/hostname -F /etc/hostname
-# now run any rc scripts
-# /sbin/getty invocation for tty0
-tty0::respawn:/sbin/getty 115200 tty0
-# Put a getty on the serial port
-console::respawn:/sbin/getty -L console 0 vt100
-# Stuff to do for the 3-finger salute
-# Stuff to do before rebooting
-::shutdown:/sbin/swapoff -a
-::shutdown:/bin/umount -a -r
diff --git a/board/synopsys/axs10x/post-build.sh b/board/synopsys/axs10x/post-build.sh
new file mode 100755
index 0000000000..f23c8a99b8
--- /dev/null
+++ b/board/synopsys/axs10x/post-build.sh
@@ -0,0 +1,11 @@
+set -u
+set -e
+# Add a console on tty0
+if [ -e ${TARGET_DIR}/etc/inittab ]; then
+ grep -qE '^tty0::' ${TARGET_DIR}/etc/inittab || \
+ sed -i '/GENERIC_SERIAL/a\
+tty0::respawn:/sbin/getty 115200 tty0' ${TARGET_DIR}/etc/inittab