From 8cd838bfacced99d1045a36d1618ebd9cc86ab7b Mon Sep 17 00:00:00 2001 From: srs5694 Date: Sat, 14 Dec 2013 18:28:43 -0500 Subject: [PATCH] Added support for "-1" value to "screensaver" token. Modified install.sh and mkrlconf.sh to create a new boot option that sets the efi_no_storage_paranoia kernel option. --- NEWS.txt | 12 +++++++++++- docs/refind/configfile.html | 9 +++++++-- docs/refind/todo.html | 5 +++++ install.sh | 7 ++++--- mkrlconf.sh | 7 ++++--- refind.conf-sample | 2 +- refind/config.c | 8 ++++++-- refind/menu.c | 16 ++++++++++++---- refind/screen.c | 18 ++++++++++++++---- 9 files changed, 64 insertions(+), 20 deletions(-) diff --git a/NEWS.txt b/NEWS.txt index ec97a1b..bcfefd4 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -1,6 +1,16 @@ -0.7.6 (11/??/2013): +0.7.6 (12/??/2013): ------------------- +- Added support for a blank-screen startup: Set "screensaver -1" and the + screen saver will be initialized when rEFInd starts. If you set a low + "timeout" value, the result will be a boot straight to the default OS + unless you hit a key soon after rEFInd starts. Once you hit a key, the + screensaver will be disabled. + +- Modified install.sh and mkrlconf.sh to create a new Linux kernel + option set: "Boot without EFI storage paranoia," which passes the + efi_no_storage_paranoia option to the kernel. + - Added --ownhfs {target} option to install.sh. This option causes rEFInd to install to an HFS+ partition in a way that's more consistent with the way the Mac's native boot loader is installed. Note that you should NOT diff --git a/docs/refind/configfile.html b/docs/refind/configfile.html index 6efd42c..4bae3e5 100644 --- a/docs/refind/configfile.html +++ b/docs/refind/configfile.html @@ -15,7 +15,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

Originally written: 3/14/2012; last Web page update: -11/10/2013, referencing rEFInd 0.7.5

+12/14/2013, referencing rEFInd 0.7.5

I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!

@@ -214,7 +214,7 @@ timeout 20 screensaver numeric value - Sets the number of seconds of inactivity before the screen blanks to prevent burn-in. The display returns after most keypresses (unfortunately, not including modifiers such as Shift, Control, Alt, or Option). The default is 0, which disables this feature. + Sets the number of seconds of inactivity before the screen blanks to prevent burn-in. The display returns after most keypresses (unfortunately, not including modifiers such as Shift, Control, Alt, or Option). The default is 0, which disables this feature. Setting this token to -1 causes a blank display until the timeout value passes or you press a key. hideui @@ -311,6 +311,11 @@ timeout 20 none or 0 When set, causes rEFInd to add Linux kernels (files with names that begin with vmlinuz or bzImage) to the list of EFI boot loaders, even if they lack .efi filename extensions. The hope is that this will simplify use of rEFInd on distributions that provide kernels with EFI stub loader support but that don't give those kernels names that end in .efi. Of course, the kernels must still be stored on a filesystem that rEFInd can read, and in a directory that it scans. (Drivers and the also_scan_dirs options can help with those issues.) Note that this option can cause unwanted files to be improperly detected and given loader tags, such as older kernels without EFI stub loader support. Versions of rEFInd prior to 0.5.0 left this option commented out in the refind.conf-sample file, but as of version 0.5.0, this option is enabled in the default configuration file. The program default remains to not scan for such kernels, though, so you can delete or uncomment this option to keep them from appearing in your boot menu. Passing any option but 0 causes scans for all kernels to occur; passing a 0 causes these kernels to not be scanned. (This could be useful if you want to override a setting of scan_all_linux_kernels in an included secondary configuration file.) + + max_tags + numeric (integer) value + Limits the number of tags that rEFInd will display at one time. If rEFInd discovers more loaders than this value, they're shown in a scrolling list. The default value is 0, which imposes no limit. + default_selection a substring of a boot loader's title; or a numeric position diff --git a/docs/refind/todo.html b/docs/refind/todo.html index bca8a39..cd5110f 100644 --- a/docs/refind/todo.html +++ b/docs/refind/todo.html @@ -219,6 +219,11 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com

