Jumpdrive/initramfs/init

59 lines
1.1 KiB
Plaintext
Raw Permalink Normal View History

#!/bin/sh
## SPDX-License-Identifier: GPL-2.0-only
2020-03-16 11:13:57 +00:00
## Init script for JumpDrive
## Copyright (C) 2020 - postmarketOS
## Copyright (C) 2020 - Danctl12 <danct12@disroot.org>
2020-03-16 14:49:12 +00:00
echo "Welcome to JumpDrive"
2020-03-17 18:19:34 +00:00
. /info.sh
echo "Running on $PLATFORM"
. /init_functions.sh
# Environment variables that we want:
IP=172.16.42.1
2020-03-16 14:49:12 +00:00
# Create all the symlinks to /bin/busybox
mkdir -p /usr/bin
mkdir -p /sbin
mkdir -p /usr/sbin
echo "Installing Busybox..." && /bin/busybox --install -s
# Mount things needed by this script
2020-03-16 14:49:12 +00:00
mkdir /proc
mkdir /sys
mkdir /etc
mount -t proc proc /proc
mount -t sysfs sysfs /sys
mkdir /config
mount -t configfs -o nodev,noexec,nosuid configfs /config
# /dev/pts (needed for telnet)
mkdir -p /dev/pts
mount -t devpts devpts /dev/pts
2020-03-17 18:19:34 +00:00
# LED indicator for MMC r/w access
if [ -n "$LED" ]; then
echo $TRIGGER > /sys/class/leds/$LED/trigger
fi
# Create device nodes
echo "Creating device nodes..."
mknod /dev/null c 1 3
mknod /dev/tty c 5 0
mdev -s
# Finishing rescue setup
start_serial_getty
setup_usb_configfs
start_udhcpd
setup_telnetd
2020-03-16 14:49:12 +00:00
gzip -c -d splash.ppm.gz > /splash.ppm
fbsplash -s /splash.ppm
loop_forever