Andrei Borzenkov
3bca85b418
devmapper: check for valid device abstraction in get_grub_dev
...
This was lost when code was refactored. Patch restores previous behavior.
It is still not clear whether this is the right one. Due to the way we
detect DM abstraction, partitions on DM are skipped, we fall through to
generic detection which ends up in assuming parent device is BIOS disk.
It is useful to install GRUB on VM disk from the host. But it also means
that GRUB will mistakenly allow install on real system as well.
For now let's fix regression; future behavior needs to be discussed.
Closes: 45163
2015-12-26 21:45:22 +03:00
Michael Chang
7a210304eb
Fix missing byte order conversion in get_btrfs_fs_prefix function
...
Since btrfs on-disk format uses little-endian, the searched item types
(ROOT_REF, INODE_REF) need converting the byte order in order to
function properly on big-endian systems.
2015-06-26 09:55:56 +03:00
Andrei Borzenkov
5082ea6184
remove extra newlines in grub_util_* strings
...
grub_util_{info,warn,error} already add trailing newlines, so remove
them from format strings. Also trailing full stops are already added.
2015-05-13 09:47:17 +03:00
Steve McIntyre
1a33de8b56
Recognize EFI platform even in case of mismatch between Linux and EFI.
...
Some x86 systems might be capable of running a 64-bit Linux kernel but
only use a 32-bit EFI (e.g. Intel Bay Trail systems). It's useful for
grub-install to be able to recognise such systems, to set the default
x86 platform correctly.
To allow grub-install to know the size of the firmware rather than
just the size of the kernel, there is now an extra EFI sysfs file to
describe the underlying firmware. Read that if possible, otherwise
fall back to the kernel type as before.
Signed-off-by: Steve McIntyre <steve@einval.com>
2015-03-27 14:51:51 +01:00
Andrei Borzenkov
637fc62699
linux/ofpath: fix descriptor leak
...
Found by: Coverity scan
2015-01-27 20:29:00 +03:00
Andrei Borzenkov
7ba137f628
linux/hostdisk: use strncpy instead of strlcpy
...
strlcpy is not available on Linux as part of standard libraries.
It probably is not worth extra configure checks espicially as we
need to handle missing function anyway.
2015-01-27 20:00:23 +03:00
Vladimir Serbinenko
8f95eae423
linux/ofpath: Fix error handling.
...
Found by: Coverity Scan.
2015-01-27 16:49:49 +01:00
Vladimir Serbinenko
c2fc41990a
linux/hostdisk: Limit strcpy size to buffer size.
...
Found by: Coverity scan.
2015-01-27 16:48:53 +01:00
Andrei Borzenkov
e2a21238da
linux/ofpath: fix various memory leaks.
...
Found by: Coverity scan.
2015-01-26 23:04:00 +03:00
Andrei Borzenkov
6704abade6
linux/getroot: fix descriptor leak.
...
Found by: Coverity scan.
2015-01-26 23:02:55 +03:00
Vladimir Serbinenko
cba5a85a67
linux/getroot: Fix error handling.
...
Found by: Coverity scan.
2015-01-26 09:51:48 +01:00
Vladimir Serbinenko
5adc6d76d3
linux/blocklist: Fix memory leak.
...
Found by: Coverity scan.
2015-01-26 09:50:58 +01:00
Vladimir Serbinenko
111ab3b9cc
osdep/linux/blocklist.c (grub_install_get_blocklist): Check blocksize validity.
2015-01-21 17:42:12 +01:00
Vladimir Serbinenko
9706066791
* grub-core/osdep/linux/getroot.c (grub_util_part_to_disk): Support NVMe device names.
2014-04-03 21:31:12 +02:00
Mike Gilbert
35f2d96c0d
grub-install: support for partitioned partx loop devices.
...
* grub-core/osdep/linux/getroot.c (grub_util_part_to_disk): Detect
/dev/loopX as being the parent of /dev/loopXpY.
2014-01-26 02:56:04 +01:00
Vladimir Serbinenko
e88f0420b9
Make grub_util_devmapper_part_to_disk and grub_util_find_partition_start
...
follow the same algorithm to avoid method mismatch. Don't assume
DMRAID- UUID to mean full disk but instead check that mapping is linear.
2013-12-24 14:16:57 +01:00
Vladimir Serbinenko
ae558c2ccf
Enable -Wformat=2 if it's supported.
2013-12-21 15:28:28 +01:00
Vladimir Serbinenko
579ee114b1
Add missing static qualifiers.
2013-12-21 13:50:13 +01:00
Andrey Borzenkov
840a2c0592
add verbose information to linux platform check
...
As suggested by Vladimir Serbienko, add additional verbose output to inform
why we selected this specific platform.
2013-12-16 23:17:40 +04:00
Andrey Borzenkov
d770e63557
use grub_util_exec_redirect_all to silence "moprobe efivars"
...
modprobe -q still prints error on non-EFI. Redirect stderr instead.
Reported by Javier Vasquez.
2013-12-16 22:41:16 +04:00
Colin Watson
59b38922a1
Pacify compiler warning
...
* grub-core/osdep/linux/hostdisk.c
(grub_util_find_partition_start_os): Initialise start to avoid
spurious compiler warning.
2013-12-05 15:48:27 +00:00
Colin Watson
0480665b9d
On Linux, read partition start offsets from sysfs if possible
...
This lets us cope with block device drivers that don't implement
HDIO_GETGEO. Fixes Ubuntu bug #1237519 .
* grub-core/osdep/linux/hostdisk.c (sysfs_partition_path): New
function.
(sysfs_partition_start): Likewise.
(grub_util_find_partition_start_os): Try sysfs_partition_start
before HDIO_GETGEO.
2013-12-05 13:51:52 +00:00
Vladimir Serbinenko
d54f647a4a
* grub-core/osdep/linux/ofpath.c: Check return value of read.
2013-11-29 05:46:19 +01:00
Vladimir Serbinenko
cd46aa6cef
Rewrite grub-install, grub-mkrescue, grub-mkstandalone and grub-mknetdir
...
the function of these files exceeds what can be sanely handled in shell
in posix-comaptible way. Also writing it in C extends the functionality
to non-UNIX-like OS and minimal environments.
2013-11-16 20:21:16 +01:00
Vladimir Serbinenko
090d7c81cf
* grub-core/osdep/linux/getroot.c: Fix cast-align problems.
2013-11-03 00:43:49 +01:00
neil
a86865891a
* grub-core/osdep/linux/blocklist.c: Include linux/types.h for some
...
broken linux headers.
2013-11-02 22:19:34 +01:00
Vladimir Serbinenko
cb72aa1809
Rewrite blocklist functions in order to get progress when
...
reading large extents and decrease amount of blocklist hook calls.
2013-11-01 23:28:03 +01:00
Vladimir Serbinenko
effe203677
* grub-core/osdep/linux/getroot.c: Add new btrfs defines.
2013-10-28 01:45:06 +01:00
Vladimir Serbinenko
82591fa6e7
Make / in btrfs refer to real root, not the default volume.
...
Modify mkrelpath to work even if device is mounted with subvolid option.
2013-10-28 01:37:19 +01:00
Vladimir 'phcoder' Serbinenko
cd78a56fb2
Move stat () and device mode checking into OS-dependent files as
...
long as performance doesn't suffer.
2013-10-19 16:29:20 +02:00
Vladimir 'phcoder' Serbinenko
40346de6d3
* grub-core/osdep/unix/getroot.c: Move exec functions to ...
...
* osdep/unix/exec.c: ... here. Add few additional exec_* variants.
2013-10-19 02:56:40 +02:00
Vladimir 'phcoder' Serbinenko
5a869940de
Split out blocklist retrieving from setup.c to
...
grub-core/osdep/blocklist.c and add windows implementation since
generic version doesn't work on NTFS on Windows due to aggressive
unflushable cache.
2013-10-15 17:02:26 +02:00
Vladimir 'phcoder' Serbinenko
70671037c8
Split emunet into platform-dependent and GRUB-binding parts. Keep
...
platform-dependent part in kernel for easy access to OS functions.
2013-10-15 11:55:20 +02:00
Vladimir 'phcoder' Serbinenko
b73249d260
Make grub_util_fd_seek match behaviour of other grub_util_fd_* and
...
fseeko.
2013-10-14 12:47:09 +02:00
Vladimir 'phcoder' Serbinenko
bb338aaf24
Add a wrapper for fopen. On unix-like systems just pass-through. On
...
windows use unicode version.
2013-10-13 20:36:28 +02:00
Vladimir 'phcoder' Serbinenko
37149a2f20
* include/grub/emu/hostdisk.h (grub_hostdisk_linux_find_partition):
...
Removed.
* grub-core/osdep/linux/hostdisk.c (grub_hostdisk_linux_find_partition):
Made static.
2013-10-09 07:16:20 +02:00
Vladimir 'phcoder' Serbinenko
acbbe5cbad
* include/grub/util/lvm.h: Removed.
2013-10-08 21:01:09 +02:00
Vladimir 'phcoder' Serbinenko
aabe433afe
* grub-core/net/drivers/emu/emunet.c: Move to ..
...
* grub-core/osdep/linux/emunet.c: ..here.
2013-10-08 18:42:46 +02:00
Vladimir 'phcoder' Serbinenko
9a2c903f28
* util/ieee1275/ofpath.c: Move to ...
...
* grub-core/osdep/linux/ofpath.c: ..here, split stub into ...
* grub-core/osdep/basic/ofpath.c: ..here.
2013-10-08 18:25:49 +02:00
Vladimir 'phcoder' Serbinenko
672fa55e81
Move OS-dependent files to grub-core/osdep and document it.
2013-10-08 17:30:22 +02:00