diff --git a/VERSION b/VERSION index 943f9cb..f8a696c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.7.1 +1.7.2 diff --git a/doc/boot-update.8 b/doc/boot-update.8 index 7a72904..6c4d890 100644 --- a/doc/boot-update.8 +++ b/doc/boot-update.8 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH BOOT-UPDATE 8 "" "1.7.1" "Funtoo Linux Core System" +.TH BOOT-UPDATE 8 "" "1.7.2" "Funtoo Linux Core System" .SH NAME boot-update \- Automatically create a boot loader configuration file . @@ -76,8 +76,12 @@ loader configuration file is stored at \fI/boot/grub/grub.cfg\fP, is quite complex and is not intended to be edited directly by system administrators. .sp \fIboot\-update\fP has since been extended to support GRUB (\fIsys\-boot/grub\fP), GRUB -Legacy (\fIsys\-boot/grub\-legacy\fP) and LILO (\fIsys\-boot/lilo\fP). This allows a -single file, \fI/etc/boot.conf\fP, to store boot\-related information in a +Legacy (\fIsys\-boot/grub\-legacy\fP) and LILO (\fIsys\-boot/lilo\fP) to boot systems in +MBR (legacy) mode. In addition, GRUB also supports auto\-detecting and configuring +UEFI booting. If boot\-update detects that your system has booted in UEFI mode, +it will create a UEFI\-compatible configuration file automatically. +.sp +Boot\-update allows a single file, \fI/etc/boot.conf\fP, to store boot\-related information in a boot\-loader\-independent way, thus simplifying boot loader configuration and providing advanced features to all popular boot loaders. .sp diff --git a/doc/boot-update.8.rst b/doc/boot-update.8.rst index 4afcc95..569b00e 100644 --- a/doc/boot-update.8.rst +++ b/doc/boot-update.8.rst @@ -46,8 +46,12 @@ loader configuration file is stored at */boot/grub/grub.cfg*, is quite complex and is not intended to be edited directly by system administrators. *boot-update* has since been extended to support GRUB (*sys-boot/grub*), GRUB -Legacy (*sys-boot/grub-legacy*) and LILO (*sys-boot/lilo*). This allows a -single file, */etc/boot.conf*, to store boot-related information in a +Legacy (*sys-boot/grub-legacy*) and LILO (*sys-boot/lilo*) to boot systems in +MBR (legacy) mode. In addition, GRUB also supports auto-detecting and configuring +UEFI booting. If boot-update detects that your system has booted in UEFI mode, +it will create a UEFI-compatible configuration file automatically. + +Boot-update allows a single file, */etc/boot.conf*, to store boot-related information in a boot-loader-independent way, thus simplifying boot loader configuration and providing advanced features to all popular boot loaders. diff --git a/doc/boot.conf.5 b/doc/boot.conf.5 index 2691e72..29f0497 100644 --- a/doc/boot.conf.5 +++ b/doc/boot.conf.5 @@ -1,6 +1,6 @@ .\" Man page generated from reStructuredText. . -.TH BOOT.CONF 5 "" "1.7.1" "Funtoo Linux Core System" +.TH BOOT.CONF 5 "" "1.7.2" "Funtoo Linux Core System" .SH NAME boot.conf \- Funtoo global boot loader configuration file . @@ -45,6 +45,11 @@ The benefit of \fI/etc/boot.conf\fP is that it provides a single location to store all boot\-related information. It also provides a single, consistent file format and feature set for configuring all boot loaders. .sp +For MBR booting, GRUB, GRUB (legacy) and LILO boot loaders are supported. For +UEFI booting, GRUB is supported. When using GRUB, boot\-update will auto\-enable +UEFI boot configuration if it sees that your system has been booted in UEFI mode. +Otherwise, MBR (legacy) boot mode will be used. +.sp \fIboot\-update(8)\fP utilizes \fI/etc/boot.conf\fP to provide a consistent process for updating boot loader configuration, regardless of the actual boot loader used. .sp @@ -635,7 +640,7 @@ rootfstype=auto\fP\&. Specifies the video mode to be used by the boot loader\(aqs menus. This value is also inherited and used as the video mode for the kernel when a graphical boot (\fIuvesafb\fP, \fIvesafb\-tng\fP) is used. This option is only supported for -\fIgrub\fP\&. +\fIgrub\fP\&. Default value is "text" for MBR booting, or "640x480" for UEFI booting. .SS \fIdisplay :: background\fP .sp Specifies the graphical image to display at boot. The specified file should diff --git a/doc/boot.conf.5.rst b/doc/boot.conf.5.rst index aa9f8e8..63e3da4 100644 --- a/doc/boot.conf.5.rst +++ b/doc/boot.conf.5.rst @@ -26,6 +26,11 @@ The benefit of */etc/boot.conf* is that it provides a single location to store all boot-related information. It also provides a single, consistent file format and feature set for configuring all boot loaders. +For MBR booting, GRUB, GRUB (legacy) and LILO boot loaders are supported. For +UEFI booting, GRUB is supported. When using GRUB, boot-update will auto-enable +UEFI boot configuration if it sees that your system has been booted in UEFI mode. +Otherwise, MBR (legacy) boot mode will be used. + *boot-update(8)* utilizes */etc/boot.conf* to provide a consistent process for updating boot loader configuration, regardless of the actual boot loader used. @@ -465,7 +470,7 @@ rootfstype=auto*. Specifies the video mode to be used by the boot loader's menus. This value is also inherited and used as the video mode for the kernel when a graphical boot (*uvesafb*, *vesafb-tng*) is used. This option is only supported for -*grub*. +*grub*. Default value is "text" for MBR booting, or "640x480" for UEFI booting. *display :: background* ~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/python/modules/funtoo/boot/extensions/grub.py b/python/modules/funtoo/boot/extensions/grub.py index a462362..4eee73a 100644 --- a/python/modules/funtoo/boot/extensions/grub.py +++ b/python/modules/funtoo/boot/extensions/grub.py @@ -26,6 +26,10 @@ def __init__(self, config, testing = False): self.GuppyMap() self.defpos = 0 self.defname = "undefined" + if os.path.exists("/sys/firmware/efi"): + self.uefiboot = True + else: + self.uefiboot = False def grubProbe(self): gprobe = "/usr/sbin/grub-probe" @@ -134,16 +138,27 @@ def generateBootEntry(self, l, sect, kname, kext): # Append graphics line if self.config.hasItem("{s}/gfxmode".format(s = sect)): - l.append(" set gfxpayload={gm}".format(gm = self.config.item(sect, "gfxmode"))) + l.append(" set gfxpayload=keep") l.append("}") return [ ok, allmsgs ] + def sanitizeDisplayMode(self,dm): + if self.uefiboot and dm == "text": + # UEFI doesn't support text mode: + return "640x480" + else: + return dm + def generateConfigFile(self): l = [] c = self.config ok = True allmsgs = [] + if self.uefiboot: + allmsgs.append(["warn","Detected UEFI boot. Configuring for UEFI booting."]) + else: + allmsgs.append(["warn","Detected MBR boot. Configuring for Legacy MBR booting."]) l.append(c.condFormatSubItem("boot/timeout", "set timeout={s}")) # pass our boot entry generator function to GenerateSections, # and everything is taken care of for our boot entries @@ -175,9 +190,8 @@ def generateConfigFile(self): return [False, allmsgs, l] l += [ "if loadfont {dst}; then".format(dst = self.r.RelativePathTo(dst_font,c["boot/path"])), - " set gfxmode={gfx}".format(gfx = c["display/gfxmode"]), - " insmod gfxterm", - " insmod vbe", + " set gfxmode={gfx}".format(gfx = self.sanitizeDisplayMode(c["display/gfxmode"])), + " insmod all_video", " terminal_output gfxterm" ] bg = c.item("display","background").split() if len(bg): diff --git a/sbin/boot-update b/sbin/boot-update index 53b3ce6..f91714b 100755 --- a/sbin/boot-update +++ b/sbin/boot-update @@ -26,7 +26,7 @@ GREEN = "\x1b[32;01m" RED = "\x1b[31;01m" PURP = "\x1b[35;01m" OFF = "\x1b[0m" -version = "1.7.1" +version = "1.7.2" verbose = False def banner(extra=True):