and/or initial RAM disks relative to the rEFInd directory (or the boot loader's directory, in the case of initrds). +
  • Currently the background for certain subscreens (such as the + information page or submenu listings) is a solid color based on the + upper-left corner of the screen. Having an option to support a + transparent background is desirable to some users.
  • +
  • Known bugs that need squashing: diff --git a/install.sh b/install.sh index d00c6a8..a31dbb3 100755 --- a/install.sh +++ b/install.sh @@ -780,9 +780,10 @@ GenerateRefindLinuxConf() { fi fi DefaultOptions="$GRUB_CMDLINE_LINUX $GRUB_CMDLINE_LINUX_DEFAULT" - echo "\"Boot with standard options\" \"ro root=$RootFS $DefaultOptions \"" > $RLConfFile - echo "\"Boot to single-user mode\" \"ro root=$RootFS $DefaultOptions single\"" >> $RLConfFile - echo "\"Boot with minimal options\" \"ro root=$RootFS\"" >> $RLConfFile + echo "\"Boot with standard options\" \"ro root=$RootFS $DefaultOptions \"" > $RLConfFile + echo "\"Boot to single-user mode\" \"ro root=$RootFS $DefaultOptions single\"" >> $RLConfFile + echo "\"Boot without EFI storage paranoia\" \"ro root=$RootFS $DefaultOptions efi_no_storage_paranoia\"" >> $RLConfFile + echo "\"Boot with minimal options\" \"ro root=$RootFS\"" >> $RLConfFile fi } diff --git a/mkrlconf.sh b/mkrlconf.sh index f7c1f59..ae9eff6 100755 --- a/mkrlconf.sh +++ b/mkrlconf.sh @@ -40,9 +40,10 @@ if [[ ! -f $RLConfFile || $1 == "--force" ]] ; then fi fi DefaultOptions="$GRUB_CMDLINE_LINUX $GRUB_CMDLINE_LINUX_DEFAULT" - echo "\"Boot with standard options\" \"ro root=$RootFS $DefaultOptions \"" > $RLConfFile - echo "\"Boot to single-user mode\" \"ro root=$RootFS $DefaultOptions single\"" >> $RLConfFile - echo "\"Boot with minimal options\" \"ro root=$RootFS\"" >> $RLConfFile + echo "\"Boot with standard options\" \"ro root=$RootFS $DefaultOptions \"" > $RLConfFile + echo "\"Boot to single-user mode\" \"ro root=$RootFS $DefaultOptions single\"" >> $RLConfFile + echo "\"Boot without EFI storage paranoia\" \"ro root=$RootFS $DefaultOptions efi_no_storage_paranoia\"" >> $RLConfFile + echo "\"Boot with minimal options\" \"ro root=$RootFS\"" >> $RLConfFile else echo "Existing $RLConfFile found! Not overwriting!" echo "To force overwriting, pass the --force option." diff --git a/refind.conf-sample b/refind.conf-sample index 5d86de2..71237d5 100644 --- a/refind.conf-sample +++ b/refind.conf-sample @@ -143,7 +143,7 @@ timeout 20 # about - an "about this program" option # exit - a tag to exit from rEFInd # shutdown - shuts down the computer (a bug causes this to reboot -# EFI systems) +# many UEFI systems) # reboot - a tag to reboot the computer # firmware - a tag to reboot the computer into the firmware's # user interface (ignored on older computers) diff --git a/refind/config.c b/refind/config.c index ee9c818..c310e30 100644 --- a/refind/config.c +++ b/refind/config.c @@ -305,8 +305,12 @@ VOID FreeTokenLine(IN OUT CHAR16 ***TokenList, IN OUT UINTN *TokenCount) // handle a parameter with a single integer argument static VOID HandleInt(IN CHAR16 **TokenList, IN UINTN TokenCount, OUT UINTN *Value) { - if (TokenCount == 2) - *Value = Atoi(TokenList[1]); + if (TokenCount == 2) { + if (StriCmp(TokenList[1], L"-1") == 0) + *Value = -1; + else + *Value = Atoi(TokenList[1]); + } } // handle a parameter with a single string argument diff --git a/refind/menu.c b/refind/menu.c index f4bfd57..c2ad279 100644 --- a/refind/menu.c +++ b/refind/menu.c @@ -395,13 +395,15 @@ static UINTN RunGenericMenu(IN REFIT_MENU_SCREEN *Screen, IN MENU_STYLE_FUNC Sty // override the starting selection with the default index, if any if (*DefaultEntryIndex >= 0 && *DefaultEntryIndex <= State.MaxIndex) { State.CurrentSelection = *DefaultEntryIndex; - UpdateScroll(&State, SCROLL_NONE); + if (GlobalConfig.ScreensaverTime != -1) + UpdateScroll(&State, SCROLL_NONE); } - State.PaintAll = TRUE; + if (GlobalConfig.ScreensaverTime != -1) + State.PaintAll = TRUE; while (!MenuExit) { // update the screen - if (State.PaintAll) { + if (State.PaintAll && (GlobalConfig.ScreensaverTime != -1)) { StyleFunc(Screen, &State, MENU_FUNCTION_PAINT_ALL, NULL); State.PaintAll = FALSE; } else if (State.PaintSelection) { @@ -413,7 +415,8 @@ static UINTN RunGenericMenu(IN REFIT_MENU_SCREEN *Screen, IN MENU_STYLE_FUNC Sty CurrentTime = (TimeoutCountdown + 5) / 10; if (CurrentTime != PreviousTime) { SPrint(TimeoutMessage, 255, L"%s in %d seconds", Screen->TimeoutText, CurrentTime); - StyleFunc(Screen, &State, MENU_FUNCTION_PAINT_TIMEOUT, TimeoutMessage); + if (GlobalConfig.ScreensaverTime != -1) + StyleFunc(Screen, &State, MENU_FUNCTION_PAINT_TIMEOUT, TimeoutMessage); PreviousTime = CurrentTime; } } @@ -449,6 +452,11 @@ static UINTN RunGenericMenu(IN REFIT_MENU_SCREEN *Screen, IN MENU_STYLE_FUNC Sty // the user pressed a key, cancel the timeout StyleFunc(Screen, &State, MENU_FUNCTION_PAINT_TIMEOUT, L""); HaveTimeout = FALSE; + if (GlobalConfig.ScreensaverTime == -1) { // cancel start-with-blank-screen coding + GlobalConfig.ScreensaverTime = 0; + if (!GlobalConfig.TextOnly) + BltClearScreen(TRUE); + } } // react to key press diff --git a/refind/screen.c b/refind/screen.c index 7907d36..1676cb6 100644 --- a/refind/screen.c +++ b/refind/screen.c @@ -119,7 +119,7 @@ VOID InitScreen(VOID) PrepareBlankLine(); // show the banner if in text mode - if (GlobalConfig.TextOnly) + if (GlobalConfig.TextOnly && (GlobalConfig.ScreensaverTime != -1)) DrawScreenHeader(L"Initializing..."); } @@ -168,7 +168,11 @@ VOID SetupScreen(VOID) // clear screen and show banner // (now we know we'll stay in graphics mode) SwitchToGraphics(); - BltClearScreen(TRUE); + if (GlobalConfig.ScreensaverTime != -1) { + BltClearScreen(TRUE); + } else { // start with screen blanked + GraphicsScreenDirty = TRUE; + } } } // VOID SetupScreen() @@ -433,6 +437,7 @@ VOID BltClearScreen(IN BOOLEAN ShowBanner) { static EG_IMAGE *Banner = NULL, *CroppedBanner; INTN BannerPosX, BannerPosY; + EG_PIXEL Black = { 0x0, 0x0, 0x0, 0 }; if (ShowBanner && !(GlobalConfig.HideUIFlags & HIDEUI_FLAG_BANNER)) { // load banner on first call @@ -456,14 +461,19 @@ VOID BltClearScreen(IN BOOLEAN ShowBanner) } // clear and draw banner - egClearScreen(&MenuBackgroundPixel); + if (GlobalConfig.ScreensaverTime != -1) + egClearScreen(&MenuBackgroundPixel); + else + egClearScreen(&Black); + if (Banner != NULL) { BannerPosX = (Banner->Width < UGAWidth) ? ((UGAWidth - Banner->Width) / 2) : 0; BannerPosY = (INTN) (ComputeRow0PosY() / 2) - (INTN) Banner->Height; if (BannerPosY < 0) BannerPosY = 0; GlobalConfig.BannerBottomEdge = BannerPosY + Banner->Height; - BltImage(Banner, (UINTN) BannerPosX, (UINTN) BannerPosY); + if (GlobalConfig.ScreensaverTime != -1) + BltImage(Banner, (UINTN) BannerPosX, (UINTN) BannerPosY); } } else { -- 2.39.2