Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #519 from fbelavenuto/dev
Browse files Browse the repository at this point in the history
Adding video mode selection in grub.
  • Loading branch information
fbelavenuto authored Jan 18, 2023
2 parents 6a49f24 + bd34a24 commit abc533f
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 23 deletions.
1 change: 1 addition & 0 deletions files/board/arpl/overlayfs/opt/arpl/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ ln -s "${CACHE_PATH}/ssh" "/etc/ssh"
# Link bash history to cache volume
rm -rf ~/.bash_history
ln -s ${CACHE_PATH}/.bash_history ~/.bash_history
touch ~/.bash_history
if ! grep -q "menu.sh" ~/.bash_history; then
echo "menu.sh " >> ~/.bash_history
fi
Expand Down
63 changes: 40 additions & 23 deletions files/board/arpl/p1/grub/grub.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@ insmod ext2
set default="boot"
set timeout="5"
set timeout_style="menu"
set vesa_mode=1

if [ -s $prefix/grubenv ]; then
load_env
fi
if [ "${next_entry}" ]; then
set default="${next_entry}"
unset next_entry
save_env next_entry
fi
if [ "${vesa_mode}" ]; then
set vesa_mode=${vesa_mode}
fi

function load_video {
if [ x$feature_all_video_module = xy ]; then
Expand All @@ -33,7 +46,6 @@ load_video
if loadfont unicode; then
set gfxmode=auto
insmod gfxterm
set gfxpayload=keep
terminal_output gfxterm
fi

Expand All @@ -45,30 +57,22 @@ if serial --unit=0 --speed=115200; then
terminal_output --append serial_com0
fi

if [ -s $prefix/grubenv ]; then
load_env
fi
if [ "${default}" ]; then
set default="${default}"
fi
if [ "${next_entry}" ]; then
set default="${next_entry}"
set next_entry=
save_env next_entry
fi

if serial --unit=0 --speed=115200; then
terminal_input --append serial_com0
terminal_output --append serial_com0
fi
function set_gfxpayload {
if [ ${vesa_mode} -eq 1 ]; then
set gfxpayload=keep
else
set gfxpayload=text
fi
}

set TERM=tty2

search --set=root --label "ARPL3"
if [ -s /zImage-dsm -a -s /initrd-dsm ]; then
if [ "${default}" = "direct" ]; then
set timeout="1"
menuentry 'Boot DSM kernel directly' --id direct {
load_video
set_gfxpayload
echo "Loading DSM kernel..."
linux /zImage-dsm console=ttyS0,115200n8 earlyprintk log_buf_len=32M earlycon=uart8250,io,0x3f8,115200n8 root=/dev/md0 loglevel=15 ${dsm_cmdline}
echo "Loading DSM initramfs..."
Expand All @@ -77,30 +81,43 @@ if [ -s /zImage-dsm -a -s /initrd-dsm ]; then
}
fi
menuentry 'Boot DSM' --id boot {
load_video
set_gfxpayload
echo "Loading kernel..."
linux /bzImage-arpl console=${TERM} net.ifnames=0
echo "Loading initramfs..."
initrd /initrd-arpl
echo "Booting..."
}
menuentry 'Force re-install DSM' --id junior {
load_video
set_gfxpayload
echo "Loading kernel..."
linux /bzImage-arpl console=${TERM} net.ifnames=0 force_junior
echo "Loading initramfs..."
initrd /initrd-arpl
echo "Booting..."
}
else
set timeout="1"
fi

menuentry 'Configure loader' --id config {
load_video
set_gfxpayload
echo "Loading kernel..."
linux /bzImage-arpl console=${TERM} net.ifnames=0 IWANTTOCHANGETHECONFIG
echo "Loading initramfs..."
initrd /initrd-arpl
echo "Booting..."
}

if [ ${vesa_mode} = 1 ]; then
menuentry 'Change vesa to text video mode' --id videomode {
set vesa_mode=0
save_env vesa_mode
configfile ${prefix}/grub.cfg
}
else
menuentry 'Change text to vesa video mode' --id videomode {
set vesa_mode=1
save_env vesa_mode
reboot
configfile ${prefix}/grub.cfg
}
fi

0 comments on commit abc533f

Please sign in to comment.