1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter.git synced 2025-02-15 04:42:02 +00:00
openmptcprouter/root/target/linux/ipq40xx/base-files/etc/init.d/boot
Ycarus (Yannick Chabanois) 0b14e36374 Fix RUTX support
2022-03-07 20:21:35 +01:00

70 lines
1.7 KiB
Bash
Executable file

#!/bin/sh /etc/rc.common
# Copyright (C) 2006-2011 OpenWrt.org
START=10
STOP=90
uci_apply_defaults() {
. /lib/functions/system.sh
cd /etc/uci-defaults || return 0
files="$(find . -type f | sort)"
[ -z "$files" ] && return 0
mkdir -p /tmp/.uci
for file in $files; do
( . "./$file" ) && rm -f "$file"
done
uci commit
}
boot() {
[ -f /proc/mounts ] || /sbin/mount_root
[ -f /proc/jffs2_bbc ] && echo "S" > /proc/jffs2_bbc
mkdir -p /var/run
mkdir -p /var/log
mkdir -p /var/lock
mkdir -p /var/state
mkdir -p /var/tmp
mkdir -p /tmp/.uci
chmod 0700 /tmp/.uci
touch /var/log/wtmp
touch /var/log/lastlog
mkdir -p /tmp/resolv.conf.d
touch /tmp/resolv.conf.d/resolv.conf.auto
ln -sf /tmp/resolv.conf.d/resolv.conf.auto /tmp/resolv.conf
grep -q debugfs /proc/filesystems && /bin/mount -o noatime -t debugfs debugfs /sys/kernel/debug
grep -q bpf /proc/filesystems && /bin/mount -o nosuid,nodev,noexec,noatime,mode=0700 -t bpf bpffs /sys/fs/bpf
grep -q pstore /proc/filesystems && /bin/mount -o noatime -t pstore pstore /sys/fs/pstore
# mount all entries in fstab
/bin/mount -a &
# /log directory might be created on preinit
# symlink /storage to /log on TRB14X devices
[ -d /storage -a ! -h /log ] && {
rm -rf /log
ln -sf /storage /log
}
# Wifi ---
param=$(/sbin/mnf_info "--name")
router_name=${param:0:6}
if [ $router_name == "RUTX08" ] || [ $router_name == "RUTX09" ]; then
rm /etc/modules.d/ath10k
fi
/bin/board_detect
/sbin/kmodloader
/bin/config_generate
uci_apply_defaults
[ -f "/etc/config/teltonika" ] && rm /etc/config/teltonika
# temporary hack until configd exists
/sbin/reload_config
# leave finished boot script indication
touch /var/run/boot-done
}