2020-03-13 08:38:01 +00:00
|
|
|
#!/bin/sh
|
2020-03-16 21:13:39 +00:00
|
|
|
|
|
|
|
## 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-13 08:38:01 +00:00
|
|
|
|
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"
|
|
|
|
|
2020-03-13 08:38:01 +00:00
|
|
|
. /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
|
|
|
|
|
2020-03-13 08:38:01 +00:00
|
|
|
# Mount things needed by this script
|
2020-03-16 14:49:12 +00:00
|
|
|
mkdir /proc
|
|
|
|
mkdir /sys
|
|
|
|
mkdir /etc
|
2020-03-13 08:38:01 +00:00
|
|
|
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
|
2020-03-13 08:38:01 +00:00
|
|
|
|
|
|
|
# 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
|
|
|
|
|
2020-03-16 14:49:12 +00:00
|
|
|
gzip -c -d splash.ppm.gz > /splash.ppm
|
|
|
|
fbsplash -s /splash.ppm
|
2020-03-13 08:38:01 +00:00
|
|
|
|
|
|
|
loop_forever
|