5 Star 0 Fork 16

OpenCloudOS Stream/grub2

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0046-SUSE-Add-the-t-hotkey.patch 2.01 KB
一键复制 编辑 原始数据 按行查看 历史
nilusyi 提交于 2024-04-07 16:45 . update patches
From 723bafd59aa3cc894fada9b637da737b90db968b Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Tue, 26 Apr 2016 15:59:03 +0200
Subject: [PATCH 046/272] SUSE: Add the "t" hotkey
While graphical output is fancy and nice, in some environments (EFI) we can
only have fancy graphical on frame buffer _or_ ugly serial on any output.
To give the user a nicely graphical screen in the default case, but still
allow them to get their boot menu on the serial console, let's add a new
hidden option "t" that switches the output device back to the firmware default.
Signed-off-by: Alexander Graf <agraf@suse.de>
---
Makefile.util.def | 6 ++++++
util/grub.d/00_header.in | 4 ++++
util/grub.d/95_textmode.in | 12 ++++++++++++
3 files changed, 22 insertions(+)
create mode 100644 util/grub.d/95_textmode.in
diff --git a/Makefile.util.def b/Makefile.util.def
index 8a74ae0e7..1aaab4eca 100644
--- a/Makefile.util.def
+++ b/Makefile.util.def
@@ -548,6 +548,12 @@ script = {
installdir = grubconf;
};
+script = {
+ name = '95_textmode';
+ common = util/grub.d/95_textmode.in;
+ installdir = grubconf;
+};
+
program = {
mansection = 1;
name = grub-mkrescue;
diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in
index 314d0d763..8b2658279 100644
--- a/util/grub.d/00_header.in
+++ b/util/grub.d/00_header.in
@@ -220,6 +220,10 @@ EOF
fi
cat << EOF
+ if [ "\${grub_platform}" = "efi" ]; then
+ echo "Please press 't' to show the boot menu on this console"
+ fi
+
set gfxmode=${GRUB_GFXMODE}
load_video
insmod gfxterm
diff --git a/util/grub.d/95_textmode.in b/util/grub.d/95_textmode.in
new file mode 100644
index 000000000..d6c1dbf00
--- /dev/null
+++ b/util/grub.d/95_textmode.in
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+cat <<EOF
+if [ "\${grub_platform}" = "efi" ]; then
+ # On EFI systems we can only have graphics *or* serial, so allow the user
+ # to switch between the two
+ hiddenentry 'Text mode' --hotkey 't' {
+ set textmode=true
+ terminal_output console
+ }
+fi
+EOF
--
2.41.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/opencloudos-stream/grub2.git
git@gitee.com:opencloudos-stream/grub2.git
opencloudos-stream
grub2
grub2
master

搜索帮助