Commit graph

95 commits

Author SHA1 Message Date
Vladimir 'phcoder' Serbinenko
e55599dcbf * util/grub-install.in: Declare IEEE1275 as able to find out the disk
name.
2011-10-19 20:35:41 +02:00
Vladimir 'phcoder' Serbinenko
4155e6974a * util/grub-install.in: Move cryptodisk logic to appropriate place. 2011-08-23 11:18:00 +02:00
Colin Watson
303b6246a3 * util/grub-install.in: Don't source grub-mkconfig_lib until after
processing arguments (otherwise help2man fails when GRUB has not yet
been installed).
2011-07-26 11:59:47 +01:00
Vladimir 'phcoder' Serbinenko
9222759765 * util/grub-install.in: Don't use uhci outside of x86. 2011-07-25 08:06:20 +02:00
Vladimir 'phcoder' Serbinenko
ca5572a9ad * util/grub-install.in: Recognize ESP mounted at /boot/EFI. 2011-07-10 16:06:31 +02:00
Vladimir 'phcoder' Serbinenko
16a2bab03c * util/grub-install.in: Source grub-mkconfig_lib. 2011-07-10 15:32:43 +02:00
Vladimir Serbinenko
a251b71915 LUKS and GELI support.
* Makefile.util.def (libgrubkern.a): Add grub-core/lib/crypto.c,
	grub-core/disk/luks.c, grub-core/disk/geli.c,
	grub-core/disk/cryptodisk.c, grub-core/disk/AFSplitter.c,
	grub-core/lib/pbkdf2.c, grub-core/commands/extcmd.c,
	grub-core/lib/arg.c.
	(libgrubmods.a): Remove gcrypts cflags and cppflags.
	Remove grub-core/commands/extcmd.c, grub-core/lib/arg.c,
	grub-core/lib/crypto.c, grub-core/lib/libgcrypt-grub/cipher/sha512.c,
	grub-core/lib/libgcrypt-grub/cipher/crc.c and grub-core/lib/pbkdf2.c.
	(grub-bin2h): Add libgcry.a.
	(grub-mkimage): Likewise.
	(grub-mkrelpath): Likewise.
	(grub-script-check): Likewise.
	(grub-editenv): Likewise.
	(grub-mkpasswd-pbkdf2): Likewise.
	(grub-pe2elf): Likewise.
	(grub-fstest): Likewise.
	(grub-mkfont): Likewise.
	(grub-mkdevicemap): Likewise.
	(grub-probe): Likewise.
	(grub-ofpath): Likewise.
	(grub-mklayout): Likewise.
	(example_unit_test): Likewise.
	(grub-menulst2cfg): Likewise.
	* autogen.sh (UTIL_DEFS): Add Makefile.utilgcry.def.
	* grub-core/Makefile.core.def (cryptodisk): New module.
	(luks): Likewise.
	(geli): Likewise.
	* grub-core/disk/AFSplitter.c: New file.
	* grub-core/disk/cryptodisk.c: Likewise.
	* grub-core/disk/geli.c: Likewise.
	* grub-core/disk/luks.c: Likewise.
	* grub-core/kern/emu/getroot.c (get_dm_uuid): New function based on
	grub_util_is_lvm.
	(grub_util_get_dm_abstraction): New function.
	(grub_util_follow_gpart_up): Likewise.
	(grub_util_get_geom_abstraction): Likewise.
	(grub_util_get_dev_abstraction): Use new functions.
	(grub_util_pull_device): Pull GELI and LUKS.
	(grub_util_get_grub_dev): Handle LUKS and GELI.
	* grub-core/kern/emu/hostdisk.c (grub_util_get_fd_sectors): New function.
	(grub_util_biosdisk_open): Use grub_util_get_fd_sectors.
	(follow_geom_up): Removed.
	(grub_util_fd_seek): New function.
	(open_device): Use grub_util_fd_seek.
	(nread): Rename to ..
	(grub_util_fd_read): ... this. All users updated.
	* grub-core/lib/crypto.c (grub_crypto_ecb_decrypt): A better prototype.
	(grub_crypto_cbc_decrypt): Likewise.
	(grub_crypto_hmac_write): Likewise.
	(grub_crypto_hmac_buffer): Likewise.
	(grub_password_get): Extend to util.
	* include/grub/crypto.h (gcry_cipher_spec) [GRUB_UTIL]:
	New member modname.
	(gcry_md_spec) [GRUB_UTIL]: Likewise.
	* include/grub/cryptodisk.h: New file.
	* include/grub/disk.h (grub_disk_dev_id): Rename LUKS to CRYPTODISK.
	* include/grub/emu/getroot.h (grub_dev_abstraction_types): Add
	LUKS and GELI.
	(grub_util_follow_gpart_up): New proto.
	* include/grub/emu/hostdisk.h (grub_util_fd_seek): Likewise.
	(grub_util_fd_read): Likewise.
	(grub_cryptodisk_cheat_mount): Likewise.
	(grub_util_cryptodisk_print_uuid): Likewise.
	(grub_util_get_fd_sectors): Likewise.
	* util/grub-fstest.c (mount_crypt): New var.
	(fstest): Mount crypto if requested.
	(options): New option -C.
	(argp_parser): Parse -C.
	(main): Init and fini gcry.
	* util/grub-install.in: Support cryptodisk install.
	* util/grub-mkconfig.in: Export GRUB_ENABLE_CRYPTODISK.
	* util/grub-mkconfig_lib.in (is_path_readable_by_grub): Support
	cryptodisk.
	(prepare_grub_to_access_device): Likewise.
	* util/grub-mkpasswd-pbkdf2.c (main): Use grub_password_get.
	* util/grub-probe.c (probe_partmap): Support cryptodisk UUID probe.
	(probe_cryptodisk_uuid): New function.
	(probe_abstraction): Likewise.
	(probe): Use new functions.
	* util/import_gcry.py: Create Makefile.utilgcry.def.
	Add modname member.

	Also-By: Michael Gorven <michael@gorven.za.net>

	Also-By: Clemens Fruhwirth <clemens@endorphin.org>
