This commit is contained in:
Ing 2023-08-20 21:16:49 +08:00
parent 8905f37680
commit fa21e70678
5 changed files with 16 additions and 16 deletions

View File

@ -7,7 +7,7 @@ DAEMON=/usr/sbin/dhcpcd
CONFIG=/etc/dhcpcd.conf CONFIG=/etc/dhcpcd.conf
PIDFILE=/var/run/dhcpcd/pid PIDFILE=/var/run/dhcpcd/pid
[ -f $CONFIG ] || exit 0 [ -f "${CONFIG}" ] || exit 0
case "$1" in case "$1" in
start) start)

View File

@ -5,15 +5,15 @@
# be able to execute in the initramfs/preboot environment (so no bashism etc) # be able to execute in the initramfs/preboot environment (so no bashism etc)
# All comments will be stripped, functions here should NOT start with brp_ as they're not part of the builder # All comments will be stripped, functions here should NOT start with brp_ as they're not part of the builder
if [ -z ${SED_PATH+x} ]; then if [ -z "${SED_PATH+x}" ]; then
echo "Your SED_PATH variable is not set/is empty!" echo "Your SED_PATH variable is not set/is empty!"
exit 1 exit 1
fi fi
##$1 from, $2 to, $3 file to path ##$1 from, $2 to, $3 file to path
_replace_in_file() { _replace_in_file() {
if grep -q "$1" "$3"; then if grep -q "${1}" "${3}"; then
$SED_PATH -i "$3" -e "s#$1#$2#" "${SED_PATH}" -i "${3}" -e "s#${1}#${2}#"
fi fi
} }
@ -23,16 +23,16 @@ _replace_in_file() {
_set_conf_kv() { _set_conf_kv() {
# Delete # Delete
if [ -z "$2" ]; then if [ -z "$2" ]; then
$SED_PATH -i "$3" -e "s/^$1=.*$//" "${SED_PATH}" -i "${3}" -e "s/^${1}=.*$//"
return 0 return 0
fi fi
# Replace # Replace
if grep -q "^$1=" "$3"; then if grep -q "^${1}=" "${3}"; then
$SED_PATH -i "$3" -e "s\"^$1=.*\"$1=\\\"$2\\\"\"" "${SED_PATH}" -i "${3}" -e "s\"^${1}=.*\"${1}=\\\"${2}\\\"\""
return 0 return 0
fi fi
# Add if doesn't exist # Add if doesn't exist
echo "$1=\"$2\"" >>$3 echo "${1}=\"${2}\"" >>"${3}"
} }

View File

@ -5,7 +5,7 @@
# When the kernel is booted with "elevator=elevator" it will attempt to load a module "elevator-iosched"... and the rest # When the kernel is booted with "elevator=elevator" it will attempt to load a module "elevator-iosched"... and the rest
# should be obvious from the code below. DO NOT print anything here (kernel doesn't attach STDOUT) # should be obvious from the code below. DO NOT print anything here (kernel doesn't attach STDOUT)
for arg in "$@"; do for arg in "$@"; do
if [ "$arg" = "elevator-iosched" ]; then if [ "${arg}" = "elevator-iosched" ]; then
insmod /usr/lib/modules/rp.ko insmod /usr/lib/modules/rp.ko
rm /usr/lib/modules/rp.ko rm /usr/lib/modules/rp.ko
rm /usr/sbin/modprobe rm /usr/sbin/modprobe

View File

@ -42,7 +42,7 @@ SCRIPT_DIR=$(dirname $0)
VMLINUX_MOD=${1} VMLINUX_MOD=${1}
ZIMAGE_MOD=${2} ZIMAGE_MOD=${2}
KVER_MAJOR=${KVER:0:1} KVER_MAJOR=${KVER:0:1}
if [ $KVER_MAJOR -eq 4 ] || [ $KVER_MAJOR -eq 3 ]; then if [ ${KVER_MAJOR} -eq 4 ] || [ ${KVER_MAJOR} -eq 3 ]; then
# Kernel version 4.x or 3.x (bromolow) # Kernel version 4.x or 3.x (bromolow)
#zImage_head 16494 #zImage_head 16494
#payload( #payload(

View File

@ -7,8 +7,8 @@ PS1='\u@\h:\w# '
# You may uncomment the following lines if you want `ls' to be colorized: # You may uncomment the following lines if you want `ls' to be colorized:
export LS_OPTIONS='--color=auto' export LS_OPTIONS='--color=auto'
alias ls='ls $LS_OPTIONS' alias ls='ls ${LS_OPTIONS}'
alias ll='ls $LS_OPTIONS -l' alias ll='ls ${LS_OPTIONS} -l'
# Save history in realtime # Save history in realtime
shopt -s histappend shopt -s histappend
@ -25,17 +25,17 @@ if [ -f ${BOOTLOADER_PATH}/.locale ]; then
export LANG="$(cat ${BOOTLOADER_PATH}/.locale)" export LANG="$(cat ${BOOTLOADER_PATH}/.locale)"
fi fi
if [ -d /opt/arpl/lang ]; then if [ $(ls /opt/arpl/lang/*.mo 2>/dev/null | wc -l) -gt 0 ]; then
for F in $(ls /opt/arpl/lang/*.mo); do for F in $(ls /opt/arpl/lang/*.mo); do
install "${F}" "/usr/share/locale/$(basename $F .mo)/LC_MESSAGES/arpl.mo" install "${F}" "/usr/share/locale/$(basename "${F}" .mo)/LC_MESSAGES/arpl.mo"
done done
fi fi
if [ ! -f ${HOME}/.initialized ]; then if [ ! -f ${HOME}/.initialized ]; then
touch ${HOME}/.initialized touch "${HOME}/.initialized"
/opt/arpl/init.sh /opt/arpl/init.sh
fi fi
cd /opt/arpl cd "/opt/arpl"
if tty | grep -q "/dev/pts" && [ -z "${SSH_TTY}" ]; then if tty | grep -q "/dev/pts" && [ -z "${SSH_TTY}" ]; then
/opt/arpl/menu.sh /opt/arpl/menu.sh
#exit # Allow web access back to shell #exit # Allow web access back to shell