Commit Graph

10228 Commits

Author SHA1 Message Date
Colin Watson
11ea79546d Adjust efi_distributor for some distributions
This is not a very good approach, and certainly not sanely upstreamable;
we probably need to split GRUB_DISTRIBUTOR into a couple of different
variables.

Bug-Ubuntu: https://bugs.launchpad.net/bugs/1242417
Bug-Debian: https://bugs.debian.org/932966
Forwarded: not-needed
Last-Update: 2019-08-06

Patch-Name: install-efi-adjust-distributor.patch
2021-09-27 20:09:38 +01:00
Colin Watson
0b33def5d9 Add configure option to reduce visual clutter at boot time
If this option is enabled, then do all of the following:

Don't display introductory message about line editing unless we're
actually offering a shell prompt.  (This is believed to be a workaround
for a different bug.  We'll go with this for now, but will drop this in
favour of a better fix upstream if somebody figures out what that is.)

Don't clear the screen just before booting if we never drew the menu in
the first place.

Remove verbose messages printed before reading configuration.  In some
ways this is awkward because it makes debugging harder, but it's a
requirement for a smooth-looking boot process; we may be able to do
better in future.  Upstream doesn't want this, though.

Disable the cursor as well, for similar reasons of tidiness.

Suppress kernel/initrd progress messages, except in recovery mode.

Suppress "GRUB loading" message unless Shift is held down.  Upstream
doesn't want this, as it makes debugging harder.  Ubuntu wants it to
provide a cleaner boot experience.

Author: Will Thompson <will@willthompson.co.uk>
Bug-Ubuntu: https://bugs.launchpad.net/bugs/386922
Bug-Ubuntu: https://bugs.launchpad.net/bugs/861048
Forwarded: (partial) http://lists.gnu.org/archive/html/grub-devel/2009-09/msg00056.html
Last-Update: 2021-09-24

Patch-Name: maybe-quiet.patch
2021-09-27 20:09:38 +01:00
Colin Watson
f366950984 Skip Windows os-prober entries on Wubi systems
Since we're already being booted from the Windows boot loader, including
entries that take us back to it mostly just causes confusion, and stops
us from being able to hide the menu if there are no other OSes
installed.

https://blueprints.launchpad.net/ubuntu/+spec/foundations-o-wubi

Forwarded: not-needed
Last-Update: 2013-11-26

Patch-Name: wubi-no-windows.patch
2021-09-27 20:09:38 +01:00
Colin Watson
0bd31f4c74 Install signed images if UEFI Secure Boot is enabled
Author: Stéphane Graber <stgraber@ubuntu.com>
Author: Steve Langasek <steve.langasek@ubuntu.com>
Author: Linn Crosetto <linn@hpe.com>
Author: Mathieu Trudel-Lapierre <cyphermox@ubuntu.com>
Forwarded: no
Last-Update: 2021-09-24

Patch-Name: install-signed.patch
2021-09-27 20:09:38 +01:00
Colin Watson
9eefe03f4b Generate configuration for signed UEFI kernels if available
Forwarded: no
Last-Update: 2013-12-25

Patch-Name: mkconfig-signed-kernel.patch
2021-09-27 20:09:37 +01:00
Matthew Garrett
fc550c31c2 Add "linuxefi" loader which avoids ExitBootServices
Origin: vendor, http://pkgs.fedoraproject.org/cgit/grub2.git/tree/grub2-linuxefi.patch
Author: Colin Watson <cjwatson@ubuntu.com>
Author: Steve Langasek <steve.langasek@canonical.com>
Author: Linn Crosetto <linn@hpe.com>
Forwarded: no
Last-Update: 2021-09-24

Patch-Name: linuxefi.patch
2021-09-27 20:09:34 +01:00
Mario Limonciello
84938bc37e Remove GNU/Linux from default distributor string for Ubuntu
Ubuntu is called "Ubuntu", not "Ubuntu GNU/Linux".

Author: Colin Watson <cjwatson@debian.org>
Author: Harald Sitter <apachelogger@kubuntu.org>
Forwarded: not-needed
Last-Update: 2013-12-25

