Jumpdrive/initramfs/init

55 lines
1.1 KiB
Bash
Executable File

#!/bin/sh
## SPDX-License-Identifier: GPL-2.0-only
## Init script for JumpDrive
## Copyright (C) 2020 - postmarketOS
## Copyright (C) 2020 - Danctl12 <danct12@disroot.org>
echo "Welcome to JumpDrive"
. /init_functions.sh
# Environment variables that we want:
IP=172.16.42.1
# 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
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
# Amber LED indicator for MMC r/w access
echo mmc2 > /sys/class/leds/pinephone\:green\:user/trigger
echo mmc2 > /sys/class/leds/pinephone\:red\:user/trigger
# Create device nodes
echo "Creating device nodes..."
mknod /dev/null c 1 3
mknod /dev/tty c 5 0
mdev -s
# Finishing rescue setup
setup_usb_configfs
start_udhcpd
setup_telnetd
gzip -c -d splash.ppm.gz > /splash.ppm
fbsplash -s /splash.ppm
loop_forever