forked from ChimeraOS/chimeraos
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[Unit] | ||
Description=Auto keep next boot entry | ||
After=network.target | ||
|
||
[Service] | ||
Type=oneshot | ||
ExecStart=/usr/bin/sk-set-next-boot-entry | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
# 使用efibootmgr获取当前的启动项编号 | ||
boot_current=$(efibootmgr | grep "BootCurrent" | awk -F' ' '{print $2}') | ||
|
||
# 如果没有找到启动项编号,则输出错误信息并退出 | ||
if [ -z "$boot_current" ]; then | ||
echo "无法获取当前的启动项编号" | ||
exit 1 | ||
fi | ||
|
||
# 使用efibootmgr -n设置新的启动项编号 | ||
efibootmgr -n "$boot_current" | ||
|
||
echo "已将启动项设置为: $boot_current" |