2011-07-07 23:52:58 +02:00
Vladimir 'phcoder' Serbinenko
548937c6d6 merge mainline into ahci 2011-05-18 12:36:26 +02:00
Vladimir 'phcoder' Serbinenko
4959e11109 Use mipsel- rather than mips- in directories involving mipsel ports to
allow both endiannesses coexist.

	* configure.ac: proparate target_cpu=mipsel rather than resetting to
	mips. All conditions adjusted.
	* tests/util/grub-shell-tester.in: Remove gratuitious target_cpu
	variable.
	* util/grub-install.in: Adjust conditions to take renaming into account.
	* util/grub-mkimage.c (image_targets): Likewise. New target
	mips-qemu_mips-elf for bigendian mips.
2011-05-17 22:48:20 +02:00
Vladimir 'phcoder' Serbinenko
276ef9be21 Fix install message 2011-05-16 21:50:24 +02:00
Vladimir 'phcoder' Serbinenko
0670a9751b merge mainline into ahci 2011-05-16 17:17:04 +02:00
Vladimir 'phcoder' Serbinenko
bee1aeb9a1 merge mainline into sgi 2011-05-15 02:23:36 +02:00
Vladimir 'phcoder' Serbinenko
5d063cdc10 Fuloong support.
* configure.ac: Rename yeeloong platform to loongson. All users updated.
	* grub-core/Makefile.core.def (fwstart_fuloong): New image.
	* grub-core/boot/mips/loongson/fuloong.S: New file.
	* grub-core/boot/mips/loongson/fwstart.S: Wait for CS5536 to come up.
	Explicitly init CS5536.
	[FULOONG]: Don't use serial until CS5536 is available.
	Set GPIO based on dumps.
	(serial_hw_init) [FULOONG]: Handle CS5536 parts.
	[FULOONG]: Handle GPIO and memory controller differences.
	Parse machine type in $a2.
	* grub-core/boot/mips/startup_raw.S: Determine and save the
	architecture.
	* grub-core/bus/cs5536.c (gpiodump): Move to fwstart.S.
	(grub_cs5536_init_geode): Remove gpio part. Conditionalise DIVIL
	init on architecture type.
	* grub-core/kern/mips/loongson/init.c (grub_machine_init): Init
	SIS315E. Don't init at_keyboard on fuloong.
	(grub_halt): Support Fuloong.
	* grub-core/kern/mips/startup.S [LOONGSON]: Save $s7.
	* grub-core/loader/mips/linux.c (LOONGSON_MACHTYPE): Removed.
	(loongson_machtypes): New array.
	(grub_cmd_linux) [GRUB_MACHINE_MIPS_LOONGSON]: Pass the right machine
	type.
	* grub-core/term/ns8250.c (serial_get_divisor): New parameter port and
	config. All users updated. Handle CS5536 serial.
	* grub-core/term/serial.c (grub_serial_register): Conditionalise
	default port on machine type. Register serial as inactive.
	* grub-core/video/sis315pro.c: New file.
	* include/grub/cs5536.h (GRUB_CS5536_MSR_MAILBOX_CONFIG_ENABLED): New
	definition.
	(GRUB_CS5536_MSR_MAILBOX_CONFIG): Likewise.
	(GRUB_CS5536_MSR_DIVIL_LEG_IO_UART1_COM1): Likewise.
	(GRUB_CS5536_MSR_DIVIL_LEG_IO_UART2_COM3): Likewise.
	(GRUB_CS5536_MSR_DIVIL_UART1_CONF): Likewise.
	(GRUB_CS5536_MSR_DIVIL_UART2_CONF): Likewise.
	* include/grub/mips/loongson.h (GRUB_CPU_LOONGSON_SHUTDOWN_GPIO): Rename
	to ...
	(GRUB_CPU_YEELOONG_SHUTDOWN_GPIO): ... this.
	* include/grub/mips/loongson/kernel.h (GRUB_ARCH_MACHINE_YEELOONG): New
	definition.
	(GRUB_ARCH_MACHINE_FULOONG): Likewise.
	(grub_arch_machine): New extern var.
	* include/grub/mips/loongson/serial.h
	(GRUB_MACHINE_SERIAL_DIVISOR_115200): Renamed to ...
	(GRUB_MACHINE_SERIAL_PORT0_DIVISOR_115200): ... this.
	(GRUB_MACHINE_SERIAL_PORT): Renamed to ...
	(GRUB_MACHINE_SERIAL_PORT0): ... this.
	(GRUB_MACHINE_SERIAL_PORT2_DIVISOR_115200): New definition.
	(GRUB_MACHINE_SERIAL_PORT1): Likewise.
	(GRUB_MACHINE_SERIAL_PORT2): Likewise.
	(GRUB_MACHINE_SERIAL_PORTS): Include ports 1 and 2.
	* include/grub/term.h (grub_term_register_input_inactive): New inline
	function.
	(grub_term_register_output_inactive): Likewise.
	* include/grub/video.h (grub_video_driver_id): New value
	GRUB_VIDEO_DRIVER_SIS315PRO.
	* util/grub-mkimage.c (image_target_desc): Rename name to dirname.
	New field "names". All users updated.
	New field value IMAGE_FULOONG_FLASH.
	(generate_image): USe separate fwstart hashes for yeeloong and fuloong.
