Skip to contentSkip to conversation

synopsys/axs10x: Update /etc/inittab by post-build

PATCH New Evgeniy Didin 2 participants 2 messages Jun 19, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

Cc Thomas Petazzoni <[email protected]>
Cc arc-buildroot at synopsys.com
---
 board/synopsys/axs10x/fs-overlay/etc/inittab | 42 --------------------
 board/synopsys/axs10x/post-build.sh          | 11 +++++
 configs/snps_arc700_axs101_defconfig         |  2 +-
 configs/snps_archs38_axs103_defconfig        |  2 +-
 4 files changed, 13 insertions(+), 44 deletions(-)
 delete mode 100644 board/synopsys/axs10x/fs-overlay/etc/inittab
 create mode 100755 board/synopsys/axs10x/post-build.sh
board/synopsys/axs10x/fs-overlay/etc/inittab deleted +0 -42
deleted file mode 100644
index 7412a27366..0000000000
@@ -1,42 +0,0 @@
-# /etc/inittab
-#
-# Copyright (C) 2001 Erik Andersen <[email protected]>
-#
-# 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
-::sysinit:/etc/init.d/rcS
-
-# /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
-::ctrlaltdel:/sbin/reboot
-
-# Stuff to do before rebooting
-::shutdown:/etc/init.d/rcK
-::shutdown:/sbin/swapoff -a
-::shutdown:/bin/umount -a -r
board/synopsys/axs10x/post-build.sh new file +11 -0
new file mode 100755
index 0000000000..f23c8a99b8
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+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
+fi
configs/snps_arc700_axs101_defconfig +1 -1
index 2a71ff3896..4f796b438b 100644
@@ -6,7 +6,7 @@ BR2_TARGET_GENERIC_HOSTNAME="axs101"
 BR2_TARGET_GENERIC_ISSUE="Welcome to the ARC Software Development Platform"
 BR2_TARGET_ROOTFS_INITRAMFS=y
 BR2_SYSTEM_DHCP="eth0"
-BR2_ROOTFS_OVERLAY="board/synopsys/axs10x/fs-overlay"
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/synopsys/axs10x/post-build.sh"
 
 # Linux headers same as kernel, a 4.16 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_16=y
configs/snps_archs38_axs103_defconfig +1 -1
index 1ad79eb406..456d4cba2e 100644
@@ -7,7 +7,7 @@ BR2_TARGET_GENERIC_HOSTNAME="axs103"
 BR2_TARGET_GENERIC_ISSUE="Welcome to the ARC Software Development Platform"
 BR2_TARGET_ROOTFS_INITRAMFS=y
 BR2_SYSTEM_DHCP="eth0"
-BR2_ROOTFS_OVERLAY="board/synopsys/axs10x/fs-overlay"
+BR2_ROOTFS_POST_BUILD_SCRIPT="board/synopsys/axs10x/post-build.sh"
 
 # Linux headers same as kernel, a 4.16 series
 BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_16=y
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 synopsys/axs10x: Update /etc/inittab by post-build

Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Evgeniy" == Evgeniy Didin <[email protected]> writes:

To not maintain custom copy of inittab file lets adopt approach used in raspberrypi adding post-build script for synopsys/axs10x boards.

Cc Thomas Petazzoni <[email protected]>
Cc arc-buildroot at synopsys.com

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard