aboutsummaryrefslogtreecommitdiffstats
path: root/meta-mel/recipes-core/initrdscripts/files/init-boot.sh
blob: afe0458158c7a7d931cd41373bc6eb997c5085dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

# ---------------------------------------------------------------------------------------------------------------------
# SPDX-License-Identifier: MIT
# ---------------------------------------------------------------------------------------------------------------------

PATH=/sbin:/bin:/usr/sbin:/usr/bin

mkdir -p /proc
mkdir -p /sys
mount -t proc proc /proc
mount -t sysfs sysfs /sys

# mount devtmpfs 
mount -n -o mode=0755 -t devtmpfs none "/dev"

# get name of active terminal
CONSOLE=`cat /sys/devices/virtual/tty/console/active | cut -d " " -f2`

# run shell on active terminal
setsid sh -c "exec sh </dev/$CONSOLE >/dev/$CONSOLE 2>&1"