2011-05-15 01:43:44 +02:00
Vladimir 'phcoder' Serbinenko
dd10ec9e60 sgimips grub-install partial support (untested) 2011-05-13 18:02:36 +02:00
Vladimir 'phcoder' Serbinenko
20a409405b Integrate geli into autoconfiguration system 2011-04-25 14:52:07 +02:00
Vladimir 'phcoder' Serbinenko
8306591ff3 support LUKS in shell libraries 2011-04-23 00:13:56 +02:00
Vladimir 'phcoder' Serbinenko
09ceb9a592 * util/grub-install.in: Add a recommendation to use --recheck before
reporting bugs.
2011-04-03 15:37:24 +02:00
Vladimir 'phcoder' Serbinenko
fc8584825c Old macs search for boot.efi rather than for bootia32.efi.
* util/grub-install.in: Copy bootia32.efi to boot.efi.
	* util/grub-mkrescue.in: Likewise.
	Suggested by: Peter Jones.
2011-03-30 00:05:25 +02:00
Vladimir 'phcoder' Serbinenko
2da48d28d9 * util/grub-install.in: Correct the x86-64 name as x86_64. 2011-03-23 11:52:04 +01:00
Vladimir 'phcoder' Serbinenko
54da1febce Rename mipsel-yeeloong to mipsel-loongson 2011-02-19 13:18:05 +01:00
Colin Watson
22b28eb3fe * util/grub-install.in: Remove unnecessary brackets from tr
arguments.
* util/grub.d/10_hurd.in: Likewise.
* util/grub.d/10_kfreebsd.in: Likewise.
* util/grub.d/10_linux.in: Likewise.
* util/grub.d/20_linux_xen.in: Likewise.
Reported by: Jamie Heilman.  Fixes Debian bug #612564.
2011-02-09 11:23:11 +00:00
Vladimir 'phcoder' Serbinenko
37f4f60828 * util/grub-install.in: Ignore install device on platforms
where it doesn't make sense. Always use UUIDs except on pc, efi and
	sparc64.
	Reported by: Daniel Kahn Gillmor.
