mirror of
https://github.com/dreemurrs-embedded/Pineloader.git
synced 2024-09-28 14:50:58 +00:00
Make Pineloader to be able to handle initrd and cmdline variables
Signed-off-by: Danct12 <danct12@disroot.org>
This commit is contained in:
parent
4c25519623
commit
e376e0f3da
@ -63,4 +63,6 @@ setup_telnetd
|
|||||||
/pineloader
|
/pineloader
|
||||||
|
|
||||||
# Don't kernel panic just in case if the pineloader script crashes
|
# Don't kernel panic just in case if the pineloader script crashes
|
||||||
|
echo "ERROR: Pineloader script finished, this is not supposed to happen!"
|
||||||
|
echo "Please telnet to $IP and diagnose the issue."
|
||||||
loop_forever
|
loop_forever
|
||||||
|
@ -99,15 +99,19 @@ done
|
|||||||
|
|
||||||
i=$(select_opt "${choices[@]}")
|
i=$(select_opt "${choices[@]}")
|
||||||
key="${choices[$i]}"
|
key="${choices[$i]}"
|
||||||
value="${config[$key]}"
|
value="${config[$key]}" && $value
|
||||||
|
|
||||||
if [ -z "$value" ]; then
|
if [ -z "$value" ] || [ -z "$KERNEL" ]; then
|
||||||
echo "ERROR: The selected boot variables are blank, please debug the issue by telnet to:"
|
echo "ERROR: The selected boot variables are blank, please check for syntax, double quote in your config file."
|
||||||
echo "$IP"
|
|
||||||
else
|
else
|
||||||
|
# Building up the kexec command line
|
||||||
|
KEXEC_CMD=("kexec" "-l" "$KERNEL")
|
||||||
|
[[ "$INITRD" ]] && KEXEC_CMD+=("--initrd" "$INITRD")
|
||||||
|
[[ "$CMDLINE" ]] && KEXEC_CMD+=("--command-line" "$CMDLINE")
|
||||||
|
|
||||||
mount -o ro $BOOTPART /mnt
|
mount -o ro $BOOTPART /mnt
|
||||||
echo "Loading kernel and ramdisk to memory..."
|
echo "Loading kernel and ramdisk to memory..."
|
||||||
kexec -l --initrd="$INITRD" --command-line="$CMDLINE" $KERNEL
|
"${KEXEC_CMD[@]}"
|
||||||
echo "Starting kernel..."
|
echo "Starting kernel..."
|
||||||
kexec -e
|
kexec -e
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user