Patch-Name: mkconfig-ubuntu-distributor.patch
2021-09-24 23:29:41 +01:00
Colin Watson
ee6cee995e Blacklist 1440x900x32 from VBE preferred mode handling
Bug-Ubuntu: https://bugs.launchpad.net/bugs/701111
Forwarded: no
Last-Update: 2013-11-14

Patch-Name: blacklist-1440x900x32.patch
2021-09-24 23:29:41 +01:00
Colin Watson
4dff7f7df2 Read /etc/default/grub.d/*.cfg after /etc/default/grub
Bug-Ubuntu: https://bugs.launchpad.net/bugs/901600
Forwarded: no
Last-Update: 2021-09-24

Patch-Name: default-grub-d.patch
2021-09-24 23:29:41 +01:00
Colin Watson
989f83d664 Avoid getting confused by inaccessible loop device backing paths
Bug-Ubuntu: https://bugs.launchpad.net/bugs/938724
Forwarded: no
Last-Update: 2021-09-24

Patch-Name: mkconfig-nonexistent-loopback.patch
2021-09-24 22:18:50 +01:00
Colin Watson
31e9c5eaec Prefer translations from Ubuntu language packs if available
Bug-Ubuntu: https://bugs.launchpad.net/bugs/537998
Forwarded: not-needed
Last-Update: 2013-12-25

Patch-Name: install-locale-langpack.patch
2021-09-24 22:18:50 +01:00
Colin Watson
13c9a7101d "single" -> "recovery" when friendly-recovery is installed
If configured with --enable-ubuntu-recovery, also set nomodeset for
recovery mode, and disable 'set gfxpayload=keep' even if the system
normally supports it.  See
https://launchpad.net/ubuntu/+spec/desktop-o-xorg-tools-and-processes.

Author: Stéphane Graber <stgraber@ubuntu.com>
Forwarded: no
Last-Update: 2013-12-25

Patch-Name: mkconfig-ubuntu-recovery.patch
2021-09-24 22:18:50 +01:00
Colin Watson
7cf3ac7be5 Fall back to non-EFI if booted using EFI but -efi is missing
It may be possible, particularly in recovery situations, to be booted
using EFI on x86 when only the i386-pc target is installed, or on ARM
when only the arm-uboot target is installed.  There's nothing actually
stopping us installing i386-pc or arm-uboot from an EFI environment, and
it's better than returning a confusing error.

Author: Steve McIntyre <93sam@debian.org>
Forwarded: no
Last-Update: 2019-05-24

Patch-Name: install-efi-fallback.patch
2021-09-24 22:18:50 +01:00
Colin Watson
ddc3423d5c Silence error messages when translations are unavailable
Bug: https://savannah.gnu.org/bugs/?35880
Forwarded: https://savannah.gnu.org/bugs/?35880
Last-Update: 2013-11-14

Patch-Name: gettext-quiet.patch
2021-09-24 22:18:50 +01:00
Colin Watson
a7b960126f Restore grub-mkdevicemap
This is kind of a mess, requiring lots of OS-specific code to iterate
over all possible devices.  However, we use it in a number of scripts to
discover devices and reimplementing those in terms of something else
would be very complicated.

Author: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
Forwarded: no
Last-Update: 2021-09-24

Patch-Name: restore-mkdevicemap.patch
2021-09-24 22:18:39 +01:00
Colin Watson
3f0c88e2ff Handle filesystems loop-mounted on file images
Improve prepare_grub_to_access_device to emit appropriate commands for
such filesystems, and ignore them in Linux grub.d scripts.

This is needed for Ubuntu's Wubi installation method.

This patch isn't inherently Debian/Ubuntu-specific.  losetup and
/proc/mounts are Linux-specific, though, so we might need to refine this
before sending it upstream.  The changes to the Linux grub.d scripts
might be better handled by integrating 10_lupin properly instead.

Patch-Name: mkconfig-loopback.patch
2021-09-24 10:36:01 +01:00
Mario Limonciello
41f0edb8be Build vfat into EFI boot images
Author: Colin Watson <cjwatson@ubuntu.com>
Bug-Ubuntu: https://bugs.launchpad.net/bugs/677758
Forwarded: http://lists.gnu.org/archive/html/grub-devel/2011-01/msg00028.html
Last-Update: 2016-09-18

Patch-Name: mkrescue-efi-modules.patch
2021-09-24 10:36:01 +01:00
Colin Watson
07ebcd8f76 If GRUB Legacy is still around, tell packaging to ignore it
Bug-Debian: http://bugs.debian.org/586143
Forwarded: not-needed
Last-Update: 2021-09-24

Patch-Name: install-stage2-confusion.patch
2021-09-24 10:35:54 +01:00
Colin Watson
70a2b23aad Disable gfxpayload=keep by default
Setting gfxpayload=keep has been known to cause efifb to be
inappropriately enabled.  In any case, with the current Linux kernel the
result of this option is that early kernelspace will be unable to print
anything to the console, so (for example) if boot fails and you end up
dumped to an initramfs prompt, you won't be able to see anything on the
screen.  As such it shouldn't be enabled by default in Debian, no matter
what kernel options are enabled.

gfxpayload=keep is a good idea but rather ahead of its time ...

Bug-Debian: http://bugs.debian.org/567245
Forwarded: no
Last-Update: 2013-12-25

Patch-Name: gfxpayload-keep-default.patch
2021-09-24 10:34:44 +01:00
Colin Watson
2f1be2e80b Make grub.cfg world-readable if it contains no passwords
Patch-Name: grub.cfg-400.patch
2021-09-24 10:34:44 +01:00
Colin Watson
6a1ff6845e Disable use of floppy devices
An ugly kludge.  Should this be merged upstream?

Author: Robert Millan

Patch-Name: disable-floppies.patch
2021-09-24 10:34:44 +01:00
Robert Millan
ae648ba616 Support running grub-probe in grub-legacy's update-grub
Author: Colin Watson <cjwatson@debian.org>
Forwarded: not-needed
Last-Update: 2013-12-25

Patch-Name: grub-legacy-0-based-partitions.patch
2021-09-24 10:34:44 +01:00
Robert Millan
562d50025e Improve handling of Debian kernel version numbers
Forwarded: not-needed
Last-Update: 2013-12-20

Patch-Name: dpkg-version-comparison.patch
2021-09-24 10:34:44 +01:00
Colin Watson
bd289b232f Write marker if core.img was written to filesystem
The Debian bug reporting script includes a warning in this case.

Patch-Name: core-in-fs.patch
2021-09-24 10:34:44 +01:00
Colin Watson
39e079ec50 Hack prefix for OLPC
This sucks, but it's better than what OFW was giving us.

Patch-Name: olpc-prefix-hack.patch
2021-09-24 10:34:44 +01:00
Colin Watson
21f954425f Import grub2_2.06.orig.tar.xz 2021-09-24 10:34:42 +01:00
Daniel Kiper
ae94b97be2 Release 2.06
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
2021-06-08 16:28:15 +02:00
Daniel Kiper
76013f9918 SECURITY: Add SECURITY file
The SECURITY file describes the GRUB project security policy.

It is based on https://github.com/wireapp/wire/blob/master/SECURITY.md

Signed-off-by: Alex Burmashev <alexander.burmashev@oracle.com>
Signed-off-by: Vladimir Serbinenko <phcoder@google.com>
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
2021-06-08 14:24:34 +02:00
Daniel Kiper
2564baae57 MAINTAINERS: Add MAINTAINERS file
The MAINTAINERS file provides basic information about the GRUB project
and its maintainers.

Signed-off-by: Alex Burmashev <alexander.burmashev@oracle.com>
Signed-off-by: Vladimir Serbinenko <phcoder@google.com>
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
2021-06-08 14:15:13 +02:00
Dimitri John Ledkov
8ddbdc3bc2 grub-install: Add backup and restore
Refactor clean_grub_dir() to create a backup of all the files, instead
of just irrevocably removing them as the first action. If available,
register atexit() handler to restore the backup if errors occur before
point of no return, or remove the backup if everything was successful.
If atexit() is not available, the backup remains on disk for manual
recovery.

Some platforms defined a point of no return, i.e. after modules & core
images were updated. Failures from any commands after that stage are
ignored, and backup is cleaned up. For example, on EFI platforms update
is not reverted when efibootmgr fails.

Extra care is taken to ensure atexit() handler is only invoked by the
parent process and not any children forks. Some older GRUB codebases
can invoke parent atexit() hooks from forks, which can mess up the
backup.

This allows safer upgrades of MBR & modules, such that
modules/images/fonts/translations are consistent with MBR in case of
errors. For example accidental grub-install /dev/non-existent-disk
currently clobbers and upgrades modules in /boot/grub, despite not
actually updating any MBR.

This patch only handles backup and restore of files copied to /boot/grub.
This patch does not perform backup (or restoration) of MBR itself or
blocklists. Thus when installing i386-pc platform, corruption may still
occur with MBR and blocklists which will not be attempted to be
automatically recovered.

Also add modinfo.sh and *.efi to the cleanup/backup/restore code path,
to ensure it is also cleaned, backed up and restored.

Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2021-06-01 17:20:20 +02:00
Dimitri John Ledkov
7da1d0dde1 osdep/unix/exec: Avoid atexit() handlers when child execvp() fails
The functions grub_util_exec_pipe() and grub_util_exec_pipe_stderr()
currently call execvp(). If the call fails for any reason, the child
currently calls exit(127). This in turn executes the parents
atexit() handlers from the forked child, and then the same handlers
are called again from parent. This is usually not desired, and can
lead to deadlocks, and undesired behavior. So, change the exit() calls
to _exit() calls to avoid calling atexit() handlers from child.

Fixes: e75cf4a58 (unix exec: avoid atexit handlers when child exits)

Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2021-06-01 17:20:20 +02:00
Jan (janneke) Nieuwenhuizen
80948f532d lib/i386/relocator64: Build fixes for i386
This fixes cross-compiling to x86 (e.g., the Hurd) from x86-linux of

    grub-core/lib/i386/relocator64.S

This file has six sections that only build with a 64-bit assembler,
yet only the first two sections had support for a 32-bit assembler.
This patch completes this for the remaining sections.

To reproduce, update the GRUB source description in your local Guix
archive and run

   ./pre-inst-env guix build --system=i686-linux --target=i586-pc-gnu grub

or install an x86 cross-build environment on x86-linux (32-bit!) and
configure to cross build and make, e.g., do something like

    ./configure \
       CC_FOR_BUILD=gcc \
       --build=i686-unknown-linux-gnu \
       --host=i586-pc-gnu
    make

Additionally, remove a line with redundant spaces.

Signed-off-by: Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2021-06-01 17:20:20 +02:00
Javier Martinez Canillas
777276063e fs/xfs: Add needsrepair incompat feature support
The XFS now has an incompat feature flag to indicate that a filesystem
needs to be repaired. The Linux kernel refuses to mount the filesystem
that has it set and only the xfs_repair tool is able to clear that flag.

The GRUB doesn't have the concept of mounting filesystems and just
attempts to read the files. But it does some sanity checking before
attempting to read from the filesystem. Among the things which are tested,
is if the super block only has set of incompatible features flags that
are supported by GRUB. If it contains any flags that are not listed as
supported, reading the XFS filesystem fails.

Since the GRUB doesn't attempt to detect if the filesystem is inconsistent
nor replays the journal, the filesystem access is a best effort. For this
reason, ignore if the filesystem needs to be repaired and just print a debug
message. That way, if reading or booting fails later, the user is able to
figure out that the failures can be related to broken XFS filesystem.

Suggested-by: Eric Sandeen <esandeen@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2021-06-01 17:20:20 +02:00
Carlos Maiolino
8b1e5d1936 fs/xfs: Add bigtime incompat feature support
The XFS filesystem supports a bigtime feature to overcome y2038 problem.
This patch makes the GRUB able to support the XFS filesystems with this
feature enabled.

The XFS counter for the bigtime enabled timestamps starts at 0, which
translates to GRUB_INT32_MIN (Dec 31 20:45:52 UTC 1901) in the legacy
timestamps. The conversion to Unix timestamps is made before passing the
value to other GRUB functions.

For this to work properly, GRUB requires an access to flags2 field in the
XFS ondisk inode. So, the grub_xfs_inode structure has been updated to
cover full ondisk inode.

Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2021-06-01 17:20:20 +02:00
Carlos Maiolino
81f1962393 fs: Use 64-bit type for filesystem timestamp
Some filesystems nowadays use 64-bit types for timestamps. So, update
grub_dirhook_info struct to use an grub_int64_t type to store mtime.
This also updates the grub_unixtime2datetime() function to receive
a 64-bit timestamp argument and do 64-bit-safe divisions.

All the remaining conversion from 32-bit to 64-bit should be safe, as
32-bit to 64-bit attributions will be implicitly casted. The most
critical part in the 32-bit to 64-bit conversion is in the function
grub_unixtime2datetime() where it needs to deal with the 64-bit type.
So, for that, the grub_divmod64() helper has been used.

These changes enables the GRUB to support dates beyond y2038.

Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2021-06-01 17:19:13 +02:00
Javier Martinez Canillas
af54062b54 types: Define PRI{x,d}GRUB_INT{32,64}_T format specifiers
There are already PRI*_T constants defined for unsigned integers but not
for signed integers. Add format specifiers for the latter.

Suggested-by: Daniel Kiper <daniel.kiper@oracle.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2021-05-28 15:57:05 +02:00
Tianjia Zhang
f17e8b9ed2 kern/efi/sb: Remove duplicate efi_shim_lock_guid variable
The efi_shim_lock_guid local variable and shim_lock_guid global variable
have the same GUID value. Only the latter is retained.

Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2021-05-28 12:49:56 +02:00
Javier Martinez Canillas
c0e647eb0e util/mkimage: Fix wrong PE32+ section sizes for some arches
The commit f60ba9e594 (util/mkimage: Refactor section setup to use a helper)
added a helper function to setup PE sections. But it also changed how the
raw data offsets were calculated since all the section sizes are aligned.
However, for some platforms, i.e ia64-efi and arm64-efi, the kernel image
size is not aligned using the section alignment. This leads to the situation
in which the mods section offset in its PE section header does not match its
real placement in the PE file. So, finally the GRUB is not able to locate
and load built-in modules.

The problem surfaces on ia64-efi and arm64-efi because both platforms
require additional relocation data which is added behind .bss section.
So, we have to add some padding behind this extra data to make the
beginning of mods section properly aligned in the PE file. Fix it by
aligning the kernel_size to the section alignment. That makes the sizes
and offsets in the PE section headers to match relevant sections in the
PE32+ binary file.

Reported-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Tested-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2021-05-10 15:18:34 +02:00
Daniel Kiper
88e856a5b3 term/terminfo: Fix the terminfo command help and documentation
Additionally, fix the terminfo spelling mistake in
the GRUB development documentation.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
2021-05-10 15:08:39 +02:00
Daniel Kiper
3a1afa19ca i18n: Align N_() formatting with the rest of GRUB code
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
2021-05-10 15:07:58 +02:00
Daniel Kiper
66be067e61 i18n: Format large integers before the translation message - take 2
This is an additional fix which has been missing from the commit 837fe48de
(i18n: Format large integers before the translation message).

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
2021-05-10 15:06:33 +02:00
Miguel Ángel Arruga Vivas
837fe48deb i18n: Format large integers before the translation message
The GNU gettext only supports the ISO C99 macros for integral
types. If there is a need to use unsupported formatting macros,
e.g. PRIuGRUB_UINT64_T, according to [1] the number to a string
conversion should be separated from the code printing message
requiring the internationalization. So, the function grub_snprintf()
is used to print the numeric values to an intermediate buffer and
the internationalized message contains a string format directive.

[1] https://www.gnu.org/software/gettext/manual/html_node/Preparing-Strings.html#No-string-concatenation

Signed-off-by: Miguel Ángel Arruga Vivas <rosen644835@gmail.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2021-04-13 17:16:04 +02:00
Daniel Axtens
e48fc8880d video/fb/fbfill: Use unsigned integers for width/height
Since commit 7ce3259f67 (video/fb/fbfill: Fix potential integer
overflow), clang builds of grub-emu have failed with messages like:

  /usr/bin/ld: libgrubmods.a(libgrubmods_a-fbfill.o): in function `grub_video_fbfill_direct24':
  fbfill.c:(.text+0x28e): undefined reference to `__muloti4'

This appears to be due to a weird quirk in how clang compiles

  grub_mul(dst->mode_info->bytes_per_pixel, width, &rowskip)

which is grub_mul(unsigned int, int, &grub_size_t).

It looks like clang somewhere promotes everything to 128-bit maths
before ultimately reducing down to 64 bit for grub_size_t. I think
this is because width is signed, and indeed converting width to an
unsigned int makes the problem go away.

This conversion also makes more sense generally:
  - the caller of all the fbfill_directN functions is
    grub_video_fb_fill_dispatch() and it takes width and height as
    unsigned ints already,
  - it doesn't make sense to fill a negative width or height.

Convert the width and height arguments and associated loop counters
to unsigned ints.

Fixes: 7ce3259f67 (video/fb/fbfill: Fix potential integer overflow)

Signed-off-by: Daniel Axtens <dja@axtens.net>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2021-04-12 16:56:45 +02:00
Glenn Washburn
406dde6f27 docs: Conform badmem and cutmem description indentations with other commands
Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2021-04-12 16:49:40 +02:00
Glenn Washburn
cb715be37d docs: Add note to cryptomount that UUIDs should be specified without dashes
Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2021-04-12 16:46:27 +02:00
Aru Sahni
7227376308 templates: Fix user-facing typo with an incorrect use of "it's"
Since the possessive form of "it" is being used, the apostrophe must be omitted.

Signed-off-by: Aru Sahni <aru@arusahni.net>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2021-04-12 16:40:34 +02:00
Colin Watson
edbe7076cb buffer: Sync up out-of-range error message
The messages associated with other similar GRUB_ERR_OUT_OF_RANGE errors
were lacking the trailing full stop. Syncing up the strings saves a small
amount of precious core image space on i386-pc.

  DOWN: obj/i386-pc/grub-core/kernel.img (31740 > 31708) - change: -32
  DOWN: i386-pc core image (biosdisk ext2 part_msdos) (27453 > 27452) - change: -1
  DOWN: i386-pc core image (biosdisk ext2 part_msdos diskfilter mdraid09) (32367 > 32359) - change: -8

Signed-off-by: Colin Watson <cjwatson@debian.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2021-04-12 16:31:18 +02:00
Glenn Washburn
c9c22dc803 usb/usbhub: Use GRUB_USB_MAX_CONF macro instead of literal in hub for maximum configs
Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2021-04-12 16:26:49 +02:00
Daniel Drake
25d64bb273 fs/minix: Avoid mistakenly probing ext2 filesystems
The ext2 (and ext3, ext4) filesystems write the number of free inodes to
location 0x410.

On a MINIX filesystem, that same location is used for the MINIX superblock
magic number.

If the number of free inodes on an ext2 filesystem is equal to any
of the four MINIX superblock magic values plus any multiple of 65536,
GRUB's MINIX filesystem code will probe it as a MINIX filesystem.

In the case of an OS using ext2 as the root filesystem, since there will
ordinarily be some amount of file creation and deletion on every bootup,
it effectively means that this situation has a 1:16384 chance of being hit
on every reboot.

This will cause GRUB's filesystem probing code to mistakenly identify an
ext2 filesystem as MINIX. This can be seen by e.g. "search --label"
incorrectly indicating that no such ext2 partition with matching label
exists, whereas in fact it does.

After spotting the rough cause of the issue I was facing here, I borrowed
much of the diagnosis/explanation from meierfra who found and investigated
the same issue in util-linux in 2010:

  https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/518582

This was fixed in util-linux by having the MINIX code check for the
ext2 magic. Do the same here.

Signed-off-by: Daniel Drake <drake@endlessm.com>
Reviewed-by: Derek Foreman <derek@endlessos.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2021-04-12 16:22:44 +02:00
Daniel Kiper
a53e530f8a Release 2.06~rc1
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
2021-03-12 16:09:51 +01:00