2011-01-22 15:10:29 +01:00
Vladimir 'phcoder' Serbinenko
4c3e4f37be * util/grub-install.in: Determine ofpathname, nvsetenv and efibootmgr
only when needed.
2011-01-05 01:28:28 +01:00
Vladimir 'phcoder' Serbinenko
092fd3a072 merge mainline into ahci 2011-01-03 16:03:13 +01:00
Vladimir 'phcoder' Serbinenko
469ee10a7f * util/grub-install.in: Correctly use bootloader_id and not
GRUB_DISTRIBUTOR on efibootmgr line.
2011-01-03 14:33:43 +01:00
Vladimir 'phcoder' Serbinenko
d1e517eb20 extend --disk-module to AHCI and USB 2010-12-25 12:11:54 +01:00
Colin Watson
03df09c7c8 * util/grub-install.in: Fix parsing of --grub-mkrelpath= option. 2010-11-22 13:57:16 +00:00
Colin Watson
cf8ffc3825 * util/grub-install.in: Remove excessive quoting that broke
installations to RAID devices.
2010-11-22 12:20:57 +00:00
Vladimir 'phcoder' Serbinenko
65e93f6b84 * util/grub-install.in: Ignore empty partition table detection
instead of trying to include part_ module.
2010-11-14 16:15:41 +01:00
Vladimir 'phcoder' Serbinenko
5f0c02b3d8 * util/grub-install.in: Handle filenames containing spaces.
Reported by: Jordan Uggla.
	Tested by: Jordan Uggla.
2010-11-13 16:03:29 +01:00
Vladimir 'phcoder' Serbinenko
6972dea937 * util/grub-install.in: Replace useless recomendation to pass
--modules with a recomendation to report a bug.
2010-11-06 21:37:13 +01:00
Vladimir 'phcoder' Serbinenko
fdf2ec9c8c * util/grub-setup.c (setup): New parameter allow_floppy.
(arguments): New member allow_floppy.
	(argp_parser): Handle --allow-floppy.
	(main): Pass allow_floppy.
	* util/grub-install.in: New option --allow-floppy passed though to
	grub-setup.
2010-10-17 00:35:14 +02:00
Vladimir 'phcoder' Serbinenko
861dfd4cb2 * util/grub-install.in: Handle partitionless disks. 2010-10-17 00:28:19 +02:00
Colin Watson
5c5277839a * util/grub-install.in: Fix the bootloader ID option to be
consistently --bootloader-id, not --bootloader_id.
Reported by: KESHAV P.R.
2010-09-21 12:10:36 +01:00
Yves Blusseau
a4c1d277c1 Keep boot and grub directory names in sync with utils scripts
* configure.ac: Define GRUB_BOOT_DIR_NAME and GRUB_DIR_NAME macros.
    * config.h.in: Add previous macros.
    * include/grub/emu/misc.h (DEFAULT_DIRECTORY): Use previous macros.
    * util/grub-install.in: Use $bootdir and $grubdir variables.
2010-09-21 11:42:30 +02:00
Vladimir 'phcoder' Serbinenko
74342e312f Support some annoying BSD and Minix subpartitions.
* Makefile.util.def (libgrub.a): Add grub-core/partmap/bsdlabel.c.
	* grub-core/disk/efi/efidisk.c (grub_efidisk_get_device_name):
	Properly handle concatenation.
	* grub-core/kern/device.c (grub_device_iterate): Likewise.
	* grub-core/normal/completion.c (iterate_partition): Likewise.
	* grub-core/kern/disk.c (grub_disk_open): Make disk->name not
	contain partition. All users updated.
	* grub-core/partmap/bsdlabel.c (grub_netbsdlabel_partition_map): New
	struct.
	(grub_openbsdlabel_partition_map): Likewise.
	(bsdlabel_partition_map_iterate): Rename to ..
	(iterate_real): ... this. New arguments sector, freebsd and pmap.
	(bsdlabel_partition_map_iterate): New function.
	(netopenbsdlabel_partition_map_iterate): Likewise.
	(netbsdlabel_partition_map_iterate): Likewise.
	(openbsdlabel_partition_map_iterate): Likewise.
	(GRUB_MOD_INIT): Register new partmaps.
	(GRUB_MOD_FINI): Unregister new partmaps.
	* grub-core/partmap/msdos.c (pc_partition_map_iterate): Rename to ...
	(grub_partition_msdos_iterate): ... this. All users updated.
	Don't support embedding other than in a minix partition.
	* include/grub/msdos_partition.h (grub_partition_msdos_iterate): New
	proto.
	* include/grub/partition.h (grub_partition): New field msdostype.
	* util/grub-install.in: Handle openbsd and netbsd types being in
	part_bsd module.
2010-09-20 21:45:06 +02:00
Colin Watson
c514c29712 Explicitly pass -d ${pkglibdir} to grub-mkimage, to make it easier to
run grub-install from the build directory.
2010-09-16 14:50:41 +01:00
Vladimir 'phcoder' Serbinenko
76de44d8ac Merge mainline into install 2010-09-15 14:46:53 +02:00
Vladimir 'phcoder' Serbinenko
14437e8008 Allow install_device to be missing on non-pc and non-sparc 2010-09-15 14:45:08 +02:00
Vladimir 'phcoder' Serbinenko
3352800b99 Remove readability checks (too many false negatives).
* util/grub-install.in: Remove readability checks.
	* util/grub-mkconfig.in: Likewise.
	* util/grub.d/10_hurd.in: Likewise.
	* util/grub.d/10_kfreebsd.in: Likewise.
	* util/grub.d/10_linux.in: Likewise.
	* util/grub-mkconfig_lib.in (is_path_readable_by_grub): Revert to old
	way.
2010-09-13 22:18:03 +02:00
Vladimir 'phcoder' Serbinenko
76e61597b4 Merge mainline into install 2010-09-11 17:28:46 +02:00
Vladimir Serbinenko
25761e13ee * util/grub-install.in (grub_partition): New variable.
Set prefix_drive on EFI and PC to (,$grub_partition) as last resort.
	* util/i386/pc/grub-setup.c (setup): Don't touch prefix.
	Fixes a bug reported by Yves Blusseau.
2010-09-11 17:21:48 +02:00
Vladimir 'phcoder' Serbinenko
038272a5c5 Merge mainline into install 2010-09-11 16:38:37 +02:00
Vladimir 'phcoder' Serbinenko
638f5f7ea1 Implement --bootloader-id 2010-09-11 16:37:00 +02:00
Colin Watson
5ed7d816b4 * util/grub-install.in: Don't try to verify core.img until after
running grub-mkimage to create it.
2010-09-10 23:15:56 +01:00
Colin Watson
c452fa66dd * util/grub-install.in: ${imgext} won't be defined here until the
install branch is merged.  For the meantime, only verify core.img on
i386-pc and sparc64-ieee1275 platforms.
2010-09-10 13:47:16 +01:00
Robert Millan
f637773235 2010-09-08 Robert Millan <rmh@gnu.org>
* util/grub-mkconfig_lib.in (is_path_readable_by_grub): Improve
	with (optional) parameters to specify device and relative path.
	* util/grub-install.in: Use is_path_readable_by_grub() to
	verify readability of a few critical files.
	* util/grub-mkconfig.in: Use is_path_readable_by_grub() to
	verify readability of grub.cfg.new.
2010-09-08 23:41:27 +02:00
Robert Millan
6b8e78aee3 2010-09-08 Robert Millan <rmh@gnu.org>
* util/grub-mkconfig_lib.in (is_path_readable_by_grub): Improve
	with (optional) parameters to specify device and relative path.
	* util/grub-install.in: Use is_path_readable_by_grub() to
	verify readability of a few critical files.
	* util/grub-mkconfig.in: Use is_path_readable_by_grub() to
	verify readability of grub.cfg.new.
2010-09-08 23:35:53 +02:00
Vladimir 'phcoder' Serbinenko
dedb5f9be2 merge mainline into nested 2010-09-08 20:40:27 +02:00
Yves Blusseau
c0e53ea537 Add new --boot-directory option to replace --root-directory
* util/grub-install.in: Add new --boot-directory option
	* util/grub-reboot.in: Likewise.
	* util/grub-set-default.in: Likewise.
2010-09-08 17:25:29 +02:00