Merge lp:~madengineer10/ubuntu/trusty/grub/linux-pref-substr into lp:ubuntu/trusty/grub

Proposed by Doug Brunner
Status: Needs review
Proposed branch: lp:~madengineer10/ubuntu/trusty/grub/linux-pref-substr
Merge into: lp:ubuntu/trusty/grub
Diff against target: 1248766 lines (+1234695/-0) (has conflicts)
2676 files modified
.pc/.quilt_patches (+1/-0)
.pc/.quilt_series (+1/-0)
.pc/.version (+1/-0)
.pc/applied-patches (+51/-0)
.pc/blacklist_1440x900x32.patch/grub-core/video/i386/pc/vbe.c (+1249/-0)
.pc/btrfs-endian.patch/grub-core/fs/btrfs.c (+1768/-0)
.pc/core_in_fs.patch/util/setup.c (+778/-0)
.pc/default_grub_d.patch/grub-core/osdep/unix/config.c (+139/-0)
.pc/default_grub_d.patch/util/grub-mkconfig.in (+291/-0)
.pc/disable_floppies.patch/grub-core/kern/emu/hostdisk.c (+686/-0)
.pc/dpkg_version_comparison.patch/util/grub-mkconfig_lib.in (+370/-0)
.pc/elf_bi_endian.patch/grub-core/kern/elf.c (+158/-0)
.pc/elf_bi_endian.patch/grub-core/kern/elfXX.c (+156/-0)
.pc/elf_bi_endian.patch/include/grub/elf.h (+2523/-0)
.pc/freebsd_debugflags_eperm.patch/grub-core/osdep/freebsd/hostdisk.c (+122/-0)
.pc/gettext_quiet.patch/grub-core/gettext/gettext.c (+542/-0)
.pc/gfxpayload_dynamic.patch/configure.ac (+1868/-0)
.pc/gfxpayload_dynamic.patch/grub-core/Makefile.core.def (+2305/-0)
.pc/gfxpayload_dynamic.patch/util/grub.d/10_linux.in (+299/-0)
.pc/gfxpayload_keep_default.patch/util/grub.d/10_linux.in (+253/-0)
.pc/grub-shell-no-pad.patch/tests/util/grub-shell.in (+458/-0)
.pc/grub.cfg_400.patch/util/grub-mkconfig.in (+280/-0)
.pc/grub_legacy_0_based_partitions.patch/util/getroot.c (+481/-0)
.pc/ieee1275-pseries-emulation.patch/grub-core/kern/ieee1275/cmain.c (+215/-0)
.pc/ignore_grub_func_test_failures.patch/tests/grub_func_test.in (+21/-0)
.pc/install_arm64_naming.patch/util/grub-install.c (+2005/-0)
.pc/install_efi_fallback.patch/grub-core/osdep/linux/platform.c (+95/-0)
.pc/install_efi_ubuntu_flavours.patch/util/grub-install.c (+1988/-0)
.pc/install_locale_langpack.patch/util/grub-install-common.c (+939/-0)
.pc/install_powerpc_machtypes.patch/grub-core/osdep/basic/platform.c (+26/-0)
.pc/install_powerpc_machtypes.patch/grub-core/osdep/linux/platform.c (+110/-0)
.pc/install_powerpc_machtypes.patch/grub-core/osdep/windows/platform.c (+424/-0)
.pc/install_powerpc_machtypes.patch/include/grub/util/install.h (+256/-0)
.pc/install_powerpc_machtypes.patch/util/grub-install.c (+1990/-0)
.pc/install_signed.patch/util/grub-install.c (+1913/-0)
.pc/install_stage2_confusion.patch/util/grub-install.c (+1899/-0)
.pc/linuxefi.patch/grub-core/Makefile.core.def (+2298/-0)
.pc/linuxefi.patch/grub-core/kern/efi/mm.c (+522/-0)
.pc/linuxefi.patch/include/grub/efi/efi.h (+100/-0)
.pc/linuxefi.patch/include/grub/i386/linux.h (+315/-0)
.pc/linuxefi_amd64_only.patch/grub-core/Makefile.core.def (+2306/-0)
.pc/linuxefi_debug.patch/grub-core/loader/i386/efi/linux.c (+371/-0)
.pc/linuxefi_non_sb_fallback.patch/grub-core/loader/i386/efi/linux.c (+393/-0)
.pc/linuxefi_non_sb_fallback.patch/grub-core/loader/i386/linux.c (+1151/-0)
.pc/linuxefi_require_shim.patch/grub-core/loader/i386/efi/linux.c (+393/-0)
.pc/macbless_mansection.patch/Makefile.util.def (+1347/-0)
.pc/maybe_quiet.patch/config.h.in (+62/-0)
.pc/maybe_quiet.patch/configure.ac (+1841/-0)
.pc/maybe_quiet.patch/grub-core/boot/i386/pc/boot.S (+542/-0)
.pc/maybe_quiet.patch/grub-core/boot/i386/pc/diskboot.S (+378/-0)
.pc/maybe_quiet.patch/grub-core/kern/main.c (+312/-0)
.pc/maybe_quiet.patch/grub-core/kern/rescue_reader.c (+98/-0)
.pc/maybe_quiet.patch/grub-core/normal/main.c (+557/-0)
.pc/maybe_quiet.patch/grub-core/normal/menu.c (+931/-0)
.pc/maybe_quiet.patch/util/grub.d/10_linux.in (+288/-0)
.pc/mkconfig_loopback.patch/util/grub-mkconfig_lib.in (+371/-0)
.pc/mkconfig_loopback.patch/util/grub.d/10_linux.in (+249/-0)
.pc/mkconfig_loopback.patch/util/grub.d/20_linux_xen.in (+272/-0)
.pc/mkconfig_mid_upgrade.patch/util/grub-mkconfig.in (+284/-0)
.pc/mkconfig_nonexistent_loopback.patch/util/grub-mkconfig_lib.in (+395/-0)
.pc/mkconfig_nonexistent_loopback.patch/util/grub.d/30_os-prober.in (+327/-0)
.pc/mkconfig_recovery_title.patch/docs/grub.texi (+6504/-0)
.pc/mkconfig_recovery_title.patch/util/grub-mkconfig.in (+297/-0)
.pc/mkconfig_recovery_title.patch/util/grub.d/10_hurd.in (+180/-0)
.pc/mkconfig_recovery_title.patch/util/grub.d/10_kfreebsd.in (+241/-0)
.pc/mkconfig_recovery_title.patch/util/grub.d/10_linux.in (+356/-0)
.pc/mkconfig_recovery_title.patch/util/grub.d/10_netbsd.in (+186/-0)
.pc/mkconfig_recovery_title.patch/util/grub.d/20_linux_xen.in (+277/-0)
.pc/mkconfig_signed_kernel.patch/util/grub.d/10_linux.in (+273/-0)
.pc/mkconfig_ubuntu_distributor.patch/util/grub.d/10_linux.in (+266/-0)
.pc/mkconfig_ubuntu_recovery.patch/configure.ac (+1830/-0)
.pc/mkconfig_ubuntu_recovery.patch/util/grub.d/10_linux.in (+254/-0)
.pc/mkconfig_ubuntu_recovery.patch/util/grub.d/30_os-prober.in (+327/-0)
.pc/mkrescue_arm64_naming.patch/util/grub-mkrescue.c (+876/-0)
.pc/mkrescue_efi_modules.patch/util/grub-mkrescue.c (+870/-0)
.pc/no_insmod_on_sb.patch/grub-core/kern/dl.c (+810/-0)
.pc/no_insmod_on_sb.patch/grub-core/kern/efi/efi.c (+858/-0)
.pc/no_insmod_on_sb.patch/include/grub/efi/efi.h (+99/-0)
.pc/olpc_prefix_hack.patch/grub-core/kern/ieee1275/init.c (+319/-0)
.pc/probe-delimiter.patch/grub-core/disk/cryptodisk.c (+1129/-0)
.pc/probe-delimiter.patch/grub-core/disk/diskfilter.c (+1216/-0)
.pc/probe-delimiter.patch/include/grub/cryptodisk.h (+157/-0)
.pc/probe-delimiter.patch/include/grub/diskfilter.h (+208/-0)
.pc/probe-delimiter.patch/util/grub-install.c (+2005/-0)
.pc/probe-delimiter.patch/util/grub-probe.c (+909/-0)
.pc/probe_fusionio.patch/grub-core/osdep/linux/getroot.c (+1084/-0)
.pc/probe_fusionio.patch/util/deviceiter.c (+954/-0)
.pc/quick_boot.patch/configure.ac (+1857/-0)
.pc/quick_boot.patch/docs/grub.texi (+6495/-0)
.pc/quick_boot.patch/grub-core/normal/menu.c (+944/-0)
.pc/quick_boot.patch/util/grub-mkconfig.in (+296/-0)
.pc/quick_boot.patch/util/grub.d/00_header.in (+356/-0)
.pc/quick_boot.patch/util/grub.d/10_linux.in (+295/-0)
.pc/quick_boot.patch/util/grub.d/30_os-prober.in (+347/-0)
.pc/restore_mkdevicemap.patch/Makefile.util.def (+1324/-0)
.pc/skip_gettext_strings_test.patch/tests/gettext_strings_test.in (+20/-0)
.pc/sleep_shift.patch/grub-core/commands/sleep.c (+117/-0)
.pc/sleep_shift.patch/grub-core/normal/menu.c (+912/-0)
.pc/tolerate-lvm-snapshots.patch/util/grub.d/30_os-prober.in (+368/-0)
.pc/uefi_firmware_setup.patch/Makefile.util.def (+1341/-0)
.pc/vt_handoff.patch/configure.ac (+1879/-0)
.pc/vt_handoff.patch/util/grub.d/10_linux.in (+330/-0)
.pc/wubi_no_windows.patch/util/grub.d/30_os-prober.in (+328/-0)
ABOUT-NLS (+223/-0)
AUTHORS (+23/-0)
BUGS (+7/-0)
COPYING (+674/-0)
ChangeLog (+54605/-0)
INSTALL (+286/-0)
Makefile.am (+429/-0)
Makefile.in (+13594/-0)
Makefile.util.am (+1950/-0)
Makefile.util.def (+1347/-0)
Makefile.utilgcry.def (+31/-0)
NEWS (+525/-0)
README (+22/-0)
THANKS (+38/-0)
TODO (+13/-0)
acinclude.m4 (+499/-0)
aclocal.m4 (+1265/-0)
autogen.sh (+84/-0)
build-aux/compile (+347/-0)
build-aux/config.guess (+1558/-0)
build-aux/config.rpath (+690/-0)
build-aux/config.sub (+1791/-0)
build-aux/depcomp (+791/-0)
build-aux/install-sh (+527/-0)
build-aux/mdate-sh (+224/-0)
build-aux/missing (+215/-0)
build-aux/snippet/_Noreturn.h (+10/-0)
build-aux/snippet/arg-nonnull.h (+26/-0)
build-aux/snippet/c++defs.h (+271/-0)
build-aux/snippet/warn-on-use.h (+109/-0)
build-aux/test-driver (+127/-0)
build-aux/texinfo.tex (+10079/-0)
conf/Makefile.common (+143/-0)
conf/Makefile.extra-dist (+112/-0)
conf/i386-cygwin-img-ld.sc (+53/-0)
config-util.h.in (+1544/-0)
config.h.in (+64/-0)
configure (+30356/-0)
configure.ac (+1890/-0)
coreboot.cfg (+3/-0)
debian/.git-dpm (+8/-0)
debian/NEWS (+13/-0)
debian/apport/source_grub2.py (+96/-0)
debian/bug-presubj (+23/-0)
debian/bug-script (+61/-0)
debian/build-efi-images (+144/-0)
debian/changelog (+4070/-0)
debian/clean (+1/-0)
debian/compat (+1/-0)
debian/config.in (+76/-0)
debian/control (+695/-0)
debian/copyright (+374/-0)
debian/default/grub (+32/-0)
debian/default/grub.md5sum (+3/-0)
debian/dirs.in (+3/-0)
debian/grub-common.dirs (+1/-0)
debian/grub-common.examples (+1/-0)
debian/grub-common.init (+42/-0)
debian/grub-common.install.in (+51/-0)
debian/grub-common.install.kfreebsd.in (+2/-0)
debian/grub-common.install.linux.in (+2/-0)
debian/grub-common.install.sparc.in (+2/-0)
debian/grub-common.links (+1/-0)
debian/grub-common.maintscript.hurd.in (+3/-0)
debian/grub-common.maintscript.kfreebsd.in (+3/-0)
debian/grub-common.maintscript.linux.in (+3/-0)
debian/grub-common.pm-sleep (+11/-0)
debian/grub-coreboot-bin.install.amd64.in (+1/-0)
debian/grub-coreboot-bin.install.kopensolaris-i386.in (+1/-0)
debian/grub-coreboot-bin.install.linux-i386.in (+1/-0)
debian/grub-efi.postinst (+19/-0)
debian/grub-emu-dbg.install.in (+4/-0)
debian/grub-emu.install.in (+8/-0)
debian/grub-emu.install.kopensolaris-i386.in (+1/-0)
debian/grub-emu.install.linux-i386.in (+1/-0)
debian/grub-emu.postinst.in (+19/-0)
debian/grub-extras/915resolution/915resolution.c (+1040/-0)
debian/grub-extras/915resolution/COPYING (+674/-0)
debian/grub-extras/915resolution/Makefile.core.def (+7/-0)
debian/grub-extras/915resolution/README (+11/-0)
debian/grub-extras/disabled/gpxe/Makefile.common (+2/-0)
debian/grub-extras/disabled/gpxe/Makefile.core.def (+434/-0)
debian/grub-extras/disabled/gpxe/include_wrap/assert.h (+1/-0)
debian/grub-extras/disabled/gpxe/include_wrap/bits/errfile.h (+1/-0)
debian/grub-extras/disabled/gpxe/include_wrap/bits/uaccess.h (+1/-0)
debian/grub-extras/disabled/gpxe/include_wrap/byteswap.h (+1/-0)
debian/grub-extras/disabled/gpxe/include_wrap/config/ioapi.h (+1/-0)
debian/grub-extras/disabled/gpxe/include_wrap/console.h (+1/-0)
debian/grub-extras/disabled/gpxe/include_wrap/ctype.h (+1/-0)
debian/grub-extras/disabled/gpxe/include_wrap/errno.h (+508/-0)
debian/grub-extras/disabled/gpxe/include_wrap/gpxe/device.h (+1/-0)
debian/grub-extras/disabled/gpxe/include_wrap/gpxe/efi/efi_uaccess.h (+1/-0)
debian/grub-extras/disabled/gpxe/include_wrap/gpxe/features.h (+68/-0)
debian/grub-extras/disabled/gpxe/include_wrap/gpxe/io.h (+1/-0)
debian/grub-extras/disabled/gpxe/include_wrap/gpxe/list.h (+118/-0)
debian/grub-extras/disabled/gpxe/include_wrap/gpxe/nap.h (+44/-0)
debian/grub-extras/disabled/gpxe/include_wrap/gpxe/pci.h (+296/-0)
debian/grub-extras/disabled/gpxe/include_wrap/gpxe/timer.h (+66/-0)
debian/grub-extras/disabled/gpxe/include_wrap/gpxe/vsprintf.h (+1/-0)
debian/grub-extras/disabled/gpxe/include_wrap/gpxe/wrap.h (+261/-0)
debian/grub-extras/disabled/gpxe/include_wrap/libgen.h (+1/-0)
debian/grub-extras/disabled/gpxe/include_wrap/limits.h (+1/-0)
debian/grub-extras/disabled/gpxe/include_wrap/stddef.h (+1/-0)
debian/grub-extras/disabled/gpxe/include_wrap/stdint.h (+1/-0)
debian/grub-extras/disabled/gpxe/include_wrap/stdio.h (+1/-0)
debian/grub-extras/disabled/gpxe/include_wrap/stdlib.h (+1/-0)
debian/grub-extras/disabled/gpxe/include_wrap/string.h (+1/-0)
debian/grub-extras/disabled/gpxe/include_wrap/strings.h (+1/-0)
debian/grub-extras/disabled/gpxe/include_wrap/unistd.h (+1/-0)
debian/grub-extras/disabled/gpxe/src/core/base64.c (+68/-0)
debian/grub-extras/disabled/gpxe/src/core/basename.c (+64/-0)
debian/grub-extras/disabled/gpxe/src/core/bitmap.c (+101/-0)
debian/grub-extras/disabled/gpxe/src/core/cwuri.c (+46/-0)
debian/grub-extras/disabled/gpxe/src/core/interface.c (+63/-0)
debian/grub-extras/disabled/gpxe/src/core/iobuf.c (+96/-0)
debian/grub-extras/disabled/gpxe/src/core/job.c (+97/-0)
debian/grub-extras/disabled/gpxe/src/core/linebuf.c (+111/-0)
debian/grub-extras/disabled/gpxe/src/core/misc.c (+80/-0)
debian/grub-extras/disabled/gpxe/src/core/nvo.c (+263/-0)
debian/grub-extras/disabled/gpxe/src/core/open.c (+197/-0)
debian/grub-extras/disabled/gpxe/src/core/process.c (+106/-0)
debian/grub-extras/disabled/gpxe/src/core/random.c (+41/-0)
debian/grub-extras/disabled/gpxe/src/core/refcnt.c (+78/-0)
debian/grub-extras/disabled/gpxe/src/core/resolv.c (+415/-0)
debian/grub-extras/disabled/gpxe/src/core/settings.c (+1447/-0)
debian/grub-extras/disabled/gpxe/src/core/uri.c (+463/-0)
debian/grub-extras/disabled/gpxe/src/core/uuid.c (+51/-0)
debian/grub-extras/disabled/gpxe/src/core/xfer.c (+417/-0)
debian/grub-extras/disabled/gpxe/src/drivers/bitbash/bitbash.c (+57/-0)
debian/grub-extras/disabled/gpxe/src/drivers/bitbash/i2c_bit.c (+393/-0)
debian/grub-extras/disabled/gpxe/src/drivers/bitbash/spi_bit.c (+225/-0)
debian/grub-extras/disabled/gpxe/src/drivers/block/scsi.c (+366/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/3c509.c (+432/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/3c509.h (+394/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/3c515.c (+763/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/3c529.c (+62/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/3c595.c (+553/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/3c595.h (+437/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/3c5x9.c (+416/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/3c90x.c (+994/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/3c90x.h (+302/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/amd8111e.c (+693/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/amd8111e.h (+631/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/ath5k/ath5k.c (+1694/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/ath5k/ath5k.h (+1275/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/ath5k/ath5k_attach.c (+340/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/ath5k/ath5k_caps.c (+154/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/ath5k/ath5k_desc.c (+544/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/ath5k/ath5k_dma.c (+631/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/ath5k/ath5k_eeprom.c (+1749/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/ath5k/ath5k_gpio.c (+122/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/ath5k/ath5k_initvals.c (+1560/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/ath5k/ath5k_pcu.c (+534/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/ath5k/ath5k_phy.c (+2586/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/ath5k/ath5k_qcu.c (+394/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/ath5k/ath5k_reset.c (+1176/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/ath5k/base.h (+140/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/ath5k/desc.h (+332/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/ath5k/eeprom.h (+441/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/ath5k/reg.h (+2589/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/ath5k/rfbuffer.h (+1181/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/ath5k/rfgain.h (+516/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/atl1e.c (+1757/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/b44.c (+951/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/b44.h (+470/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/bnx2.c (+2697/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/bnx2.h (+4598/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/davicom.c (+727/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/depca.c (+805/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/dmfe.c (+1226/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/eepro.c (+637/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/eepro100.c (+853/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/epic100.c (+539/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/epic100.h (+190/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/etherfabric.c (+4236/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/etherfabric.h (+553/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/etherfabric_nic.h (+204/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/forcedeth.c (+1442/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/ipoib.c (+718/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/legacy.c (+157/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/mtd80x.c (+1022/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/natsemi.c (+609/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/natsemi.h (+232/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/ne2k_isa.c (+375/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/ns83820.c (+1013/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/ns8390.c (+1037/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/ns8390.h (+240/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/pcnet32.c (+1021/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/pnic.c (+281/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/pnic_api.h (+61/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/prism2.c (+857/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/prism2_pci.c (+58/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/prism2_plx.c (+122/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/r8169.c (+2285/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/r8169.h (+487/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/rtl8139.c (+606/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/sis900.c (+1304/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/sis900.h (+375/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/smc9000.c (+955/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/smc9000.h (+428/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/sundance.c (+897/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/tlan.c (+1723/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/tlan.h (+491/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/tulip.c (+2098/-0)
debian/grub-extras/disabled/gpxe/src/drivers/net/w89c840.c (+964/-0)
debian/grub-extras/disabled/gpxe/src/drivers/nvs/nvs.c (+149/-0)
debian/grub-extras/disabled/gpxe/src/drivers/nvs/spi.c (+140/-0)
debian/grub-extras/disabled/gpxe/src/drivers/nvs/threewire.c (+131/-0)
debian/grub-extras/disabled/gpxe/src/hci/strerror.c (+123/-0)
debian/grub-extras/disabled/gpxe/src/include/etherboot.h (+44/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/acpi.h (+43/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/aes.h (+10/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/ansiesc.h (+120/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/aoe.h (+150/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/api.h (+84/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/arp.h (+46/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/asn1.h (+34/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/ata.h (+209/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/base64.h (+26/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/bitbash.h (+52/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/bitmap.h (+85/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/bitops.h (+230/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/blockdev.h (+53/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/cbc.h (+100/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/chap.h (+53/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/command.h (+26/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/cpio.h (+53/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/crypto.h (+154/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/dhcp.h (+618/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/dhcpopts.h (+34/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/dhcppkt.h (+64/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/dns.h (+92/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/downloader.h (+19/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/editbox.h (+61/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/editstring.h (+33/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/eisa.h (+130/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/elf.h (+17/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/errfile.h (+196/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/errortab.h (+23/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/ethernet.h (+20/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/fakedhcp.h (+23/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/filter.h (+75/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/ftp.h (+15/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/gdbserial.h (+21/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/gdbstub.h (+77/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/gdbudp.h (+24/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/hidemem.h (+17/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/hmac.h (+32/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/http.h (+23/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/i2c.h (+171/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/ib_cm.h (+72/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/ib_cmrc.h (+20/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/ib_mad.h (+561/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/ib_mcast.h (+48/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/ib_mi.h (+135/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/ib_packet.h (+147/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/ib_pathrec.h (+76/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/ib_sma.h (+20/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/ib_smc.h (+20/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/ib_srp.h (+79/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/icmp.h (+25/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/icmp6.h (+59/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/ieee80211.h (+1182/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/if_arp.h (+102/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/if_ether.h (+35/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/image.h (+194/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/in.h (+105/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/infiniband.h (+652/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/init.h (+81/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/interface.h (+58/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/iobuf.h (+229/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/ip.h (+97/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/ip6.h (+80/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/ipoib.h (+60/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/isa.h (+97/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/isa_ids.h (+51/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/isapnp.h (+278/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/iscsi.h (+678/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/job.h (+169/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/keys.h (+81/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/linebuf.h (+30/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/linux_compat.h (+27/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/login_ui.h (+14/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/malloc.h (+59/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/mca.h (+108/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/md5.h (+24/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/memmap.h (+36/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/monojob.h (+17/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/net80211.h (+1016/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/netdevice.h (+525/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/null_nap.h (+23/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/nvo.h (+55/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/nvs.h (+68/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/open.h (+105/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/pci_io.h (+124/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/pcibackup.h (+33/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/posix_io.h (+87/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/process.h (+80/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/profile.h (+80/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/ramdisk.h (+24/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/rarp.h (+16/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/rc80211.h (+19/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/refcnt.h (+46/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/resolv.h (+170/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/retry.h (+81/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/rotate.h (+29/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/rsa.h (+12/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/sanboot.h (+18/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/scsi.h (+281/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/segment.h (+17/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/serial.h (+16/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/settings.h (+334/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/settings_ui.h (+16/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/shell.h (+14/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/shell_banner.h (+14/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/smbios.h (+161/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/socket.h (+101/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/spi.h (+258/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/spi_bit.h (+63/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/srp.h (+868/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/tables.h (+434/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/tcp.h (+318/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/tcpip.h (+128/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/tftp.h (+85/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/threewire.h (+105/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/tls.h (+187/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/uaccess.h (+344/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/udp.h (+48/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/umalloc.h (+68/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/uri.h (+144/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/uuid.h (+33/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/x509.h (+41/-0)
debian/grub-extras/disabled/gpxe/src/include/gpxe/xfer.h (+277/-0)
debian/grub-extras/disabled/gpxe/src/include/nic.h (+273/-0)
debian/grub-extras/disabled/gpxe/src/net/80211/net80211.c (+2645/-0)
debian/grub-extras/disabled/gpxe/src/net/80211/rc80211.c (+371/-0)
debian/grub-extras/disabled/gpxe/src/net/aoe.c (+471/-0)
debian/grub-extras/disabled/gpxe/src/net/arp.c (+289/-0)
debian/grub-extras/disabled/gpxe/src/net/dhcpopts.c (+436/-0)
debian/grub-extras/disabled/gpxe/src/net/dhcppkt.c (+283/-0)
debian/grub-extras/disabled/gpxe/src/net/ethernet.c (+181/-0)
debian/grub-extras/disabled/gpxe/src/net/fakedhcp.c (+217/-0)
debian/grub-extras/disabled/gpxe/src/net/icmp.c (+103/-0)
debian/grub-extras/disabled/gpxe/src/net/infiniband.c (+923/-0)
debian/grub-extras/disabled/gpxe/src/net/infiniband/ib_cm.c (+411/-0)
debian/grub-extras/disabled/gpxe/src/net/infiniband/ib_cmrc.c (+436/-0)
debian/grub-extras/disabled/gpxe/src/net/infiniband/ib_mcast.c (+218/-0)
debian/grub-extras/disabled/gpxe/src/net/infiniband/ib_mi.c (+406/-0)
debian/grub-extras/disabled/gpxe/src/net/infiniband/ib_packet.c (+244/-0)
debian/grub-extras/disabled/gpxe/src/net/infiniband/ib_pathrec.c (+296/-0)
debian/grub-extras/disabled/gpxe/src/net/infiniband/ib_sma.c (+362/-0)
debian/grub-extras/disabled/gpxe/src/net/infiniband/ib_smc.c (+179/-0)
debian/grub-extras/disabled/gpxe/src/net/infiniband/ib_srp.c (+406/-0)
debian/grub-extras/disabled/gpxe/src/net/iobpad.c (+68/-0)
debian/grub-extras/disabled/gpxe/src/net/ipv4.c (+635/-0)
debian/grub-extras/disabled/gpxe/src/net/netdev_settings.c (+102/-0)
debian/grub-extras/disabled/gpxe/src/net/netdevice.c (+633/-0)
debian/grub-extras/disabled/gpxe/src/net/nullnet.c (+60/-0)
debian/grub-extras/disabled/gpxe/src/net/rarp.c (+70/-0)
debian/grub-extras/disabled/gpxe/src/net/retry.c (+192/-0)
debian/grub-extras/disabled/gpxe/src/net/tcp.c (+1156/-0)
debian/grub-extras/disabled/gpxe/src/net/tcp/http.c (+603/-0)
debian/grub-extras/disabled/gpxe/src/net/tcp/https.c (+51/-0)
debian/grub-extras/disabled/gpxe/src/net/tcp/iscsi.c (+1934/-0)
debian/grub-extras/disabled/gpxe/src/net/tcpip.c (+135/-0)
debian/grub-extras/disabled/gpxe/src/net/tls.c (+1759/-0)
debian/grub-extras/disabled/gpxe/src/net/udp.c (+463/-0)
debian/grub-extras/disabled/gpxe/src/net/udp/dhcp.c (+1430/-0)
debian/grub-extras/disabled/gpxe/src/net/udp/dns.c (+602/-0)
debian/grub-extras/disabled/gpxe/src/net/udp/slam.c (+812/-0)
debian/grub-extras/disabled/gpxe/src/net/udp/tftp.c (+1205/-0)
debian/grub-extras/disabled/gpxe/wrap/nic.c (+138/-0)
debian/grub-extras/disabled/gpxe/wrap/pci.c (+56/-0)
debian/grub-extras/disabled/gpxe/wrap/wrap.c (+75/-0)
debian/grub-extras/disabled/zfs/COPYING (+674/-0)
debian/grub-extras/disabled/zfs/Makefile.common (+1/-0)
debian/grub-extras/disabled/zfs/Makefile.core.def (+16/-0)
debian/grub-extras/disabled/zfs/Makefile.util.def (+10/-0)
debian/grub-extras/disabled/zfs/README (+11/-0)
debian/grub-extras/disabled/zfs/include/grub/zfs/dmu.h (+120/-0)
debian/grub-extras/disabled/zfs/include/grub/zfs/dmu_objset.h (+44/-0)
debian/grub-extras/disabled/zfs/include/grub/zfs/dnode.h (+81/-0)
debian/grub-extras/disabled/zfs/include/grub/zfs/dsl_dataset.h (+53/-0)
debian/grub-extras/disabled/zfs/include/grub/zfs/dsl_dir.h (+49/-0)
debian/grub-extras/disabled/zfs/include/grub/zfs/sa_impl.h (+35/-0)
debian/grub-extras/disabled/zfs/include/grub/zfs/spa.h (+312/-0)
debian/grub-extras/disabled/zfs/include/grub/zfs/uberblock_impl.h (+61/-0)
debian/grub-extras/disabled/zfs/include/grub/zfs/vdev_impl.h (+70/-0)
debian/grub-extras/disabled/zfs/include/grub/zfs/zap_impl.h (+112/-0)
debian/grub-extras/disabled/zfs/include/grub/zfs/zap_leaf.h (+104/-0)
debian/grub-extras/disabled/zfs/include/grub/zfs/zfs.h (+125/-0)
debian/grub-extras/disabled/zfs/include/grub/zfs/zfs_acl.h (+60/-0)
debian/grub-extras/disabled/zfs/include/grub/zfs/zfs_znode.h (+71/-0)
debian/grub-extras/disabled/zfs/include/grub/zfs/zil.h (+57/-0)
debian/grub-extras/disabled/zfs/include/grub/zfs/zio.h (+85/-0)
debian/grub-extras/disabled/zfs/include/grub/zfs/zio_checksum.h (+50/-0)
debian/grub-extras/disabled/zfs/zfs.c (+2546/-0)
debian/grub-extras/disabled/zfs/zfs_fletcher.c (+86/-0)
debian/grub-extras/disabled/zfs/zfs_lzjb.c (+95/-0)
debian/grub-extras/disabled/zfs/zfs_sha256.c (+145/-0)
debian/grub-extras/disabled/zfs/zfsinfo.c (+414/-0)
debian/grub-extras/lua/COPYING (+674/-0)
debian/grub-extras/lua/Makefile.core.def (+39/-0)
debian/grub-extras/lua/README (+11/-0)
debian/grub-extras/lua/grub_lib.c (+510/-0)
debian/grub-extras/lua/grub_lib.h (+24/-0)
debian/grub-extras/lua/grub_lua.h (+50/-0)
debian/grub-extras/lua/grub_main.c (+230/-0)
debian/grub-extras/lua/lapi.c (+1088/-0)
debian/grub-extras/lua/lapi.h (+16/-0)
debian/grub-extras/lua/lauxlib.c (+687/-0)
debian/grub-extras/lua/lauxlib.h (+175/-0)
debian/grub-extras/lua/lbaselib.c (+652/-0)
debian/grub-extras/lua/lcode.c (+852/-0)
debian/grub-extras/lua/lcode.h (+76/-0)
debian/grub-extras/lua/ldblib.c (+398/-0)
debian/grub-extras/lua/ldebug.c (+638/-0)
debian/grub-extras/lua/ldebug.h (+33/-0)
debian/grub-extras/lua/ldo.c (+519/-0)
debian/grub-extras/lua/ldo.h (+57/-0)
debian/grub-extras/lua/ldump.c (+164/-0)
debian/grub-extras/lua/lfunc.c (+174/-0)
debian/grub-extras/lua/lfunc.h (+34/-0)
debian/grub-extras/lua/lgc.c (+713/-0)
debian/grub-extras/lua/lgc.h (+110/-0)
debian/grub-extras/lua/linit.c (+38/-0)
debian/grub-extras/lua/liolib.c (+553/-0)
debian/grub-extras/lua/llex.c (+467/-0)
debian/grub-extras/lua/llex.h (+81/-0)
debian/grub-extras/lua/llimits.h (+128/-0)
debian/grub-extras/lua/lmathlib.c (+263/-0)
debian/grub-extras/lua/lmem.c (+86/-0)
debian/grub-extras/lua/lmem.h (+50/-0)
debian/grub-extras/lua/loadlib.c (+665/-0)
debian/grub-extras/lua/lobject.c (+221/-0)
debian/grub-extras/lua/lobject.h (+380/-0)
debian/grub-extras/lua/lopcodes.c (+102/-0)
debian/grub-extras/lua/lopcodes.h (+268/-0)
debian/grub-extras/lua/loslib.c (+243/-0)
debian/grub-extras/lua/lparser.c (+1340/-0)
debian/grub-extras/lua/lparser.h (+82/-0)
debian/grub-extras/lua/lstate.c (+213/-0)
debian/grub-extras/lua/lstate.h (+169/-0)
debian/grub-extras/lua/lstring.c (+112/-0)
debian/grub-extras/lua/lstring.h (+31/-0)
debian/grub-extras/lua/lstrlib.c (+874/-0)
debian/grub-extras/lua/ltable.c (+594/-0)
debian/grub-extras/lua/ltable.h (+40/-0)
debian/grub-extras/lua/ltablib.c (+288/-0)
debian/grub-extras/lua/ltm.c (+76/-0)
debian/grub-extras/lua/ltm.h (+54/-0)
debian/grub-extras/lua/lua.h (+388/-0)
debian/grub-extras/lua/luaconf.h (+846/-0)
debian/grub-extras/lua/lualib.h (+53/-0)
debian/grub-extras/lua/lundump.c (+229/-0)
debian/grub-extras/lua/lundump.h (+36/-0)
debian/grub-extras/lua/lvm.c (+764/-0)
debian/grub-extras/lua/lvm.h (+36/-0)
debian/grub-extras/lua/lzio.c (+83/-0)
debian/grub-extras/lua/lzio.h (+67/-0)
debian/grub-extras/lua/osdetect.lua (+204/-0)
debian/grub-extras/ntldr-img/COPYING (+674/-0)
debian/grub-extras/ntldr-img/Makefile.core.common (+38/-0)
debian/grub-extras/ntldr-img/Makefile.core.def (+32/-0)
debian/grub-extras/ntldr-img/README (+11/-0)
debian/grub-extras/ntldr-img/bin2h.c (+69/-0)
debian/grub-extras/ntldr-img/g2hdr.S (+98/-0)
debian/grub-extras/ntldr-img/grldrstart.S (+5793/-0)
debian/grub-extras/ntldr-img/grubinst.c (+1041/-0)
debian/grub-extras/ntldr-img/ntfsbs.S (+1508/-0)
debian/grub-extras/ntldr-img/utils.c (+392/-0)
debian/grub-extras/ntldr-img/utils.h (+88/-0)
debian/grub-extras/ntldr-img/version.h (+3/-0)
debian/grub-firmware-qemu.dirs (+1/-0)
debian/grub-firmware-qemu.install (+1/-0)
debian/grub-firmware-qemu_grub.cfg (+37/-0)
debian/grub-ieee1275-bin.install.amd64.in (+1/-0)
debian/grub-ieee1275-bin.install.kopensolaris-i386.in (+1/-0)
debian/grub-ieee1275-bin.install.linux-i386.in (+1/-0)
debian/grub-ieee1275-bin.install.powerpc.in (+2/-0)
debian/grub-ieee1275-bin.install.ppc64el.in (+2/-0)
debian/grub-ieee1275.install.sparc.in (+2/-0)
debian/grub-linuxbios.postinst (+19/-0)
debian/grub-mount-udeb.install (+2/-0)
debian/grub-pc-bin.install.amd64.in (+1/-0)
debian/grub-pc-bin.install.in (+4/-0)
debian/grub-pc-bin.install.kopensolaris-i386.in (+1/-0)
debian/grub-pc-bin.install.linux-i386.in (+1/-0)
debian/grub-pc-dbg.install.in (+1/-0)
debian/grub-pc.dirs.in (+1/-0)
debian/grub-pc.install.in (+4/-0)
debian/grub-pc.links.in (+2/-0)
debian/grub-pc.prerm (+28/-0)
debian/grub-pc.templates.in (+157/-0)
debian/grub-rescue-pc.README.Debian (+22/-0)
debian/grub-rescue-pc.install (+2/-0)
debian/grub-rescue-pc.links (+3/-0)
debian/grub-theme-starfield.install (+1/-0)
debian/grub.d/05_debian_theme (+192/-0)
debian/grub2-common.install (+10/-0)
debian/grub2-common.links (+2/-0)
debian/grub2-common.manpages (+1/-0)
debian/grub2.postinst (+19/-0)
debian/install-bin.in (+5/-0)
debian/install-dbg.in (+4/-0)
debian/install.in (+2/-0)
debian/kernel/zz-update-grub (+26/-0)
debian/legacy/update-grub (+1068/-0)
debian/legacy/update-grub.ubuntu.patch (+119/-0)
debian/legacy/upgrade-from-grub-legacy (+42/-0)
debian/patches/99-linux-pref-substr.patch (+62/-0)
debian/patches/blacklist_1440x900x32.patch (+34/-0)
debian/patches/btrfs-endian.patch (+30/-0)
debian/patches/core_in_fs.patch (+45/-0)
debian/patches/default_grub_d.patch (+195/-0)
debian/patches/disable_floppies.patch (+37/-0)
debian/patches/dpkg_version_comparison.patch (+38/-0)
debian/patches/elf_bi_endian.patch (+190/-0)
debian/patches/freebsd_debugflags_eperm.patch (+44/-0)
debian/patches/gettext_quiet.patch (+30/-0)
debian/patches/gfxpayload_dynamic.patch (+278/-0)
debian/patches/gfxpayload_keep_default.patch (+39/-0)
debian/patches/grub-shell-no-pad.patch (+37/-0)
debian/patches/grub.cfg_400.patch (+25/-0)
debian/patches/grub_legacy_0_based_partitions.patch (+39/-0)
debian/patches/ieee1275-pseries-emulation.patch (+35/-0)
debian/patches/ignore_grub_func_test_failures.patch (+29/-0)
debian/patches/install_arm64_naming.patch (+32/-0)
debian/patches/install_efi_fallback.patch (+62/-0)
debian/patches/install_efi_ubuntu_flavours.patch (+31/-0)
debian/patches/install_locale_langpack.patch (+118/-0)
debian/patches/install_powerpc_machtypes.patch (+187/-0)
debian/patches/install_signed.patch (+266/-0)
debian/patches/install_stage2_confusion.patch (+46/-0)
debian/patches/linuxefi.patch (+484/-0)
debian/patches/linuxefi_amd64_only.patch (+25/-0)
debian/patches/linuxefi_debug.patch (+93/-0)
debian/patches/linuxefi_non_sb_fallback.patch (+96/-0)
debian/patches/linuxefi_require_shim.patch (+28/-0)
debian/patches/macbless_mansection.patch (+23/-0)
debian/patches/maybe_quiet.patch (+381/-0)
debian/patches/mkconfig_loopback.patch (+96/-0)
debian/patches/mkconfig_mid_upgrade.patch (+39/-0)
debian/patches/mkconfig_nonexistent_loopback.patch (+55/-0)
debian/patches/mkconfig_recovery_title.patch (+130/-0)
debian/patches/mkconfig_signed_kernel.patch (+48/-0)
debian/patches/mkconfig_ubuntu_distributor.patch (+37/-0)
debian/patches/mkconfig_ubuntu_recovery.patch (+107/-0)
debian/patches/mkrescue_arm64_naming.patch (+26/-0)
debian/patches/mkrescue_efi_modules.patch (+38/-0)
debian/patches/no_insmod_on_sb.patch (+99/-0)
debian/patches/olpc_prefix_hack.patch (+52/-0)
debian/patches/probe-delimiter.patch (+333/-0)
debian/patches/probe_fusionio.patch (+76/-0)
debian/patches/quick_boot.patch (+333/-0)
debian/patches/restore_mkdevicemap.patch (+1249/-0)
debian/patches/series (+52/-0)
debian/patches/skip_gettext_strings_test.patch (+28/-0)
debian/patches/sleep_shift.patch (+95/-0)
debian/patches/tolerate-lvm-snapshots.patch (+66/-0)
debian/patches/uefi_firmware_setup.patch (+84/-0)
debian/patches/vt_handoff.patch (+101/-0)
debian/patches/wubi_no_windows.patch (+57/-0)
debian/platform-subst (+38/-0)
debian/po/POTFILES.in (+2/-0)
debian/po/ar.po (+445/-0)
debian/po/ast.po (+418/-0)
debian/po/be.po (+460/-0)
debian/po/bg.po (+422/-0)
debian/po/ca.po (+425/-0)
debian/po/cs.po (+416/-0)
debian/po/cy.po (+415/-0)
debian/po/da.po (+422/-0)
debian/po/de.po (+420/-0)
debian/po/dz.po (+410/-0)
debian/po/el.po (+435/-0)
debian/po/eo.po (+416/-0)
debian/po/es.po (+492/-0)
debian/po/eu.po (+412/-0)
debian/po/fa.po (+411/-0)
debian/po/fi.po (+421/-0)
debian/po/fr.po (+438/-0)
debian/po/gl.po (+429/-0)
debian/po/gu.po (+393/-0)
debian/po/he.po (+394/-0)
debian/po/hr.po (+419/-0)
debian/po/hu.po (+411/-0)
debian/po/id.po (+420/-0)
debian/po/is.po (+409/-0)
debian/po/it.po (+421/-0)
debian/po/ja.po (+406/-0)
debian/po/ka.po (+386/-0)
debian/po/kk.po (+412/-0)
debian/po/km.po (+391/-0)
debian/po/lt.po (+410/-0)
debian/po/lv.po (+407/-0)
debian/po/mr.po (+394/-0)
debian/po/nb.po (+420/-0)
debian/po/nl.po (+417/-0)
debian/po/pl.po (+418/-0)
debian/po/pt.po (+430/-0)
debian/po/pt_BR.po (+419/-0)
debian/po/ro.po (+462/-0)
debian/po/ru.po (+424/-0)
debian/po/si.po (+391/-0)
debian/po/sk.po (+418/-0)
debian/po/sl.po (+421/-0)
debian/po/sv.po (+424/-0)
debian/po/ta.po (+407/-0)
debian/po/templates.pot (+337/-0)
debian/po/th.po (+387/-0)
debian/po/tr.po (+413/-0)
debian/po/ug.po (+410/-0)
debian/po/uk.po (+417/-0)
debian/po/vi.po (+419/-0)
debian/po/zh_CN.po (+388/-0)
debian/po/zh_TW.po (+390/-0)
debian/postinst.in (+739/-0)
debian/postrm.in (+51/-0)
debian/preinst.in (+15/-0)
debian/rules (+463/-0)
debian/source/format (+1/-0)
debian/source/include-binaries (+1/-0)
debian/templates.in (+45/-0)
debian/update-grub (+3/-0)
debian/update-grub.8 (+14/-0)
debian/watch (+7/-0)
docs/Makefile.am (+9/-0)
docs/Makefile.in (+1551/-0)
docs/autoiso.cfg (+244/-0)
docs/fdl.texi (+452/-0)
docs/font_char_metrics.txt (+1/-0)
docs/grub-dev.info (+2516/-0)
docs/grub-dev.texi (+1968/-0)
docs/grub.cfg (+76/-0)
docs/grub.info (+7345/-0)
docs/grub.texi (+6509/-0)
docs/man/grub-bios-setup.h2m (+6/-0)
docs/man/grub-editenv.h2m (+5/-0)
docs/man/grub-emu.h2m (+6/-0)
docs/man/grub-file.h2m (+2/-0)
docs/man/grub-fstest.h2m (+4/-0)
docs/man/grub-glue-efi.h2m (+4/-0)
docs/man/grub-install.h2m (+6/-0)
docs/man/grub-kbdcomp.h2m (+10/-0)
docs/man/grub-macbless.h2m (+4/-0)
docs/man/grub-macho2img.h2m (+4/-0)
docs/man/grub-menulst2cfg.h2m (+4/-0)
docs/man/grub-mkconfig.h2m (+4/-0)
docs/man/grub-mkdevicemap.h2m (+4/-0)
docs/man/grub-mkfont.h2m (+4/-0)
docs/man/grub-mkimage.h2m (+6/-0)
docs/man/grub-mklayout.h2m (+10/-0)
docs/man/grub-mknetdir.h2m (+4/-0)
docs/man/grub-mkpasswd-pbkdf2.h2m (+4/-0)
docs/man/grub-mkrelpath.h2m (+4/-0)
docs/man/grub-mkrescue.h2m (+4/-0)
docs/man/grub-mkstandalone.h2m (+4/-0)
docs/man/grub-mount.h2m (+2/-0)
docs/man/grub-ofpathname.h2m (+4/-0)
docs/man/grub-pe2elf.h2m (+4/-0)
docs/man/grub-probe.h2m (+4/-0)
docs/man/grub-reboot.h2m (+5/-0)
docs/man/grub-render-label.h2m (+3/-0)
docs/man/grub-script-check.h2m (+4/-0)
docs/man/grub-set-default.h2m (+5/-0)
docs/man/grub-sparc64-setup.h2m (+6/-0)
docs/man/grub-syslinux2cfg.h2m (+4/-0)
docs/mdate-sh (+205/-0)
docs/osdetect.cfg (+331/-0)
docs/stamp-1 (+4/-0)
docs/stamp-vti (+4/-0)
docs/texinfo.tex (+8959/-0)
docs/version-dev.texi (+4/-0)
docs/version.texi (+4/-0)
geninit.sh (+69/-0)
gentpl.py (+880/-0)
grub-core/Makefile.am (+433/-0)
grub-core/Makefile.core.am (+20293/-0)
grub-core/Makefile.core.def (+2314/-0)
grub-core/Makefile.gcry.def (+157/-0)
grub-core/Makefile.in (+41494/-0)
grub-core/boot/decompressor/minilib.c (+102/-0)
grub-core/boot/decompressor/none.c (+42/-0)
grub-core/boot/decompressor/xz.c (+60/-0)
grub-core/boot/i386/pc/boot.S (+553/-0)
grub-core/boot/i386/pc/cdboot.S (+173/-0)
grub-core/boot/i386/pc/diskboot.S (+404/-0)
grub-core/boot/i386/pc/lnxboot.S (+295/-0)
grub-core/boot/i386/pc/lzma_decode.S (+614/-0)
grub-core/boot/i386/pc/pxeboot.S (+42/-0)
grub-core/boot/i386/pc/startup_raw.S (+360/-0)
grub-core/boot/i386/qemu/boot.S (+74/-0)
grub-core/boot/mips/loongson/fuloong2f.S (+2/-0)
grub-core/boot/mips/loongson/fwstart.S (+756/-0)
grub-core/boot/mips/startup_raw.S (+299/-0)
grub-core/boot/powerpc/bootinfo.txt.in (+73/-0)
grub-core/boot/powerpc/grub.chrp.in (+172/-0)
grub-core/boot/sparc64/ieee1275/boot.S (+230/-0)
grub-core/boot/sparc64/ieee1275/diskboot.S (+145/-0)
grub-core/bus/bonito.c (+176/-0)
grub-core/bus/cs5536.c (+381/-0)
grub-core/bus/emu/pci.c (+77/-0)
grub-core/bus/i386/ieee1275/pci.c (+42/-0)
grub-core/bus/pci.c (+173/-0)
grub-core/bus/usb/ehci.c (+1963/-0)
grub-core/bus/usb/emu/usb.c (+203/-0)
grub-core/bus/usb/ohci.c (+1465/-0)
grub-core/bus/usb/serial/common.c (+139/-0)
grub-core/bus/usb/serial/ftdi.c (+218/-0)
grub-core/bus/usb/serial/pl2303.c (+231/-0)
grub-core/bus/usb/serial/usbdebug_late.c (+93/-0)
grub-core/bus/usb/uhci.c (+873/-0)
grub-core/bus/usb/usb.c (+337/-0)
grub-core/bus/usb/usbhub.c (+756/-0)
grub-core/bus/usb/usbtrans.c (+448/-0)
grub-core/commands/acpi.c (+794/-0)
grub-core/commands/acpihalt.c (+396/-0)
grub-core/commands/arc/lsdev.c (+57/-0)
grub-core/commands/blocklist.c (+160/-0)
grub-core/commands/boot.c (+195/-0)
grub-core/commands/boottime.c (+65/-0)
grub-core/commands/cacheinfo.c (+60/-0)
grub-core/commands/cat.c (+167/-0)
grub-core/commands/cmp.c (+119/-0)
grub-core/commands/configfile.c (+98/-0)
grub-core/commands/date.c (+148/-0)
grub-core/commands/echo.c (+141/-0)
grub-core/commands/efi/acpi.c (+59/-0)
grub-core/commands/efi/efifwsetup.c (+90/-0)
grub-core/commands/efi/fixvideo.c (+114/-0)
grub-core/commands/efi/loadbios.c (+222/-0)
grub-core/commands/efi/lsefi.c (+153/-0)
grub-core/commands/efi/lsefimmap.c (+145/-0)
grub-core/commands/efi/lsefisystab.c (+110/-0)
grub-core/commands/efi/lssal.c (+169/-0)
grub-core/commands/eval.c (+71/-0)
grub-core/commands/extcmd.c (+118/-0)
grub-core/commands/file.c (+678/-0)
grub-core/commands/file32.c (+5/-0)
grub-core/commands/file64.c (+5/-0)
grub-core/commands/fileXX.c (+70/-0)
grub-core/commands/gptsync.c (+264/-0)
grub-core/commands/halt.c (+47/-0)
grub-core/commands/hashsum.c (+327/-0)
grub-core/commands/hdparm.c (+445/-0)
grub-core/commands/help.c (+153/-0)
grub-core/commands/hexdump.c (+133/-0)
grub-core/commands/i386/cmosdump.c (+64/-0)
grub-core/commands/i386/cmostest.c (+124/-0)
grub-core/commands/i386/coreboot/cb_timestamps.c (+118/-0)
grub-core/commands/i386/coreboot/cbls.c (+143/-0)
grub-core/commands/i386/cpuid.c (+125/-0)
grub-core/commands/i386/pc/acpi.c (+81/-0)
grub-core/commands/i386/pc/drivemap.c (+428/-0)
grub-core/commands/i386/pc/drivemap_int13h.S (+124/-0)
grub-core/commands/i386/pc/halt.c (+126/-0)
grub-core/commands/i386/pc/hwmatch.c (+146/-0)
grub-core/commands/i386/pc/lsapm.c (+115/-0)
grub-core/commands/i386/pc/play.c (+182/-0)
grub-core/commands/i386/pc/sendkey.c (+389/-0)
grub-core/commands/ieee1275/suspend.c (+51/-0)
grub-core/commands/iorw.c (+155/-0)
grub-core/commands/keylayouts.c (+305/-0)
grub-core/commands/keystatus.c (+113/-0)
grub-core/commands/legacycfg.c (+861/-0)
grub-core/commands/loadenv.c (+477/-0)
grub-core/commands/ls.c (+293/-0)
grub-core/commands/lsacpi.c (+314/-0)
grub-core/commands/lsmmap.c (+83/-0)
grub-core/commands/lspci.c (+238/-0)
grub-core/commands/macbless.c (+236/-0)
grub-core/commands/memrw.c (+157/-0)
grub-core/commands/menuentry.c (+337/-0)
grub-core/commands/minicmd.c (+221/-0)
grub-core/commands/mips/loongson/lsspd.c (+103/-0)
grub-core/commands/nativedisk.c (+317/-0)
grub-core/commands/parttool.c (+339/-0)
grub-core/commands/password.c (+93/-0)
grub-core/commands/password_pbkdf2.c (+205/-0)
grub-core/commands/pcidump.c (+175/-0)
grub-core/commands/probe.c (+172/-0)
grub-core/commands/read.c (+92/-0)
grub-core/commands/reboot.c (+46/-0)
grub-core/commands/regexp.c (+168/-0)
grub-core/commands/search.c (+337/-0)
grub-core/commands/search_file.c (+5/-0)
grub-core/commands/search_label.c (+5/-0)
grub-core/commands/search_uuid.c (+5/-0)
grub-core/commands/search_wrap.c (+215/-0)
grub-core/commands/setpci.c (+341/-0)
grub-core/commands/sleep.c (+142/-0)
grub-core/commands/syslinuxcfg.c (+214/-0)
grub-core/commands/terminal.c (+285/-0)
grub-core/commands/test.c (+455/-0)
grub-core/commands/testload.c (+170/-0)
grub-core/commands/testspeed.c (+115/-0)
grub-core/commands/time.c (+68/-0)
grub-core/commands/tr.c (+126/-0)
grub-core/commands/true.c (+61/-0)
grub-core/commands/usbtest.c (+218/-0)
grub-core/commands/verify.c (+986/-0)
grub-core/commands/videoinfo.c (+262/-0)
grub-core/commands/videotest.c (+241/-0)
grub-core/commands/wildcard.c (+622/-0)
grub-core/commands/xen/lsxen.c (+90/-0)
grub-core/commands/xnu_uuid.c (+119/-0)
grub-core/disk/AFSplitter.c (+92/-0)
grub-core/disk/ahci.c (+1122/-0)
grub-core/disk/arc/arcdisk.c (+325/-0)
grub-core/disk/ata.c (+677/-0)
grub-core/disk/cryptodisk.c (+1130/-0)
grub-core/disk/diskfilter.c (+1217/-0)
grub-core/disk/dmraid_nvidia.c (+185/-0)
grub-core/disk/efi/efidisk.c (+882/-0)
grub-core/disk/geli.c (+567/-0)
grub-core/disk/host.c (+103/-0)
grub-core/disk/i386/pc/biosdisk.c (+673/-0)
grub-core/disk/ieee1275/nand.c (+237/-0)
grub-core/disk/ieee1275/ofdisk.c (+631/-0)
grub-core/disk/ldm.c (+1052/-0)
grub-core/disk/loopback.c (+247/-0)
grub-core/disk/luks.c (+472/-0)
grub-core/disk/lvm.c (+789/-0)
grub-core/disk/mdraid1x_linux.c (+233/-0)
grub-core/disk/mdraid_linux.c (+298/-0)
grub-core/disk/mdraid_linux_be.c (+2/-0)
grub-core/disk/memdisk.c (+116/-0)
grub-core/disk/pata.c (+550/-0)
grub-core/disk/raid5_recover.c (+76/-0)
grub-core/disk/raid6_recover.c (+192/-0)
grub-core/disk/scsi.c (+765/-0)
grub-core/disk/uboot/ubootdisk.c (+297/-0)
grub-core/disk/usbms.c (+660/-0)
grub-core/disk/xen/xendisk.c (+458/-0)
grub-core/efiemu/i386/coredetect.c (+27/-0)
grub-core/efiemu/i386/loadcore32.c (+121/-0)
grub-core/efiemu/i386/loadcore64.c (+132/-0)
grub-core/efiemu/i386/nocfgtables.c (+30/-0)
grub-core/efiemu/i386/pc/cfgtables.c (+76/-0)
grub-core/efiemu/loadcore.c (+384/-0)
grub-core/efiemu/loadcore32.c (+22/-0)
grub-core/efiemu/loadcore64.c (+22/-0)
grub-core/efiemu/loadcore_common.c (+196/-0)
grub-core/efiemu/main.c (+328/-0)
grub-core/efiemu/mm.c (+657/-0)
grub-core/efiemu/pnvram.c (+268/-0)
grub-core/efiemu/prepare.c (+162/-0)
grub-core/efiemu/prepare32.c (+22/-0)
grub-core/efiemu/prepare64.c (+22/-0)
grub-core/efiemu/runtime/config.h (+36/-0)
grub-core/efiemu/runtime/efiemu.S (+159/-0)
grub-core/efiemu/runtime/efiemu.c (+636/-0)
grub-core/efiemu/symbols.c (+272/-0)
grub-core/font/font.c (+1599/-0)
grub-core/font/font_cmd.c (+92/-0)
grub-core/fs/affs.c (+711/-0)
grub-core/fs/afs.c (+3/-0)
grub-core/fs/archelp.c (+300/-0)
grub-core/fs/bfs.c (+1130/-0)
grub-core/fs/btrfs.c (+1768/-0)
grub-core/fs/cbfs.c (+391/-0)
grub-core/fs/cpio.c (+61/-0)
grub-core/fs/cpio_be.c (+61/-0)
grub-core/fs/cpio_common.c (+237/-0)
grub-core/fs/exfat.c (+2/-0)
grub-core/fs/ext2.c (+1008/-0)
grub-core/fs/fat.c (+1260/-0)
grub-core/fs/fshelp.c (+312/-0)
grub-core/fs/hfs.c (+1443/-0)
grub-core/fs/hfsplus.c (+1092/-0)
grub-core/fs/hfspluscomp.c (+317/-0)
grub-core/fs/iso9660.c (+1128/-0)
grub-core/fs/jfs.c (+955/-0)
grub-core/fs/minix.c (+726/-0)
grub-core/fs/minix2.c (+2/-0)
grub-core/fs/minix2_be.c (+3/-0)
grub-core/fs/minix3.c (+2/-0)
grub-core/fs/minix3_be.c (+3/-0)
grub-core/fs/minix_be.c (+2/-0)
grub-core/fs/newc.c (+73/-0)
grub-core/fs/nilfs2.c (+1219/-0)
grub-core/fs/ntfs.c (+1230/-0)
grub-core/fs/ntfscomp.c (+443/-0)
grub-core/fs/odc.c (+61/-0)
grub-core/fs/proc.c (+173/-0)
grub-core/fs/reiserfs.c (+1406/-0)
grub-core/fs/romfs.c (+484/-0)
grub-core/fs/sfs.c (+760/-0)
grub-core/fs/squash4.c (+1002/-0)
grub-core/fs/tar.c (+345/-0)
grub-core/fs/udf.c (+1231/-0)
grub-core/fs/ufs.c (+911/-0)
grub-core/fs/ufs2.c (+3/-0)
grub-core/fs/ufs_be.c (+2/-0)
grub-core/fs/xfs.c (+929/-0)
grub-core/fs/zfs/zfs.c (+4292/-0)
grub-core/fs/zfs/zfs_fletcher.c (+84/-0)
grub-core/fs/zfs/zfs_lz4.c (+284/-0)
grub-core/fs/zfs/zfs_lzjb.c (+93/-0)
grub-core/fs/zfs/zfs_sha256.c (+143/-0)
grub-core/fs/zfs/zfscrypt.c (+479/-0)
grub-core/fs/zfs/zfsinfo.c (+439/-0)
grub-core/gdb/cstub.c (+365/-0)
grub-core/gdb/gdb.c (+100/-0)
grub-core/gdb/i386/idt.c (+78/-0)
grub-core/gdb/i386/machdep.S (+245/-0)
grub-core/gdb/i386/signal.c (+53/-0)
grub-core/gdb_grub.in (+85/-0)
grub-core/genemuinit.sh (+72/-0)
grub-core/genemuinitheader.sh (+52/-0)
grub-core/genmod.sh.in (+96/-0)
grub-core/genmoddep.awk (+68/-0)
grub-core/gensyminfo.sh.in (+37/-0)
grub-core/gensymlist.sh (+73/-0)
grub-core/gentrigtables.c (+57/-0)
grub-core/gettext/gettext.c (+547/-0)
grub-core/gfxmenu/font.c (+111/-0)
grub-core/gfxmenu/gfxmenu.c (+150/-0)
grub-core/gfxmenu/gui_box.c (+428/-0)
grub-core/gfxmenu/gui_canvas.c (+278/-0)
grub-core/gfxmenu/gui_circular_progress.c (+329/-0)
grub-core/gfxmenu/gui_image.c (+267/-0)
grub-core/gfxmenu/gui_label.c (+273/-0)
grub-core/gfxmenu/gui_list.c (+950/-0)
grub-core/gfxmenu/gui_progress_bar.c (+448/-0)
grub-core/gfxmenu/gui_string_util.c (+206/-0)
grub-core/gfxmenu/gui_util.c (+101/-0)
grub-core/gfxmenu/icon_manager.c (+255/-0)
grub-core/gfxmenu/theme_loader.c (+826/-0)
grub-core/gfxmenu/view.c (+647/-0)
grub-core/gfxmenu/widget-box.c (+360/-0)
grub-core/gmodule.pl.in (+30/-0)
grub-core/gnulib-fix-null-deref.diff (+13/-0)
grub-core/gnulib-fix-width.diff (+231/-0)
grub-core/gnulib-no-abort.diff (+30/-0)
grub-core/gnulib-no-gets.diff (+10/-0)
grub-core/gnulib/Makefile.am (+1747/-0)
grub-core/gnulib/Makefile.in (+2664/-0)
grub-core/gnulib/alloca.c (+478/-0)
grub-core/gnulib/alloca.in.h (+63/-0)
grub-core/gnulib/argp-ba.c (+34/-0)
grub-core/gnulib/argp-eexst.c (+30/-0)
grub-core/gnulib/argp-fmtstream.c (+488/-0)
grub-core/gnulib/argp-fmtstream.h (+359/-0)
grub-core/gnulib/argp-fs-xinl.c (+46/-0)
grub-core/gnulib/argp-help.c (+1956/-0)
grub-core/gnulib/argp-namefrob.h (+157/-0)
grub-core/gnulib/argp-parse.c (+953/-0)
grub-core/gnulib/argp-pin.c (+26/-0)
grub-core/gnulib/argp-pv.c (+34/-0)
grub-core/gnulib/argp-pvh.c (+31/-0)
grub-core/gnulib/argp-xinl.c (+46/-0)
grub-core/gnulib/argp.h (+650/-0)
grub-core/gnulib/asnprintf.c (+34/-0)
grub-core/gnulib/basename-lgpl.c (+75/-0)
grub-core/gnulib/btowc.c (+39/-0)
grub-core/gnulib/config.charset (+684/-0)
grub-core/gnulib/dirname-lgpl.c (+86/-0)
grub-core/gnulib/dirname.h (+46/-0)
grub-core/gnulib/dosname.h (+53/-0)
grub-core/gnulib/errno.in.h (+279/-0)
grub-core/gnulib/error.c (+401/-0)
grub-core/gnulib/error.h (+65/-0)
grub-core/gnulib/float+.h (+147/-0)
grub-core/gnulib/float.c (+33/-0)
grub-core/gnulib/float.in.h (+188/-0)
grub-core/gnulib/fnmatch.c (+350/-0)
grub-core/gnulib/fnmatch.in.h (+67/-0)
grub-core/gnulib/fnmatch_loop.c (+1219/-0)
grub-core/gnulib/getdelim.c (+135/-0)
grub-core/gnulib/getline.c (+27/-0)
grub-core/gnulib/getopt.c (+1245/-0)
grub-core/gnulib/getopt.in.h (+255/-0)
grub-core/gnulib/getopt1.c (+170/-0)
grub-core/gnulib/getopt_int.h (+135/-0)
grub-core/gnulib/gettext.h (+288/-0)
grub-core/gnulib/intprops.h (+319/-0)
grub-core/gnulib/itold.c (+28/-0)
grub-core/gnulib/langinfo.in.h (+176/-0)
grub-core/gnulib/localcharset.c (+553/-0)
grub-core/gnulib/localcharset.h (+40/-0)
grub-core/gnulib/locale.in.h (+216/-0)
grub-core/gnulib/localeconv.c (+103/-0)
grub-core/gnulib/malloc.c (+56/-0)
grub-core/gnulib/mbrtowc.c (+402/-0)
grub-core/gnulib/mbsinit.c (+61/-0)
grub-core/gnulib/mbsrtowcs-impl.h (+122/-0)
grub-core/gnulib/mbsrtowcs-state.c (+37/-0)
grub-core/gnulib/mbsrtowcs.c (+32/-0)
grub-core/gnulib/mbswidth.c (+199/-0)
grub-core/gnulib/mbswidth.h (+63/-0)
grub-core/gnulib/mbtowc-impl.h (+44/-0)
grub-core/gnulib/mbtowc.c (+26/-0)
grub-core/gnulib/memchr.c (+172/-0)
grub-core/gnulib/memchr.valgrind (+14/-0)
grub-core/gnulib/mempcpy.c (+28/-0)
grub-core/gnulib/msvc-inval.c (+129/-0)
grub-core/gnulib/msvc-inval.h (+222/-0)
grub-core/gnulib/msvc-nothrow.c (+49/-0)
grub-core/gnulib/msvc-nothrow.h (+43/-0)
grub-core/gnulib/nl_langinfo.c (+271/-0)
grub-core/gnulib/printf-args.c (+187/-0)
grub-core/gnulib/printf-args.h (+158/-0)
grub-core/gnulib/printf-parse.c (+638/-0)
grub-core/gnulib/printf-parse.h (+193/-0)
grub-core/gnulib/progname.c (+92/-0)
grub-core/gnulib/progname.h (+62/-0)
grub-core/gnulib/rawmemchr.c (+136/-0)
grub-core/gnulib/rawmemchr.valgrind (+12/-0)
grub-core/gnulib/realloc.c (+79/-0)
grub-core/gnulib/ref-add.sin (+29/-0)
grub-core/gnulib/ref-del.sin (+24/-0)
grub-core/gnulib/regcomp.c (+3913/-0)
grub-core/gnulib/regex.c (+81/-0)
grub-core/gnulib/regex.h (+667/-0)
grub-core/gnulib/regex_internal.c (+1741/-0)
grub-core/gnulib/regex_internal.h (+873/-0)
grub-core/gnulib/regexec.c (+4414/-0)
grub-core/gnulib/size_max.h (+30/-0)
grub-core/gnulib/sleep.c (+76/-0)
grub-core/gnulib/stdalign.in.h (+90/-0)
grub-core/gnulib/stdbool.in.h (+132/-0)
grub-core/gnulib/stddef.in.h (+86/-0)
grub-core/gnulib/stdint.in.h (+636/-0)
grub-core/gnulib/stdio.in.h (+1333/-0)
grub-core/gnulib/stdlib.in.h (+954/-0)
grub-core/gnulib/strcasecmp.c (+62/-0)
grub-core/gnulib/strchrnul.c (+142/-0)
grub-core/gnulib/strchrnul.valgrind (+12/-0)
grub-core/gnulib/streq.h (+176/-0)
grub-core/gnulib/strerror-override.c (+302/-0)
grub-core/gnulib/strerror-override.h (+56/-0)
grub-core/gnulib/strerror.c (+70/-0)
grub-core/gnulib/string.in.h (+1029/-0)
grub-core/gnulib/strings.in.h (+122/-0)
grub-core/gnulib/stripslash.c (+45/-0)
grub-core/gnulib/strncasecmp.c (+62/-0)
grub-core/gnulib/strndup.c (+36/-0)
grub-core/gnulib/strnlen.c (+30/-0)
grub-core/gnulib/strnlen1.c (+35/-0)
grub-core/gnulib/strnlen1.h (+40/-0)
grub-core/gnulib/sys_types.in.h (+51/-0)
grub-core/gnulib/sysexits.in.h (+72/-0)
grub-core/gnulib/unistd.c (+3/-0)
grub-core/gnulib/unistd.in.h (+1530/-0)
grub-core/gnulib/unitypes.in.h (+46/-0)
grub-core/gnulib/uniwidth.in.h (+72/-0)
grub-core/gnulib/uniwidth/cjk.h (+37/-0)
grub-core/gnulib/uniwidth/width.c (+368/-0)
grub-core/gnulib/vasnprintf.c (+5606/-0)
grub-core/gnulib/vasnprintf.h (+79/-0)
grub-core/gnulib/verify.h (+245/-0)
grub-core/gnulib/vsnprintf.c (+70/-0)
grub-core/gnulib/wchar.in.h (+1028/-0)
grub-core/gnulib/wcrtomb.c (+53/-0)
grub-core/gnulib/wctype-h.c (+4/-0)
grub-core/gnulib/wctype.in.h (+504/-0)
grub-core/gnulib/wcwidth.c (+50/-0)
grub-core/gnulib/xsize.c (+3/-0)
grub-core/gnulib/xsize.h (+114/-0)
grub-core/hello/hello.c (+51/-0)
grub-core/hook/datehook.c (+110/-0)
grub-core/io/bufio.c (+207/-0)
grub-core/io/gzio.c (+1353/-0)
grub-core/io/lzopio.c (+550/-0)
grub-core/io/offset.c (+111/-0)
grub-core/io/xzio.c (+344/-0)
grub-core/kern/arm/cache.S (+123/-0)
grub-core/kern/arm/cache.c (+274/-0)
grub-core/kern/arm/cache_armv6.S (+73/-0)
grub-core/kern/arm/cache_armv7.S (+126/-0)
grub-core/kern/arm/dl.c (+260/-0)
grub-core/kern/arm/dl_helper.c (+216/-0)
grub-core/kern/arm/efi/init.c (+74/-0)
grub-core/kern/arm/efi/misc.c (+202/-0)
grub-core/kern/arm/efi/startup.S (+36/-0)
grub-core/kern/arm/misc.S (+89/-0)
grub-core/kern/arm/uboot/startup.S (+183/-0)
grub-core/kern/arm64/cache.c (+63/-0)
grub-core/kern/arm64/cache_flush.S (+55/-0)
grub-core/kern/arm64/dl.c (+165/-0)
grub-core/kern/arm64/dl_helper.c (+55/-0)
grub-core/kern/arm64/efi/startup.S (+39/-0)
grub-core/kern/command.c (+87/-0)
grub-core/kern/corecmd.c (+189/-0)
grub-core/kern/device.c (+191/-0)
grub-core/kern/disk.c (+544/-0)
grub-core/kern/disk_common.c (+55/-0)
grub-core/kern/dl.c (+823/-0)
grub-core/kern/efi/efi.c (+886/-0)
grub-core/kern/efi/init.c (+77/-0)
grub-core/kern/efi/mm.c (+554/-0)
grub-core/kern/elf.c (+209/-0)
grub-core/kern/elfXX.c (+199/-0)
grub-core/kern/emu/argp_common.c (+41/-0)
grub-core/kern/emu/cache.c (+29/-0)
grub-core/kern/emu/cache_s.S (+14/-0)
grub-core/kern/emu/full.c (+69/-0)
grub-core/kern/emu/hostdisk.c (+698/-0)
grub-core/kern/emu/hostfs.c (+198/-0)
grub-core/kern/emu/lite.c (+45/-0)
grub-core/kern/emu/main.c (+239/-0)
grub-core/kern/emu/misc.c (+152/-0)
grub-core/kern/emu/mm.c (+64/-0)
grub-core/kern/emu/time.c (+46/-0)
grub-core/kern/env.c (+238/-0)
grub-core/kern/err.c (+122/-0)
grub-core/kern/file.c (+211/-0)
grub-core/kern/fs.c (+251/-0)
grub-core/kern/generic/millisleep.c (+39/-0)
grub-core/kern/generic/rtc_get_time_ms.c (+38/-0)
grub-core/kern/i386/coreboot/cbtable.c (+83/-0)
grub-core/kern/i386/coreboot/init.c (+138/-0)
grub-core/kern/i386/coreboot/mmap.c (+72/-0)
grub-core/kern/i386/coreboot/startup.S (+68/-0)
grub-core/kern/i386/dl.c (+81/-0)
grub-core/kern/i386/efi/init.c (+43/-0)
grub-core/kern/i386/efi/startup.S (+36/-0)
grub-core/kern/i386/ieee1275/startup.S (+41/-0)
grub-core/kern/i386/int.S (+123/-0)
grub-core/kern/i386/multiboot_mmap.c (+73/-0)
grub-core/kern/i386/pc/init.c (+247/-0)
grub-core/kern/i386/pc/mmap.c (+191/-0)
grub-core/kern/i386/pc/startup.S (+217/-0)
grub-core/kern/i386/qemu/init.c (+276/-0)
grub-core/kern/i386/qemu/mmap.c (+107/-0)
grub-core/kern/i386/qemu/startup.S (+77/-0)
grub-core/kern/i386/realmode.S (+263/-0)
grub-core/kern/i386/tsc.c (+157/-0)
grub-core/kern/i386/xen/hypercall.S (+43/-0)
grub-core/kern/i386/xen/startup.S (+38/-0)
grub-core/kern/ia64/cache.c (+35/-0)
grub-core/kern/ia64/dl.c (+141/-0)
grub-core/kern/ia64/dl_helper.c (+207/-0)
grub-core/kern/ia64/efi/init.c (+75/-0)
grub-core/kern/ia64/efi/startup.S (+44/-0)
grub-core/kern/ieee1275/cmain.c (+217/-0)
grub-core/kern/ieee1275/ieee1275.c (+609/-0)
grub-core/kern/ieee1275/init.c (+330/-0)
grub-core/kern/ieee1275/mmap.c (+80/-0)
grub-core/kern/ieee1275/openfw.c (+563/-0)
grub-core/kern/list.c (+55/-0)
grub-core/kern/main.c (+329/-0)
grub-core/kern/mips/arc/init.c (+463/-0)
grub-core/kern/mips/cache.S (+68/-0)
grub-core/kern/mips/cache_flush.S (+54/-0)
grub-core/kern/mips/dl.c (+269/-0)
grub-core/kern/mips/init.c (+38/-0)
grub-core/kern/mips/loongson/init.c (+320/-0)
grub-core/kern/mips/qemu_mips/init.c (+105/-0)
grub-core/kern/mips/startup.S (+125/-0)
grub-core/kern/misc.c (+1341/-0)
grub-core/kern/mm.c (+615/-0)
grub-core/kern/parser.c (+274/-0)
grub-core/kern/partition.c (+276/-0)
grub-core/kern/powerpc/cache.S (+26/-0)
grub-core/kern/powerpc/cache_flush.S (+43/-0)
grub-core/kern/powerpc/dl.c (+167/-0)
grub-core/kern/powerpc/ieee1275/startup.S (+67/-0)
grub-core/kern/rescue_parser.c (+79/-0)
grub-core/kern/rescue_reader.c (+100/-0)
grub-core/kern/sparc64/cache.S (+41/-0)
grub-core/kern/sparc64/dl.c (+185/-0)
grub-core/kern/sparc64/ieee1275/crt0.S (+104/-0)
grub-core/kern/sparc64/ieee1275/ieee1275.c (+91/-0)
grub-core/kern/term.c (+130/-0)
grub-core/kern/time.c (+37/-0)
grub-core/kern/uboot/hw.c (+112/-0)
grub-core/kern/uboot/init.c (+188/-0)
grub-core/kern/uboot/uboot.c (+326/-0)
grub-core/kern/vga_init.c (+128/-0)
grub-core/kern/x86_64/dl.c (+115/-0)
grub-core/kern/x86_64/efi/callwrap.S (+129/-0)
grub-core/kern/x86_64/efi/startup.S (+35/-0)
grub-core/kern/x86_64/xen/hypercall.S (+53/-0)
grub-core/kern/x86_64/xen/startup.S (+39/-0)
grub-core/kern/xen/init.c (+580/-0)
grub-core/lib/LzFind.c (+777/-0)
grub-core/lib/LzmaDec.c (+1037/-0)
grub-core/lib/LzmaEnc.c (+2244/-0)
grub-core/lib/adler32.c (+102/-0)
grub-core/lib/arc/datetime.c (+48/-0)
grub-core/lib/arg.c (+463/-0)
grub-core/lib/arm/setjmp.S (+53/-0)
grub-core/lib/arm64/setjmp.S (+53/-0)
grub-core/lib/backtrace.c (+70/-0)
grub-core/lib/cmdline.c (+108/-0)
grub-core/lib/cmos_datetime.c (+194/-0)
grub-core/lib/crc.c (+76/-0)
grub-core/lib/crc64.c (+114/-0)
grub-core/lib/crypto.c (+480/-0)
grub-core/lib/disk.c (+161/-0)
grub-core/lib/efi/datetime.c (+82/-0)
grub-core/lib/efi/halt.c (+39/-0)
grub-core/lib/efi/reboot.c (+33/-0)
grub-core/lib/efi/relocator.c (+119/-0)
grub-core/lib/emu/halt.c (+25/-0)
grub-core/lib/envblk.c (+297/-0)
grub-core/lib/fake_module.c (+4/-0)
grub-core/lib/fdt.c (+462/-0)
grub-core/lib/getline.c (+92/-0)
grub-core/lib/hexdump.c (+85/-0)
grub-core/lib/i386/backtrace.c (+66/-0)
grub-core/lib/i386/halt.c (+82/-0)
grub-core/lib/i386/pc/biosnum.c (+47/-0)
grub-core/lib/i386/pc/vesa_modes_table.c (+127/-0)
grub-core/lib/i386/reboot.c (+60/-0)
grub-core/lib/i386/reboot_trampoline.S (+34/-0)
grub-core/lib/i386/relocator.c (+214/-0)
grub-core/lib/i386/relocator16.S (+328/-0)
grub-core/lib/i386/relocator32.S (+134/-0)
grub-core/lib/i386/relocator64.S (+165/-0)
grub-core/lib/i386/relocator_asm.S (+80/-0)
grub-core/lib/i386/relocator_common.S (+113/-0)
grub-core/lib/i386/relocator_common_c.c (+109/-0)
grub-core/lib/i386/setjmp.S (+59/-0)
grub-core/lib/i386/xen/relocator.S (+150/-0)
grub-core/lib/ia64/longjmp.S (+162/-0)
grub-core/lib/ia64/setjmp.S (+177/-0)
grub-core/lib/ieee1275/cmos.c (+77/-0)
grub-core/lib/ieee1275/datetime.c (+156/-0)
grub-core/lib/ieee1275/halt.c (+33/-0)
grub-core/lib/ieee1275/reboot.c (+27/-0)
grub-core/lib/ieee1275/relocator.c (+114/-0)
grub-core/lib/legacy_parse.c (+874/-0)
grub-core/lib/libgcrypt-grub/cipher/ChangeLog (+4357/-0)
grub-core/lib/libgcrypt-grub/cipher/arcfour.c (+143/-0)
grub-core/lib/libgcrypt-grub/cipher/bithelp.h (+57/-0)
grub-core/lib/libgcrypt-grub/cipher/blowfish.c (+592/-0)
grub-core/lib/libgcrypt-grub/cipher/camellia-glue.c (+211/-0)
grub-core/lib/libgcrypt-grub/cipher/camellia.c (+1463/-0)
grub-core/lib/libgcrypt-grub/cipher/camellia.h (+94/-0)
grub-core/lib/libgcrypt-grub/cipher/cast5.c (+590/-0)
grub-core/lib/libgcrypt-grub/cipher/cipher.h (+2/-0)
grub-core/lib/libgcrypt-grub/cipher/crc.c (+329/-0)
grub-core/lib/libgcrypt-grub/cipher/crypto.lst (+45/-0)
grub-core/lib/libgcrypt-grub/cipher/des.c (+929/-0)
grub-core/lib/libgcrypt-grub/cipher/dsa.c (+292/-0)
grub-core/lib/libgcrypt-grub/cipher/g10lib.h (+1/-0)
grub-core/lib/libgcrypt-grub/cipher/hash-common.h (+36/-0)
grub-core/lib/libgcrypt-grub/cipher/idea.c (+322/-0)
grub-core/lib/libgcrypt-grub/cipher/init.c (+91/-0)
grub-core/lib/libgcrypt-grub/cipher/md4.c (+344/-0)
grub-core/lib/libgcrypt-grub/cipher/md5.c (+372/-0)
grub-core/lib/libgcrypt-grub/cipher/memory.h (+1/-0)
grub-core/lib/libgcrypt-grub/cipher/rfc2268.c (+285/-0)
grub-core/lib/libgcrypt-grub/cipher/rijndael-tables.h (+1689/-0)
grub-core/lib/libgcrypt-grub/cipher/rijndael.c (+1478/-0)
grub-core/lib/libgcrypt-grub/cipher/rmd.h (+39/-0)
grub-core/lib/libgcrypt-grub/cipher/rmd160.c (+565/-0)
grub-core/lib/libgcrypt-grub/cipher/rsa.c (+395/-0)
grub-core/lib/libgcrypt-grub/cipher/seed.c (+461/-0)
grub-core/lib/libgcrypt-grub/cipher/serpent.c (+903/-0)
grub-core/lib/libgcrypt-grub/cipher/sha1.c (+419/-0)
grub-core/lib/libgcrypt-grub/cipher/sha256.c (+463/-0)
grub-core/lib/libgcrypt-grub/cipher/sha512.c (+525/-0)
grub-core/lib/libgcrypt-grub/cipher/tiger.c (+944/-0)
grub-core/lib/libgcrypt-grub/cipher/twofish.c (+1001/-0)
grub-core/lib/libgcrypt-grub/cipher/types.h (+2/-0)
grub-core/lib/libgcrypt-grub/cipher/whirlpool.c (+1422/-0)
grub-core/lib/libgcrypt-grub/mpi/generic/Manifest (+29/-0)
grub-core/lib/libgcrypt-grub/mpi/generic/distfiles (+11/-0)
grub-core/lib/libgcrypt-grub/mpi/generic/mpi-asm-defs.h (+10/-0)
grub-core/lib/libgcrypt-grub/mpi/generic/mpih-add1.c (+65/-0)
grub-core/lib/libgcrypt-grub/mpi/generic/mpih-lshift.c (+68/-0)
grub-core/lib/libgcrypt-grub/mpi/generic/mpih-mul1.c (+62/-0)
grub-core/lib/libgcrypt-grub/mpi/generic/mpih-mul2.c (+68/-0)
grub-core/lib/libgcrypt-grub/mpi/generic/mpih-mul3.c (+68/-0)
grub-core/lib/libgcrypt-grub/mpi/generic/mpih-rshift.c (+67/-0)
grub-core/lib/libgcrypt-grub/mpi/generic/mpih-sub1.c (+66/-0)
grub-core/lib/libgcrypt-grub/mpi/generic/udiv-w-sdiv.c (+133/-0)
grub-core/lib/libgcrypt-grub/mpi/longlong.h (+1615/-0)
grub-core/lib/libgcrypt-grub/mpi/mpi-add.c (+237/-0)
grub-core/lib/libgcrypt-grub/mpi/mpi-asm-defs.h (+10/-0)
grub-core/lib/libgcrypt-grub/mpi/mpi-bit.c (+366/-0)
grub-core/lib/libgcrypt-grub/mpi/mpi-cmp.c (+109/-0)
grub-core/lib/libgcrypt-grub/mpi/mpi-div.c (+357/-0)
grub-core/lib/libgcrypt-grub/mpi/mpi-gcd.c (+53/-0)
grub-core/lib/libgcrypt-grub/mpi/mpi-inline.c (+37/-0)
grub-core/lib/libgcrypt-grub/mpi/mpi-inline.h (+163/-0)
grub-core/lib/libgcrypt-grub/mpi/mpi-internal.h (+279/-0)
grub-core/lib/libgcrypt-grub/mpi/mpi-inv.c (+269/-0)
grub-core/lib/libgcrypt-grub/mpi/mpi-mod.c (+186/-0)
grub-core/lib/libgcrypt-grub/mpi/mpi-mpow.c (+225/-0)
grub-core/lib/libgcrypt-grub/mpi/mpi-mul.c (+214/-0)
grub-core/lib/libgcrypt-grub/mpi/mpi-pow.c (+340/-0)
grub-core/lib/libgcrypt-grub/mpi/mpicoder.c (+752/-0)
grub-core/lib/libgcrypt-grub/mpi/mpih-add1.c (+65/-0)
grub-core/lib/libgcrypt-grub/mpi/mpih-div.c (+536/-0)
grub-core/lib/libgcrypt-grub/mpi/mpih-lshift.c (+68/-0)
grub-core/lib/libgcrypt-grub/mpi/mpih-mul.c (+530/-0)
grub-core/lib/libgcrypt-grub/mpi/mpih-mul1.c (+62/-0)
grub-core/lib/libgcrypt-grub/mpi/mpih-mul2.c (+68/-0)
grub-core/lib/libgcrypt-grub/mpi/mpih-mul3.c (+68/-0)
grub-core/lib/libgcrypt-grub/mpi/mpih-rshift.c (+67/-0)
grub-core/lib/libgcrypt-grub/mpi/mpih-sub1.c (+66/-0)
grub-core/lib/libgcrypt-grub/mpi/mpiutil.c (+435/-0)
grub-core/lib/libgcrypt-grub/src/ath.h (+147/-0)
grub-core/lib/libgcrypt-grub/src/cipher-proto.h (+124/-0)
grub-core/lib/libgcrypt-grub/src/cipher.h (+182/-0)
grub-core/lib/libgcrypt-grub/src/g10lib.h (+302/-0)
grub-core/lib/libgcrypt-grub/src/gcrypt.h (+1925/-0)
grub-core/lib/libgcrypt-grub/src/hmac256.h (+36/-0)
grub-core/lib/libgcrypt-grub/src/mpi.h (+266/-0)
grub-core/lib/libgcrypt-grub/src/secmem.h (+39/-0)
grub-core/lib/libgcrypt-grub/src/stdmem.h (+32/-0)
grub-core/lib/libgcrypt-grub/src/types.h (+128/-0)
grub-core/lib/libgcrypt-grub/src/visibility.h (+1/-0)
grub-core/lib/libgcrypt/cipher/ChangeLog (+3990/-0)
grub-core/lib/libgcrypt/cipher/ChangeLog-2011 (+4247/-0)
grub-core/lib/libgcrypt/cipher/Makefile.am (+83/-0)
grub-core/lib/libgcrypt/cipher/Makefile.in (+643/-0)
grub-core/lib/libgcrypt/cipher/Manifest (+73/-0)
grub-core/lib/libgcrypt/cipher/ac.c (+3301/-0)
grub-core/lib/libgcrypt/cipher/arcfour.c (+155/-0)
grub-core/lib/libgcrypt/cipher/bithelp.h (+54/-0)
grub-core/lib/libgcrypt/cipher/blowfish.c (+605/-0)
grub-core/lib/libgcrypt/cipher/camellia-glue.c (+253/-0)
grub-core/lib/libgcrypt/cipher/camellia.c (+1461/-0)
grub-core/lib/libgcrypt/cipher/camellia.h (+81/-0)
grub-core/lib/libgcrypt/cipher/cast5.c (+620/-0)
grub-core/lib/libgcrypt/cipher/cipher.c (+2217/-0)
grub-core/lib/libgcrypt/cipher/crc.c (+296/-0)
grub-core/lib/libgcrypt/cipher/des.c (+1196/-0)
grub-core/lib/libgcrypt/cipher/dsa.c (+1193/-0)
grub-core/lib/libgcrypt/cipher/ecc.c (+1793/-0)
grub-core/lib/libgcrypt/cipher/elgamal.c (+845/-0)
grub-core/lib/libgcrypt/cipher/hash-common.c (+93/-0)
grub-core/lib/libgcrypt/cipher/hash-common.h (+33/-0)
grub-core/lib/libgcrypt/cipher/hmac-tests.c (+732/-0)
grub-core/lib/libgcrypt/cipher/idea.c (+378/-0)
grub-core/lib/libgcrypt/cipher/kdf.c (+278/-0)
grub-core/lib/libgcrypt/cipher/md.c (+1383/-0)
grub-core/lib/libgcrypt/cipher/md4.c (+327/-0)
grub-core/lib/libgcrypt/cipher/md5.c (+355/-0)
grub-core/lib/libgcrypt/cipher/primegen.c (+1861/-0)
grub-core/lib/libgcrypt/cipher/pubkey.c (+4212/-0)
grub-core/lib/libgcrypt/cipher/rfc2268.c (+344/-0)
grub-core/lib/libgcrypt/cipher/rijndael-tables.h (+1686/-0)
grub-core/lib/libgcrypt/cipher/rijndael.c (+2092/-0)
grub-core/lib/libgcrypt/cipher/rmd.h (+36/-0)
grub-core/lib/libgcrypt/cipher/rmd160.c (+572/-0)
grub-core/lib/libgcrypt/cipher/rsa.c (+1390/-0)
grub-core/lib/libgcrypt/cipher/seed.c (+478/-0)
grub-core/lib/libgcrypt/cipher/serpent.c (+953/-0)
grub-core/lib/libgcrypt/cipher/sha1.c (+477/-0)
grub-core/lib/libgcrypt/cipher/sha256.c (+554/-0)
grub-core/lib/libgcrypt/cipher/sha512.c (+629/-0)
grub-core/lib/libgcrypt/cipher/test-getrusage.c (+105/-0)
grub-core/lib/libgcrypt/cipher/tiger.c (+911/-0)
grub-core/lib/libgcrypt/cipher/twofish.c (+1040/-0)
grub-core/lib/libgcrypt/cipher/whirlpool.c (+1405/-0)
grub-core/lib/libgcrypt/mpi/ChangeLog-2011 (+822/-0)
grub-core/lib/libgcrypt/mpi/Makefile.am (+177/-0)
grub-core/lib/libgcrypt/mpi/Makefile.in (+740/-0)
grub-core/lib/libgcrypt/mpi/Manifest (+41/-0)
grub-core/lib/libgcrypt/mpi/alpha/README (+53/-0)
grub-core/lib/libgcrypt/mpi/alpha/distfiles (+11/-0)
grub-core/lib/libgcrypt/mpi/alpha/mpih-add1.S (+124/-0)
grub-core/lib/libgcrypt/mpi/alpha/mpih-lshift.S (+122/-0)
grub-core/lib/libgcrypt/mpi/alpha/mpih-mul1.S (+90/-0)
grub-core/lib/libgcrypt/mpi/alpha/mpih-mul2.S (+97/-0)
grub-core/lib/libgcrypt/mpi/alpha/mpih-mul3.S (+95/-0)
grub-core/lib/libgcrypt/mpi/alpha/mpih-rshift.S (+118/-0)
grub-core/lib/libgcrypt/mpi/alpha/mpih-sub1.S (+124/-0)
grub-core/lib/libgcrypt/mpi/alpha/udiv-qrnnd.S (+159/-0)
grub-core/lib/libgcrypt/mpi/amd64/distfiles (+8/-0)
grub-core/lib/libgcrypt/mpi/amd64/mpi-asm-defs.h (+4/-0)
grub-core/lib/libgcrypt/mpi/amd64/mpih-add1.S (+63/-0)
grub-core/lib/libgcrypt/mpi/amd64/mpih-lshift.S (+77/-0)
grub-core/lib/libgcrypt/mpi/amd64/mpih-mul1.S (+65/-0)
grub-core/lib/libgcrypt/mpi/amd64/mpih-mul2.S (+107/-0)
grub-core/lib/libgcrypt/mpi/amd64/mpih-mul3.S (+66/-0)
grub-core/lib/libgcrypt/mpi/amd64/mpih-rshift.S (+80/-0)
grub-core/lib/libgcrypt/mpi/amd64/mpih-sub1.S (+61/-0)
grub-core/lib/libgcrypt/mpi/config.links (+360/-0)
grub-core/lib/libgcrypt/mpi/ec.c (+721/-0)
grub-core/lib/libgcrypt/mpi/generic/Manifest (+29/-0)
grub-core/lib/libgcrypt/mpi/generic/distfiles (+11/-0)
grub-core/lib/libgcrypt/mpi/generic/mpi-asm-defs.h (+10/-0)
grub-core/lib/libgcrypt/mpi/generic/mpih-add1.c (+65/-0)
grub-core/lib/libgcrypt/mpi/generic/mpih-lshift.c (+68/-0)
grub-core/lib/libgcrypt/mpi/generic/mpih-mul1.c (+62/-0)
grub-core/lib/libgcrypt/mpi/generic/mpih-mul2.c (+68/-0)
grub-core/lib/libgcrypt/mpi/generic/mpih-mul3.c (+68/-0)
grub-core/lib/libgcrypt/mpi/generic/mpih-rshift.c (+67/-0)
grub-core/lib/libgcrypt/mpi/generic/mpih-sub1.c (+66/-0)
grub-core/lib/libgcrypt/mpi/generic/udiv-w-sdiv.c (+133/-0)
grub-core/lib/libgcrypt/mpi/hppa/README (+84/-0)
grub-core/lib/libgcrypt/mpi/hppa/distfiles (+7/-0)
grub-core/lib/libgcrypt/mpi/hppa/mpih-add1.S (+70/-0)
grub-core/lib/libgcrypt/mpi/hppa/mpih-lshift.S (+77/-0)
grub-core/lib/libgcrypt/mpi/hppa/mpih-rshift.S (+73/-0)
grub-core/lib/libgcrypt/mpi/hppa/mpih-sub1.S (+78/-0)
grub-core/lib/libgcrypt/mpi/hppa/udiv-qrnnd.S (+297/-0)
grub-core/lib/libgcrypt/mpi/hppa1.1/distfiles (+5/-0)
grub-core/lib/libgcrypt/mpi/hppa1.1/mpih-mul1.S (+115/-0)
grub-core/lib/libgcrypt/mpi/hppa1.1/mpih-mul2.S (+117/-0)
grub-core/lib/libgcrypt/mpi/hppa1.1/mpih-mul3.S (+126/-0)
grub-core/lib/libgcrypt/mpi/hppa1.1/udiv-qrnnd.S (+92/-0)
grub-core/lib/libgcrypt/mpi/i386/Manifest (+28/-0)
grub-core/lib/libgcrypt/mpi/i386/distfiles (+10/-0)
grub-core/lib/libgcrypt/mpi/i386/mpih-add1.S (+116/-0)
grub-core/lib/libgcrypt/mpi/i386/mpih-lshift.S (+94/-0)
grub-core/lib/libgcrypt/mpi/i386/mpih-mul1.S (+84/-0)
grub-core/lib/libgcrypt/mpi/i386/mpih-mul2.S (+86/-0)
grub-core/lib/libgcrypt/mpi/i386/mpih-mul3.S (+86/-0)
grub-core/lib/libgcrypt/mpi/i386/mpih-rshift.S (+97/-0)
grub-core/lib/libgcrypt/mpi/i386/mpih-sub1.S (+117/-0)
grub-core/lib/libgcrypt/mpi/i386/syntax.h (+68/-0)
grub-core/lib/libgcrypt/mpi/i586/Manifest (+27/-0)
grub-core/lib/libgcrypt/mpi/i586/README (+26/-0)
grub-core/lib/libgcrypt/mpi/i586/distfiles (+10/-0)
grub-core/lib/libgcrypt/mpi/i586/mpih-add1.S (+135/-0)
grub-core/lib/libgcrypt/mpi/i586/mpih-lshift.S (+229/-0)
grub-core/lib/libgcrypt/mpi/i586/mpih-mul1.S (+89/-0)
grub-core/lib/libgcrypt/mpi/i586/mpih-mul2.S (+93/-0)
grub-core/lib/libgcrypt/mpi/i586/mpih-mul3.S (+93/-0)
grub-core/lib/libgcrypt/mpi/i586/mpih-rshift.S (+228/-0)
grub-core/lib/libgcrypt/mpi/i586/mpih-sub1.S (+142/-0)
grub-core/lib/libgcrypt/mpi/longlong.h (+1613/-0)
grub-core/lib/libgcrypt/mpi/m68k/Manifest (+25/-0)
grub-core/lib/libgcrypt/mpi/m68k/distfiles (+9/-0)
grub-core/lib/libgcrypt/mpi/m68k/mc68020/Manifest (+23/-0)
grub-core/lib/libgcrypt/mpi/m68k/mc68020/distfiles (+4/-0)
grub-core/lib/libgcrypt/mpi/m68k/mc68020/mpih-mul1.S (+104/-0)
grub-core/lib/libgcrypt/mpi/m68k/mc68020/mpih-mul2.S (+94/-0)
grub-core/lib/libgcrypt/mpi/m68k/mc68020/mpih-mul3.S (+97/-0)
grub-core/lib/libgcrypt/mpi/m68k/mpih-add1.S (+92/-0)
grub-core/lib/libgcrypt/mpi/m68k/mpih-lshift.S (+164/-0)
grub-core/lib/libgcrypt/mpi/m68k/mpih-rshift.S (+162/-0)
grub-core/lib/libgcrypt/mpi/m68k/mpih-sub1.S (+91/-0)
grub-core/lib/libgcrypt/mpi/m68k/syntax.h (+185/-0)
grub-core/lib/libgcrypt/mpi/mips3/Manifest (+28/-0)
grub-core/lib/libgcrypt/mpi/mips3/README (+23/-0)
grub-core/lib/libgcrypt/mpi/mips3/distfiles (+11/-0)
grub-core/lib/libgcrypt/mpi/mips3/mpi-asm-defs.h (+10/-0)
grub-core/lib/libgcrypt/mpi/mips3/mpih-add1.S (+124/-0)
grub-core/lib/libgcrypt/mpi/mips3/mpih-lshift.S (+97/-0)
grub-core/lib/libgcrypt/mpi/mips3/mpih-mul1.S (+89/-0)
grub-core/lib/libgcrypt/mpi/mips3/mpih-mul2.S (+101/-0)
grub-core/lib/libgcrypt/mpi/mips3/mpih-mul3.S (+101/-0)
grub-core/lib/libgcrypt/mpi/mips3/mpih-rshift.S (+95/-0)
grub-core/lib/libgcrypt/mpi/mips3/mpih-sub1.S (+125/-0)
grub-core/lib/libgcrypt/mpi/mpi-add.c (+235/-0)
grub-core/lib/libgcrypt/mpi/mpi-bit.c (+364/-0)
grub-core/lib/libgcrypt/mpi/mpi-cmp.c (+107/-0)
grub-core/lib/libgcrypt/mpi/mpi-div.c (+355/-0)
grub-core/lib/libgcrypt/mpi/mpi-gcd.c (+51/-0)
grub-core/lib/libgcrypt/mpi/mpi-inline.c (+35/-0)
grub-core/lib/libgcrypt/mpi/mpi-inline.h (+161/-0)
grub-core/lib/libgcrypt/mpi/mpi-internal.h (+277/-0)
grub-core/lib/libgcrypt/mpi/mpi-inv.c (+267/-0)
grub-core/lib/libgcrypt/mpi/mpi-mod.c (+184/-0)
grub-core/lib/libgcrypt/mpi/mpi-mpow.c (+223/-0)
grub-core/lib/libgcrypt/mpi/mpi-mul.c (+212/-0)
grub-core/lib/libgcrypt/mpi/mpi-pow.c (+338/-0)
grub-core/lib/libgcrypt/mpi/mpi-scan.c (+130/-0)
grub-core/lib/libgcrypt/mpi/mpicoder.c (+750/-0)
grub-core/lib/libgcrypt/mpi/mpih-div.c (+534/-0)
grub-core/lib/libgcrypt/mpi/mpih-mul.c (+528/-0)
grub-core/lib/libgcrypt/mpi/mpiutil.c (+460/-0)
grub-core/lib/libgcrypt/mpi/pa7100/Manifest (+22/-0)
grub-core/lib/libgcrypt/mpi/pa7100/distfiles (+4/-0)
grub-core/lib/libgcrypt/mpi/pa7100/mpih-lshift.S (+96/-0)
grub-core/lib/libgcrypt/mpi/pa7100/mpih-rshift.S (+92/-0)
grub-core/lib/libgcrypt/mpi/pentium4/README (+115/-0)
grub-core/lib/libgcrypt/mpi/pentium4/distfiles (+3/-0)
grub-core/lib/libgcrypt/mpi/pentium4/mmx/distfiles (+2/-0)
grub-core/lib/libgcrypt/mpi/pentium4/mmx/mpih-lshift.S (+457/-0)
grub-core/lib/libgcrypt/mpi/pentium4/mmx/mpih-rshift.S (+453/-0)
grub-core/lib/libgcrypt/mpi/pentium4/sse2/distfiles (+5/-0)
grub-core/lib/libgcrypt/mpi/pentium4/sse2/mpih-add1.S (+91/-0)
grub-core/lib/libgcrypt/mpi/pentium4/sse2/mpih-mul1.S (+96/-0)
grub-core/lib/libgcrypt/mpi/pentium4/sse2/mpih-mul2.S (+136/-0)
grub-core/lib/libgcrypt/mpi/pentium4/sse2/mpih-mul3.S (+127/-0)
grub-core/lib/libgcrypt/mpi/pentium4/sse2/mpih-sub1.S (+112/-0)
grub-core/lib/libgcrypt/mpi/power/Manifest (+27/-0)
grub-core/lib/libgcrypt/mpi/power/distfiles (+8/-0)
grub-core/lib/libgcrypt/mpi/power/mpih-add1.S (+87/-0)
grub-core/lib/libgcrypt/mpi/power/mpih-lshift.S (+64/-0)
grub-core/lib/libgcrypt/mpi/power/mpih-mul1.S (+115/-0)
grub-core/lib/libgcrypt/mpi/power/mpih-mul2.S (+130/-0)
grub-core/lib/libgcrypt/mpi/power/mpih-mul3.S (+135/-0)
grub-core/lib/libgcrypt/mpi/power/mpih-rshift.S (+64/-0)
grub-core/lib/libgcrypt/mpi/power/mpih-sub1.S (+88/-0)
grub-core/lib/libgcrypt/mpi/powerpc32/Manifest (+28/-0)
grub-core/lib/libgcrypt/mpi/powerpc32/distfiles (+10/-0)
grub-core/lib/libgcrypt/mpi/powerpc32/mpih-add1.S (+136/-0)
grub-core/lib/libgcrypt/mpi/powerpc32/mpih-lshift.S (+198/-0)
grub-core/lib/libgcrypt/mpi/powerpc32/mpih-mul1.S (+120/-0)
grub-core/lib/libgcrypt/mpi/powerpc32/mpih-mul2.S (+127/-0)
grub-core/lib/libgcrypt/mpi/powerpc32/mpih-mul3.S (+130/-0)
grub-core/lib/libgcrypt/mpi/powerpc32/mpih-rshift.S (+131/-0)
grub-core/lib/libgcrypt/mpi/powerpc32/mpih-sub1.S (+133/-0)
grub-core/lib/libgcrypt/mpi/powerpc32/syntax.h (+75/-0)
grub-core/lib/libgcrypt/mpi/sparc32/Manifest (+24/-0)
grub-core/lib/libgcrypt/mpi/sparc32/distfiles (+6/-0)
grub-core/lib/libgcrypt/mpi/sparc32/mpih-add1.S (+239/-0)
grub-core/lib/libgcrypt/mpi/sparc32/mpih-lshift.S (+97/-0)
grub-core/lib/libgcrypt/mpi/sparc32/mpih-rshift.S (+93/-0)
grub-core/lib/libgcrypt/mpi/sparc32/udiv.S (+195/-0)
grub-core/lib/libgcrypt/mpi/sparc32v8/Manifest (+23/-0)
grub-core/lib/libgcrypt/mpi/sparc32v8/distfiles (+5/-0)
grub-core/lib/libgcrypt/mpi/sparc32v8/mpih-mul1.S (+109/-0)
grub-core/lib/libgcrypt/mpi/sparc32v8/mpih-mul2.S (+132/-0)
grub-core/lib/libgcrypt/mpi/sparc32v8/mpih-mul3.S (+67/-0)
grub-core/lib/libgcrypt/mpi/supersparc/Manifest (+21/-0)
grub-core/lib/libgcrypt/mpi/supersparc/distfiles (+3/-0)
grub-core/lib/libgcrypt/mpi/supersparc/udiv.S (+118/-0)
grub-core/lib/libgcrypt/src/ChangeLog-2011 (+2335/-0)
grub-core/lib/libgcrypt/src/Makefile.am (+143/-0)
grub-core/lib/libgcrypt/src/Makefile.in (+1096/-0)
grub-core/lib/libgcrypt/src/Manifest (+58/-0)
grub-core/lib/libgcrypt/src/ath.c (+344/-0)
grub-core/lib/libgcrypt/src/ath.h (+147/-0)
grub-core/lib/libgcrypt/src/cipher-proto.h (+124/-0)
grub-core/lib/libgcrypt/src/cipher.h (+182/-0)
grub-core/lib/libgcrypt/src/dumpsexp.c (+766/-0)
grub-core/lib/libgcrypt/src/fips.c (+860/-0)
grub-core/lib/libgcrypt/src/g10lib.h (+302/-0)
grub-core/lib/libgcrypt/src/gcrypt-module.h (+240/-0)
grub-core/lib/libgcrypt/src/gcrypt.h.in (+1760/-0)
grub-core/lib/libgcrypt/src/gcryptrnd.c (+680/-0)
grub-core/lib/libgcrypt/src/getrandom.c (+326/-0)
grub-core/lib/libgcrypt/src/global.c (+1123/-0)
grub-core/lib/libgcrypt/src/hmac256.c (+793/-0)
grub-core/lib/libgcrypt/src/hmac256.h (+36/-0)
grub-core/lib/libgcrypt/src/hwfeatures.c (+192/-0)
grub-core/lib/libgcrypt/src/libgcrypt-config.in (+189/-0)
grub-core/lib/libgcrypt/src/libgcrypt.def (+239/-0)
grub-core/lib/libgcrypt/src/libgcrypt.m4 (+123/-0)
grub-core/lib/libgcrypt/src/libgcrypt.vers (+111/-0)
grub-core/lib/libgcrypt/src/misc.c (+298/-0)
grub-core/lib/libgcrypt/src/missing-string.c (+54/-0)
grub-core/lib/libgcrypt/src/module.c (+212/-0)
grub-core/lib/libgcrypt/src/mpi.h (+266/-0)
grub-core/lib/libgcrypt/src/secmem.c (+696/-0)
grub-core/lib/libgcrypt/src/secmem.h (+39/-0)
grub-core/lib/libgcrypt/src/sexp.c (+2045/-0)
grub-core/lib/libgcrypt/src/stdmem.c (+242/-0)
grub-core/lib/libgcrypt/src/stdmem.h (+32/-0)
grub-core/lib/libgcrypt/src/types.h (+128/-0)
grub-core/lib/libgcrypt/src/versioninfo.rc.in (+51/-0)
grub-core/lib/libgcrypt/src/visibility.c (+1486/-0)
grub-core/lib/libgcrypt/src/visibility.h (+807/-0)
grub-core/lib/libgcrypt_wrap/cipher_wrap.h (+77/-0)
grub-core/lib/libgcrypt_wrap/mem.c (+133/-0)
grub-core/lib/minilzo/lzoconf.h (+446/-0)
grub-core/lib/minilzo/lzodefs.h (+1852/-0)
grub-core/lib/minilzo/minilzo.c (+4562/-0)
grub-core/lib/minilzo/minilzo.h (+109/-0)
grub-core/lib/mips/arc/reboot.c (+35/-0)
grub-core/lib/mips/loongson/reboot.c (+64/-0)
grub-core/lib/mips/qemu_mips/reboot.c (+27/-0)
grub-core/lib/mips/relocator.c (+149/-0)
grub-core/lib/mips/relocator_asm.S (+61/-0)
grub-core/lib/mips/setjmp.S (+68/-0)
grub-core/lib/pbkdf2.c (+110/-0)
grub-core/lib/posix_wrap/assert.h (+33/-0)
grub-core/lib/posix_wrap/ctype.h (+108/-0)
grub-core/lib/posix_wrap/errno.h (+29/-0)
grub-core/lib/posix_wrap/inttypes.h (+1/-0)
grub-core/lib/posix_wrap/langinfo.h (+38/-0)
grub-core/lib/posix_wrap/limits.h (+35/-0)
grub-core/lib/posix_wrap/localcharset.h (+28/-0)
grub-core/lib/posix_wrap/locale.h (+3/-0)
grub-core/lib/posix_wrap/stdint.h (+1/-0)
grub-core/lib/posix_wrap/stdio.h (+43/-0)
grub-core/lib/posix_wrap/stdlib.h (+55/-0)
grub-core/lib/posix_wrap/string.h (+102/-0)
grub-core/lib/posix_wrap/sys/types.h (+65/-0)
grub-core/lib/posix_wrap/unistd.h (+1/-0)
grub-core/lib/posix_wrap/wchar.h (+119/-0)
grub-core/lib/posix_wrap/wctype.h (+110/-0)
grub-core/lib/powerpc/relocator.c (+142/-0)
grub-core/lib/powerpc/relocator_asm.S (+60/-0)
grub-core/lib/powerpc/setjmp.S (+89/-0)
grub-core/lib/priority_queue.c (+163/-0)
grub-core/lib/progress.c (+130/-0)
grub-core/lib/reed_solomon.c (+493/-0)
grub-core/lib/relocator.c (+1645/-0)
grub-core/lib/setjmp.S (+20/-0)
grub-core/lib/sparc64/setjmp.S (+54/-0)
grub-core/lib/syslinux_parse.c (+1501/-0)
grub-core/lib/uboot/datetime.c (+41/-0)
grub-core/lib/uboot/halt.c (+32/-0)
grub-core/lib/uboot/reboot.c (+31/-0)
grub-core/lib/x86_64/relocator_asm.S (+85/-0)
grub-core/lib/x86_64/setjmp.S (+68/-0)
grub-core/lib/x86_64/xen/relocator.S (+156/-0)
grub-core/lib/xen/datetime.c (+40/-0)
grub-core/lib/xen/halt.c (+32/-0)
grub-core/lib/xen/reboot.c (+32/-0)
grub-core/lib/xen/relocator.c (+125/-0)
grub-core/lib/xzembed/xz.h (+187/-0)
grub-core/lib/xzembed/xz_config.h (+152/-0)
grub-core/lib/xzembed/xz_dec_bcj.c (+578/-0)
grub-core/lib/xzembed/xz_dec_lzma2.c (+1184/-0)
grub-core/lib/xzembed/xz_dec_stream.c (+1036/-0)
grub-core/lib/xzembed/xz_lzma2.h (+236/-0)
grub-core/lib/xzembed/xz_private.h (+96/-0)
grub-core/lib/xzembed/xz_stream.h (+53/-0)
grub-core/loader/aout.c (+62/-0)
grub-core/loader/arm/linux.c (+529/-0)
grub-core/loader/arm64/linux.c (+487/-0)
grub-core/loader/efi/appleloader.c (+242/-0)
grub-core/loader/efi/chainloader.c (+417/-0)
grub-core/loader/i386/bsd.c (+2155/-0)
grub-core/loader/i386/bsd32.c (+6/-0)
grub-core/loader/i386/bsd64.c (+6/-0)
grub-core/loader/i386/bsdXX.c (+633/-0)
grub-core/loader/i386/bsd_pagetable.c (+92/-0)
grub-core/loader/i386/coreboot/chainloader.c (+516/-0)
grub-core/loader/i386/efi/linux.c (+393/-0)
grub-core/loader/i386/linux.c (+1194/-0)
grub-core/loader/i386/multiboot_mbi.c (+732/-0)
grub-core/loader/i386/pc/chainloader.c (+294/-0)
grub-core/loader/i386/pc/freedos.c (+190/-0)
grub-core/loader/i386/pc/linux.c (+485/-0)
grub-core/loader/i386/pc/ntldr.c (+162/-0)
grub-core/loader/i386/pc/plan9.c (+587/-0)
grub-core/loader/i386/pc/pxechainloader.c (+168/-0)
grub-core/loader/i386/pc/truecrypt.c (+233/-0)
grub-core/loader/i386/xen.c (+712/-0)
grub-core/loader/i386/xen_file.c (+96/-0)
grub-core/loader/i386/xen_file32.c (+7/-0)
grub-core/loader/i386/xen_file64.c (+7/-0)
grub-core/loader/i386/xen_fileXX.c (+346/-0)
grub-core/loader/i386/xnu.c (+1120/-0)
grub-core/loader/ia64/efi/linux.c (+643/-0)
grub-core/loader/linux.c (+294/-0)
grub-core/loader/lzss.c (+56/-0)
grub-core/loader/macho.c (+205/-0)
grub-core/loader/macho32.c (+22/-0)
grub-core/loader/macho64.c (+22/-0)
grub-core/loader/machoXX.c (+384/-0)
grub-core/loader/mips/linux.c (+503/-0)
grub-core/loader/multiboot.c (+408/-0)
grub-core/loader/multiboot_elfxx.c (+245/-0)
grub-core/loader/multiboot_mbi2.c (+1024/-0)
grub-core/loader/powerpc/ieee1275/linux.c (+392/-0)
grub-core/loader/sparc64/ieee1275/linux.c (+520/-0)
grub-core/loader/xnu.c (+1521/-0)
grub-core/loader/xnu_resume.c (+188/-0)
grub-core/mmap/efi/mmap.c (+301/-0)
grub-core/mmap/i386/mmap.c (+113/-0)
grub-core/mmap/i386/pc/mmap.c (+219/-0)
grub-core/mmap/i386/pc/mmap_helper.S (+163/-0)
grub-core/mmap/i386/uppermem.c (+94/-0)
grub-core/mmap/mips/uppermem.c (+72/-0)
grub-core/mmap/mmap.c (+551/-0)
grub-core/modinfo.sh.in (+36/-0)
grub-core/net/arp.c (+187/-0)
grub-core/net/bootp.c (+616/-0)
grub-core/net/dns.c (+772/-0)
grub-core/net/drivers/efi/efinet.c (+271/-0)
grub-core/net/drivers/emu/emunet.c (+116/-0)
grub-core/net/drivers/i386/pc/pxe.c (+420/-0)
grub-core/net/drivers/ieee1275/ofnet.c (+339/-0)
grub-core/net/drivers/uboot/ubootnet.c (+161/-0)
grub-core/net/ethernet.c (+134/-0)
grub-core/net/http.c (+562/-0)
grub-core/net/icmp.c (+122/-0)
grub-core/net/icmp6.c (+534/-0)
grub-core/net/ip.c (+716/-0)
grub-core/net/net.c (+1743/-0)
grub-core/net/netbuff.c (+113/-0)
grub-core/net/tcp.c (+998/-0)
grub-core/net/tftp.c (+490/-0)
grub-core/net/udp.c (+211/-0)
grub-core/normal/auth.c (+275/-0)
grub-core/normal/autofs.c (+157/-0)
grub-core/normal/charset.c (+1291/-0)
grub-core/normal/cmdline.c (+680/-0)
grub-core/normal/color.c (+145/-0)
grub-core/normal/completion.c (+527/-0)
grub-core/normal/context.c (+211/-0)
grub-core/normal/crypto.c (+163/-0)
grub-core/normal/datetime.c (+109/-0)
grub-core/normal/dyncmd.c (+210/-0)
grub-core/normal/main.c (+568/-0)
grub-core/normal/menu.c (+968/-0)
grub-core/normal/menu_entry.c (+1438/-0)
grub-core/normal/menu_text.c (+599/-0)
grub-core/normal/misc.c (+193/-0)
grub-core/normal/term.c (+1098/-0)
grub-core/osdep/apple/getroot.c (+109/-0)
grub-core/osdep/apple/hostdisk.c (+95/-0)
grub-core/osdep/aros/config.c (+94/-0)
grub-core/osdep/aros/getroot.c (+228/-0)
grub-core/osdep/aros/hostdisk.c (+609/-0)
grub-core/osdep/aros/relpath.c (+75/-0)
grub-core/osdep/basic/compress.c (+21/-0)
grub-core/osdep/basic/emunet.c (+50/-0)
grub-core/osdep/basic/getroot.c (+82/-0)
grub-core/osdep/basic/hostdisk.c (+58/-0)
grub-core/osdep/basic/init.c (+38/-0)
grub-core/osdep/basic/no_platform.c (+46/-0)
grub-core/osdep/basic/ofpath.c (+29/-0)
grub-core/osdep/basic/platform.c (+31/-0)
grub-core/osdep/basic/random.c (+43/-0)
grub-core/osdep/blocklist.c (+7/-0)
grub-core/osdep/bsd/getroot.c (+204/-0)
grub-core/osdep/bsd/hostdisk.c (+130/-0)
grub-core/osdep/compress.c (+5/-0)
grub-core/osdep/config.c (+7/-0)
grub-core/osdep/cputime.c (+5/-0)
grub-core/osdep/devmapper/getroot.c (+329/-0)
grub-core/osdep/devmapper/hostdisk.c (+225/-0)
grub-core/osdep/dl.c (+5/-0)
grub-core/osdep/emuconsole.c (+5/-0)
grub-core/osdep/emunet.c (+5/-0)
grub-core/osdep/exec.c (+3/-0)
grub-core/osdep/freebsd/getroot.c (+364/-0)
grub-core/osdep/freebsd/hostdisk.c (+130/-0)
grub-core/osdep/generic/blocklist.c (+134/-0)
grub-core/osdep/getroot.c (+22/-0)
grub-core/osdep/haiku/getroot.c (+105/-0)
grub-core/osdep/haiku/hostdisk.c (+69/-0)
grub-core/osdep/hostdisk.c (+22/-0)
grub-core/osdep/hurd/getroot.c (+247/-0)
grub-core/osdep/hurd/hostdisk.c (+146/-0)
grub-core/osdep/init.c (+5/-0)
grub-core/osdep/linux/blocklist.c (+133/-0)
grub-core/osdep/linux/emunet.c (+74/-0)
grub-core/osdep/linux/getroot.c (+1097/-0)
grub-core/osdep/linux/hostdisk.c (+459/-0)
grub-core/osdep/linux/ofpath.c (+561/-0)
grub-core/osdep/linux/platform.c (+174/-0)
grub-core/osdep/ofpath.c (+5/-0)
grub-core/osdep/password.c (+5/-0)
grub-core/osdep/platform.c (+9/-0)
grub-core/osdep/platform_unix.c (+3/-0)
grub-core/osdep/random.c (+10/-0)
grub-core/osdep/relpath.c (+7/-0)
grub-core/osdep/sleep.c (+5/-0)
grub-core/osdep/sun/getroot.c (+126/-0)
grub-core/osdep/sun/hostdisk.c (+73/-0)
grub-core/osdep/unix/compress.c (+41/-0)
grub-core/osdep/unix/config.c (+211/-0)
grub-core/osdep/unix/cputime.c (+15/-0)
grub-core/osdep/unix/dl.c (+61/-0)
grub-core/osdep/unix/emuconsole.c (+184/-0)
grub-core/osdep/unix/exec.c (+245/-0)
grub-core/osdep/unix/getroot.c (+774/-0)
grub-core/osdep/unix/hostdisk.c (+330/-0)
grub-core/osdep/unix/password.c (+68/-0)
grub-core/osdep/unix/platform.c (+235/-0)
grub-core/osdep/unix/random.c (+48/-0)
grub-core/osdep/unix/relpath.c (+148/-0)
grub-core/osdep/unix/sleep.c (+30/-0)
grub-core/osdep/windows/blocklist.c (+118/-0)
grub-core/osdep/windows/config.c (+57/-0)
grub-core/osdep/windows/cputime.c (+19/-0)
grub-core/osdep/windows/dl.c (+59/-0)
grub-core/osdep/windows/emuconsole.c (+308/-0)
grub-core/osdep/windows/getroot.c (+355/-0)
grub-core/osdep/windows/hostdisk.c (+668/-0)
grub-core/osdep/windows/init.c (+190/-0)
grub-core/osdep/windows/password.c (+51/-0)
grub-core/osdep/windows/platform.c (+430/-0)
grub-core/osdep/windows/random.c (+55/-0)
grub-core/osdep/windows/relpath.c (+96/-0)
grub-core/osdep/windows/sleep.c (+31/-0)
grub-core/partmap/acorn.c (+154/-0)
grub-core/partmap/amiga.c (+183/-0)
grub-core/partmap/apple.c (+199/-0)
grub-core/partmap/bsdlabel.c (+271/-0)
grub-core/partmap/dfly.c (+132/-0)
grub-core/partmap/dvh.c (+127/-0)
grub-core/partmap/gpt.c (+231/-0)
grub-core/partmap/msdos.c (+431/-0)
grub-core/partmap/plan.c (+120/-0)
grub-core/partmap/sun.c (+154/-0)
grub-core/partmap/sunpc.c (+151/-0)
grub-core/parttool/msdospart.c (+162/-0)
grub-core/script/argv.c (+153/-0)
grub-core/script/execute.c (+1150/-0)
grub-core/script/function.c (+113/-0)
grub-core/script/lexer.c (+341/-0)
grub-core/script/main.c (+98/-0)
grub-core/script/parser.y (+356/-0)
grub-core/script/script.c (+396/-0)
grub-core/script/yylex.l (+393/-0)
grub-core/term/arc/console.c (+209/-0)
grub-core/term/arc/serial.c (+147/-0)
grub-core/term/at_keyboard.c (+693/-0)
grub-core/term/efi/console.c (+303/-0)
grub-core/term/efi/serial.c (+192/-0)
grub-core/term/gfxterm.c (+1143/-0)
grub-core/term/gfxterm_background.c (+190/-0)
grub-core/term/i386/coreboot/cbmemc.c (+127/-0)
grub-core/term/i386/pc/console.c (+310/-0)
grub-core/term/i386/pc/mda_text.c (+13/-0)
grub-core/term/i386/pc/vga_text.c (+288/-0)
grub-core/term/ieee1275/console.c (+267/-0)
grub-core/term/ieee1275/escc.c (+319/-0)
grub-core/term/ieee1275/serial.c (+287/-0)
grub-core/term/morse.c (+133/-0)
grub-core/term/ns8250.c (+316/-0)
grub-core/term/serial.c (+456/-0)
grub-core/term/spkmodem.c (+141/-0)
grub-core/term/terminfo.c (+779/-0)
grub-core/term/tparm.c (+767/-0)
grub-core/term/uboot/console.c (+132/-0)
grub-core/term/usb_keyboard.c (+472/-0)
grub-core/term/xen/console.c (+122/-0)
grub-core/tests/boot/kbsd.init-i386.S (+107/-0)
grub-core/tests/boot/kbsd.init-x86_64.S (+94/-0)
grub-core/tests/boot/kbsd.spec.txt (+3/-0)
grub-core/tests/boot/kernel-8086.S (+50/-0)
grub-core/tests/boot/kernel-i386.S (+72/-0)
grub-core/tests/boot/kfreebsd-aout.cfg (+4/-0)
grub-core/tests/boot/kfreebsd.cfg (+8/-0)
grub-core/tests/boot/kfreebsd.init-i386.S (+109/-0)
grub-core/tests/boot/kfreebsd.init-x86_64.S (+90/-0)
grub-core/tests/boot/knetbsd.cfg (+5/-0)
grub-core/tests/boot/kopenbsd.cfg (+5/-0)
grub-core/tests/boot/kopenbsdlabel.txt (+3/-0)
grub-core/tests/boot/linux-ppc.cfg (+5/-0)
grub-core/tests/boot/linux.cfg (+5/-0)
grub-core/tests/boot/linux.init-i386.S (+61/-0)
grub-core/tests/boot/linux.init-mips.S (+61/-0)
grub-core/tests/boot/linux.init-ppc.S (+61/-0)
grub-core/tests/boot/linux.init-x86_64.S (+60/-0)
grub-core/tests/boot/linux16.cfg (+5/-0)
grub-core/tests/boot/multiboot.cfg (+4/-0)
grub-core/tests/boot/multiboot2.cfg (+4/-0)
grub-core/tests/boot/ntldr.cfg (+4/-0)
grub-core/tests/boot/pc-chainloader.cfg (+4/-0)
grub-core/tests/boot/qemu-shutdown-x86.S (+17/-0)
grub-core/tests/checksums.h (+465/-0)
grub-core/tests/cmdline_cat_test.c (+125/-0)
grub-core/tests/div_test.c (+124/-0)
grub-core/tests/example_functional_test.c (+38/-0)
grub-core/tests/fake_input.c (+75/-0)
grub-core/tests/gfxterm_menu.c (+180/-0)
grub-core/tests/legacy_password_test.c (+68/-0)
grub-core/tests/lib/functional_test.c (+91/-0)
grub-core/tests/lib/test.c (+239/-0)
grub-core/tests/pbkdf2_test.c (+97/-0)
grub-core/tests/setjmp_test.c (+77/-0)
grub-core/tests/signature_test.c (+170/-0)
grub-core/tests/signatures.h (+211/-0)
grub-core/tests/sleep_test.c (+45/-0)
grub-core/tests/test_blockarg.c (+55/-0)
grub-core/tests/video_checksum.c (+813/-0)
grub-core/tests/videotest_checksum.c (+80/-0)
grub-core/tests/xnu_uuid_test.c (+58/-0)
grub-core/unidata.c (+1538/-0)
grub-core/video/bitmap.c (+231/-0)
grub-core/video/bitmap_scale.c (+491/-0)
grub-core/video/bochs.c (+438/-0)
grub-core/video/capture.c (+139/-0)
grub-core/video/cirrus.c (+519/-0)
grub-core/video/colors.c (+333/-0)
grub-core/video/efi_gop.c (+626/-0)
grub-core/video/efi_uga.c (+359/-0)
grub-core/video/emu/sdl.c (+252/-0)
grub-core/video/fb/fbblit.c (+2216/-0)
grub-core/video/fb/fbfill.c (+208/-0)
grub-core/video/fb/fbutil.c (+151/-0)
grub-core/video/fb/video_fb.c (+1683/-0)
grub-core/video/i386/coreboot/cbfb.c (+190/-0)
grub-core/video/i386/pc/vbe.c (+1258/-0)
grub-core/video/i386/pc/vga.c (+404/-0)
grub-core/video/ieee1275.c (+369/-0)
grub-core/video/radeon_fuloong2e.c (+239/-0)
grub-core/video/radeon_yeeloong3a.c (+237/-0)
grub-core/video/readers/jpeg.c (+849/-0)
grub-core/video/readers/png.c (+1146/-0)
grub-core/video/readers/tga.c (+511/-0)
grub-core/video/sis315_init.c (+158/-0)
grub-core/video/sis315pro.c (+459/-0)
grub-core/video/sm712.c (+818/-0)
grub-core/video/sm712_init.c (+14/-0)
grub-core/video/video.c (+761/-0)
include/grub/acorn_filecore.h (+53/-0)
include/grub/acpi.h (+220/-0)
include/grub/aout.h (+128/-0)
include/grub/arc/arc.h (+284/-0)
include/grub/arc/console.h (+31/-0)
include/grub/archelp.h (+63/-0)
include/grub/arm/efi/loader.h (+26/-0)
include/grub/arm/efi/memory.h (+6/-0)
include/grub/arm/linux.h (+57/-0)
include/grub/arm/reloc.h (+46/-0)
include/grub/arm/setjmp.h (+27/-0)
include/grub/arm/system.h (+18/-0)
include/grub/arm/time.h (+29/-0)
include/grub/arm/types.h (+34/-0)
include/grub/arm/uboot/kernel.h (+32/-0)
include/grub/arm64/efi/memory.h (+6/-0)
include/grub/arm64/linux.h (+41/-0)
include/grub/arm64/reloc.h (+26/-0)
include/grub/arm64/setjmp.h (+27/-0)
include/grub/arm64/time.h (+29/-0)
include/grub/arm64/types.h (+34/-0)
include/grub/at_keyboard.h (+42/-0)
include/grub/ata.h (+225/-0)
include/grub/auth.h (+37/-0)
include/grub/autoefi.h (+64/-0)
include/grub/backtrace.h (+26/-0)
include/grub/bitmap.h (+87/-0)
include/grub/bitmap_scale.h (+85/-0)
include/grub/bsdlabel.h (+106/-0)
include/grub/btrfs.h (+71/-0)
include/grub/bufio.h (+28/-0)
include/grub/cache.h (+53/-0)
include/grub/cbfs_core.h (+178/-0)
include/grub/charset.h (+323/-0)
include/grub/cmos.h (+128/-0)
include/grub/color.h (+30/-0)
include/grub/command.h (+128/-0)
include/grub/crypto.h (+423/-0)
include/grub/cryptodisk.h (+158/-0)
include/grub/cs5536.h (+198/-0)
include/grub/datetime.h (+133/-0)
include/grub/decompressor.h (+34/-0)
include/grub/deflate.h (+30/-0)
include/grub/device.h (+43/-0)
include/grub/disk.h (+261/-0)
include/grub/diskfilter.h (+209/-0)
include/grub/dl.h (+288/-0)
include/grub/efi/api.h (+1634/-0)
include/grub/efi/console.h (+31/-0)
include/grub/efi/console_control.h (+57/-0)
include/grub/efi/disk.h (+33/-0)
include/grub/efi/edid.h (+54/-0)
include/grub/efi/efi.h (+103/-0)
include/grub/efi/graphics_output.h (+114/-0)
include/grub/efi/memory.h (+31/-0)
include/grub/efi/pci.h (+319/-0)
include/grub/efi/pe32.h (+320/-0)
include/grub/efi/uga_draw.h (+76/-0)
include/grub/efiemu/efiemu.h (+286/-0)
include/grub/efiemu/runtime.h (+37/-0)
include/grub/elf.h (+2530/-0)
include/grub/elfload.h (+82/-0)
include/grub/emu/config.h (+48/-0)
include/grub/emu/console.h (+28/-0)
include/grub/emu/exec.h (+42/-0)
include/grub/emu/getroot.h (+104/-0)
include/grub/emu/hostdisk.h (+98/-0)
include/grub/emu/hostfile.h (+68/-0)
include/grub/emu/misc.h (+79/-0)
include/grub/emu/net.h (+37/-0)
include/grub/env.h (+72/-0)
include/grub/env_private.h (+46/-0)
include/grub/err.h (+96/-0)
include/grub/exfat.h (+53/-0)
include/grub/extcmd.h (+79/-0)
include/grub/fat.h (+82/-0)
include/grub/fbblit.h (+36/-0)
include/grub/fbfill.h (+59/-0)
include/grub/fbutil.h (+59/-0)
include/grub/fdt.h (+120/-0)
include/grub/file.h (+167/-0)
include/grub/fileid.h (+29/-0)
include/grub/font.h (+153/-0)
include/grub/fontformat.h (+38/-0)
include/grub/fs.h (+131/-0)
include/grub/fshelp.h (+80/-0)
include/grub/gcry/types.h (+37/-0)
include/grub/gcrypt/g10lib.h (+302/-0)
include/grub/gcrypt/gcrypt.h (+1746/-0)
include/grub/gcrypt/gpg-error.h (+32/-0)
include/grub/gdb.h (+39/-0)
include/grub/gfxmenu_model.h (+1/-0)
include/grub/gfxmenu_view.h (+124/-0)
include/grub/gfxterm.h (+51/-0)
include/grub/gfxwidgets.h (+50/-0)
include/grub/gpt_partition.h (+87/-0)
include/grub/gui.h (+282/-0)
include/grub/gui_string_util.h (+33/-0)
include/grub/hfs.h (+72/-0)
include/grub/hfsplus.h (+253/-0)
include/grub/i18n.h (+68/-0)
include/grub/i386/at_keyboard.h (+25/-0)
include/grub/i386/bsd.h (+128/-0)
include/grub/i386/cmos.h (+30/-0)
include/grub/i386/coreboot/boot.h (+1/-0)
include/grub/i386/coreboot/console.h (+32/-0)
include/grub/i386/coreboot/lbio.h (+105/-0)
include/grub/i386/coreboot/memory.h (+54/-0)
include/grub/i386/coreboot/serial.h (+24/-0)
include/grub/i386/coreboot/time.h (+1/-0)
include/grub/i386/cpuid.h (+85/-0)
include/grub/i386/efi/memory.h (+6/-0)
include/grub/i386/efi/serial.h (+1/-0)
include/grub/i386/efiemu.h (+33/-0)
include/grub/i386/floppy.h (+36/-0)
include/grub/i386/freebsd_linker.h (+74/-0)
include/grub/i386/freebsd_reboot.h (+77/-0)
include/grub/i386/gdb.h (+78/-0)
include/grub/i386/ieee1275/ieee1275.h (+1/-0)
include/grub/i386/ieee1275/memory.h (+1/-0)
include/grub/i386/ieee1275/serial.h (+1/-0)
include/grub/i386/io.h (+72/-0)
include/grub/i386/linux.h (+316/-0)
include/grub/i386/macho.h (+32/-0)
include/grub/i386/memory.h (+66/-0)
include/grub/i386/memory_raw.h (+58/-0)
include/grub/i386/multiboot.h (+36/-0)
include/grub/i386/multiboot/boot.h (+1/-0)
include/grub/i386/multiboot/console.h (+1/-0)
include/grub/i386/multiboot/kernel.h (+1/-0)
include/grub/i386/multiboot/memory.h (+1/-0)
include/grub/i386/multiboot/serial.h (+1/-0)
include/grub/i386/multiboot/time.h (+1/-0)
include/grub/i386/netbsd_bootinfo.h (+149/-0)
include/grub/i386/netbsd_reboot.h (+81/-0)
include/grub/i386/openbsd_bootarg.h (+91/-0)
include/grub/i386/openbsd_reboot.h (+79/-0)
include/grub/i386/pc/apm.h (+48/-0)
include/grub/i386/pc/biosdisk.h (+109/-0)
include/grub/i386/pc/biosnum.h (+6/-0)
include/grub/i386/pc/boot.h (+73/-0)
include/grub/i386/pc/chainloader.h (+27/-0)
include/grub/i386/pc/console.h (+36/-0)
include/grub/i386/pc/int.h (+67/-0)
include/grub/i386/pc/kernel.h (+41/-0)
include/grub/i386/pc/memory.h (+63/-0)
include/grub/i386/pc/pxe.h (+292/-0)
include/grub/i386/pc/time.h (+24/-0)
include/grub/i386/pc/vbe.h (+232/-0)
include/grub/i386/pc/vesa_modes_table.h (+19/-0)
include/grub/i386/pci.h (+105/-0)
include/grub/i386/pit.h (+103/-0)
include/grub/i386/qemu/boot.h (+25/-0)
include/grub/i386/qemu/console.h (+1/-0)
include/grub/i386/qemu/kernel.h (+35/-0)
include/grub/i386/qemu/memory.h (+1/-0)
include/grub/i386/qemu/serial.h (+1/-0)
include/grub/i386/qemu/time.h (+1/-0)
include/grub/i386/reboot.h (+28/-0)
include/grub/i386/relocator.h (+79/-0)
include/grub/i386/relocator_private.h (+1/-0)
include/grub/i386/setjmp.h (+29/-0)
include/grub/i386/time.h (+29/-0)
include/grub/i386/tsc.h (+28/-0)
include/grub/i386/types.h (+33/-0)
include/grub/i386/xen/hypercall.h (+85/-0)
include/grub/i386/xnu.h (+148/-0)
include/grub/ia64/efi/memory.h (+6/-0)
include/grub/ia64/efi/time.h (+23/-0)
include/grub/ia64/kernel.h (+25/-0)
include/grub/ia64/reloc.h (+42/-0)
include/grub/ia64/setjmp.h (+28/-0)
include/grub/ia64/time.h (+28/-0)
include/grub/ia64/types.h (+32/-0)
include/grub/icon_manager.h (+41/-0)
include/grub/ieee1275/console.h (+34/-0)
include/grub/ieee1275/ieee1275.h (+243/-0)
include/grub/ieee1275/ofdisk.h (+28/-0)
include/grub/kernel.h (+128/-0)
include/grub/keyboard_layouts.h (+150/-0)
include/grub/legacy_parse.h (+32/-0)
include/grub/lib/LzFind.h (+130/-0)
include/grub/lib/LzHash.h (+77/-0)
include/grub/lib/LzmaDec.h (+246/-0)
include/grub/lib/LzmaEnc.h (+95/-0)
include/grub/lib/LzmaTypes.h (+151/-0)
include/grub/lib/arg.h (+79/-0)
include/grub/lib/cmdline.h (+31/-0)
include/grub/lib/crc.h (+25/-0)
include/grub/lib/envblk.h (+56/-0)
include/grub/lib/hexdump.h (+25/-0)
include/grub/libgcc.h (+97/-0)
include/grub/libpciaccess.h (+26/-0)
include/grub/libusb.h (+29/-0)
include/grub/linux.h (+24/-0)
include/grub/list.h (+87/-0)
include/grub/loader.h (+78/-0)
include/grub/lvm.h (+90/-0)
include/grub/macho.h (+166/-0)
include/grub/machoload.h (+88/-0)
include/grub/memory.h (+85/-0)
include/grub/menu.h (+106/-0)
include/grub/menu_viewer.h (+48/-0)
include/grub/mips/arc/kernel.h (+2/-0)
include/grub/mips/arc/memory.h (+46/-0)
include/grub/mips/at_keyboard.h (+1/-0)
include/grub/mips/cmos.h (+1/-0)
include/grub/mips/io.h (+62/-0)
include/grub/mips/kernel.h (+24/-0)
include/grub/mips/loongson.h (+86/-0)
include/grub/mips/loongson/at_keyboard.h (+27/-0)
include/grub/mips/loongson/cmos.h (+30/-0)
include/grub/mips/loongson/ec.h (+45/-0)
include/grub/mips/loongson/kernel.h (+36/-0)
include/grub/mips/loongson/memory.h (+51/-0)
include/grub/mips/loongson/pci.h (+110/-0)
include/grub/mips/loongson/serial.h (+33/-0)
include/grub/mips/loongson/time.h (+27/-0)
include/grub/mips/memory.h (+60/-0)
include/grub/mips/mips.h (+30/-0)
include/grub/mips/multiboot.h (+31/-0)
include/grub/mips/pci.h (+1/-0)
include/grub/mips/qemu_mips/at_keyboard.h (+25/-0)
include/grub/mips/qemu_mips/cmos.h (+30/-0)
include/grub/mips/qemu_mips/console.h (+25/-0)
include/grub/mips/qemu_mips/kernel.h (+30/-0)
include/grub/mips/qemu_mips/memory.h (+50/-0)
include/grub/mips/qemu_mips/serial.h (+24/-0)
include/grub/mips/qemu_mips/time.h (+25/-0)
include/grub/mips/relocator.h (+38/-0)
include/grub/mips/setjmp.h (+27/-0)
include/grub/mips/time.h (+37/-0)
include/grub/mips/types.h (+38/-0)
include/grub/misc.h (+544/-0)
include/grub/mm.h (+77/-0)
include/grub/mm_private.h (+64/-0)
include/grub/msdos_partition.h (+127/-0)
include/grub/multiboot.h (+103/-0)
include/grub/multiboot_loader.h (+28/-0)
include/grub/net.h (+536/-0)
include/grub/net/arp.h (+31/-0)
include/grub/net/ethernet.h (+41/-0)
include/grub/net/ip.h (+95/-0)
include/grub/net/netbuff.h (+30/-0)
include/grub/net/tcp.h (+85/-0)
include/grub/net/udp.h (+51/-0)
include/grub/normal.h (+177/-0)
include/grub/ns8250.h (+80/-0)
include/grub/ntfs.h (+198/-0)
include/grub/offsets.h (+159/-0)
include/grub/osdep/hostfile.h (+7/-0)
include/grub/osdep/hostfile_aros.h (+113/-0)
include/grub/osdep/hostfile_unix.h (+112/-0)
include/grub/osdep/hostfile_windows.h (+82/-0)
include/grub/parser.h (+96/-0)
include/grub/partition.h (+138/-0)
include/grub/parttool.h (+58/-0)
include/grub/pci.h (+172/-0)
include/grub/pciutils.h (+103/-0)
include/grub/powerpc/ieee1275/ieee1275.h (+28/-0)
include/grub/powerpc/kernel.h (+22/-0)
include/grub/powerpc/memory.h (+47/-0)
include/grub/powerpc/relocator.h (+37/-0)
include/grub/powerpc/setjmp.h (+27/-0)
include/grub/powerpc/time.h (+28/-0)
include/grub/powerpc/types.h (+32/-0)
include/grub/priority_queue.h (+44/-0)
include/grub/procfs.h (+50/-0)
include/grub/pubkey.h (+38/-0)
include/grub/reader.h (+29/-0)
include/grub/reed_solomon.h (+30/-0)
include/grub/relocator.h (+59/-0)
include/grub/relocator_private.h (+113/-0)
include/grub/script_sh.h (+413/-0)
include/grub/scsi.h (+111/-0)
include/grub/scsicmd.h (+206/-0)
include/grub/sdl.h (+24/-0)
include/grub/search.h (+29/-0)
include/grub/serial.h (+205/-0)
include/grub/setjmp.h (+42/-0)
include/grub/smbus.h (+70/-0)
include/grub/sparc64/ieee1275/boot.h (+63/-0)
include/grub/sparc64/ieee1275/ieee1275.h (+48/-0)
include/grub/sparc64/ieee1275/kernel.h (+31/-0)
include/grub/sparc64/setjmp.h (+29/-0)
include/grub/sparc64/time.h (+28/-0)
include/grub/sparc64/types.h (+32/-0)
include/grub/speaker.h (+47/-0)
include/grub/symbol.h (+72/-0)
include/grub/syslinux_parse.h (+37/-0)
include/grub/term.h (+464/-0)
include/grub/terminfo.h (+87/-0)
include/grub/test.h (+125/-0)
include/grub/time.h (+46/-0)
include/grub/tparm.h (+26/-0)
include/grub/trig.h (+44/-0)
include/grub/types.h (+325/-0)
include/grub/uboot/api_public.h (+181/-0)
include/grub/uboot/console.h (+29/-0)
include/grub/uboot/disk.h (+43/-0)
include/grub/uboot/image.h (+175/-0)
include/grub/uboot/uboot.h (+86/-0)
include/grub/udf.h (+30/-0)
include/grub/unicode.h (+360/-0)
include/grub/usb.h (+325/-0)
include/grub/usbdesc.h (+134/-0)
include/grub/usbserial.h (+39/-0)
include/grub/usbtrans.h (+155/-0)
include/grub/util/deviceiter.h (+14/-0)
include/grub/util/install.h (+259/-0)
include/grub/util/libnvpair.h (+38/-0)
include/grub/util/libzfs.h (+47/-0)
include/grub/util/misc.h (+52/-0)
include/grub/util/ofpath.h (+6/-0)
include/grub/util/resolve.h (+35/-0)
include/grub/util/windows.h (+33/-0)
include/grub/vga.h (+129/-0)
include/grub/vgaregs.h (+307/-0)
include/grub/video.h (+704/-0)
include/grub/video_fb.h (+151/-0)
include/grub/x86_64/at_keyboard.h (+1/-0)
include/grub/x86_64/efi/loader.h (+26/-0)
include/grub/x86_64/efi/memory.h (+10/-0)
include/grub/x86_64/efi/serial.h (+1/-0)
include/grub/x86_64/io.h (+19/-0)
include/grub/x86_64/linux.h (+19/-0)
include/grub/x86_64/macho.h (+1/-0)
include/grub/x86_64/memory.h (+1/-0)
include/grub/x86_64/multiboot.h (+1/-0)
include/grub/x86_64/pci.h (+19/-0)
include/grub/x86_64/relocator.h (+1/-0)
include/grub/x86_64/setjmp.h (+27/-0)
include/grub/x86_64/time.h (+29/-0)
include/grub/x86_64/types.h (+37/-0)
include/grub/x86_64/xen/hypercall.h (+36/-0)
include/grub/x86_64/xnu.h (+1/-0)
include/grub/xen.h (+93/-0)
include/grub/xen/relocator.h (+44/-0)
include/grub/xen_file.h (+54/-0)
include/grub/xnu.h (+119/-0)
include/grub/zfs/dmu.h (+164/-0)
include/grub/zfs/dmu_objset.h (+43/-0)
include/grub/zfs/dnode.h (+74/-0)
include/grub/zfs/dsl_dataset.h (+52/-0)
include/grub/zfs/dsl_dir.h (+50/-0)
include/grub/zfs/sa_impl.h (+37/-0)
include/grub/zfs/spa.h (+307/-0)
include/grub/zfs/uberblock_impl.h (+60/-0)
include/grub/zfs/vdev_impl.h (+69/-0)
include/grub/zfs/zap_impl.h (+109/-0)
include/grub/zfs/zap_leaf.h (+104/-0)
include/grub/zfs/zfs.h (+158/-0)
include/grub/zfs/zfs_acl.h (+59/-0)
include/grub/zfs/zfs_znode.h (+70/-0)
include/grub/zfs/zil.h (+56/-0)
include/grub/zfs/zio.h (+95/-0)
include/grub/zfs/zio_checksum.h (+33/-0)
include/multiboot.h (+274/-0)
include/multiboot2.h (+378/-0)
linguas.sh (+20/-0)
m4/00gnulib.m4 (+30/-0)
m4/alloca.m4 (+121/-0)
m4/argp.m4 (+61/-0)
m4/btowc.m4 (+116/-0)
m4/codeset.m4 (+23/-0)
m4/configmake.m4 (+50/-0)
m4/dirname.m4 (+19/-0)
m4/double-slash-root.m4 (+38/-0)
m4/eealloc.m4 (+31/-0)
m4/errno_h.m4 (+137/-0)
m4/error.m4 (+27/-0)
m4/exponentd.m4 (+116/-0)
m4/extensions.m4 (+138/-0)
m4/extern-inline.m4 (+65/-0)
m4/fcntl-o.m4 (+134/-0)
m4/float_h.m4 (+98/-0)
m4/fnmatch.m4 (+156/-0)
m4/getdelim.m4 (+88/-0)
m4/getline.m4 (+96/-0)
m4/getopt.m4 (+368/-0)
m4/gettext.m4 (+401/-0)
m4/glibc2.m4 (+31/-0)
m4/glibc21.m4 (+34/-0)
m4/gnulib-cache.m4 (+55/-0)
m4/gnulib-common.m4 (+377/-0)
m4/gnulib-comp.m4 (+756/-0)
m4/gnulib-tool.m4 (+57/-0)
m4/iconv.m4 (+268/-0)
m4/include_next.m4 (+270/-0)
m4/intdiv0.m4 (+87/-0)
m4/intl.m4 (+300/-0)
m4/intldir.m4 (+19/-0)
m4/intlmacosx.m4 (+56/-0)
m4/intmax.m4 (+36/-0)
m4/intmax_t.m4 (+67/-0)
m4/inttypes-pri.m4 (+42/-0)
m4/inttypes_h.m4 (+29/-0)
m4/langinfo_h.m4 (+105/-0)
m4/lcmessage.m4 (+35/-0)
m4/lib-ld.m4 (+119/-0)
m4/lib-link.m4 (+777/-0)
m4/lib-prefix.m4 (+224/-0)
m4/libunistring-base.m4 (+141/-0)
m4/localcharset.m4 (+17/-0)
m4/locale-fr.m4 (+250/-0)
m4/locale-ja.m4 (+136/-0)
m4/locale-zh.m4 (+130/-0)
m4/locale_h.m4 (+122/-0)
m4/localeconv.m4 (+22/-0)
m4/lock.m4 (+39/-0)
m4/longlong.m4 (+113/-0)
m4/malloc.m4 (+98/-0)
m4/math_h.m4 (+353/-0)
m4/mbrtowc.m4 (+572/-0)
m4/mbsinit.m4 (+51/-0)
m4/mbsrtowcs.m4 (+155/-0)
m4/mbstate_t.m4 (+41/-0)
m4/mbswidth.m4 (+46/-0)
m4/mbtowc.m4 (+19/-0)
m4/memchr.m4 (+88/-0)
m4/mempcpy.m4 (+26/-0)
m4/mmap-anon.m4 (+55/-0)
m4/msvc-inval.m4 (+19/-0)
m4/msvc-nothrow.m4 (+10/-0)
m4/multiarch.m4 (+62/-0)
m4/nl_langinfo.m4 (+50/-0)
m4/nls.m4 (+32/-0)
m4/nocrash.m4 (+130/-0)
m4/off_t.m4 (+18/-0)
m4/po.m4 (+452/-0)
m4/printf-posix.m4 (+48/-0)
m4/printf.m4 (+1570/-0)
m4/progtest.m4 (+91/-0)
m4/rawmemchr.m4 (+20/-0)
m4/realloc.m4 (+76/-0)
m4/regex.m4 (+261/-0)
m4/size_max.m4 (+79/-0)
m4/sleep.m4 (+62/-0)
m4/ssize_t.m4 (+23/-0)
m4/stdalign.m4 (+52/-0)
m4/stdbool.m4 (+100/-0)
m4/stddef_h.m4 (+47/-0)
m4/stdint.m4 (+484/-0)
m4/stdint_h.m4 (+27/-0)
m4/stdio_h.m4 (+194/-0)
m4/stdlib_h.m4 (+117/-0)
m4/strcase.m4 (+45/-0)
m4/strchrnul.m4 (+50/-0)
m4/strerror.m4 (+96/-0)
m4/string_h.m4 (+120/-0)
m4/strings_h.m4 (+52/-0)
m4/strndup.m4 (+55/-0)
m4/strnlen.m4 (+30/-0)
m4/sys_socket_h.m4 (+176/-0)
m4/sys_types_h.m4 (+24/-0)
m4/sysexits.m4 (+44/-0)
m4/threadlib.m4 (+371/-0)
m4/uintmax_t.m4 (+30/-0)
m4/unistd_h.m4 (+186/-0)
m4/vasnprintf.m4 (+291/-0)
m4/visibility.m4 (+77/-0)
m4/vsnprintf.m4 (+54/-0)
m4/warn-on-use.m4 (+47/-0)
m4/wchar_h.m4 (+225/-0)
m4/wchar_t.m4 (+24/-0)
m4/wcrtomb.m4 (+112/-0)
m4/wctype_h.m4 (+209/-0)
m4/wcwidth.m4 (+101/-0)
m4/wint_t.m4 (+32/-0)
m4/xsize.m4 (+12/-0)
po/LINGUAS (+1/-0)
po/Makefile.in.in (+469/-0)
po/Makevars (+41/-0)
po/POTFILES-shell.in (+18/-0)
po/POTFILES.in (+1262/-0)
po/README (+24/-0)
po/Rules-piglatin (+41/-0)
po/Rules-quot (+47/-0)
po/Rules-swiss (+7/-0)
po/Rules-translit (+16/-0)
po/Rules-windowsdir (+11/-0)
po/arabic.sed (+81/-0)
po/ast.po (+7329/-0)
po/boldquot.sed (+10/-0)
po/ca.po (+7169/-0)
po/cyrillic.sed (+28/-0)
po/da.po (+6903/-0)
po/de.po (+7735/-0)
po/de@hebrew.po (+7726/-0)
po/de_CH.po (+7735/-0)
po/en@arabic.po (+6781/-0)
po/en@boldquot.header (+25/-0)
po/en@cyrillic.po (+6780/-0)
po/en@greek.po (+6780/-0)
po/en@hebrew.po (+6781/-0)
po/en@piglatin.header (+4/-0)
po/en@piglatin.po (+6891/-0)
po/en@quot.header (+22/-0)
po/en@quot.po (+6755/-0)
po/eo.po (+6685/-0)
po/es.po (+7053/-0)
po/exclude.pot (+7175/-0)
po/fi.po (+7186/-0)
po/fr.po (+7099/-0)
po/gl.po (+6952/-0)
po/greek.sed (+30/-0)
po/grub.d.sed (+2/-0)
po/grub.pot (+6543/-0)
po/hebrew.sed (+89/-0)
po/hu.po (+6986/-0)
po/id.po (+7513/-0)
po/insert-header.sin (+23/-0)
po/it.po (+6945/-0)
po/ja.po (+6950/-0)
po/lt.po (+6668/-0)
po/nl.po (+7507/-0)
po/pa.po (+6632/-0)
po/piglatin.sed (+21/-0)
po/pl.po (+6931/-0)
po/pt_BR.po (+6962/-0)
po/quot.sed (+6/-0)
po/remove-potcdate.sin (+19/-0)
po/ru.po (+7442/-0)
po/sl.po (+7052/-0)
po/stamp-po (+1/-0)
po/sv.po (+7304/-0)
po/swiss.sed (+7/-0)
po/tr.po (+6659/-0)
po/uk.po (+7027/-0)
po/vi.po (+6916/-0)
po/zh_CN.po (+7502/-0)
po/zh_TW.po (+6919/-0)
stamp-h.in (+1/-0)
tests/ahci_test.in (+53/-0)
tests/btrfs_test.in (+24/-0)
tests/cdboot_test.in (+39/-0)
tests/cmp_unit_test.c (+226/-0)
tests/core_compress_test.in (+36/-0)
tests/cpio_test.in (+16/-0)
tests/date_unit_test.c (+76/-0)
tests/ehci_test.in (+51/-0)
tests/example_grub_script_test.in (+3/-0)
tests/example_scripted_test.in (+4/-0)
tests/example_unit_test.c (+38/-0)
tests/exfat_test.in (+18/-0)
tests/ext234_test.in (+31/-0)
tests/fat_test.in (+22/-0)
tests/fddboot_test.in (+51/-0)
tests/gettext_strings_test.in (+23/-0)
tests/grub_cmd_date.in (+29/-0)
tests/grub_cmd_echo.in (+41/-0)
tests/grub_cmd_regexp.in (+42/-0)
tests/grub_cmd_set_date.in (+35/-0)
tests/grub_cmd_sleep.in (+20/-0)
tests/grub_cmd_tr.in (+62/-0)
tests/grub_func_test.in (+23/-0)
tests/grub_script_blanklines.in (+15/-0)
tests/grub_script_blockarg.in (+41/-0)
tests/grub_script_break.in (+86/-0)
tests/grub_script_comments.in (+28/-0)
tests/grub_script_continue.in (+86/-0)
tests/grub_script_dollar.in (+6/-0)
tests/grub_script_echo1.in (+183/-0)
tests/grub_script_echo_keywords.in (+3/-0)
tests/grub_script_escape_comma.in (+18/-0)
tests/grub_script_eval.in (+6/-0)
tests/grub_script_expansion.in (+43/-0)
tests/grub_script_final_semicolon.in (+11/-0)
tests/grub_script_for1.in (+27/-0)
tests/grub_script_functions.in (+147/-0)
tests/grub_script_gettext.in (+69/-0)
tests/grub_script_if.in (+31/-0)
tests/grub_script_leading_whitespace.in (+4/-0)
tests/grub_script_no_commands.in (+21/-0)
tests/grub_script_not.in (+62/-0)
tests/grub_script_return.in (+134/-0)
tests/grub_script_setparams.in (+59/-0)
tests/grub_script_shift.in (+85/-0)
tests/grub_script_strcmp.in (+22/-0)
tests/grub_script_test.in (+15/-0)
tests/grub_script_vars1.in (+34/-0)
tests/grub_script_while1.in (+32/-0)
tests/gzcompress_test.in (+29/-0)
tests/hddboot_test.in (+40/-0)
tests/help_test.in (+16/-0)
tests/hfs_test.in (+23/-0)
tests/hfsplus_test.in (+20/-0)
tests/iso9660_test.in (+15/-0)
tests/jfs_test.in (+18/-0)
tests/lib/unit_test.c (+42/-0)
tests/lzocompress_test.in (+29/-0)
tests/minixfs_test.in (+25/-0)
tests/netboot_test.in (+45/-0)
tests/nilfs2_test.in (+18/-0)
tests/ntfs_test.in (+19/-0)
tests/ohci_test.in (+51/-0)
tests/partmap_test.in (+480/-0)
tests/pata_test.in (+55/-0)
tests/printf_unit_test.c (+71/-0)
tests/priority_queue_unit_test.cc (+105/-0)
tests/pseries_test.in (+37/-0)
tests/reiserfs_test.in (+20/-0)
tests/romfs_test.in (+10/-0)
tests/squashfs_test.in (+12/-0)
tests/tar_test.in (+10/-0)
tests/test_sha512sum.in (+36/-0)
tests/test_unset.in (+10/-0)
tests/udf_test.in (+19/-0)
tests/uhci_test.in (+51/-0)
tests/util/grub-fs-tester.in (+1427/-0)
tests/util/grub-shell-tester.in (+106/-0)
tests/util/grub-shell.in (+462/-0)
tests/xfs_test.in (+19/-0)
tests/xzcompress_test.in (+29/-0)
tests/zfs_test.in (+27/-0)
themes/starfield/COPYING.CC-BY-SA-3.0 (+65/-0)
themes/starfield/README (+36/-0)
themes/starfield/theme.txt (+79/-0)
unicode/ArabicShaping.txt (+378/-0)
unicode/BidiMirroring.txt (+597/-0)
unicode/COPYING (+9/-0)
unicode/UnicodeData.txt (+23697/-0)
util/bash-completion.d/Makefile.am (+13/-0)
util/bash-completion.d/Makefile.in (+1246/-0)
util/bash-completion.d/grub-completion.bash.in (+495/-0)
util/bin2h.c (+64/-0)
util/config.c (+121/-0)
util/deviceiter.c (+973/-0)
util/devicemap.c (+13/-0)
util/editenv.c (+65/-0)
util/garbage-gen.c (+67/-0)
util/getroot.c (+495/-0)
util/glue-efi.c (+143/-0)
util/grub-editenv.c (+298/-0)
util/grub-file.c (+106/-0)
util/grub-fstest.c (+776/-0)
util/grub-gen-asciih.c (+253/-0)
util/grub-gen-widthspec.c (+153/-0)
util/grub-glue-efi.c (+125/-0)
util/grub-install-common.c (+965/-0)
util/grub-install.c (+2011/-0)
util/grub-kbdcomp.in (+77/-0)
util/grub-macbless.c (+203/-0)
util/grub-macho2img.c (+120/-0)
util/grub-menulst2cfg.c (+135/-0)
util/grub-mkconfig.in (+302/-0)
util/grub-mkconfig_lib.in (+395/-0)
util/grub-mkdevicemap.c (+181/-0)
util/grub-mkfont.c (+1284/-0)
util/grub-mkimage.c (+308/-0)
util/grub-mkimagexx.c (+1661/-0)
util/grub-mklayout.c (+522/-0)
util/grub-mknetdir.c (+221/-0)
util/grub-mkpasswd-pbkdf2.c (+210/-0)
util/grub-mkrelpath.c (+105/-0)
util/grub-mkrescue.c (+876/-0)
util/grub-mkstandalone.c (+360/-0)
util/grub-mount.c (+619/-0)
util/grub-pe2elf.c (+575/-0)
util/grub-probe.c (+907/-0)
util/grub-reboot.in (+144/-0)
util/grub-render-label.c (+193/-0)
util/grub-script-check.c (+218/-0)
util/grub-set-default.in (+137/-0)
util/grub-setup.c (+333/-0)
util/grub-syslinux2cfg.c (+246/-0)
util/grub.d/00_header.in (+390/-0)
util/grub.d/10_hurd.in (+180/-0)
util/grub.d/10_illumos.in (+53/-0)
util/grub.d/10_kfreebsd.in (+241/-0)
util/grub.d/10_linux.in (+356/-0)
util/grub.d/10_netbsd.in (+186/-0)
util/grub.d/10_windows.in (+100/-0)
util/grub.d/10_xnu.in (+95/-0)
util/grub.d/20_linux_xen.in (+277/-0)
util/grub.d/30_os-prober.in (+371/-0)
util/grub.d/30_uefi-firmware.in (+46/-0)
util/grub.d/40_custom.in (+5/-0)
util/grub.d/41_custom.in (+9/-0)
util/grub.d/README (+11/-0)
util/i386/efi/grub-dumpdevtree (+22/-0)
util/ieee1275/grub-ofpathname.c (+54/-0)
util/import_gcry.py (+653/-0)
util/import_gcrypth.sed (+18/-0)
util/import_unicode.py (+193/-0)
util/misc.c (+271/-0)
util/mkimage.c (+1918/-0)
util/probe.c (+172/-0)
util/render-label.c (+215/-0)
util/resolve.c (+273/-0)
util/setup.c (+786/-0)
util/setup_bios.c (+2/-0)
util/setup_sparc.c (+2/-0)
util/spkmodem-recv.c (+115/-0)
Conflict adding file AUTHORS.  Moved existing file to AUTHORS.moved.
Conflict adding file BUGS.  Moved existing file to BUGS.moved.
Conflict adding file COPYING.  Moved existing file to COPYING.moved.
Conflict adding file ChangeLog.  Moved existing file to ChangeLog.moved.
Conflict adding file INSTALL.  Moved existing file to INSTALL.moved.
Conflict adding file Makefile.am.  Moved existing file to Makefile.am.moved.
Conflict adding file Makefile.in.  Moved existing file to Makefile.in.moved.
Conflict adding file NEWS.  Moved existing file to NEWS.moved.
Conflict adding file README.  Moved existing file to README.moved.
Conflict adding file THANKS.  Moved existing file to THANKS.moved.
Conflict adding file TODO.  Moved existing file to TODO.moved.
Conflict adding file acinclude.m4.  Moved existing file to acinclude.m4.moved.
Conflict adding file aclocal.m4.  Moved existing file to aclocal.m4.moved.
Conflict adding file config.h.in.  Moved existing file to config.h.in.moved.
Conflict adding file configure.ac.  Moved existing file to configure.ac.moved.
Conflict adding file configure.  Moved existing file to configure.moved.
Conflict adding file debian.  Moved existing file to debian.moved.
Conflict adding file docs.  Moved existing file to docs.moved.
Conflict adding file util.  Moved existing file to util.moved.
To merge this branch: bzr merge lp:~madengineer10/ubuntu/trusty/grub/linux-pref-substr
Reviewer Review Type Date Requested Status
Colin Watson Disapprove
Review via email: mp+232022@code.launchpad.net

Description of the change

Adds an option, GRUB_LINUX_PREF_VERSION_SUBSTR, that can be set to prioritize Linux kernels containing a given substring. This takes precedence over version ordering, so if you have 3.14.1-generic, 3.14.2-generic, 3.8.13-fnord1, and 3.8.13-fnord2 and the substring is 'fnord', the order is:
3.8.13-fnord2
3.8.13-fnord1
3.14.2-generic
3.14.1-generic

Rationale: I (and apparently a number of others, see e.g. http://askubuntu.com/questions/216398/set-older-kernel-as-default-grub-entry) found myself needing to change the Linux kernel version GRUB sets as default. The process is rather clunky and error-prone; you have to figure out where in the GRUB menu it will appear, then enter that in /etc/default/grub, and if the menu position changes due to new kernels added to the system you have to do it all over again. I had older kernels with a distinctive local version naming scheme that I wanted preferred over the stock kernels, but it could also be used to specify a particular kernel version.

Testing: Kernels that do not have the substring from GRUB_LINUX_PREF_VERSION_SUBSTR should be ordered below kernels that do. The group of kernels with the substring should be sorted by version, as should kernels without.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

Aside from the grub/grub2 thing (as per https://code.launchpad.net/~madengineer10/ubuntu/utopic/grub/linux-pref-substr/+merge/232023), we wouldn't do this sort of thing in stable updates until it's all sorted in utopic. Please drop this for now, let's get whatever we need to agreed and implemented in the development release, and only then consider an SRU.

review: Disapprove
Revision history for this message
Doug Brunner (madengineer10) wrote :

Sorry, I didn't know how backporting to current releases was done. I apologize for the inconvenience.

Unmerged revisions

191. By Doug Brunner

debian/patches/99-linux-pref-substr.patch: Add option to prefer Linux kernels containing substring

190. By Colin Watson

* Backport from upstream:
  - Tolerate devices with no filesystem UUID returned by os-prober
    (LP: #1287436).

189. By Colin Watson

[ Colin Watson ]
* Backport from upstream:
  - ieee1275: check for IBM pseries emulated machine.
  - Fix partmap, cryptodisk, and abstraction handling in grub-mkconfig
    (closes: #735935).
  - btrfs: fix get_root key comparison failures due to endianness.
* Build-depend on automake (>= 1.10.1) to ensure that it meets configure's
  requirements (LP: #1299041).
* When installing an image for use with UEFI Secure Boot, generate a
  load.cfg even if there are no device abstractions in use (LP: #1298399).

[ Jon Severinsson ]
* Add Tanglu support, as in Debian except:
  - Enable splash screen by default (as Ubuntu)
  - Enable quiet and quick boot (as Ubuntu)
  - Enable the grub-common init script (as Ubuntu)
  - Enable dynamic gfxpayload (as Ubuntu)
  - Enable vt handover (as Ubuntu)
  - Use monochromatic theme by default (as Ubuntu)
  - Use Tanglu GRUB wallpaper by default.

188. By Colin Watson

* Fix shift-held-down test not to clear other modifier key states
  (LP: #843804).
* Explicitly pass an appropriate --target to grub-install in the postinst
  (suggested by Jordan Uggla).
* Backport from upstream:
  - Use bootaa64.efi instead of bootaarch64.efi on arm64 to comply with
    EFI specification. Also use grubaa64.efi for consistency.

187. By Colin Watson

* Install bootinfo.txt and grub.chrp into grub-ieee1275-bin on powerpc and
  ppc64el.
* Port yaboot logic to improve installation for various powerpc machine
  types.
* Improve parsing of /etc/default/grub.d/*.cfg in C utilities
  (LP: #1273694).
* Run grub-install on install or upgrade on grub-ieee1275/ppc64el.

186. By Colin Watson

* Add a number of EFI debugging commands to the signed image (lsefi,
  lsefimmap, lsefisystab, lssal).
* Add gfxterm_background to the signed image so that background_image
  works in UEFI Secure Boot mode. Thanks to syscon-hh for the report.

185. By Colin Watson

* Remove redundant build-dependencies on autoconf and automake, covered by
  dh-autoreconf.
* In --enable-quick-boot mode, restore previous behaviour of using a
  hidden timeout if GRUB_HIDDEN_TIMEOUT=0 (thanks to Sebastien Bacher for
  the report).
* Disable cpio test on kFreeBSD again for now; it fails within cpio itself
  with "field width not sufficient for storing rdev minor".
* Copy shim.efi.signed to the correct path in UEFI Secure Boot mode.
  Thanks to syscon-hh for the report.

184. By Colin Watson

* Convert patch handling to git-dpm.
* Add bi-endian support to ELF parser (Tomohiro B Berry).
* Adjust restore_mkdevicemap.patch to mark get_kfreebsd_version as static,
  to appease "gcc -Werror=missing-prototypes".
* Cherry-pick from upstream:
  - Change grub-macbless' manual page section to 8.
* Install grub-glue-efi, grub-macbless, grub-render-label, and
  grub-syslinux2cfg.
* grub-shell: Pass -no-pad to xorriso when building floppy images.

183. By Colin Watson

* Backport from upstream:
  - On Linux, read partition start offsets from sysfs if possible
    (LP: #1237519).
  - Fix sector number when writing to non-512B disks (LP: #1253443).
* Regularise indentation of "recordfail" in /etc/grub.d/10_linux.

182. By Colin Watson

[ Robert Millan ]
* Backport from upstream:
  - Accept ZFS version 5000 (feature based).

[ Colin Watson ]
* Silence error message on initial installation when /etc/default/grub
  does not yet exist.
* Add GRUB_RECOVERY_TITLE option, to allow the controversial "recovery
  mode" text to be customised (LP: #1240360).
* Backport from upstream:
  - Revamp hidden timeout handling by adding a new timeout_style
    environment variable and a corresponding GRUB_TIMEOUT_STYLE
    configuration key for grub-mkconfig. This controls hidden-timeout
    handling more simply than the previous arrangements, and pressing any
    hotkeys associated with menu entries during the hidden timeout will
    now boot the corresponding menu entry immediately (LP: #1178618). As
    part of merging this, radically simplify the mess that
    quick_boot.patch had made of /etc/grub.d/30_os-prober; if it finds
    other OSes it can now just set timeout_style=menu and make sure the
    timeout is non-zero.
  - Fix build with FreeType 2.5.1.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory '.pc'
2=== added file '.pc/.quilt_patches'
3--- .pc/.quilt_patches 1970-01-01 00:00:00 +0000
4+++ .pc/.quilt_patches 2014-08-24 23:28:48 +0000
5@@ -0,0 +1,1 @@
6+debian/patches
7
8=== added file '.pc/.quilt_series'
9--- .pc/.quilt_series 1970-01-01 00:00:00 +0000
10+++ .pc/.quilt_series 2014-08-24 23:28:48 +0000
11@@ -0,0 +1,1 @@
12+series
13
14=== added file '.pc/.version'
15--- .pc/.version 1970-01-01 00:00:00 +0000
16+++ .pc/.version 2014-08-24 23:28:48 +0000
17@@ -0,0 +1,1 @@
18+2
19
20=== added file '.pc/applied-patches'
21--- .pc/applied-patches 1970-01-01 00:00:00 +0000
22+++ .pc/applied-patches 2014-08-24 23:28:48 +0000
23@@ -0,0 +1,51 @@
24+olpc_prefix_hack.patch
25+core_in_fs.patch
26+dpkg_version_comparison.patch
27+grub_legacy_0_based_partitions.patch
28+disable_floppies.patch
29+grub.cfg_400.patch
30+gfxpayload_keep_default.patch
31+install_stage2_confusion.patch
32+mkrescue_efi_modules.patch
33+mkconfig_loopback.patch
34+restore_mkdevicemap.patch
35+gettext_quiet.patch
36+mkconfig_mid_upgrade.patch
37+install_efi_fallback.patch
38+mkconfig_ubuntu_recovery.patch
39+install_locale_langpack.patch
40+mkconfig_nonexistent_loopback.patch
41+no_insmod_on_sb.patch
42+default_grub_d.patch
43+blacklist_1440x900x32.patch
44+uefi_firmware_setup.patch
45+mkconfig_ubuntu_distributor.patch
46+linuxefi.patch
47+linuxefi_amd64_only.patch
48+linuxefi_debug.patch
49+linuxefi_require_shim.patch
50+linuxefi_non_sb_fallback.patch
51+mkconfig_signed_kernel.patch
52+install_signed.patch
53+sleep_shift.patch
54+wubi_no_windows.patch
55+maybe_quiet.patch
56+install_efi_ubuntu_flavours.patch
57+quick_boot.patch
58+gfxpayload_dynamic.patch
59+vt_handoff.patch
60+probe_fusionio.patch
61+ignore_grub_func_test_failures.patch
62+mkconfig_recovery_title.patch
63+skip_gettext_strings_test.patch
64+elf_bi_endian.patch
65+macbless_mansection.patch
66+grub-shell-no-pad.patch
67+freebsd_debugflags_eperm.patch
68+install_powerpc_machtypes.patch
69+install_arm64_naming.patch
70+mkrescue_arm64_naming.patch
71+ieee1275-pseries-emulation.patch
72+probe-delimiter.patch
73+btrfs-endian.patch
74+tolerate-lvm-snapshots.patch
75
76=== added directory '.pc/blacklist_1440x900x32.patch'
77=== added directory '.pc/blacklist_1440x900x32.patch/grub-core'
78=== added directory '.pc/blacklist_1440x900x32.patch/grub-core/video'
79=== added directory '.pc/blacklist_1440x900x32.patch/grub-core/video/i386'
80=== added directory '.pc/blacklist_1440x900x32.patch/grub-core/video/i386/pc'
81=== added file '.pc/blacklist_1440x900x32.patch/grub-core/video/i386/pc/vbe.c'
82--- .pc/blacklist_1440x900x32.patch/grub-core/video/i386/pc/vbe.c 1970-01-01 00:00:00 +0000
83+++ .pc/blacklist_1440x900x32.patch/grub-core/video/i386/pc/vbe.c 2014-08-24 23:28:48 +0000
84@@ -0,0 +1,1249 @@
85+/*
86+ * GRUB -- GRand Unified Bootloader
87+ * Copyright (C) 2005,2006,2007,2008,2009 Free Software Foundation, Inc.
88+ *
89+ * GRUB is free software: you can redistribute it and/or modify
90+ * it under the terms of the GNU General Public License as published by
91+ * the Free Software Foundation, either version 3 of the License, or
92+ * (at your option) any later version.
93+ *
94+ * GRUB is distributed in the hope that it will be useful,
95+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
96+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
97+ * GNU General Public License for more details.
98+ *
99+ * You should have received a copy of the GNU General Public License
100+ * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
101+ */
102+
103+#define grub_video_render_target grub_video_fbrender_target
104+
105+#include <grub/err.h>
106+#include <grub/machine/memory.h>
107+#include <grub/i386/pc/vbe.h>
108+#include <grub/video_fb.h>
109+#include <grub/types.h>
110+#include <grub/dl.h>
111+#include <grub/misc.h>
112+#include <grub/mm.h>
113+#include <grub/video.h>
114+#include <grub/i386/pc/int.h>
115+#include <grub/i18n.h>
116+#include <grub/cpu/cpuid.h>
117+
118+GRUB_MOD_LICENSE ("GPLv3+");
119+
120+static int vbe_detected = -1;
121+
122+static struct grub_vbe_info_block controller_info;
123+
124+/* Track last mode to support cards which fail on get_mode. */
125+static grub_uint32_t last_set_mode = 3;
126+
127+static struct
128+{
129+ struct grub_video_mode_info mode_info;
130+
131+ grub_uint8_t *ptr;
132+ int mtrr;
133+} framebuffer;
134+
135+static grub_uint32_t initial_vbe_mode;
136+static grub_uint16_t *vbe_mode_list;
137+
138+static void *
139+real2pm (grub_vbe_farptr_t ptr)
140+{
141+ return (void *) ((((unsigned long) ptr & 0xFFFF0000) >> 12UL)
142+ + ((unsigned long) ptr & 0x0000FFFF));
143+}
144+
145+#define rdmsr(num,a,d) \
146+ asm volatile ("rdmsr" : "=a" (a), "=d" (d) : "c" (num))
147+
148+#define wrmsr(num,lo,hi) \
149+ asm volatile ("wrmsr" : : "c" (num), "a" (lo), "d" (hi) : "memory")
150+
151+#define mtrr_base(reg) (0x200 + (reg) * 2)
152+#define mtrr_mask(reg) (0x200 + (reg) * 2 + 1)
153+
154+/* Try to set up a variable-range write-combining MTRR for a memory region.
155+ This is best-effort; if it seems too hard, we just accept the performance
156+ degradation rather than risking undefined behaviour. It is intended
157+ exclusively to work around BIOS bugs, as the BIOS should already be
158+ setting up a suitable MTRR. */
159+static void
160+grub_vbe_enable_mtrr_entry (int mtrr)
161+{
162+ grub_uint32_t eax, edx;
163+ grub_uint32_t mask_lo, mask_hi;
164+
165+ rdmsr (mtrr_mask (mtrr), eax, edx);
166+ mask_lo = eax;
167+ mask_hi = edx;
168+
169+ mask_lo |= 0x800 /* valid */;
170+ wrmsr (mtrr_mask (mtrr), mask_lo, mask_hi);
171+}
172+
173+static void
174+grub_vbe_enable_mtrr (grub_uint8_t *base, grub_size_t size)
175+{
176+ grub_uint32_t eax, ebx, ecx, edx;
177+ grub_uint32_t features;
178+ grub_uint32_t mtrrcap;
179+ int var_mtrrs;
180+ grub_uint32_t max_extended_cpuid;
181+ grub_uint32_t maxphyaddr;
182+ grub_uint64_t fb_base, fb_size;
183+ grub_uint64_t size_bits, fb_mask;
184+ grub_uint32_t bits_lo, bits_hi;
185+ grub_uint64_t bits;
186+ int i, first_unused = -1;
187+ grub_uint32_t base_lo, base_hi, mask_lo, mask_hi;
188+
189+ fb_base = (grub_uint64_t) (grub_size_t) base;
190+ fb_size = (grub_uint64_t) size;
191+
192+ /* Check that fb_base and fb_size can be represented using a single
193+ MTRR. */
194+
195+ if (fb_base < (1 << 20))
196+ return; /* under 1MB, so covered by fixed-range MTRRs */
197+ if (fb_base >= (1LL << 36))
198+ return; /* over 36 bits, so out of range */
199+ if (fb_size < (1 << 12))
200+ return; /* variable-range MTRRs must cover at least 4KB */
201+
202+ size_bits = fb_size;
203+ while (size_bits > 1)
204+ size_bits >>= 1;
205+ if (size_bits != 1)
206+ return; /* not a power of two */
207+
208+ if (fb_base & (fb_size - 1))
209+ return; /* not aligned on size boundary */
210+
211+ fb_mask = ~(fb_size - 1);
212+
213+ /* Check CPU capabilities. */
214+
215+ if (! grub_cpu_is_cpuid_supported ())
216+ return;
217+
218+ grub_cpuid (1, eax, ebx, ecx, edx);
219+ features = edx;
220+ if (! (features & 0x00001000)) /* MTRR */
221+ return;
222+
223+ rdmsr (0xFE, eax, edx);
224+ mtrrcap = eax;
225+ if (! (mtrrcap & 0x00000400)) /* write-combining */
226+ return;
227+ var_mtrrs = (mtrrcap & 0xFF);
228+
229+ grub_cpuid (0x80000000, eax, ebx, ecx, edx);
230+ max_extended_cpuid = eax;
231+ if (max_extended_cpuid >= 0x80000008)
232+ {
233+ grub_cpuid (0x80000008, eax, ebx, ecx, edx);
234+ maxphyaddr = (eax & 0xFF);
235+ }
236+ else
237+ maxphyaddr = 36;
238+ bits_lo = 0xFFFFF000; /* assume maxphyaddr >= 36 */
239+ bits_hi = (1 << (maxphyaddr - 32)) - 1;
240+ bits = bits_lo | ((grub_uint64_t) bits_hi << 32);
241+
242+ /* Check whether an MTRR already covers this region. If not, take an
243+ unused one if possible. */
244+ for (i = 0; i < var_mtrrs; i++)
245+ {
246+ rdmsr (mtrr_mask (i), eax, edx);
247+ mask_lo = eax;
248+ mask_hi = edx;
249+ if (mask_lo & 0x800) /* valid */
250+ {
251+ grub_uint64_t real_base, real_mask;
252+
253+ rdmsr (mtrr_base (i), eax, edx);
254+ base_lo = eax;
255+ base_hi = edx;
256+
257+ real_base = ((grub_uint64_t) (base_hi & bits_hi) << 32) |
258+ (base_lo & bits_lo);
259+ real_mask = ((grub_uint64_t) (mask_hi & bits_hi) << 32) |
260+ (mask_lo & bits_lo);
261+ if (real_base < (fb_base + fb_size) &&
262+ real_base + (~real_mask & bits) >= fb_base)
263+ return; /* existing MTRR overlaps this region */
264+ }
265+ else if (first_unused < 0)
266+ first_unused = i;
267+ }
268+
269+ if (first_unused < 0)
270+ return; /* all MTRRs in use */
271+
272+ /* Set up the first unused MTRR we found. */
273+ rdmsr (mtrr_base (first_unused), eax, edx);
274+ base_lo = eax;
275+ base_hi = edx;
276+ rdmsr (mtrr_mask (first_unused), eax, edx);
277+ mask_lo = eax;
278+ mask_hi = edx;
279+
280+ base_lo = (base_lo & ~bits_lo & ~0xFF) |
281+ (fb_base & bits_lo) | 0x01 /* WC */;
282+ base_hi = (base_hi & ~bits_hi) | ((fb_base >> 32) & bits_hi);
283+ wrmsr (mtrr_base (first_unused), base_lo, base_hi);
284+ mask_lo = (mask_lo & ~bits_lo) | (fb_mask & bits_lo) | 0x800 /* valid */;
285+ mask_hi = (mask_hi & ~bits_hi) | ((fb_mask >> 32) & bits_hi);
286+ wrmsr (mtrr_mask (first_unused), mask_lo, mask_hi);
287+
288+ framebuffer.mtrr = first_unused;
289+}
290+
291+static void
292+grub_vbe_disable_mtrr (int mtrr)
293+{
294+ grub_uint32_t eax, edx;
295+ grub_uint32_t mask_lo, mask_hi;
296+
297+ rdmsr (mtrr_mask (mtrr), eax, edx);
298+ mask_lo = eax;
299+ mask_hi = edx;
300+
301+ mask_lo &= ~0x800 /* valid */;
302+ wrmsr (mtrr_mask (mtrr), mask_lo, mask_hi);
303+}
304+
305+/* Call VESA BIOS 0x4f09 to set palette data, return status. */
306+static grub_vbe_status_t
307+grub_vbe_bios_set_palette_data (grub_uint32_t color_count,
308+ grub_uint32_t start_index,
309+ struct grub_vbe_palette_data *palette_data)
310+{
311+ struct grub_bios_int_registers regs;
312+ regs.eax = 0x4f09;
313+ regs.ebx = 0;
314+ regs.ecx = color_count;
315+ regs.edx = start_index;
316+ regs.es = (((grub_addr_t) palette_data) & 0xffff0000) >> 4;
317+ regs.edi = ((grub_addr_t) palette_data) & 0xffff;
318+ regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT;
319+ grub_bios_interrupt (0x10, &regs);
320+ return regs.eax & 0xffff;
321+}
322+
323+/* Call VESA BIOS 0x4f00 to get VBE Controller Information, return status. */
324+grub_vbe_status_t
325+grub_vbe_bios_get_controller_info (struct grub_vbe_info_block *ci)
326+{
327+ struct grub_bios_int_registers regs;
328+ /* Store *controller_info to %es:%di. */
329+ regs.es = (((grub_addr_t) ci) & 0xffff0000) >> 4;
330+ regs.edi = ((grub_addr_t) ci) & 0xffff;
331+ regs.eax = 0x4f00;
332+ regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT;
333+ grub_bios_interrupt (0x10, &regs);
334+ return regs.eax & 0xffff;
335+}
336+
337+/* Call VESA BIOS 0x4f01 to get VBE Mode Information, return status. */
338+grub_vbe_status_t
339+grub_vbe_bios_get_mode_info (grub_uint32_t mode,
340+ struct grub_vbe_mode_info_block *mode_info)
341+{
342+ struct grub_bios_int_registers regs;
343+ regs.eax = 0x4f01;
344+ regs.ecx = mode;
345+ /* Store *mode_info to %es:%di. */
346+ regs.es = ((grub_addr_t) mode_info & 0xffff0000) >> 4;
347+ regs.edi = (grub_addr_t) mode_info & 0x0000ffff;
348+ regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT;
349+ grub_bios_interrupt (0x10, &regs);
350+ return regs.eax & 0xffff;
351+}
352+
353+/* Call VESA BIOS 0x4f02 to set video mode, return status. */
354+static grub_vbe_status_t
355+grub_vbe_bios_set_mode (grub_uint32_t mode,
356+ struct grub_vbe_crtc_info_block *crtc_info)
357+{
358+ struct grub_bios_int_registers regs;
359+
360+ regs.eax = 0x4f02;
361+ regs.ebx = mode;
362+ /* Store *crtc_info to %es:%di. */
363+ regs.es = (((grub_addr_t) crtc_info) & 0xffff0000) >> 4;
364+ regs.edi = ((grub_addr_t) crtc_info) & 0xffff;
365+ regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT;
366+ grub_bios_interrupt (0x10, &regs);
367+
368+ return regs.eax & 0xffff;
369+}
370+
371+/* Call VESA BIOS 0x4f03 to return current VBE Mode, return status. */
372+grub_vbe_status_t
373+grub_vbe_bios_get_mode (grub_uint32_t *mode)
374+{
375+ struct grub_bios_int_registers regs;
376+
377+ regs.eax = 0x4f03;
378+ regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT;
379+ grub_bios_interrupt (0x10, &regs);
380+ *mode = regs.ebx & 0xffff;
381+
382+ return regs.eax & 0xffff;
383+}
384+
385+grub_vbe_status_t
386+grub_vbe_bios_getset_dac_palette_width (int set, int *dac_mask_size)
387+{
388+ struct grub_bios_int_registers regs;
389+
390+ regs.eax = 0x4f08;
391+ regs.ebx = (*dac_mask_size & 0xff) >> 8;
392+ regs.ebx = set ? 1 : 0;
393+ regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT;
394+ grub_bios_interrupt (0x10, &regs);
395+ *dac_mask_size = (regs.ebx >> 8) & 0xff;
396+
397+ return regs.eax & 0xffff;
398+}
399+
400+/* Call VESA BIOS 0x4f05 to set memory window, return status. */
401+grub_vbe_status_t
402+grub_vbe_bios_set_memory_window (grub_uint32_t window,
403+ grub_uint32_t position)
404+{
405+ struct grub_bios_int_registers regs;
406+
407+ /* BL = window, BH = 0, Set memory window. */
408+ regs.ebx = window & 0x00ff;
409+ regs.edx = position;
410+ regs.eax = 0x4f05;
411+ regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT;
412+ grub_bios_interrupt (0x10, &regs);
413+ return regs.eax & 0xffff;
414+}
415+
416+/* Call VESA BIOS 0x4f05 to return memory window, return status. */
417+grub_vbe_status_t
418+grub_vbe_bios_get_memory_window (grub_uint32_t window,
419+ grub_uint32_t *position)
420+{
421+ struct grub_bios_int_registers regs;
422+
423+ regs.eax = 0x4f05;
424+ /* BH = 1, Get memory window. BL = window. */
425+ regs.ebx = (window & 0x00ff) | 0x100;
426+ regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT;
427+ grub_bios_interrupt (0x10, &regs);
428+
429+ *position = regs.edx & 0xffff;
430+ return regs.eax & 0xffff;
431+}
432+
433+/* Call VESA BIOS 0x4f06 to set scanline length (in bytes), return status. */
434+grub_vbe_status_t
435+grub_vbe_bios_set_scanline_length (grub_uint32_t length)
436+{
437+ struct grub_bios_int_registers regs;
438+
439+ regs.ecx = length;
440+ regs.eax = 0x4f06;
441+ /* BL = 2, Set Scan Line in Bytes. */
442+ regs.ebx = 0x0002;
443+ regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT;
444+ grub_bios_interrupt (0x10, &regs);
445+ return regs.eax & 0xffff;
446+}
447+
448+/* Call VESA BIOS 0x4f06 to return scanline length (in bytes), return status. */
449+grub_vbe_status_t
450+grub_vbe_bios_get_scanline_length (grub_uint32_t *length)
451+{
452+ struct grub_bios_int_registers regs;
453+
454+ regs.eax = 0x4f06;
455+ regs.ebx = 0x0001;
456+ regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT;
457+ /* BL = 1, Get Scan Line Length (in bytes). */
458+ grub_bios_interrupt (0x10, &regs);
459+
460+ *length = regs.ebx & 0xffff;
461+ return regs.eax & 0xffff;
462+}
463+
464+/* Call VESA BIOS 0x4f07 to set display start, return status. */
465+static grub_vbe_status_t
466+grub_vbe_bios_set_display_start (grub_uint32_t x, grub_uint32_t y)
467+{
468+ struct grub_bios_int_registers regs;
469+
470+ if (framebuffer.mtrr >= 0)
471+ grub_vbe_disable_mtrr (framebuffer.mtrr);
472+
473+ /* Store x in %ecx. */
474+ regs.ecx = x;
475+ regs.edx = y;
476+ regs.eax = 0x4f07;
477+ /* BL = 80h, Set Display Start during Vertical Retrace. */
478+ regs.ebx = 0x0080;
479+ regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT;
480+ grub_bios_interrupt (0x10, &regs);
481+
482+ if (framebuffer.mtrr >= 0)
483+ grub_vbe_enable_mtrr_entry (framebuffer.mtrr);
484+
485+ return regs.eax & 0xffff;
486+}
487+
488+/* Call VESA BIOS 0x4f07 to get display start, return status. */
489+grub_vbe_status_t
490+grub_vbe_bios_get_display_start (grub_uint32_t *x,
491+ grub_uint32_t *y)
492+{
493+ struct grub_bios_int_registers regs;
494+
495+ regs.eax = 0x4f07;
496+ /* BL = 1, Get Display Start. */
497+ regs.ebx = 0x0001;
498+ regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT;
499+ grub_bios_interrupt (0x10, &regs);
500+
501+ *x = regs.ecx & 0xffff;
502+ *y = regs.edx & 0xffff;
503+ return regs.eax & 0xffff;
504+}
505+
506+/* Call VESA BIOS 0x4f0a. */
507+grub_vbe_status_t
508+grub_vbe_bios_get_pm_interface (grub_uint16_t *segment, grub_uint16_t *offset,
509+ grub_uint16_t *length)
510+{
511+ struct grub_bios_int_registers regs;
512+
513+ regs.eax = 0x4f0a;
514+ regs.ebx = 0x0000;
515+ regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT;
516+ grub_bios_interrupt (0x10, &regs);
517+
518+ if ((regs.eax & 0xffff) != GRUB_VBE_STATUS_OK)
519+ {
520+ *segment = 0;
521+ *offset = 0;
522+ *length = 0;
523+ }
524+
525+ *segment = regs.es & 0xffff;
526+ *offset = regs.edi & 0xffff;
527+ *length = regs.ecx & 0xffff;
528+ return regs.eax & 0xffff;
529+}
530+
531+/* Call VESA BIOS 0x4f11 to get flat panel information, return status. */
532+static grub_vbe_status_t
533+grub_vbe_bios_get_flat_panel_info (struct grub_vbe_flat_panel_info *flat_panel_info)
534+{
535+ struct grub_bios_int_registers regs;
536+
537+ regs.eax = 0x4f11;
538+ regs.ebx = 0x0001;
539+ regs.es = (((grub_addr_t) flat_panel_info) & 0xffff0000) >> 4;
540+ regs.edi = ((grub_addr_t) flat_panel_info) & 0xffff;
541+ regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT;
542+ grub_bios_interrupt (0x10, &regs);
543+ return regs.eax & 0xffff;
544+}
545+
546+/* Call VESA BIOS 0x4f15 to get DDC availability, return status. */
547+static grub_vbe_status_t
548+grub_vbe_bios_get_ddc_capabilities (grub_uint8_t *level)
549+{
550+ struct grub_bios_int_registers regs;
551+
552+ regs.eax = 0x4f15;
553+ regs.ebx = 0x0000;
554+ regs.ecx = 0x0000;
555+ regs.es = 0x0000;
556+ regs.edi = 0x0000;
557+ regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT;
558+ grub_bios_interrupt (0x10, &regs);
559+
560+ *level = regs.ebx & 0xff;
561+ return regs.eax & 0xffff;
562+}
563+
564+/* Call VESA BIOS 0x4f15 to read EDID information, return status. */
565+static grub_vbe_status_t
566+grub_vbe_bios_read_edid (struct grub_video_edid_info *edid_info)
567+{
568+ struct grub_bios_int_registers regs;
569+
570+ regs.eax = 0x4f15;
571+ regs.ebx = 0x0001;
572+ regs.ecx = 0x0000;
573+ regs.edx = 0x0000;
574+ regs.es = (((grub_addr_t) edid_info) & 0xffff0000) >> 4;
575+ regs.edi = ((grub_addr_t) edid_info) & 0xffff;
576+ regs.flags = GRUB_CPU_INT_FLAGS_DEFAULT;
577+ grub_bios_interrupt (0x10, &regs);
578+ return regs.eax & 0xffff;
579+}
580+
581+grub_err_t
582+grub_vbe_probe (struct grub_vbe_info_block *info_block)
583+{
584+ struct grub_vbe_info_block *vbe_ib;
585+ grub_vbe_status_t status;
586+
587+ /* Clear caller's controller info block. */
588+ if (info_block)
589+ grub_memset (info_block, 0, sizeof (*info_block));
590+
591+ /* Do not probe more than one time, if not necessary. */
592+ if (vbe_detected == -1 || info_block)
593+ {
594+ /* Clear old copy of controller info block. */
595+ grub_memset (&controller_info, 0, sizeof (controller_info));
596+
597+ /* Mark VESA BIOS extension as undetected. */
598+ vbe_detected = 0;
599+
600+ /* Use low memory scratch area as temporary storage
601+ for VESA BIOS call. */
602+ vbe_ib = (struct grub_vbe_info_block *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR;
603+
604+ /* Prepare info block. */
605+ grub_memset (vbe_ib, 0, sizeof (*vbe_ib));
606+
607+ vbe_ib->signature[0] = 'V';
608+ vbe_ib->signature[1] = 'B';
609+ vbe_ib->signature[2] = 'E';
610+ vbe_ib->signature[3] = '2';
611+
612+ /* Try to get controller info block. */
613+ status = grub_vbe_bios_get_controller_info (vbe_ib);
614+ if (status == GRUB_VBE_STATUS_OK)
615+ {
616+ /* Copy it for later usage. */
617+ grub_memcpy (&controller_info, vbe_ib, sizeof (controller_info));
618+
619+ /* Mark VESA BIOS extension as detected. */
620+ vbe_detected = 1;
621+ }
622+ }
623+
624+ if (! vbe_detected)
625+ return grub_error (GRUB_ERR_BAD_DEVICE, "VESA BIOS Extension not found");
626+
627+ /* Make copy of controller info block to caller. */
628+ if (info_block)
629+ grub_memcpy (info_block, &controller_info, sizeof (*info_block));
630+
631+ return GRUB_ERR_NONE;
632+}
633+
634+static grub_err_t
635+grub_video_vbe_get_edid (struct grub_video_edid_info *edid_info)
636+{
637+ struct grub_video_edid_info *edid_info_lowmem;
638+
639+ /* Use low memory scratch area as temporary storage for VESA BIOS calls. */
640+ edid_info_lowmem =
641+ (struct grub_video_edid_info *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR;
642+ grub_memset (edid_info_lowmem, 0, sizeof (*edid_info_lowmem));
643+
644+ if (grub_vbe_bios_read_edid (edid_info_lowmem) != GRUB_VBE_STATUS_OK)
645+ return grub_error (GRUB_ERR_BAD_DEVICE, "EDID information not available");
646+
647+ grub_memcpy (edid_info, edid_info_lowmem, sizeof (*edid_info));
648+
649+ return GRUB_ERR_NONE;
650+}
651+
652+static grub_err_t
653+grub_vbe_get_preferred_mode (unsigned int *width, unsigned int *height)
654+{
655+ grub_vbe_status_t status;
656+ grub_uint8_t ddc_level;
657+ struct grub_video_edid_info edid_info;
658+ struct grub_vbe_flat_panel_info *flat_panel_info;
659+
660+ /* Use low memory scratch area as temporary storage for VESA BIOS calls. */
661+ flat_panel_info = (struct grub_vbe_flat_panel_info *)
662+ (GRUB_MEMORY_MACHINE_SCRATCH_ADDR + sizeof (struct grub_video_edid_info));
663+
664+ if (controller_info.version >= 0x200
665+ && (grub_vbe_bios_get_ddc_capabilities (&ddc_level) & 0xff)
666+ == GRUB_VBE_STATUS_OK)
667+ {
668+ if (grub_video_vbe_get_edid (&edid_info) == GRUB_ERR_NONE
669+ && grub_video_edid_checksum (&edid_info) == GRUB_ERR_NONE
670+ && grub_video_edid_preferred_mode (&edid_info, width, height)
671+ == GRUB_ERR_NONE && *width < 4096 && *height < 4096)
672+ return GRUB_ERR_NONE;
673+
674+ grub_errno = GRUB_ERR_NONE;
675+ }
676+
677+ grub_memset (flat_panel_info, 0, sizeof (*flat_panel_info));
678+ status = grub_vbe_bios_get_flat_panel_info (flat_panel_info);
679+ if (status == GRUB_VBE_STATUS_OK
680+ && flat_panel_info->horizontal_size && flat_panel_info->vertical_size
681+ && flat_panel_info->horizontal_size < 4096
682+ && flat_panel_info->vertical_size < 4096)
683+ {
684+ *width = flat_panel_info->horizontal_size;
685+ *height = flat_panel_info->vertical_size;
686+ return GRUB_ERR_NONE;
687+ }
688+
689+ return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "cannot get preferred mode");
690+}
691+
692+static grub_err_t
693+grub_vbe_set_video_mode (grub_uint32_t vbe_mode,
694+ struct grub_vbe_mode_info_block *vbe_mode_info)
695+{
696+ grub_vbe_status_t status;
697+ grub_uint32_t old_vbe_mode;
698+ struct grub_vbe_mode_info_block new_vbe_mode_info;
699+ grub_err_t err;
700+
701+ /* Make sure that VBE is supported. */
702+ grub_vbe_probe (0);
703+ if (grub_errno != GRUB_ERR_NONE)
704+ return grub_errno;
705+
706+ /* Try to get mode info. */
707+ grub_vbe_get_video_mode_info (vbe_mode, &new_vbe_mode_info);
708+ if (grub_errno != GRUB_ERR_NONE)
709+ return grub_errno;
710+
711+ /* For all VESA BIOS modes, force linear frame buffer. */
712+ if (vbe_mode >= 0x100)
713+ {
714+ /* We only want linear frame buffer modes. */
715+ vbe_mode |= 1 << 14;
716+
717+ /* Determine frame buffer pixel format. */
718+ if (new_vbe_mode_info.memory_model != GRUB_VBE_MEMORY_MODEL_PACKED_PIXEL
719+ && new_vbe_mode_info.memory_model
720+ != GRUB_VBE_MEMORY_MODEL_DIRECT_COLOR)
721+ return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
722+ "unsupported pixel format 0x%x",
723+ new_vbe_mode_info.memory_model);
724+ }
725+
726+ /* Get current mode. */
727+ grub_vbe_get_video_mode (&old_vbe_mode);
728+ if (grub_errno != GRUB_ERR_NONE)
729+ return grub_errno;
730+
731+ /* Try to set video mode. */
732+ status = grub_vbe_bios_set_mode (vbe_mode, 0);
733+ if (status != GRUB_VBE_STATUS_OK)
734+ return grub_error (GRUB_ERR_BAD_DEVICE, "cannot set VBE mode %x", vbe_mode);
735+ last_set_mode = vbe_mode;
736+
737+ if (vbe_mode < 0x100)
738+ {
739+ /* If this is not a VESA mode, guess address. */
740+ framebuffer.ptr = (grub_uint8_t *) 0xa0000;
741+ }
742+ else
743+ {
744+ framebuffer.ptr = (grub_uint8_t *) new_vbe_mode_info.phys_base_addr;
745+ }
746+
747+ /* Check whether mode is text mode or graphics mode. */
748+ if (new_vbe_mode_info.memory_model == GRUB_VBE_MEMORY_MODEL_TEXT)
749+ {
750+ /* Text mode. */
751+
752+ /* No special action needed for text mode as it is not supported for
753+ graphical support. */
754+ }
755+ else
756+ {
757+ /* Graphics mode. */
758+
759+ /* If video mode is in indexed color, setup default VGA palette. */
760+ if (vbe_mode < 0x100 || new_vbe_mode_info.memory_model
761+ == GRUB_VBE_MEMORY_MODEL_PACKED_PIXEL)
762+ {
763+ struct grub_vbe_palette_data *palette
764+ = (struct grub_vbe_palette_data *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR;
765+ unsigned i;
766+
767+ /* Make sure that the BIOS can reach the palette. */
768+ for (i = 0; i < GRUB_VIDEO_FBSTD_NUMCOLORS; i++)
769+ {
770+ palette[i].red = grub_video_fbstd_colors[i].r;
771+ palette[i].green = grub_video_fbstd_colors[i].g;
772+ palette[i].blue = grub_video_fbstd_colors[i].b;
773+ palette[i].alignment = 0;
774+ }
775+
776+ status = grub_vbe_bios_set_palette_data (GRUB_VIDEO_FBSTD_NUMCOLORS,
777+ 0, palette);
778+
779+ /* Just ignore the status. */
780+ err = grub_video_fb_set_palette (0, GRUB_VIDEO_FBSTD_NUMCOLORS,
781+ grub_video_fbstd_colors);
782+ if (err)
783+ return err;
784+
785+ }
786+ }
787+
788+ /* Copy mode info for caller. */
789+ if (vbe_mode_info)
790+ grub_memcpy (vbe_mode_info, &new_vbe_mode_info, sizeof (*vbe_mode_info));
791+
792+ return GRUB_ERR_NONE;
793+}
794+
795+grub_err_t
796+grub_vbe_get_video_mode (grub_uint32_t *mode)
797+{
798+ grub_vbe_status_t status;
799+
800+ /* Make sure that VBE is supported. */
801+ grub_vbe_probe (0);
802+ if (grub_errno != GRUB_ERR_NONE)
803+ return grub_errno;
804+
805+ /* Try to query current mode from VESA BIOS. */
806+ status = grub_vbe_bios_get_mode (mode);
807+ /* XXX: ATI cards don't support get_mode. */
808+ if (status != GRUB_VBE_STATUS_OK)
809+ *mode = last_set_mode;
810+
811+ return GRUB_ERR_NONE;
812+}
813+
814+grub_err_t
815+grub_vbe_get_video_mode_info (grub_uint32_t mode,
816+ struct grub_vbe_mode_info_block *mode_info)
817+{
818+ struct grub_vbe_mode_info_block *mi_tmp
819+ = (struct grub_vbe_mode_info_block *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR;
820+ grub_vbe_status_t status;
821+
822+ /* Make sure that VBE is supported. */
823+ grub_vbe_probe (0);
824+ if (grub_errno != GRUB_ERR_NONE)
825+ return grub_errno;
826+
827+ /* If mode is not VESA mode, skip mode info query. */
828+ if (mode >= 0x100)
829+ {
830+ /* Try to get mode info from VESA BIOS. */
831+ status = grub_vbe_bios_get_mode_info (mode, mi_tmp);
832+ if (status != GRUB_VBE_STATUS_OK)
833+ return grub_error (GRUB_ERR_BAD_DEVICE,
834+ "cannot get information on the mode %x", mode);
835+
836+ /* Make copy of mode info block. */
837+ grub_memcpy (mode_info, mi_tmp, sizeof (*mode_info));
838+ }
839+ else
840+ /* Just clear mode info block if it isn't a VESA mode. */
841+ grub_memset (mode_info, 0, sizeof (*mode_info));
842+
843+ return GRUB_ERR_NONE;
844+}
845+
846+static grub_err_t
847+grub_video_vbe_init (void)
848+{
849+ grub_uint16_t *rm_vbe_mode_list;
850+ grub_uint16_t *p;
851+ grub_size_t vbe_mode_list_size;
852+ struct grub_vbe_info_block info_block;
853+
854+ /* Check if there is adapter present.
855+
856+ Firmware note: There has been a report that some cards store video mode
857+ list in temporary memory. So we must first use vbe probe to get
858+ refreshed information to receive valid pointers and data, and then
859+ copy this information to somewhere safe. */
860+ grub_vbe_probe (&info_block);
861+ if (grub_errno != GRUB_ERR_NONE)
862+ return grub_errno;
863+
864+ /* Copy modelist to local memory. */
865+ p = rm_vbe_mode_list = real2pm (info_block.video_mode_ptr);
866+ while(*p++ != 0xFFFF)
867+ ;
868+
869+ vbe_mode_list_size = (grub_addr_t) p - (grub_addr_t) rm_vbe_mode_list;
870+ vbe_mode_list = grub_malloc (vbe_mode_list_size);
871+ if (! vbe_mode_list)
872+ return grub_errno;
873+ grub_memcpy (vbe_mode_list, rm_vbe_mode_list, vbe_mode_list_size);
874+
875+ /* Adapter could be found, figure out initial video mode. */
876+ grub_vbe_get_video_mode (&initial_vbe_mode);
877+ if (grub_errno != GRUB_ERR_NONE)
878+ {
879+ /* Free allocated resources. */
880+ grub_free (vbe_mode_list);
881+ vbe_mode_list = NULL;
882+
883+ return grub_errno;
884+ }
885+
886+ /* Reset frame buffer. */
887+ grub_memset (&framebuffer, 0, sizeof(framebuffer));
888+ framebuffer.mtrr = -1;
889+
890+ return grub_video_fb_init ();
891+}
892+
893+static grub_err_t
894+grub_video_vbe_fini (void)
895+{
896+ grub_vbe_status_t status;
897+ grub_err_t err;
898+
899+ /* Restore old video mode. */
900+ if (last_set_mode != initial_vbe_mode)
901+ {
902+ status = grub_vbe_bios_set_mode (initial_vbe_mode, 0);
903+ if (status != GRUB_VBE_STATUS_OK)
904+ /* TODO: Decide, is this something we want to do. */
905+ return grub_errno;
906+ }
907+ last_set_mode = initial_vbe_mode;
908+
909+ /* TODO: Free any resources allocated by driver. */
910+ grub_free (vbe_mode_list);
911+ vbe_mode_list = NULL;
912+
913+ err = grub_video_fb_fini ();
914+ if (framebuffer.mtrr >= 0)
915+ {
916+ grub_vbe_disable_mtrr (framebuffer.mtrr);
917+ framebuffer.mtrr = -1;
918+ }
919+ return err;
920+}
921+
922+/*
923+ Set framebuffer render target page and display the proper page, based on
924+ `doublebuf_state.render_page' and `doublebuf_state.displayed_page',
925+ respectively.
926+*/
927+static grub_err_t
928+doublebuf_pageflipping_set_page (int page)
929+{
930+ /* Tell the video adapter to display the new front page. */
931+ int display_start_line
932+ = framebuffer.mode_info.height * page;
933+
934+ grub_vbe_status_t vbe_err =
935+ grub_vbe_bios_set_display_start (0, display_start_line);
936+
937+ if (vbe_err != GRUB_VBE_STATUS_OK)
938+ return grub_error (GRUB_ERR_IO, "couldn't commit pageflip");
939+
940+ return 0;
941+}
942+
943+static void
944+vbe2videoinfo (grub_uint32_t mode,
945+ const struct grub_vbe_mode_info_block *vbeinfo,
946+ struct grub_video_mode_info *mode_info)
947+{
948+ mode_info->mode_number = mode;
949+
950+ mode_info->width = vbeinfo->x_resolution;
951+ mode_info->height = vbeinfo->y_resolution;
952+ mode_info->mode_type = 0;
953+ switch (vbeinfo->memory_model)
954+ {
955+ case GRUB_VBE_MEMORY_MODEL_TEXT:
956+ mode_info->mode_type |= GRUB_VIDEO_MODE_TYPE_PURE_TEXT;
957+ break;
958+
959+ /* CGA is basically 4-bit packed pixel. */
960+ case GRUB_VBE_MEMORY_MODEL_CGA:
961+ mode_info->mode_type |= GRUB_VIDEO_MODE_TYPE_CGA;
962+ case GRUB_VBE_MEMORY_MODEL_PACKED_PIXEL:
963+ mode_info->mode_type |= GRUB_VIDEO_MODE_TYPE_INDEX_COLOR;
964+ break;
965+
966+ case GRUB_VBE_MEMORY_MODEL_HERCULES:
967+ mode_info->mode_type |= GRUB_VIDEO_MODE_TYPE_HERCULES
968+ | GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP;
969+ break;
970+
971+ /* Non chain 4 is a special case of planar. */
972+ case GRUB_VBE_MEMORY_MODEL_NONCHAIN4_256:
973+ mode_info->mode_type |= GRUB_VIDEO_MODE_TYPE_NONCHAIN4;
974+ case GRUB_VBE_MEMORY_MODEL_PLANAR:
975+ mode_info->mode_type |= GRUB_VIDEO_MODE_TYPE_PLANAR
976+ | GRUB_VIDEO_MODE_TYPE_INDEX_COLOR;
977+ break;
978+
979+ case GRUB_VBE_MEMORY_MODEL_YUV:
980+ mode_info->mode_type |= GRUB_VIDEO_MODE_TYPE_YUV;
981+ break;
982+
983+ case GRUB_VBE_MEMORY_MODEL_DIRECT_COLOR:
984+ mode_info->mode_type |= GRUB_VIDEO_MODE_TYPE_RGB;
985+ break;
986+ default:
987+ mode_info->mode_type |= GRUB_VIDEO_MODE_TYPE_UNKNOWN;
988+ break;
989+ }
990+
991+ mode_info->bpp = vbeinfo->bits_per_pixel;
992+ /* Calculate bytes_per_pixel value. */
993+ switch(vbeinfo->bits_per_pixel)
994+ {
995+ case 32:
996+ mode_info->bytes_per_pixel = 4;
997+ break;
998+ case 24:
999+ mode_info->bytes_per_pixel = 3;
1000+ break;
1001+ case 16:
1002+ mode_info->bytes_per_pixel = 2;
1003+ break;
1004+ case 15:
1005+ mode_info->bytes_per_pixel = 2;
1006+ break;
1007+ case 8:
1008+ mode_info->bytes_per_pixel = 1;
1009+ break;
1010+ case 4:
1011+ mode_info->bytes_per_pixel = 0;
1012+ break;
1013+ }
1014+
1015+ if (controller_info.version >= 0x300)
1016+ mode_info->pitch = vbeinfo->lin_bytes_per_scan_line;
1017+ else
1018+ mode_info->pitch = vbeinfo->bytes_per_scan_line;
1019+
1020+ if (mode_info->mode_type & GRUB_VIDEO_MODE_TYPE_INDEX_COLOR)
1021+ mode_info->number_of_colors = 16;
1022+ else
1023+ mode_info->number_of_colors = 256;
1024+ mode_info->red_mask_size = vbeinfo->red_mask_size;
1025+ mode_info->red_field_pos = vbeinfo->red_field_position;
1026+ mode_info->green_mask_size = vbeinfo->green_mask_size;
1027+ mode_info->green_field_pos = vbeinfo->green_field_position;
1028+ mode_info->blue_mask_size = vbeinfo->blue_mask_size;
1029+ mode_info->blue_field_pos = vbeinfo->blue_field_position;
1030+ mode_info->reserved_mask_size = vbeinfo->rsvd_mask_size;
1031+ mode_info->reserved_field_pos = vbeinfo->rsvd_field_position;
1032+
1033+ mode_info->blit_format = grub_video_get_blit_format (mode_info);
1034+}
1035+
1036+static int
1037+grub_video_vbe_iterate (int (*hook) (const struct grub_video_mode_info *info, void *hook_arg), void *hook_arg)
1038+{
1039+ grub_uint16_t *p;
1040+ struct grub_vbe_mode_info_block vbe_mode_info;
1041+ struct grub_video_mode_info mode_info;
1042+
1043+ for (p = vbe_mode_list; *p != 0xFFFF; p++)
1044+ {
1045+ grub_vbe_get_video_mode_info (*p, &vbe_mode_info);
1046+ if (grub_errno != GRUB_ERR_NONE)
1047+ {
1048+ /* Could not retrieve mode info, retreat. */
1049+ grub_errno = GRUB_ERR_NONE;
1050+ break;
1051+ }
1052+
1053+ vbe2videoinfo (*p, &vbe_mode_info, &mode_info);
1054+ if (hook (&mode_info, hook_arg))
1055+ return 1;
1056+ }
1057+ return 0;
1058+}
1059+
1060+static grub_err_t
1061+grub_video_vbe_setup (unsigned int width, unsigned int height,
1062+ grub_video_mode_type_t mode_type,
1063+ grub_video_mode_type_t mode_mask)
1064+{
1065+ grub_uint16_t *p;
1066+ struct grub_vbe_mode_info_block vbe_mode_info;
1067+ struct grub_vbe_mode_info_block best_vbe_mode_info;
1068+ grub_uint32_t best_vbe_mode = 0;
1069+ int depth;
1070+ int preferred_mode = 0;
1071+
1072+ /* Decode depth from mode_type. If it is zero, then autodetect. */
1073+ depth = (mode_type & GRUB_VIDEO_MODE_TYPE_DEPTH_MASK)
1074+ >> GRUB_VIDEO_MODE_TYPE_DEPTH_POS;
1075+
1076+ if (width == 0 && height == 0)
1077+ {
1078+ grub_vbe_get_preferred_mode (&width, &height);
1079+ if (grub_errno == GRUB_ERR_NONE)
1080+ preferred_mode = 1;
1081+ else
1082+ {
1083+ /* Fall back to 640x480. This is conservative, but the largest
1084+ mode supported by the graphics card may not be safe for the
1085+ display device. */
1086+ grub_errno = GRUB_ERR_NONE;
1087+ width = 640;
1088+ height = 480;
1089+ }
1090+ }
1091+
1092+ /* Walk thru mode list and try to find matching mode. */
1093+ for (p = vbe_mode_list; *p != 0xFFFF; p++)
1094+ {
1095+ grub_uint32_t vbe_mode = *p;
1096+
1097+ grub_vbe_get_video_mode_info (vbe_mode, &vbe_mode_info);
1098+ if (grub_errno != GRUB_ERR_NONE)
1099+ {
1100+ /* Could not retrieve mode info, retreat. */
1101+ grub_errno = GRUB_ERR_NONE;
1102+ break;
1103+ }
1104+
1105+ if ((vbe_mode_info.mode_attributes & GRUB_VBE_MODEATTR_SUPPORTED) == 0)
1106+ /* If not available, skip it. */
1107+ continue;
1108+
1109+ if ((vbe_mode_info.mode_attributes & GRUB_VBE_MODEATTR_COLOR) == 0)
1110+ /* Monochrome is unusable. */
1111+ continue;
1112+
1113+ if ((vbe_mode_info.mode_attributes & GRUB_VBE_MODEATTR_LFB_AVAIL) == 0)
1114+ /* We support only linear frame buffer modes. */
1115+ continue;
1116+
1117+ if ((vbe_mode_info.mode_attributes & GRUB_VBE_MODEATTR_GRAPHICS) == 0)
1118+ /* We allow only graphical modes. */
1119+ continue;
1120+
1121+ if ((vbe_mode_info.memory_model != GRUB_VBE_MEMORY_MODEL_PACKED_PIXEL)
1122+ && (vbe_mode_info.memory_model != GRUB_VBE_MEMORY_MODEL_DIRECT_COLOR))
1123+ /* Not compatible memory model. */
1124+ continue;
1125+
1126+ if (vbe_mode_info.bits_per_pixel != 8
1127+ && vbe_mode_info.bits_per_pixel != 15
1128+ && vbe_mode_info.bits_per_pixel != 16
1129+ && vbe_mode_info.bits_per_pixel != 24
1130+ && vbe_mode_info.bits_per_pixel != 32)
1131+ /* Unsupported bitdepth . */
1132+ continue;
1133+
1134+ if (preferred_mode)
1135+ {
1136+ if (vbe_mode_info.x_resolution > width
1137+ || vbe_mode_info.y_resolution > height)
1138+ /* Resolution exceeds that of preferred mode. */
1139+ continue;
1140+ }
1141+ else
1142+ {
1143+ if (((vbe_mode_info.x_resolution != width)
1144+ || (vbe_mode_info.y_resolution != height))
1145+ && width != 0 && height != 0)
1146+ /* Non matching resolution. */
1147+ continue;
1148+ }
1149+
1150+ /* Check if user requested RGB or index color mode. */
1151+ if ((mode_mask & GRUB_VIDEO_MODE_TYPE_COLOR_MASK) != 0)
1152+ {
1153+ unsigned my_mode_type = 0;
1154+
1155+ if (vbe_mode_info.memory_model == GRUB_VBE_MEMORY_MODEL_PACKED_PIXEL)
1156+ my_mode_type |= GRUB_VIDEO_MODE_TYPE_INDEX_COLOR;
1157+
1158+ if (vbe_mode_info.memory_model == GRUB_VBE_MEMORY_MODEL_DIRECT_COLOR)
1159+ my_mode_type |= GRUB_VIDEO_MODE_TYPE_RGB;
1160+
1161+ if ((my_mode_type & mode_mask
1162+ & (GRUB_VIDEO_MODE_TYPE_RGB | GRUB_VIDEO_MODE_TYPE_INDEX_COLOR))
1163+ != (mode_type & mode_mask
1164+ & (GRUB_VIDEO_MODE_TYPE_RGB
1165+ | GRUB_VIDEO_MODE_TYPE_INDEX_COLOR)))
1166+ continue;
1167+ }
1168+
1169+ /* If there is a request for specific depth, ignore others. */
1170+ if ((depth != 0) && (vbe_mode_info.bits_per_pixel != depth))
1171+ continue;
1172+
1173+ /* Select mode with most of "volume" (size of framebuffer in bits). */
1174+ if (best_vbe_mode != 0)
1175+ if ((grub_uint64_t) vbe_mode_info.bits_per_pixel
1176+ * vbe_mode_info.x_resolution * vbe_mode_info.y_resolution
1177+ < (grub_uint64_t) best_vbe_mode_info.bits_per_pixel
1178+ * best_vbe_mode_info.x_resolution * best_vbe_mode_info.y_resolution)
1179+ continue;
1180+
1181+ /* Save so far best mode information for later use. */
1182+ best_vbe_mode = vbe_mode;
1183+ grub_memcpy (&best_vbe_mode_info, &vbe_mode_info, sizeof (vbe_mode_info));
1184+ }
1185+
1186+ /* Try to initialize best mode found. */
1187+ if (best_vbe_mode != 0)
1188+ {
1189+ grub_err_t err;
1190+ static struct grub_vbe_mode_info_block active_vbe_mode_info;
1191+ /* If this fails, then we have mode selection heuristics problem,
1192+ or adapter failure. */
1193+ grub_vbe_set_video_mode (best_vbe_mode, &active_vbe_mode_info);
1194+ if (grub_errno != GRUB_ERR_NONE)
1195+ return grub_errno;
1196+
1197+ /* Fill mode info details. */
1198+ vbe2videoinfo (best_vbe_mode, &active_vbe_mode_info,
1199+ &framebuffer.mode_info);
1200+
1201+ {
1202+ /* Get video RAM size in bytes. */
1203+ grub_size_t vram_size = controller_info.total_memory << 16;
1204+ grub_size_t page_size; /* The size of a page in bytes. */
1205+
1206+ page_size = framebuffer.mode_info.pitch * framebuffer.mode_info.height;
1207+
1208+ if (vram_size >= 2 * page_size)
1209+ err = grub_video_fb_setup (mode_type, mode_mask,
1210+ &framebuffer.mode_info,
1211+ framebuffer.ptr,
1212+ doublebuf_pageflipping_set_page,
1213+ framebuffer.ptr + page_size);
1214+ else
1215+ err = grub_video_fb_setup (mode_type, mode_mask,
1216+ &framebuffer.mode_info,
1217+ framebuffer.ptr, 0, 0);
1218+ }
1219+
1220+ /* Copy default palette to initialize emulated palette. */
1221+ err = grub_video_fb_set_palette (0, GRUB_VIDEO_FBSTD_NUMCOLORS,
1222+ grub_video_fbstd_colors);
1223+
1224+ grub_vbe_enable_mtrr (framebuffer.ptr,
1225+ controller_info.total_memory << 16);
1226+
1227+ return err;
1228+ }
1229+
1230+ /* Couldn't found matching mode. */
1231+ return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no matching mode found");
1232+}
1233+
1234+static grub_err_t
1235+grub_video_vbe_set_palette (unsigned int start, unsigned int count,
1236+ struct grub_video_palette_data *palette_data)
1237+{
1238+ if (framebuffer.mode_info.mode_type == GRUB_VIDEO_MODE_TYPE_INDEX_COLOR)
1239+ {
1240+ /* TODO: Implement setting indexed color mode palette to hardware. */
1241+ //status = grub_vbe_bios_set_palette_data (sizeof (vga_colors)
1242+ // / sizeof (struct grub_vbe_palette_data),
1243+ // 0,
1244+ // palette);
1245+
1246+ }
1247+
1248+ /* Then set color to emulated palette. */
1249+
1250+ return grub_video_fb_set_palette (start, count, palette_data);
1251+}
1252+
1253+static grub_err_t
1254+grub_video_vbe_get_info_and_fini (struct grub_video_mode_info *mode_info,
1255+ void **framebuf)
1256+{
1257+ grub_err_t err;
1258+ grub_free (vbe_mode_list);
1259+ vbe_mode_list = NULL;
1260+ err = grub_video_fb_get_info_and_fini (mode_info, framebuf);
1261+ if (err)
1262+ return err;
1263+ if (framebuffer.mtrr >= 0)
1264+ {
1265+ grub_vbe_disable_mtrr (framebuffer.mtrr);
1266+ framebuffer.mtrr = -1;
1267+ }
1268+ return GRUB_ERR_NONE;
1269+}
1270+
1271+static void
1272+grub_video_vbe_print_adapter_specific_info (void)
1273+{
1274+ grub_printf_ (N_(" VBE info: version: %d.%d OEM software rev: %d.%d\n"),
1275+ controller_info.version >> 8,
1276+ controller_info.version & 0xFF,
1277+ controller_info.oem_software_rev >> 8,
1278+ controller_info.oem_software_rev & 0xFF);
1279+
1280+ /* The total_memory field is in 64 KiB units. */
1281+ grub_printf_ (N_(" total memory: %d KiB\n"),
1282+ (controller_info.total_memory << 6));
1283+}
1284+
1285+static struct grub_video_adapter grub_video_vbe_adapter =
1286+ {
1287+ .name = "VESA BIOS Extension Video Driver",
1288+ .id = GRUB_VIDEO_DRIVER_VBE,
1289+
1290+ .prio = GRUB_VIDEO_ADAPTER_PRIO_FIRMWARE,
1291+
1292+ .init = grub_video_vbe_init,
1293+ .fini = grub_video_vbe_fini,
1294+ .setup = grub_video_vbe_setup,
1295+ .get_info = grub_video_fb_get_info,
1296+ .get_info_and_fini = grub_video_vbe_get_info_and_fini,
1297+ .set_palette = grub_video_vbe_set_palette,
1298+ .get_palette = grub_video_fb_get_palette,
1299+ .set_viewport = grub_video_fb_set_viewport,
1300+ .get_viewport = grub_video_fb_get_viewport,
1301+ .set_region = grub_video_fb_set_region,
1302+ .get_region = grub_video_fb_get_region,
1303+ .set_area_status = grub_video_fb_set_area_status,
1304+ .get_area_status = grub_video_fb_get_area_status,
1305+ .map_color = grub_video_fb_map_color,
1306+ .map_rgb = grub_video_fb_map_rgb,
1307+ .map_rgba = grub_video_fb_map_rgba,
1308+ .unmap_color = grub_video_fb_unmap_color,
1309+ .fill_rect = grub_video_fb_fill_rect,
1310+ .blit_bitmap = grub_video_fb_blit_bitmap,
1311+ .blit_render_target = grub_video_fb_blit_render_target,
1312+ .scroll = grub_video_fb_scroll,
1313+ .swap_buffers = grub_video_fb_swap_buffers,
1314+ .create_render_target = grub_video_fb_create_render_target,
1315+ .delete_render_target = grub_video_fb_delete_render_target,
1316+ .set_active_render_target = grub_video_fb_set_active_render_target,
1317+ .get_active_render_target = grub_video_fb_get_active_render_target,
1318+ .iterate = grub_video_vbe_iterate,
1319+ .get_edid = grub_video_vbe_get_edid,
1320+ .print_adapter_specific_info = grub_video_vbe_print_adapter_specific_info,
1321+
1322+ .next = 0
1323+ };
1324+
1325+GRUB_MOD_INIT(video_i386_pc_vbe)
1326+{
1327+ grub_video_register (&grub_video_vbe_adapter);
1328+}
1329+
1330+GRUB_MOD_FINI(video_i386_pc_vbe)
1331+{
1332+ grub_video_unregister (&grub_video_vbe_adapter);
1333+}
1334
1335=== added directory '.pc/btrfs-endian.patch'
1336=== added directory '.pc/btrfs-endian.patch/grub-core'
1337=== added directory '.pc/btrfs-endian.patch/grub-core/fs'
1338=== added file '.pc/btrfs-endian.patch/grub-core/fs/btrfs.c'
1339--- .pc/btrfs-endian.patch/grub-core/fs/btrfs.c 1970-01-01 00:00:00 +0000
1340+++ .pc/btrfs-endian.patch/grub-core/fs/btrfs.c 2014-08-24 23:28:48 +0000
1341@@ -0,0 +1,1768 @@
1342+/* btrfs.c - B-tree file system. */
1343+/*
1344+ * GRUB -- GRand Unified Bootloader
1345+ * Copyright (C) 2010,2011,2012,2013 Free Software Foundation, Inc.
1346+ *
1347+ * GRUB is free software: you can redistribute it and/or modify
1348+ * it under the terms of the GNU General Public License as published by
1349+ * the Free Software Foundation, either version 3 of the License, or
1350+ * (at your option) any later version.
1351+ *
1352+ * GRUB is distributed in the hope that it will be useful,
1353+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1354+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1355+ * GNU General Public License for more details.
1356+ *
1357+ * You should have received a copy of the GNU General Public License
1358+ * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
1359+ */
1360+
1361+#include <grub/err.h>
1362+#include <grub/file.h>
1363+#include <grub/mm.h>
1364+#include <grub/misc.h>
1365+#include <grub/disk.h>
1366+#include <grub/dl.h>
1367+#include <grub/types.h>
1368+#include <grub/lib/crc.h>
1369+#include <grub/deflate.h>
1370+#include <minilzo.h>
1371+#include <grub/i18n.h>
1372+#include <grub/btrfs.h>
1373+
1374+GRUB_MOD_LICENSE ("GPLv3+");
1375+
1376+#define GRUB_BTRFS_SIGNATURE "_BHRfS_M"
1377+
1378+/* From http://www.oberhumer.com/opensource/lzo/lzofaq.php
1379+ * LZO will expand incompressible data by a little amount. I still haven't
1380+ * computed the exact values, but I suggest using these formulas for
1381+ * a worst-case expansion calculation:
1382+ *
1383+ * output_block_size = input_block_size + (input_block_size / 16) + 64 + 3
1384+ * */
1385+#define GRUB_BTRFS_LZO_BLOCK_SIZE 4096
1386+#define GRUB_BTRFS_LZO_BLOCK_MAX_CSIZE (GRUB_BTRFS_LZO_BLOCK_SIZE + \
1387+ (GRUB_BTRFS_LZO_BLOCK_SIZE / 16) + 64 + 3)
1388+
1389+typedef grub_uint8_t grub_btrfs_checksum_t[0x20];
1390+typedef grub_uint16_t grub_btrfs_uuid_t[8];
1391+
1392+struct grub_btrfs_device
1393+{
1394+ grub_uint64_t device_id;
1395+ grub_uint64_t size;
1396+ grub_uint8_t dummy[0x62 - 0x10];
1397+} GRUB_PACKED;
1398+
1399+struct grub_btrfs_superblock
1400+{
1401+ grub_btrfs_checksum_t checksum;
1402+ grub_btrfs_uuid_t uuid;
1403+ grub_uint8_t dummy[0x10];
1404+ grub_uint8_t signature[sizeof (GRUB_BTRFS_SIGNATURE) - 1];
1405+ grub_uint64_t generation;
1406+ grub_uint64_t root_tree;
1407+ grub_uint64_t chunk_tree;
1408+ grub_uint8_t dummy2[0x20];
1409+ grub_uint64_t root_dir_objectid;
1410+ grub_uint8_t dummy3[0x41];
1411+ struct grub_btrfs_device this_device;
1412+ char label[0x100];
1413+ grub_uint8_t dummy4[0x100];
1414+ grub_uint8_t bootstrap_mapping[0x800];
1415+} GRUB_PACKED;
1416+
1417+struct btrfs_header
1418+{
1419+ grub_btrfs_checksum_t checksum;
1420+ grub_btrfs_uuid_t uuid;
1421+ grub_uint8_t dummy[0x30];
1422+ grub_uint32_t nitems;
1423+ grub_uint8_t level;
1424+} GRUB_PACKED;
1425+
1426+struct grub_btrfs_device_desc
1427+{
1428+ grub_device_t dev;
1429+ grub_uint64_t id;
1430+};
1431+
1432+struct grub_btrfs_data
1433+{
1434+ struct grub_btrfs_superblock sblock;
1435+ grub_uint64_t tree;
1436+ grub_uint64_t inode;
1437+
1438+ struct grub_btrfs_device_desc *devices_attached;
1439+ unsigned n_devices_attached;
1440+ unsigned n_devices_allocated;
1441+
1442+ /* Cached extent data. */
1443+ grub_uint64_t extstart;
1444+ grub_uint64_t extend;
1445+ grub_uint64_t extino;
1446+ grub_uint64_t exttree;
1447+ grub_size_t extsize;
1448+ struct grub_btrfs_extent_data *extent;
1449+};
1450+
1451+struct grub_btrfs_chunk_item
1452+{
1453+ grub_uint64_t size;
1454+ grub_uint64_t dummy;
1455+ grub_uint64_t stripe_length;
1456+ grub_uint64_t type;
1457+#define GRUB_BTRFS_CHUNK_TYPE_BITS_DONTCARE 0x07
1458+#define GRUB_BTRFS_CHUNK_TYPE_SINGLE 0x00
1459+#define GRUB_BTRFS_CHUNK_TYPE_RAID0 0x08
1460+#define GRUB_BTRFS_CHUNK_TYPE_RAID1 0x10
1461+#define GRUB_BTRFS_CHUNK_TYPE_DUPLICATED 0x20
1462+#define GRUB_BTRFS_CHUNK_TYPE_RAID10 0x40
1463+ grub_uint8_t dummy2[0xc];
1464+ grub_uint16_t nstripes;
1465+ grub_uint16_t nsubstripes;
1466+} GRUB_PACKED;
1467+
1468+struct grub_btrfs_chunk_stripe
1469+{
1470+ grub_uint64_t device_id;
1471+ grub_uint64_t offset;
1472+ grub_btrfs_uuid_t device_uuid;
1473+} GRUB_PACKED;
1474+
1475+struct grub_btrfs_leaf_node
1476+{
1477+ struct grub_btrfs_key key;
1478+ grub_uint32_t offset;
1479+ grub_uint32_t size;
1480+} GRUB_PACKED;
1481+
1482+struct grub_btrfs_internal_node
1483+{
1484+ struct grub_btrfs_key key;
1485+ grub_uint64_t addr;
1486+ grub_uint64_t dummy;
1487+} GRUB_PACKED;
1488+
1489+struct grub_btrfs_dir_item
1490+{
1491+ struct grub_btrfs_key key;
1492+ grub_uint8_t dummy[8];
1493+ grub_uint16_t m;
1494+ grub_uint16_t n;
1495+#define GRUB_BTRFS_DIR_ITEM_TYPE_REGULAR 1
1496+#define GRUB_BTRFS_DIR_ITEM_TYPE_DIRECTORY 2
1497+#define GRUB_BTRFS_DIR_ITEM_TYPE_SYMLINK 7
1498+ grub_uint8_t type;
1499+ char name[0];
1500+} GRUB_PACKED;
1501+
1502+struct grub_btrfs_leaf_descriptor
1503+{
1504+ unsigned depth;
1505+ unsigned allocated;
1506+ struct
1507+ {
1508+ grub_disk_addr_t addr;
1509+ unsigned iter;
1510+ unsigned maxiter;
1511+ int leaf;
1512+ } *data;
1513+};
1514+
1515+struct grub_btrfs_time
1516+{
1517+ grub_int64_t sec;
1518+ grub_uint32_t nanosec;
1519+} __attribute__ ((aligned (4)));
1520+
1521+struct grub_btrfs_inode
1522+{
1523+ grub_uint8_t dummy1[0x10];
1524+ grub_uint64_t size;
1525+ grub_uint8_t dummy2[0x70];
1526+ struct grub_btrfs_time mtime;
1527+} GRUB_PACKED;
1528+
1529+struct grub_btrfs_extent_data
1530+{
1531+ grub_uint64_t dummy;
1532+ grub_uint64_t size;
1533+ grub_uint8_t compression;
1534+ grub_uint8_t encryption;
1535+ grub_uint16_t encoding;
1536+ grub_uint8_t type;
1537+ union
1538+ {
1539+ char inl[0];
1540+ struct
1541+ {
1542+ grub_uint64_t laddr;
1543+ grub_uint64_t compressed_size;
1544+ grub_uint64_t offset;
1545+ grub_uint64_t filled;
1546+ };
1547+ };
1548+} GRUB_PACKED;
1549+
1550+#define GRUB_BTRFS_EXTENT_INLINE 0
1551+#define GRUB_BTRFS_EXTENT_REGULAR 1
1552+
1553+#define GRUB_BTRFS_COMPRESSION_NONE 0
1554+#define GRUB_BTRFS_COMPRESSION_ZLIB 1
1555+#define GRUB_BTRFS_COMPRESSION_LZO 2
1556+
1557+#define GRUB_BTRFS_OBJECT_ID_CHUNK 0x100
1558+
1559+static grub_disk_addr_t superblock_sectors[] = { 64 * 2, 64 * 1024 * 2,
1560+ 256 * 1048576 * 2, 1048576ULL * 1048576ULL * 2
1561+};
1562+
1563+static grub_err_t
1564+grub_btrfs_read_logical (struct grub_btrfs_data *data,
1565+ grub_disk_addr_t addr, void *buf, grub_size_t size,
1566+ int recursion_depth);
1567+
1568+static grub_err_t
1569+read_sblock (grub_disk_t disk, struct grub_btrfs_superblock *sb)
1570+{
1571+ unsigned i;
1572+ grub_err_t err = GRUB_ERR_NONE;
1573+ for (i = 0; i < ARRAY_SIZE (superblock_sectors); i++)
1574+ {
1575+ struct grub_btrfs_superblock sblock;
1576+ /* Don't try additional superblocks beyond device size. */
1577+ if (i && (grub_le_to_cpu64 (sblock.this_device.size)
1578+ >> GRUB_DISK_SECTOR_BITS) <= superblock_sectors[i])
1579+ break;
1580+ err = grub_disk_read (disk, superblock_sectors[i], 0,
1581+ sizeof (sblock), &sblock);
1582+ if (err == GRUB_ERR_OUT_OF_RANGE)
1583+ break;
1584+
1585+ if (grub_memcmp ((char *) sblock.signature, GRUB_BTRFS_SIGNATURE,
1586+ sizeof (GRUB_BTRFS_SIGNATURE) - 1) != 0)
1587+ break;
1588+ if (i == 0 || grub_le_to_cpu64 (sblock.generation)
1589+ > grub_le_to_cpu64 (sb->generation))
1590+ grub_memcpy (sb, &sblock, sizeof (sblock));
1591+ }
1592+
1593+ if ((err == GRUB_ERR_OUT_OF_RANGE || !err) && i == 0)
1594+ return grub_error (GRUB_ERR_BAD_FS, "not a Btrfs filesystem");
1595+
1596+ if (err == GRUB_ERR_OUT_OF_RANGE)
1597+ grub_errno = err = GRUB_ERR_NONE;
1598+
1599+ return err;
1600+}
1601+
1602+static int
1603+key_cmp (const struct grub_btrfs_key *a, const struct grub_btrfs_key *b)
1604+{
1605+ if (grub_le_to_cpu64 (a->object_id) < grub_le_to_cpu64 (b->object_id))
1606+ return -1;
1607+ if (grub_le_to_cpu64 (a->object_id) > grub_le_to_cpu64 (b->object_id))
1608+ return +1;
1609+
1610+ if (a->type < b->type)
1611+ return -1;
1612+ if (a->type > b->type)
1613+ return +1;
1614+
1615+ if (grub_le_to_cpu64 (a->offset) < grub_le_to_cpu64 (b->offset))
1616+ return -1;
1617+ if (grub_le_to_cpu64 (a->offset) > grub_le_to_cpu64 (b->offset))
1618+ return +1;
1619+ return 0;
1620+}
1621+
1622+static void
1623+free_iterator (struct grub_btrfs_leaf_descriptor *desc)
1624+{
1625+ grub_free (desc->data);
1626+}
1627+
1628+static grub_err_t
1629+save_ref (struct grub_btrfs_leaf_descriptor *desc,
1630+ grub_disk_addr_t addr, unsigned i, unsigned m, int l)
1631+{
1632+ desc->depth++;
1633+ if (desc->allocated < desc->depth)
1634+ {
1635+ void *newdata;
1636+ desc->allocated *= 2;
1637+ newdata = grub_realloc (desc->data, sizeof (desc->data[0])
1638+ * desc->allocated);
1639+ if (!newdata)
1640+ return grub_errno;
1641+ desc->data = newdata;
1642+ }
1643+ desc->data[desc->depth - 1].addr = addr;
1644+ desc->data[desc->depth - 1].iter = i;
1645+ desc->data[desc->depth - 1].maxiter = m;
1646+ desc->data[desc->depth - 1].leaf = l;
1647+ return GRUB_ERR_NONE;
1648+}
1649+
1650+static int
1651+next (struct grub_btrfs_data *data,
1652+ struct grub_btrfs_leaf_descriptor *desc,
1653+ grub_disk_addr_t * outaddr, grub_size_t * outsize,
1654+ struct grub_btrfs_key *key_out)
1655+{
1656+ grub_err_t err;
1657+ struct grub_btrfs_leaf_node leaf;
1658+
1659+ for (; desc->depth > 0; desc->depth--)
1660+ {
1661+ desc->data[desc->depth - 1].iter++;
1662+ if (desc->data[desc->depth - 1].iter
1663+ < desc->data[desc->depth - 1].maxiter)
1664+ break;
1665+ }
1666+ if (desc->depth == 0)
1667+ return 0;
1668+ while (!desc->data[desc->depth - 1].leaf)
1669+ {
1670+ struct grub_btrfs_internal_node node;
1671+ struct btrfs_header head;
1672+
1673+ err = grub_btrfs_read_logical (data, desc->data[desc->depth - 1].iter
1674+ * sizeof (node)
1675+ + sizeof (struct btrfs_header)
1676+ + desc->data[desc->depth - 1].addr,
1677+ &node, sizeof (node), 0);
1678+ if (err)
1679+ return -err;
1680+
1681+ err = grub_btrfs_read_logical (data, grub_le_to_cpu64 (node.addr),
1682+ &head, sizeof (head), 0);
1683+ if (err)
1684+ return -err;
1685+
1686+ save_ref (desc, grub_le_to_cpu64 (node.addr), 0,
1687+ grub_le_to_cpu32 (head.nitems), !head.level);
1688+ }
1689+ err = grub_btrfs_read_logical (data, desc->data[desc->depth - 1].iter
1690+ * sizeof (leaf)
1691+ + sizeof (struct btrfs_header)
1692+ + desc->data[desc->depth - 1].addr, &leaf,
1693+ sizeof (leaf), 0);
1694+ if (err)
1695+ return -err;
1696+ *outsize = grub_le_to_cpu32 (leaf.size);
1697+ *outaddr = desc->data[desc->depth - 1].addr + sizeof (struct btrfs_header)
1698+ + grub_le_to_cpu32 (leaf.offset);
1699+ *key_out = leaf.key;
1700+ return 1;
1701+}
1702+
1703+static grub_err_t
1704+lower_bound (struct grub_btrfs_data *data,
1705+ const struct grub_btrfs_key *key_in,
1706+ struct grub_btrfs_key *key_out,
1707+ grub_uint64_t root,
1708+ grub_disk_addr_t *outaddr, grub_size_t *outsize,
1709+ struct grub_btrfs_leaf_descriptor *desc,
1710+ int recursion_depth)
1711+{
1712+ grub_disk_addr_t addr = grub_le_to_cpu64 (root);
1713+ int depth = -1;
1714+
1715+ if (desc)
1716+ {
1717+ desc->allocated = 16;
1718+ desc->depth = 0;
1719+ desc->data = grub_malloc (sizeof (desc->data[0]) * desc->allocated);
1720+ if (!desc->data)
1721+ return grub_errno;
1722+ }
1723+
1724+ /* > 2 would work as well but be robust and allow a bit more just in case.
1725+ */
1726+ if (recursion_depth > 10)
1727+ return grub_error (GRUB_ERR_BAD_FS, "too deep btrfs virtual nesting");
1728+
1729+ grub_dprintf ("btrfs",
1730+ "retrieving %" PRIxGRUB_UINT64_T
1731+ " %x %" PRIxGRUB_UINT64_T "\n",
1732+ key_in->object_id, key_in->type, key_in->offset);
1733+
1734+ while (1)
1735+ {
1736+ grub_err_t err;
1737+ struct btrfs_header head;
1738+
1739+ reiter:
1740+ depth++;
1741+ /* FIXME: preread few nodes into buffer. */
1742+ err = grub_btrfs_read_logical (data, addr, &head, sizeof (head),
1743+ recursion_depth + 1);
1744+ if (err)
1745+ return err;
1746+ addr += sizeof (head);
1747+ if (head.level)
1748+ {
1749+ unsigned i;
1750+ struct grub_btrfs_internal_node node, node_last;
1751+ int have_last = 0;
1752+ grub_memset (&node_last, 0, sizeof (node_last));
1753+ for (i = 0; i < grub_le_to_cpu32 (head.nitems); i++)
1754+ {
1755+ err = grub_btrfs_read_logical (data, addr + i * sizeof (node),
1756+ &node, sizeof (node),
1757+ recursion_depth + 1);
1758+ if (err)
1759+ return err;
1760+
1761+ grub_dprintf ("btrfs",
1762+ "internal node (depth %d) %" PRIxGRUB_UINT64_T
1763+ " %x %" PRIxGRUB_UINT64_T "\n", depth,
1764+ node.key.object_id, node.key.type,
1765+ node.key.offset);
1766+
1767+ if (key_cmp (&node.key, key_in) == 0)
1768+ {
1769+ err = GRUB_ERR_NONE;
1770+ if (desc)
1771+ err = save_ref (desc, addr - sizeof (head), i,
1772+ grub_le_to_cpu32 (head.nitems), 0);
1773+ if (err)
1774+ return err;
1775+ addr = grub_le_to_cpu64 (node.addr);
1776+ goto reiter;
1777+ }
1778+ if (key_cmp (&node.key, key_in) > 0)
1779+ break;
1780+ node_last = node;
1781+ have_last = 1;
1782+ }
1783+ if (have_last)
1784+ {
1785+ err = GRUB_ERR_NONE;
1786+ if (desc)
1787+ err = save_ref (desc, addr - sizeof (head), i - 1,
1788+ grub_le_to_cpu32 (head.nitems), 0);
1789+ if (err)
1790+ return err;
1791+ addr = grub_le_to_cpu64 (node_last.addr);
1792+ goto reiter;
1793+ }
1794+ *outsize = 0;
1795+ *outaddr = 0;
1796+ grub_memset (key_out, 0, sizeof (*key_out));
1797+ if (desc)
1798+ return save_ref (desc, addr - sizeof (head), -1,
1799+ grub_le_to_cpu32 (head.nitems), 0);
1800+ return GRUB_ERR_NONE;
1801+ }
1802+ {
1803+ unsigned i;
1804+ struct grub_btrfs_leaf_node leaf, leaf_last;
1805+ int have_last = 0;
1806+ for (i = 0; i < grub_le_to_cpu32 (head.nitems); i++)
1807+ {
1808+ err = grub_btrfs_read_logical (data, addr + i * sizeof (leaf),
1809+ &leaf, sizeof (leaf),
1810+ recursion_depth + 1);
1811+ if (err)
1812+ return err;
1813+
1814+ grub_dprintf ("btrfs",
1815+ "leaf (depth %d) %" PRIxGRUB_UINT64_T
1816+ " %x %" PRIxGRUB_UINT64_T "\n", depth,
1817+ leaf.key.object_id, leaf.key.type, leaf.key.offset);
1818+
1819+ if (key_cmp (&leaf.key, key_in) == 0)
1820+ {
1821+ grub_memcpy (key_out, &leaf.key, sizeof (*key_out));
1822+ *outsize = grub_le_to_cpu32 (leaf.size);
1823+ *outaddr = addr + grub_le_to_cpu32 (leaf.offset);
1824+ if (desc)
1825+ return save_ref (desc, addr - sizeof (head), i,
1826+ grub_le_to_cpu32 (head.nitems), 1);
1827+ return GRUB_ERR_NONE;
1828+ }
1829+
1830+ if (key_cmp (&leaf.key, key_in) > 0)
1831+ break;
1832+
1833+ have_last = 1;
1834+ leaf_last = leaf;
1835+ }
1836+
1837+ if (have_last)
1838+ {
1839+ grub_memcpy (key_out, &leaf_last.key, sizeof (*key_out));
1840+ *outsize = grub_le_to_cpu32 (leaf_last.size);
1841+ *outaddr = addr + grub_le_to_cpu32 (leaf_last.offset);
1842+ if (desc)
1843+ return save_ref (desc, addr - sizeof (head), i - 1,
1844+ grub_le_to_cpu32 (head.nitems), 1);
1845+ return GRUB_ERR_NONE;
1846+ }
1847+ *outsize = 0;
1848+ *outaddr = 0;
1849+ grub_memset (key_out, 0, sizeof (*key_out));
1850+ if (desc)
1851+ return save_ref (desc, addr - sizeof (head), -1,
1852+ grub_le_to_cpu32 (head.nitems), 1);
1853+ return GRUB_ERR_NONE;
1854+ }
1855+ }
1856+}
1857+
1858+/* Context for find_device. */
1859+struct find_device_ctx
1860+{
1861+ struct grub_btrfs_data *data;
1862+ grub_uint64_t id;
1863+ grub_device_t dev_found;
1864+};
1865+
1866+/* Helper for find_device. */
1867+static int
1868+find_device_iter (const char *name, void *data)
1869+{
1870+ struct find_device_ctx *ctx = data;
1871+ grub_device_t dev;
1872+ grub_err_t err;
1873+ struct grub_btrfs_superblock sb;
1874+
1875+ dev = grub_device_open (name);
1876+ if (!dev)
1877+ return 0;
1878+ if (!dev->disk)
1879+ {
1880+ grub_device_close (dev);
1881+ return 0;
1882+ }
1883+ err = read_sblock (dev->disk, &sb);
1884+ if (err == GRUB_ERR_BAD_FS)
1885+ {
1886+ grub_device_close (dev);
1887+ grub_errno = GRUB_ERR_NONE;
1888+ return 0;
1889+ }
1890+ if (err)
1891+ {
1892+ grub_device_close (dev);
1893+ grub_print_error ();
1894+ return 0;
1895+ }
1896+ if (grub_memcmp (ctx->data->sblock.uuid, sb.uuid, sizeof (sb.uuid)) != 0
1897+ || sb.this_device.device_id != ctx->id)
1898+ {
1899+ grub_device_close (dev);
1900+ return 0;
1901+ }
1902+
1903+ ctx->dev_found = dev;
1904+ return 1;
1905+}
1906+
1907+static grub_device_t
1908+find_device (struct grub_btrfs_data *data, grub_uint64_t id, int do_rescan)
1909+{
1910+ struct find_device_ctx ctx = {
1911+ .data = data,
1912+ .id = id,
1913+ .dev_found = NULL
1914+ };
1915+ unsigned i;
1916+
1917+ for (i = 0; i < data->n_devices_attached; i++)
1918+ if (id == data->devices_attached[i].id)
1919+ return data->devices_attached[i].dev;
1920+ if (do_rescan)
1921+ grub_device_iterate (find_device_iter, &ctx);
1922+ if (!ctx.dev_found)
1923+ {
1924+ grub_error (GRUB_ERR_BAD_FS,
1925+ N_("couldn't find a necessary member device "
1926+ "of multi-device filesystem"));
1927+ return NULL;
1928+ }
1929+ data->n_devices_attached++;
1930+ if (data->n_devices_attached > data->n_devices_allocated)
1931+ {
1932+ void *tmp;
1933+ data->n_devices_allocated = 2 * data->n_devices_attached + 1;
1934+ data->devices_attached
1935+ = grub_realloc (tmp = data->devices_attached,
1936+ data->n_devices_allocated
1937+ * sizeof (data->devices_attached[0]));
1938+ if (!data->devices_attached)
1939+ {
1940+ grub_device_close (ctx.dev_found);
1941+ data->devices_attached = tmp;
1942+ return NULL;
1943+ }
1944+ }
1945+ data->devices_attached[data->n_devices_attached - 1].id = id;
1946+ data->devices_attached[data->n_devices_attached - 1].dev = ctx.dev_found;
1947+ return ctx.dev_found;
1948+}
1949+
1950+static grub_err_t
1951+grub_btrfs_read_logical (struct grub_btrfs_data *data, grub_disk_addr_t addr,
1952+ void *buf, grub_size_t size, int recursion_depth)
1953+{
1954+ while (size > 0)
1955+ {
1956+ grub_uint8_t *ptr;
1957+ struct grub_btrfs_key *key;
1958+ struct grub_btrfs_chunk_item *chunk;
1959+ grub_uint64_t csize;
1960+ grub_err_t err = 0;
1961+ struct grub_btrfs_key key_out;
1962+ int challoc = 0;
1963+ grub_device_t dev;
1964+ struct grub_btrfs_key key_in;
1965+ grub_size_t chsize;
1966+ grub_disk_addr_t chaddr;
1967+
1968+ grub_dprintf ("btrfs", "searching for laddr %" PRIxGRUB_UINT64_T "\n",
1969+ addr);
1970+ for (ptr = data->sblock.bootstrap_mapping;
1971+ ptr < data->sblock.bootstrap_mapping
1972+ + sizeof (data->sblock.bootstrap_mapping)
1973+ - sizeof (struct grub_btrfs_key);)
1974+ {
1975+ key = (struct grub_btrfs_key *) ptr;
1976+ if (key->type != GRUB_BTRFS_ITEM_TYPE_CHUNK)
1977+ break;
1978+ chunk = (struct grub_btrfs_chunk_item *) (key + 1);
1979+ grub_dprintf ("btrfs",
1980+ "%" PRIxGRUB_UINT64_T " %" PRIxGRUB_UINT64_T " \n",
1981+ grub_le_to_cpu64 (key->offset),
1982+ grub_le_to_cpu64 (chunk->size));
1983+ if (grub_le_to_cpu64 (key->offset) <= addr
1984+ && addr < grub_le_to_cpu64 (key->offset)
1985+ + grub_le_to_cpu64 (chunk->size))
1986+ goto chunk_found;
1987+ ptr += sizeof (*key) + sizeof (*chunk)
1988+ + sizeof (struct grub_btrfs_chunk_stripe)
1989+ * grub_le_to_cpu16 (chunk->nstripes);
1990+ }
1991+
1992+ key_in.object_id = grub_cpu_to_le64_compile_time (GRUB_BTRFS_OBJECT_ID_CHUNK);
1993+ key_in.type = GRUB_BTRFS_ITEM_TYPE_CHUNK;
1994+ key_in.offset = grub_cpu_to_le64 (addr);
1995+ err = lower_bound (data, &key_in, &key_out,
1996+ data->sblock.chunk_tree,
1997+ &chaddr, &chsize, NULL, recursion_depth);
1998+ if (err)
1999+ return err;
2000+ key = &key_out;
2001+ if (key->type != GRUB_BTRFS_ITEM_TYPE_CHUNK
2002+ || !(grub_le_to_cpu64 (key->offset) <= addr))
2003+ return grub_error (GRUB_ERR_BAD_FS,
2004+ "couldn't find the chunk descriptor");
2005+
2006+ chunk = grub_malloc (chsize);
2007+ if (!chunk)
2008+ return grub_errno;
2009+
2010+ challoc = 1;
2011+ err = grub_btrfs_read_logical (data, chaddr, chunk, chsize,
2012+ recursion_depth);
2013+ if (err)
2014+ {
2015+ grub_free (chunk);
2016+ return err;
2017+ }
2018+
2019+ chunk_found:
2020+ {
2021+ grub_uint64_t stripen;
2022+ grub_uint64_t stripe_offset;
2023+ grub_uint64_t off = addr - grub_le_to_cpu64 (key->offset);
2024+ unsigned redundancy = 1;
2025+ unsigned i, j;
2026+
2027+ if (grub_le_to_cpu64 (chunk->size) <= off)
2028+ {
2029+ grub_dprintf ("btrfs", "no chunk\n");
2030+ return grub_error (GRUB_ERR_BAD_FS,
2031+ "couldn't find the chunk descriptor");
2032+ }
2033+
2034+ grub_dprintf ("btrfs", "chunk 0x%" PRIxGRUB_UINT64_T
2035+ "+0x%" PRIxGRUB_UINT64_T
2036+ " (%d stripes (%d substripes) of %"
2037+ PRIxGRUB_UINT64_T ")\n",
2038+ grub_le_to_cpu64 (key->offset),
2039+ grub_le_to_cpu64 (chunk->size),
2040+ grub_le_to_cpu16 (chunk->nstripes),
2041+ grub_le_to_cpu16 (chunk->nsubstripes),
2042+ grub_le_to_cpu64 (chunk->stripe_length));
2043+
2044+ switch (grub_le_to_cpu64 (chunk->type)
2045+ & ~GRUB_BTRFS_CHUNK_TYPE_BITS_DONTCARE)
2046+ {
2047+ case GRUB_BTRFS_CHUNK_TYPE_SINGLE:
2048+ {
2049+ grub_uint64_t stripe_length;
2050+ grub_dprintf ("btrfs", "single\n");
2051+ stripe_length = grub_divmod64 (grub_le_to_cpu64 (chunk->size),
2052+ grub_le_to_cpu16 (chunk->nstripes),
2053+ NULL);
2054+ stripen = grub_divmod64 (off, stripe_length, &stripe_offset);
2055+ csize = (stripen + 1) * stripe_length - off;
2056+ break;
2057+ }
2058+ case GRUB_BTRFS_CHUNK_TYPE_DUPLICATED:
2059+ case GRUB_BTRFS_CHUNK_TYPE_RAID1:
2060+ {
2061+ grub_dprintf ("btrfs", "RAID1\n");
2062+ stripen = 0;
2063+ stripe_offset = off;
2064+ csize = grub_le_to_cpu64 (chunk->size) - off;
2065+ redundancy = 2;
2066+ break;
2067+ }
2068+ case GRUB_BTRFS_CHUNK_TYPE_RAID0:
2069+ {
2070+ grub_uint64_t middle, high;
2071+ grub_uint64_t low;
2072+ grub_dprintf ("btrfs", "RAID0\n");
2073+ middle = grub_divmod64 (off,
2074+ grub_le_to_cpu64 (chunk->stripe_length),
2075+ &low);
2076+
2077+ high = grub_divmod64 (middle, grub_le_to_cpu16 (chunk->nstripes),
2078+ &stripen);
2079+ stripe_offset =
2080+ low + grub_le_to_cpu64 (chunk->stripe_length) * high;
2081+ csize = grub_le_to_cpu64 (chunk->stripe_length) - low;
2082+ break;
2083+ }
2084+ case GRUB_BTRFS_CHUNK_TYPE_RAID10:
2085+ {
2086+ grub_uint64_t middle, high;
2087+ grub_uint64_t low;
2088+ middle = grub_divmod64 (off,
2089+ grub_le_to_cpu64 (chunk->stripe_length),
2090+ &low);
2091+
2092+ high = grub_divmod64 (middle,
2093+ grub_le_to_cpu16 (chunk->nstripes)
2094+ / grub_le_to_cpu16 (chunk->nsubstripes),
2095+ &stripen);
2096+ stripen *= grub_le_to_cpu16 (chunk->nsubstripes);
2097+ redundancy = grub_le_to_cpu16 (chunk->nsubstripes);
2098+ stripe_offset = low + grub_le_to_cpu64 (chunk->stripe_length)
2099+ * high;
2100+ csize = grub_le_to_cpu64 (chunk->stripe_length) - low;
2101+ break;
2102+ }
2103+ default:
2104+ grub_dprintf ("btrfs", "unsupported RAID\n");
2105+ return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
2106+ "unsupported RAID flags %" PRIxGRUB_UINT64_T,
2107+ grub_le_to_cpu64 (chunk->type));
2108+ }
2109+ if (csize == 0)
2110+ return grub_error (GRUB_ERR_BUG,
2111+ "couldn't find the chunk descriptor");
2112+ if (csize > (grub_uint64_t) size)
2113+ csize = size;
2114+
2115+ for (j = 0; j < 2; j++)
2116+ {
2117+ for (i = 0; i < redundancy; i++)
2118+ {
2119+ struct grub_btrfs_chunk_stripe *stripe;
2120+ grub_disk_addr_t paddr;
2121+
2122+ stripe = (struct grub_btrfs_chunk_stripe *) (chunk + 1);
2123+ /* Right now the redundancy handling is easy.
2124+ With RAID5-like it will be more difficult. */
2125+ stripe += stripen + i;
2126+
2127+ paddr = grub_le_to_cpu64 (stripe->offset) + stripe_offset;
2128+
2129+ grub_dprintf ("btrfs", "chunk 0x%" PRIxGRUB_UINT64_T
2130+ "+0x%" PRIxGRUB_UINT64_T
2131+ " (%d stripes (%d substripes) of %"
2132+ PRIxGRUB_UINT64_T ") stripe %" PRIxGRUB_UINT64_T
2133+ " maps to 0x%" PRIxGRUB_UINT64_T "\n",
2134+ grub_le_to_cpu64 (key->offset),
2135+ grub_le_to_cpu64 (chunk->size),
2136+ grub_le_to_cpu16 (chunk->nstripes),
2137+ grub_le_to_cpu16 (chunk->nsubstripes),
2138+ grub_le_to_cpu64 (chunk->stripe_length),
2139+ stripen, stripe->offset);
2140+ grub_dprintf ("btrfs", "reading paddr 0x%" PRIxGRUB_UINT64_T
2141+ " for laddr 0x%" PRIxGRUB_UINT64_T "\n", paddr,
2142+ addr);
2143+
2144+ dev = find_device (data, stripe->device_id, j);
2145+ if (!dev)
2146+ {
2147+ err = grub_errno;
2148+ grub_errno = GRUB_ERR_NONE;
2149+ continue;
2150+ }
2151+
2152+ err = grub_disk_read (dev->disk, paddr >> GRUB_DISK_SECTOR_BITS,
2153+ paddr & (GRUB_DISK_SECTOR_SIZE - 1),
2154+ csize, buf);
2155+ if (!err)
2156+ break;
2157+ grub_errno = GRUB_ERR_NONE;
2158+ }
2159+ if (i != redundancy)
2160+ break;
2161+ }
2162+ if (err)
2163+ return grub_errno = err;
2164+ }
2165+ size -= csize;
2166+ buf = (grub_uint8_t *) buf + csize;
2167+ addr += csize;
2168+ if (challoc)
2169+ grub_free (chunk);
2170+ }
2171+ return GRUB_ERR_NONE;
2172+}
2173+
2174+static struct grub_btrfs_data *
2175+grub_btrfs_mount (grub_device_t dev)
2176+{
2177+ struct grub_btrfs_data *data;
2178+ grub_err_t err;
2179+
2180+ if (!dev->disk)
2181+ {
2182+ grub_error (GRUB_ERR_BAD_FS, "not BtrFS");
2183+ return NULL;
2184+ }
2185+
2186+ data = grub_zalloc (sizeof (*data));
2187+ if (!data)
2188+ return NULL;
2189+
2190+ err = read_sblock (dev->disk, &data->sblock);
2191+ if (err)
2192+ {
2193+ grub_free (data);
2194+ return NULL;
2195+ }
2196+
2197+ data->n_devices_allocated = 16;
2198+ data->devices_attached = grub_malloc (sizeof (data->devices_attached[0])
2199+ * data->n_devices_allocated);
2200+ if (!data->devices_attached)
2201+ {
2202+ grub_free (data);
2203+ return NULL;
2204+ }
2205+ data->n_devices_attached = 1;
2206+ data->devices_attached[0].dev = dev;
2207+ data->devices_attached[0].id = data->sblock.this_device.device_id;
2208+
2209+ return data;
2210+}
2211+
2212+static void
2213+grub_btrfs_unmount (struct grub_btrfs_data *data)
2214+{
2215+ unsigned i;
2216+ /* The device 0 is closed one layer upper. */
2217+ for (i = 1; i < data->n_devices_attached; i++)
2218+ grub_device_close (data->devices_attached[i].dev);
2219+ grub_free (data->devices_attached);
2220+ grub_free (data->extent);
2221+ grub_free (data);
2222+}
2223+
2224+static grub_err_t
2225+grub_btrfs_read_inode (struct grub_btrfs_data *data,
2226+ struct grub_btrfs_inode *inode, grub_uint64_t num,
2227+ grub_uint64_t tree)
2228+{
2229+ struct grub_btrfs_key key_in, key_out;
2230+ grub_disk_addr_t elemaddr;
2231+ grub_size_t elemsize;
2232+ grub_err_t err;
2233+
2234+ key_in.object_id = num;
2235+ key_in.type = GRUB_BTRFS_ITEM_TYPE_INODE_ITEM;
2236+ key_in.offset = 0;
2237+
2238+ err = lower_bound (data, &key_in, &key_out, tree, &elemaddr, &elemsize, NULL,
2239+ 0);
2240+ if (err)
2241+ return err;
2242+ if (num != key_out.object_id
2243+ || key_out.type != GRUB_BTRFS_ITEM_TYPE_INODE_ITEM)
2244+ return grub_error (GRUB_ERR_BAD_FS, "inode not found");
2245+
2246+ return grub_btrfs_read_logical (data, elemaddr, inode, sizeof (*inode), 0);
2247+}
2248+
2249+static grub_ssize_t
2250+grub_btrfs_lzo_decompress(char *ibuf, grub_size_t isize, grub_off_t off,
2251+ char *obuf, grub_size_t osize)
2252+{
2253+ grub_uint32_t total_size, cblock_size;
2254+ grub_size_t ret = 0;
2255+ char *ibuf0 = ibuf;
2256+
2257+ total_size = grub_le_to_cpu32 (grub_get_unaligned32 (ibuf));
2258+ ibuf += sizeof (total_size);
2259+
2260+ if (isize < total_size)
2261+ return -1;
2262+
2263+ /* Jump forward to first block with requested data. */
2264+ while (off >= GRUB_BTRFS_LZO_BLOCK_SIZE)
2265+ {
2266+ /* Don't let following uint32_t cross the page boundary. */
2267+ if (((ibuf - ibuf0) & 0xffc) == 0xffc)
2268+ ibuf = ((ibuf - ibuf0 + 3) & ~3) + ibuf0;
2269+
2270+ cblock_size = grub_le_to_cpu32 (grub_get_unaligned32 (ibuf));
2271+ ibuf += sizeof (cblock_size);
2272+
2273+ if (cblock_size > GRUB_BTRFS_LZO_BLOCK_MAX_CSIZE)
2274+ return -1;
2275+
2276+ off -= GRUB_BTRFS_LZO_BLOCK_SIZE;
2277+ ibuf += cblock_size;
2278+ }
2279+
2280+ while (osize > 0)
2281+ {
2282+ lzo_uint usize = GRUB_BTRFS_LZO_BLOCK_SIZE;
2283+
2284+ /* Don't let following uint32_t cross the page boundary. */
2285+ if (((ibuf - ibuf0) & 0xffc) == 0xffc)
2286+ ibuf = ((ibuf - ibuf0 + 3) & ~3) + ibuf0;
2287+
2288+ cblock_size = grub_le_to_cpu32 (grub_get_unaligned32 (ibuf));
2289+ ibuf += sizeof (cblock_size);
2290+
2291+ if (cblock_size > GRUB_BTRFS_LZO_BLOCK_MAX_CSIZE)
2292+ return -1;
2293+
2294+ /* Block partially filled with requested data. */
2295+ if (off > 0 || osize < GRUB_BTRFS_LZO_BLOCK_SIZE)
2296+ {
2297+ grub_size_t to_copy = GRUB_BTRFS_LZO_BLOCK_SIZE - off;
2298+ grub_uint8_t *buf;
2299+
2300+ if (to_copy > osize)
2301+ to_copy = osize;
2302+
2303+ buf = grub_malloc (GRUB_BTRFS_LZO_BLOCK_SIZE);
2304+ if (!buf)
2305+ return -1;
2306+
2307+ if (lzo1x_decompress_safe ((lzo_bytep)ibuf, cblock_size, buf, &usize,
2308+ NULL) != LZO_E_OK)
2309+ {
2310+ grub_free (buf);
2311+ return -1;
2312+ }
2313+
2314+ if (to_copy > usize)
2315+ to_copy = usize;
2316+ grub_memcpy(obuf, buf + off, to_copy);
2317+
2318+ osize -= to_copy;
2319+ ret += to_copy;
2320+ obuf += to_copy;
2321+ ibuf += cblock_size;
2322+ off = 0;
2323+
2324+ grub_free (buf);
2325+ continue;
2326+ }
2327+
2328+ /* Decompress whole block directly to output buffer. */
2329+ if (lzo1x_decompress_safe ((lzo_bytep)ibuf, cblock_size, (lzo_bytep)obuf,
2330+ &usize, NULL) != LZO_E_OK)
2331+ return -1;
2332+
2333+ osize -= usize;
2334+ ret += usize;
2335+ obuf += usize;
2336+ ibuf += cblock_size;
2337+ }
2338+
2339+ return ret;
2340+}
2341+
2342+static grub_ssize_t
2343+grub_btrfs_extent_read (struct grub_btrfs_data *data,
2344+ grub_uint64_t ino, grub_uint64_t tree,
2345+ grub_off_t pos0, char *buf, grub_size_t len)
2346+{
2347+ grub_off_t pos = pos0;
2348+ while (len)
2349+ {
2350+ grub_size_t csize;
2351+ grub_err_t err;
2352+ grub_off_t extoff;
2353+ if (!data->extent || data->extstart > pos || data->extino != ino
2354+ || data->exttree != tree || data->extend <= pos)
2355+ {
2356+ struct grub_btrfs_key key_in, key_out;
2357+ grub_disk_addr_t elemaddr;
2358+ grub_size_t elemsize;
2359+
2360+ grub_free (data->extent);
2361+ key_in.object_id = ino;
2362+ key_in.type = GRUB_BTRFS_ITEM_TYPE_EXTENT_ITEM;
2363+ key_in.offset = grub_cpu_to_le64 (pos);
2364+ err = lower_bound (data, &key_in, &key_out, tree,
2365+ &elemaddr, &elemsize, NULL, 0);
2366+ if (err)
2367+ return -1;
2368+ if (key_out.object_id != ino
2369+ || key_out.type != GRUB_BTRFS_ITEM_TYPE_EXTENT_ITEM)
2370+ {
2371+ grub_error (GRUB_ERR_BAD_FS, "extent not found");
2372+ return -1;
2373+ }
2374+ if ((grub_ssize_t) elemsize < ((char *) &data->extent->inl
2375+ - (char *) data->extent))
2376+ {
2377+ grub_error (GRUB_ERR_BAD_FS, "extent descriptor is too short");
2378+ return -1;
2379+ }
2380+ data->extstart = grub_le_to_cpu64 (key_out.offset);
2381+ data->extsize = elemsize;
2382+ data->extent = grub_malloc (elemsize);
2383+ data->extino = ino;
2384+ data->exttree = tree;
2385+ if (!data->extent)
2386+ return grub_errno;
2387+
2388+ err = grub_btrfs_read_logical (data, elemaddr, data->extent,
2389+ elemsize, 0);
2390+ if (err)
2391+ return err;
2392+
2393+ data->extend = data->extstart + grub_le_to_cpu64 (data->extent->size);
2394+ if (data->extent->type == GRUB_BTRFS_EXTENT_REGULAR
2395+ && (char *) &data->extent + elemsize
2396+ >= (char *) &data->extent->filled + sizeof (data->extent->filled))
2397+ data->extend =
2398+ data->extstart + grub_le_to_cpu64 (data->extent->filled);
2399+
2400+ grub_dprintf ("btrfs", "regular extent 0x%" PRIxGRUB_UINT64_T "+0x%"
2401+ PRIxGRUB_UINT64_T "\n",
2402+ grub_le_to_cpu64 (key_out.offset),
2403+ grub_le_to_cpu64 (data->extent->size));
2404+ if (data->extend <= pos)
2405+ {
2406+ grub_error (GRUB_ERR_BAD_FS, "extent not found");
2407+ return -1;
2408+ }
2409+ }
2410+ csize = data->extend - pos;
2411+ extoff = pos - data->extstart;
2412+ if (csize > len)
2413+ csize = len;
2414+
2415+ if (data->extent->encryption)
2416+ {
2417+ grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
2418+ "encryption not supported");
2419+ return -1;
2420+ }
2421+
2422+ if (data->extent->compression != GRUB_BTRFS_COMPRESSION_NONE
2423+ && data->extent->compression != GRUB_BTRFS_COMPRESSION_ZLIB
2424+ && data->extent->compression != GRUB_BTRFS_COMPRESSION_LZO)
2425+ {
2426+ grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
2427+ "compression type 0x%x not supported",
2428+ data->extent->compression);
2429+ return -1;
2430+ }
2431+
2432+ if (data->extent->encoding)
2433+ {
2434+ grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "encoding not supported");
2435+ return -1;
2436+ }
2437+
2438+ switch (data->extent->type)
2439+ {
2440+ case GRUB_BTRFS_EXTENT_INLINE:
2441+ if (data->extent->compression == GRUB_BTRFS_COMPRESSION_ZLIB)
2442+ {
2443+ if (grub_zlib_decompress (data->extent->inl, data->extsize -
2444+ ((grub_uint8_t *) data->extent->inl
2445+ - (grub_uint8_t *) data->extent),
2446+ extoff, buf, csize)
2447+ != (grub_ssize_t) csize)
2448+ {
2449+ if (!grub_errno)
2450+ grub_error (GRUB_ERR_BAD_COMPRESSED_DATA,
2451+ "premature end of compressed");
2452+ return -1;
2453+ }
2454+ }
2455+ else if (data->extent->compression == GRUB_BTRFS_COMPRESSION_LZO)
2456+ {
2457+ if (grub_btrfs_lzo_decompress(data->extent->inl, data->extsize -
2458+ ((grub_uint8_t *) data->extent->inl
2459+ - (grub_uint8_t *) data->extent),
2460+ extoff, buf, csize)
2461+ != (grub_ssize_t) csize)
2462+ return -1;
2463+ }
2464+ else
2465+ grub_memcpy (buf, data->extent->inl + extoff, csize);
2466+ break;
2467+ case GRUB_BTRFS_EXTENT_REGULAR:
2468+ if (!data->extent->laddr)
2469+ {
2470+ grub_memset (buf, 0, csize);
2471+ break;
2472+ }
2473+
2474+ if (data->extent->compression != GRUB_BTRFS_COMPRESSION_NONE)
2475+ {
2476+ char *tmp;
2477+ grub_uint64_t zsize;
2478+ grub_ssize_t ret;
2479+
2480+ zsize = grub_le_to_cpu64 (data->extent->compressed_size);
2481+ tmp = grub_malloc (zsize);
2482+ if (!tmp)
2483+ return -1;
2484+ err = grub_btrfs_read_logical (data,
2485+ grub_le_to_cpu64 (data->extent->laddr),
2486+ tmp, zsize, 0);
2487+ if (err)
2488+ {
2489+ grub_free (tmp);
2490+ return -1;
2491+ }
2492+
2493+ if (data->extent->compression == GRUB_BTRFS_COMPRESSION_ZLIB)
2494+ ret = grub_zlib_decompress (tmp, zsize, extoff
2495+ + grub_le_to_cpu64 (data->extent->offset),
2496+ buf, csize);
2497+ else if (data->extent->compression == GRUB_BTRFS_COMPRESSION_LZO)
2498+ ret = grub_btrfs_lzo_decompress (tmp, zsize, extoff
2499+ + grub_le_to_cpu64 (data->extent->offset),
2500+ buf, csize);
2501+ else
2502+ ret = -1;
2503+
2504+ grub_free (tmp);
2505+
2506+ if (ret != (grub_ssize_t) csize)
2507+ {
2508+ if (!grub_errno)
2509+ grub_error (GRUB_ERR_BAD_COMPRESSED_DATA,
2510+ "premature end of compressed");
2511+ return -1;
2512+ }
2513+
2514+ break;
2515+ }
2516+ err = grub_btrfs_read_logical (data,
2517+ grub_le_to_cpu64 (data->extent->laddr)
2518+ + grub_le_to_cpu64 (data->extent->offset)
2519+ + extoff, buf, csize, 0);
2520+ if (err)
2521+ return -1;
2522+ break;
2523+ default:
2524+ grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
2525+ "unsupported extent type 0x%x", data->extent->type);
2526+ return -1;
2527+ }
2528+ buf += csize;
2529+ pos += csize;
2530+ len -= csize;
2531+ }
2532+ return pos - pos0;
2533+}
2534+
2535+static grub_err_t
2536+get_root (struct grub_btrfs_data *data, struct grub_btrfs_key *key,
2537+ grub_uint64_t *tree, grub_uint8_t *type)
2538+{
2539+ grub_err_t err;
2540+ grub_disk_addr_t elemaddr;
2541+ grub_size_t elemsize;
2542+ struct grub_btrfs_key key_out, key_in;
2543+ struct grub_btrfs_root_item ri;
2544+
2545+ key_in.object_id = GRUB_BTRFS_ROOT_VOL_OBJECTID;
2546+ key_in.offset = 0;
2547+ key_in.type = GRUB_BTRFS_ITEM_TYPE_ROOT_ITEM;
2548+ err = lower_bound (data, &key_in, &key_out,
2549+ data->sblock.root_tree,
2550+ &elemaddr, &elemsize, NULL, 0);
2551+ if (err)
2552+ return err;
2553+ if (key_in.object_id != key_out.object_id
2554+ || key_in.type != key_out.type
2555+ || key_in.offset != key_out.offset)
2556+ return grub_error (GRUB_ERR_BAD_FS, "no root");
2557+ err = grub_btrfs_read_logical (data, elemaddr, &ri,
2558+ sizeof (ri), 0);
2559+ if (err)
2560+ return err;
2561+ key->type = GRUB_BTRFS_ITEM_TYPE_DIR_ITEM;
2562+ key->offset = 0;
2563+ key->object_id = grub_cpu_to_le64_compile_time (GRUB_BTRFS_OBJECT_ID_CHUNK);
2564+ *tree = ri.tree;
2565+ *type = GRUB_BTRFS_DIR_ITEM_TYPE_DIRECTORY;
2566+ return GRUB_ERR_NONE;
2567+}
2568+
2569+static grub_err_t
2570+find_path (struct grub_btrfs_data *data,
2571+ const char *path, struct grub_btrfs_key *key,
2572+ grub_uint64_t *tree, grub_uint8_t *type)
2573+{
2574+ const char *slash = path;
2575+ grub_err_t err;
2576+ grub_disk_addr_t elemaddr;
2577+ grub_size_t elemsize;
2578+ grub_size_t allocated = 0;
2579+ struct grub_btrfs_dir_item *direl = NULL;
2580+ struct grub_btrfs_key key_out;
2581+ const char *ctoken;
2582+ grub_size_t ctokenlen;
2583+ char *path_alloc = NULL;
2584+ char *origpath = NULL;
2585+ unsigned symlinks_max = 32;
2586+
2587+ err = get_root (data, key, tree, type);
2588+ if (err)
2589+ return err;
2590+
2591+ origpath = grub_strdup (path);
2592+ if (!origpath)
2593+ return grub_errno;
2594+
2595+ while (1)
2596+ {
2597+ while (path[0] == '/')
2598+ path++;
2599+ if (!path[0])
2600+ break;
2601+ slash = grub_strchr (path, '/');
2602+ if (!slash)
2603+ slash = path + grub_strlen (path);
2604+ ctoken = path;
2605+ ctokenlen = slash - path;
2606+
2607+ if (*type != GRUB_BTRFS_DIR_ITEM_TYPE_DIRECTORY)
2608+ {
2609+ grub_free (path_alloc);
2610+ grub_free (origpath);
2611+ return grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a directory"));
2612+ }
2613+
2614+ if (ctokenlen == 1 && ctoken[0] == '.')
2615+ {
2616+ path = slash;
2617+ continue;
2618+ }
2619+ if (ctokenlen == 2 && ctoken[0] == '.' && ctoken[1] == '.')
2620+ {
2621+ key->type = GRUB_BTRFS_ITEM_TYPE_INODE_REF;
2622+ key->offset = -1;
2623+
2624+ err = lower_bound (data, key, &key_out, *tree, &elemaddr, &elemsize,
2625+ NULL, 0);
2626+ if (err)
2627+ {
2628+ grub_free (direl);
2629+ grub_free (path_alloc);
2630+ grub_free (origpath);
2631+ return err;
2632+ }
2633+
2634+ if (key_out.type != key->type
2635+ || key->object_id != key_out.object_id)
2636+ {
2637+ grub_free (direl);
2638+ grub_free (path_alloc);
2639+ err = grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), origpath);
2640+ grub_free (origpath);
2641+ return err;
2642+ }
2643+
2644+ *type = GRUB_BTRFS_DIR_ITEM_TYPE_DIRECTORY;
2645+ key->object_id = key_out.offset;
2646+
2647+ path = slash;
2648+
2649+ continue;
2650+ }
2651+
2652+ key->type = GRUB_BTRFS_ITEM_TYPE_DIR_ITEM;
2653+ key->offset = grub_cpu_to_le64 (~grub_getcrc32c (1, ctoken, ctokenlen));
2654+
2655+ err = lower_bound (data, key, &key_out, *tree, &elemaddr, &elemsize,
2656+ NULL, 0);
2657+ if (err)
2658+ {
2659+ grub_free (direl);
2660+ grub_free (path_alloc);
2661+ grub_free (origpath);
2662+ return err;
2663+ }
2664+ if (key_cmp (key, &key_out) != 0)
2665+ {
2666+ grub_free (direl);
2667+ grub_free (path_alloc);
2668+ err = grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), origpath);
2669+ grub_free (origpath);
2670+ return err;
2671+ }
2672+
2673+ struct grub_btrfs_dir_item *cdirel;
2674+ if (elemsize > allocated)
2675+ {
2676+ allocated = 2 * elemsize;
2677+ grub_free (direl);
2678+ direl = grub_malloc (allocated + 1);
2679+ if (!direl)
2680+ {
2681+ grub_free (path_alloc);
2682+ grub_free (origpath);
2683+ return grub_errno;
2684+ }
2685+ }
2686+
2687+ err = grub_btrfs_read_logical (data, elemaddr, direl, elemsize, 0);
2688+ if (err)
2689+ {
2690+ grub_free (direl);
2691+ grub_free (path_alloc);
2692+ grub_free (origpath);
2693+ return err;
2694+ }
2695+
2696+ for (cdirel = direl;
2697+ (grub_uint8_t *) cdirel - (grub_uint8_t *) direl
2698+ < (grub_ssize_t) elemsize;
2699+ cdirel = (void *) ((grub_uint8_t *) (direl + 1)
2700+ + grub_le_to_cpu16 (cdirel->n)
2701+ + grub_le_to_cpu16 (cdirel->m)))
2702+ {
2703+ if (ctokenlen == grub_le_to_cpu16 (cdirel->n)
2704+ && grub_memcmp (cdirel->name, ctoken, ctokenlen) == 0)
2705+ break;
2706+ }
2707+ if ((grub_uint8_t *) cdirel - (grub_uint8_t *) direl
2708+ >= (grub_ssize_t) elemsize)
2709+ {
2710+ grub_free (direl);
2711+ grub_free (path_alloc);
2712+ err = grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), origpath);
2713+ grub_free (origpath);
2714+ return err;
2715+ }
2716+
2717+ path = slash;
2718+ if (cdirel->type == GRUB_BTRFS_DIR_ITEM_TYPE_SYMLINK)
2719+ {
2720+ struct grub_btrfs_inode inode;
2721+ char *tmp;
2722+ if (--symlinks_max == 0)
2723+ {
2724+ grub_free (direl);
2725+ grub_free (path_alloc);
2726+ grub_free (origpath);
2727+ return grub_error (GRUB_ERR_SYMLINK_LOOP,
2728+ N_("too deep nesting of symlinks"));
2729+ }
2730+
2731+ err = grub_btrfs_read_inode (data, &inode,
2732+ cdirel->key.object_id, *tree);
2733+ if (err)
2734+ {
2735+ grub_free (direl);
2736+ grub_free (path_alloc);
2737+ grub_free (origpath);
2738+ return err;
2739+ }
2740+ tmp = grub_malloc (grub_le_to_cpu64 (inode.size)
2741+ + grub_strlen (path) + 1);
2742+ if (!tmp)
2743+ {
2744+ grub_free (direl);
2745+ grub_free (path_alloc);
2746+ grub_free (origpath);
2747+ return grub_errno;
2748+ }
2749+
2750+ if (grub_btrfs_extent_read (data, cdirel->key.object_id,
2751+ *tree, 0, tmp,
2752+ grub_le_to_cpu64 (inode.size))
2753+ != (grub_ssize_t) grub_le_to_cpu64 (inode.size))
2754+ {
2755+ grub_free (direl);
2756+ grub_free (path_alloc);
2757+ grub_free (origpath);
2758+ grub_free (tmp);
2759+ return grub_errno;
2760+ }
2761+ grub_memcpy (tmp + grub_le_to_cpu64 (inode.size), path,
2762+ grub_strlen (path) + 1);
2763+ grub_free (path_alloc);
2764+ path = path_alloc = tmp;
2765+ if (path[0] == '/')
2766+ {
2767+ err = get_root (data, key, tree, type);
2768+ if (err)
2769+ return err;
2770+ }
2771+ continue;
2772+ }
2773+ *type = cdirel->type;
2774+
2775+ switch (cdirel->key.type)
2776+ {
2777+ case GRUB_BTRFS_ITEM_TYPE_ROOT_ITEM:
2778+ {
2779+ struct grub_btrfs_root_item ri;
2780+ err = lower_bound (data, &cdirel->key, &key_out,
2781+ data->sblock.root_tree,
2782+ &elemaddr, &elemsize, NULL, 0);
2783+ if (err)
2784+ {
2785+ grub_free (direl);
2786+ grub_free (path_alloc);
2787+ grub_free (origpath);
2788+ return err;
2789+ }
2790+ if (cdirel->key.object_id != key_out.object_id
2791+ || cdirel->key.type != key_out.type)
2792+ {
2793+ grub_free (direl);
2794+ grub_free (path_alloc);
2795+ err = grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), origpath);
2796+ grub_free (origpath);
2797+ return err;
2798+ }
2799+ err = grub_btrfs_read_logical (data, elemaddr, &ri,
2800+ sizeof (ri), 0);
2801+ if (err)
2802+ {
2803+ grub_free (direl);
2804+ grub_free (path_alloc);
2805+ grub_free (origpath);
2806+ return err;
2807+ }
2808+ key->type = GRUB_BTRFS_ITEM_TYPE_DIR_ITEM;
2809+ key->offset = 0;
2810+ key->object_id = grub_cpu_to_le64_compile_time (GRUB_BTRFS_OBJECT_ID_CHUNK);
2811+ *tree = ri.tree;
2812+ break;
2813+ }
2814+ case GRUB_BTRFS_ITEM_TYPE_INODE_ITEM:
2815+ if (*slash && *type == GRUB_BTRFS_DIR_ITEM_TYPE_REGULAR)
2816+ {
2817+ grub_free (direl);
2818+ grub_free (path_alloc);
2819+ err = grub_error (GRUB_ERR_FILE_NOT_FOUND, N_("file `%s' not found"), origpath);
2820+ grub_free (origpath);
2821+ return err;
2822+ }
2823+ *key = cdirel->key;
2824+ if (*type == GRUB_BTRFS_DIR_ITEM_TYPE_DIRECTORY)
2825+ key->type = GRUB_BTRFS_ITEM_TYPE_DIR_ITEM;
2826+ break;
2827+ default:
2828+ grub_free (path_alloc);
2829+ grub_free (origpath);
2830+ grub_free (direl);
2831+ return grub_error (GRUB_ERR_BAD_FS, "unrecognised object type 0x%x",
2832+ cdirel->key.type);
2833+ }
2834+ }
2835+
2836+ grub_free (direl);
2837+ grub_free (origpath);
2838+ grub_free (path_alloc);
2839+ return GRUB_ERR_NONE;
2840+}
2841+
2842+static grub_err_t
2843+grub_btrfs_dir (grub_device_t device, const char *path,
2844+ grub_fs_dir_hook_t hook, void *hook_data)
2845+{
2846+ struct grub_btrfs_data *data = grub_btrfs_mount (device);
2847+ struct grub_btrfs_key key_in, key_out;
2848+ grub_err_t err;
2849+ grub_disk_addr_t elemaddr;
2850+ grub_size_t elemsize;
2851+ grub_size_t allocated = 0;
2852+ struct grub_btrfs_dir_item *direl = NULL;
2853+ struct grub_btrfs_leaf_descriptor desc;
2854+ int r = 0;
2855+ grub_uint64_t tree;
2856+ grub_uint8_t type;
2857+
2858+ if (!data)
2859+ return grub_errno;
2860+
2861+ err = find_path (data, path, &key_in, &tree, &type);
2862+ if (err)
2863+ {
2864+ grub_btrfs_unmount (data);
2865+ return err;
2866+ }
2867+ if (type != GRUB_BTRFS_DIR_ITEM_TYPE_DIRECTORY)
2868+ {
2869+ grub_btrfs_unmount (data);
2870+ return grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a directory"));
2871+ }
2872+
2873+ err = lower_bound (data, &key_in, &key_out, tree,
2874+ &elemaddr, &elemsize, &desc, 0);
2875+ if (err)
2876+ {
2877+ grub_btrfs_unmount (data);
2878+ return err;
2879+ }
2880+ if (key_out.type != GRUB_BTRFS_ITEM_TYPE_DIR_ITEM
2881+ || key_out.object_id != key_in.object_id)
2882+ {
2883+ r = next (data, &desc, &elemaddr, &elemsize, &key_out);
2884+ if (r <= 0)
2885+ goto out;
2886+ }
2887+ do
2888+ {
2889+ struct grub_btrfs_dir_item *cdirel;
2890+ if (key_out.type != GRUB_BTRFS_ITEM_TYPE_DIR_ITEM
2891+ || key_out.object_id != key_in.object_id)
2892+ {
2893+ r = 0;
2894+ break;
2895+ }
2896+ if (elemsize > allocated)
2897+ {
2898+ allocated = 2 * elemsize;
2899+ grub_free (direl);
2900+ direl = grub_malloc (allocated + 1);
2901+ if (!direl)
2902+ {
2903+ r = -grub_errno;
2904+ break;
2905+ }
2906+ }
2907+
2908+ err = grub_btrfs_read_logical (data, elemaddr, direl, elemsize, 0);
2909+ if (err)
2910+ {
2911+ r = -err;
2912+ break;
2913+ }
2914+
2915+ for (cdirel = direl;
2916+ (grub_uint8_t *) cdirel - (grub_uint8_t *) direl
2917+ < (grub_ssize_t) elemsize;
2918+ cdirel = (void *) ((grub_uint8_t *) (direl + 1)
2919+ + grub_le_to_cpu16 (cdirel->n)
2920+ + grub_le_to_cpu16 (cdirel->m)))
2921+ {
2922+ char c;
2923+ struct grub_btrfs_inode inode;
2924+ struct grub_dirhook_info info;
2925+ err = grub_btrfs_read_inode (data, &inode, cdirel->key.object_id,
2926+ tree);
2927+ grub_memset (&info, 0, sizeof (info));
2928+ if (err)
2929+ grub_errno = GRUB_ERR_NONE;
2930+ else
2931+ {
2932+ info.mtime = grub_le_to_cpu64 (inode.mtime.sec);
2933+ info.mtimeset = 1;
2934+ }
2935+ c = cdirel->name[grub_le_to_cpu16 (cdirel->n)];
2936+ cdirel->name[grub_le_to_cpu16 (cdirel->n)] = 0;
2937+ info.dir = (cdirel->type == GRUB_BTRFS_DIR_ITEM_TYPE_DIRECTORY);
2938+ if (hook (cdirel->name, &info, hook_data))
2939+ goto out;
2940+ cdirel->name[grub_le_to_cpu16 (cdirel->n)] = c;
2941+ }
2942+ r = next (data, &desc, &elemaddr, &elemsize, &key_out);
2943+ }
2944+ while (r > 0);
2945+
2946+out:
2947+ grub_free (direl);
2948+
2949+ free_iterator (&desc);
2950+ grub_btrfs_unmount (data);
2951+
2952+ return -r;
2953+}
2954+
2955+static grub_err_t
2956+grub_btrfs_open (struct grub_file *file, const char *name)
2957+{
2958+ struct grub_btrfs_data *data = grub_btrfs_mount (file->device);
2959+ grub_err_t err;
2960+ struct grub_btrfs_inode inode;
2961+ grub_uint8_t type;
2962+ struct grub_btrfs_key key_in;
2963+
2964+ if (!data)
2965+ return grub_errno;
2966+
2967+ err = find_path (data, name, &key_in, &data->tree, &type);
2968+ if (err)
2969+ {
2970+ grub_btrfs_unmount (data);
2971+ return err;
2972+ }
2973+ if (type != GRUB_BTRFS_DIR_ITEM_TYPE_REGULAR)
2974+ {
2975+ grub_btrfs_unmount (data);
2976+ return grub_error (GRUB_ERR_BAD_FILE_TYPE, N_("not a regular file"));
2977+ }
2978+
2979+ data->inode = key_in.object_id;
2980+ err = grub_btrfs_read_inode (data, &inode, data->inode, data->tree);
2981+ if (err)
2982+ {
2983+ grub_btrfs_unmount (data);
2984+ return err;
2985+ }
2986+
2987+ file->data = data;
2988+ file->size = grub_le_to_cpu64 (inode.size);
2989+
2990+ return err;
2991+}
2992+
2993+static grub_err_t
2994+grub_btrfs_close (grub_file_t file)
2995+{
2996+ grub_btrfs_unmount (file->data);
2997+
2998+ return GRUB_ERR_NONE;
2999+}
3000+
3001+static grub_ssize_t
3002+grub_btrfs_read (grub_file_t file, char *buf, grub_size_t len)
3003+{
3004+ struct grub_btrfs_data *data = file->data;
3005+
3006+ return grub_btrfs_extent_read (data, data->inode,
3007+ data->tree, file->offset, buf, len);
3008+}
3009+
3010+static grub_err_t
3011+grub_btrfs_uuid (grub_device_t device, char **uuid)
3012+{
3013+ struct grub_btrfs_data *data;
3014+
3015+ *uuid = NULL;
3016+
3017+ data = grub_btrfs_mount (device);
3018+ if (!data)
3019+ return grub_errno;
3020+
3021+ *uuid = grub_xasprintf ("%04x%04x-%04x-%04x-%04x-%04x%04x%04x",
3022+ grub_be_to_cpu16 (data->sblock.uuid[0]),
3023+ grub_be_to_cpu16 (data->sblock.uuid[1]),
3024+ grub_be_to_cpu16 (data->sblock.uuid[2]),
3025+ grub_be_to_cpu16 (data->sblock.uuid[3]),
3026+ grub_be_to_cpu16 (data->sblock.uuid[4]),
3027+ grub_be_to_cpu16 (data->sblock.uuid[5]),
3028+ grub_be_to_cpu16 (data->sblock.uuid[6]),
3029+ grub_be_to_cpu16 (data->sblock.uuid[7]));
3030+
3031+ grub_btrfs_unmount (data);
3032+
3033+ return grub_errno;
3034+}
3035+
3036+static grub_err_t
3037+grub_btrfs_label (grub_device_t device, char **label)
3038+{
3039+ struct grub_btrfs_data *data;
3040+
3041+ *label = NULL;
3042+
3043+ data = grub_btrfs_mount (device);
3044+ if (!data)
3045+ return grub_errno;
3046+
3047+ *label = grub_strndup (data->sblock.label, sizeof (data->sblock.label));
3048+
3049+ grub_btrfs_unmount (data);
3050+
3051+ return grub_errno;
3052+}
3053+
3054+#ifdef GRUB_UTIL
3055+static grub_err_t
3056+grub_btrfs_embed (grub_device_t device __attribute__ ((unused)),
3057+ unsigned int *nsectors,
3058+ unsigned int max_nsectors,
3059+ grub_embed_type_t embed_type,
3060+ grub_disk_addr_t **sectors)
3061+{
3062+ unsigned i;
3063+
3064+ if (embed_type != GRUB_EMBED_PCBIOS)
3065+ return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
3066+ "BtrFS currently supports only PC-BIOS embedding");
3067+
3068+ if (64 * 2 - 1 < *nsectors)
3069+ return grub_error (GRUB_ERR_OUT_OF_RANGE,
3070+ N_("your core.img is unusually large. "
3071+ "It won't fit in the embedding area"));
3072+
3073+ *nsectors = 64 * 2 - 1;
3074+ if (*nsectors > max_nsectors)
3075+ *nsectors = max_nsectors;
3076+ *sectors = grub_malloc (*nsectors * sizeof (**sectors));
3077+ if (!*sectors)
3078+ return grub_errno;
3079+ for (i = 0; i < *nsectors; i++)
3080+ (*sectors)[i] = i + 1;
3081+
3082+ return GRUB_ERR_NONE;
3083+}
3084+#endif
3085+
3086+static struct grub_fs grub_btrfs_fs = {
3087+ .name = "btrfs",
3088+ .dir = grub_btrfs_dir,
3089+ .open = grub_btrfs_open,
3090+ .read = grub_btrfs_read,
3091+ .close = grub_btrfs_close,
3092+ .uuid = grub_btrfs_uuid,
3093+ .label = grub_btrfs_label,
3094+#ifdef GRUB_UTIL
3095+ .embed = grub_btrfs_embed,
3096+ .reserved_first_sector = 1,
3097+ .blocklist_install = 0,
3098+#endif
3099+};
3100+
3101+GRUB_MOD_INIT (btrfs)
3102+{
3103+ grub_fs_register (&grub_btrfs_fs);
3104+}
3105+
3106+GRUB_MOD_FINI (btrfs)
3107+{
3108+ grub_fs_unregister (&grub_btrfs_fs);
3109+}
3110
3111=== added directory '.pc/core_in_fs.patch'
3112=== added directory '.pc/core_in_fs.patch/util'
3113=== added file '.pc/core_in_fs.patch/util/setup.c'
3114--- .pc/core_in_fs.patch/util/setup.c 1970-01-01 00:00:00 +0000
3115+++ .pc/core_in_fs.patch/util/setup.c 2014-08-24 23:28:48 +0000
3116@@ -0,0 +1,778 @@
3117+/* grub-setup.c - make GRUB usable */
3118+/*
3119+ * GRUB -- GRand Unified Bootloader
3120+ * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011 Free Software Foundation, Inc.
3121+ *
3122+ * GRUB is free software: you can redistribute it and/or modify
3123+ * it under the terms of the GNU General Public License as published by
3124+ * the Free Software Foundation, either version 3 of the License, or
3125+ * (at your option) any later version.
3126+ *
3127+ * GRUB is distributed in the hope that it will be useful,
3128+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3129+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3130+ * GNU General Public License for more details.
3131+ *
3132+ * You should have received a copy of the GNU General Public License
3133+ * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
3134+ */
3135+
3136+#include <config.h>
3137+#include <grub/types.h>
3138+#include <grub/emu/misc.h>
3139+#include <grub/util/misc.h>
3140+#include <grub/device.h>
3141+#include <grub/disk.h>
3142+#include <grub/file.h>
3143+#include <grub/fs.h>
3144+#include <grub/partition.h>
3145+#include <grub/env.h>
3146+#include <grub/emu/hostdisk.h>
3147+#include <grub/term.h>
3148+#include <grub/i18n.h>
3149+
3150+#ifdef GRUB_SETUP_SPARC64
3151+#include <grub/util/ofpath.h>
3152+#include <grub/sparc64/ieee1275/boot.h>
3153+#include <grub/sparc64/ieee1275/kernel.h>
3154+#else
3155+#include <grub/i386/pc/boot.h>
3156+#include <grub/i386/pc/kernel.h>
3157+#endif
3158+
3159+#include <stdio.h>
3160+#include <unistd.h>
3161+#include <string.h>
3162+#include <stdlib.h>
3163+#include <sys/types.h>
3164+#include <sys/stat.h>
3165+#include <dirent.h>
3166+#include <assert.h>
3167+#include <grub/emu/getroot.h>
3168+#include "progname.h"
3169+#include <grub/reed_solomon.h>
3170+#include <grub/msdos_partition.h>
3171+#include <grub/crypto.h>
3172+#include <grub/util/install.h>
3173+#include <grub/emu/hostfile.h>
3174+
3175+#include <errno.h>
3176+
3177+/* On SPARC this program fills in various fields inside of the 'boot' and 'core'
3178+ * image files.
3179+ *
3180+ * The 'boot' image needs to know the OBP path name of the root
3181+ * device. It also needs to know the initial block number of
3182+ * 'core' (which is 'diskboot' concatenated with 'kernel' and
3183+ * all the modules, this is created by grub-mkimage). This resulting
3184+ * 'boot' image is 512 bytes in size and is placed in the second block
3185+ * of a partition.
3186+ *
3187+ * The initial 'diskboot' block acts as a loader for the actual GRUB
3188+ * kernel. It contains the loading code and then a block list.
3189+ *
3190+ * The block list of 'core' starts at the end of the 'diskboot' image
3191+ * and works it's way backwards towards the end of the code of 'diskboot'.
3192+ *
3193+ * We patch up the images with the necessary values and write out the
3194+ * result.
3195+ */
3196+
3197+#ifdef GRUB_SETUP_SPARC64
3198+#define grub_target_to_host16(x) grub_be_to_cpu16(x)
3199+#define grub_target_to_host32(x) grub_be_to_cpu32(x)
3200+#define grub_target_to_host64(x) grub_be_to_cpu64(x)
3201+#define grub_host_to_target16(x) grub_cpu_to_be16(x)
3202+#define grub_host_to_target32(x) grub_cpu_to_be32(x)
3203+#define grub_host_to_target64(x) grub_cpu_to_be64(x)
3204+#elif defined (GRUB_SETUP_BIOS)
3205+#define grub_target_to_host16(x) grub_le_to_cpu16(x)
3206+#define grub_target_to_host32(x) grub_le_to_cpu32(x)
3207+#define grub_target_to_host64(x) grub_le_to_cpu64(x)
3208+#define grub_host_to_target16(x) grub_cpu_to_le16(x)
3209+#define grub_host_to_target32(x) grub_cpu_to_le32(x)
3210+#define grub_host_to_target64(x) grub_cpu_to_le64(x)
3211+#else
3212+#error Complete this
3213+#endif
3214+
3215+static void
3216+write_rootdev (grub_device_t root_dev,
3217+ char *boot_img, grub_uint64_t first_sector)
3218+{
3219+#ifdef GRUB_SETUP_BIOS
3220+ {
3221+ grub_uint8_t *boot_drive;
3222+ void *kernel_sector;
3223+ boot_drive = (grub_uint8_t *) (boot_img + GRUB_BOOT_MACHINE_BOOT_DRIVE);
3224+ kernel_sector = (boot_img + GRUB_BOOT_MACHINE_KERNEL_SECTOR);
3225+
3226+ /* FIXME: can this be skipped? */
3227+ *boot_drive = 0xFF;
3228+
3229+ grub_set_unaligned64 (kernel_sector, grub_cpu_to_le64 (first_sector));
3230+ }
3231+#endif
3232+#ifdef GRUB_SETUP_SPARC64
3233+ {
3234+ void *kernel_byte;
3235+ kernel_byte = (boot_img + GRUB_BOOT_AOUT_HEADER_SIZE
3236+ + GRUB_BOOT_MACHINE_KERNEL_BYTE);
3237+ grub_set_unaligned64 (kernel_byte,
3238+ grub_cpu_to_be64 (first_sector << GRUB_DISK_SECTOR_BITS));
3239+ }
3240+#endif
3241+}
3242+
3243+#ifdef GRUB_SETUP_SPARC64
3244+#define BOOT_SECTOR 1
3245+#else
3246+#define BOOT_SECTOR 0
3247+#endif
3248+
3249+/* Helper for setup. */
3250+
3251+struct blocklists
3252+{
3253+ struct grub_boot_blocklist *first_block, *block;
3254+#ifdef GRUB_SETUP_BIOS
3255+ grub_uint16_t current_segment;
3256+#endif
3257+ grub_uint16_t last_length;
3258+ grub_disk_addr_t first_sector;
3259+};
3260+
3261+/* Helper for setup. */
3262+static void
3263+save_blocklists (grub_disk_addr_t sector, unsigned offset, unsigned length,
3264+ void *data)
3265+{
3266+ struct blocklists *bl = data;
3267+ struct grub_boot_blocklist *prev = bl->block + 1;
3268+ grub_uint64_t seclen;
3269+
3270+ grub_util_info ("saving <%" GRUB_HOST_PRIuLONG_LONG ",%u,%u>",
3271+ (unsigned long long) sector, offset, length);
3272+
3273+ if (bl->first_sector == (grub_disk_addr_t) -1)
3274+ {
3275+ if (offset != 0 || length < GRUB_DISK_SECTOR_SIZE)
3276+ grub_util_error ("%s", _("the first sector of the core file is not sector-aligned"));
3277+
3278+ bl->first_sector = sector;
3279+ sector++;
3280+ length -= GRUB_DISK_SECTOR_SIZE;
3281+ if (!length)
3282+ return;
3283+ }
3284+
3285+ if (offset != 0 || bl->last_length != 0)
3286+ grub_util_error ("%s", _("non-sector-aligned data is found in the core file"));
3287+
3288+ seclen = (length + GRUB_DISK_SECTOR_SIZE - 1) >> GRUB_DISK_SECTOR_BITS;
3289+
3290+ if (bl->block != bl->first_block
3291+ && (grub_target_to_host64 (prev->start)
3292+ + grub_target_to_host16 (prev->len)) == sector)
3293+ {
3294+ grub_uint16_t t = grub_target_to_host16 (prev->len);
3295+ t += seclen;
3296+ prev->len = grub_host_to_target16 (t);
3297+ }
3298+ else
3299+ {
3300+ bl->block->start = grub_host_to_target64 (sector);
3301+ bl->block->len = grub_host_to_target16 (seclen);
3302+#ifdef GRUB_SETUP_BIOS
3303+ bl->block->segment = grub_host_to_target16 (bl->current_segment);
3304+#endif
3305+
3306+ bl->block--;
3307+ if (bl->block->len)
3308+ grub_util_error ("%s", _("the sectors of the core file are too fragmented"));
3309+ }
3310+
3311+ bl->last_length = length & (GRUB_DISK_SECTOR_SIZE - 1);
3312+#ifdef GRUB_SETUP_BIOS
3313+ bl->current_segment += seclen << (GRUB_DISK_SECTOR_BITS - 4);
3314+#endif
3315+}
3316+
3317+#ifdef GRUB_SETUP_BIOS
3318+/* Context for setup/identify_partmap. */
3319+struct identify_partmap_ctx
3320+{
3321+ grub_partition_map_t dest_partmap;
3322+ grub_partition_t container;
3323+ int multiple_partmaps;
3324+};
3325+
3326+/* Helper for setup.
3327+ Unlike root_dev, with dest_dev we're interested in the partition map even
3328+ if dest_dev itself is a whole disk. */
3329+static int
3330+identify_partmap (grub_disk_t disk __attribute__ ((unused)),
3331+ const grub_partition_t p, void *data)
3332+{
3333+ struct identify_partmap_ctx *ctx = data;
3334+
3335+ if (p->parent != ctx->container)
3336+ return 0;
3337+ /* NetBSD and OpenBSD subpartitions have metadata inside a partition,
3338+ so they are safe to ignore.
3339+ */
3340+ if (grub_strcmp (p->partmap->name, "netbsd") == 0
3341+ || grub_strcmp (p->partmap->name, "openbsd") == 0)
3342+ return 0;
3343+ if (ctx->dest_partmap == NULL)
3344+ {
3345+ ctx->dest_partmap = p->partmap;
3346+ return 0;
3347+ }
3348+ if (ctx->dest_partmap == p->partmap)
3349+ return 0;
3350+ ctx->multiple_partmaps = 1;
3351+ return 1;
3352+}
3353+#endif
3354+
3355+#ifdef GRUB_SETUP_BIOS
3356+#define SETUP grub_util_bios_setup
3357+#elif GRUB_SETUP_SPARC64
3358+#define SETUP grub_util_sparc_setup
3359+#else
3360+#error "Shouldn't happen"
3361+#endif
3362+
3363+void
3364+SETUP (const char *dir,
3365+ const char *boot_file, const char *core_file,
3366+ const char *dest, int force,
3367+ int fs_probe, int allow_floppy,
3368+ int add_rs_codes __attribute__ ((unused))) /* unused on sparc64 */
3369+{
3370+ char *core_path;
3371+ char *boot_img, *core_img, *boot_path;
3372+ char *root = 0;
3373+ size_t boot_size, core_size;
3374+#ifdef GRUB_SETUP_BIOS
3375+ grub_uint16_t core_sectors;
3376+#endif
3377+ grub_device_t root_dev = 0, dest_dev, core_dev;
3378+ grub_util_fd_t fp;
3379+ struct blocklists bl;
3380+
3381+ bl.first_sector = (grub_disk_addr_t) -1;
3382+
3383+#ifdef GRUB_SETUP_BIOS
3384+ bl.current_segment =
3385+ GRUB_BOOT_I386_PC_KERNEL_SEG + (GRUB_DISK_SECTOR_SIZE >> 4);
3386+#endif
3387+ bl.last_length = 0;
3388+
3389+ /* Read the boot image by the OS service. */
3390+ boot_path = grub_util_get_path (dir, boot_file);
3391+ boot_size = grub_util_get_image_size (boot_path);
3392+ if (boot_size != GRUB_DISK_SECTOR_SIZE)
3393+ grub_util_error (_("the size of `%s' is not %u"),
3394+ boot_path, GRUB_DISK_SECTOR_SIZE);
3395+ boot_img = grub_util_read_image (boot_path);
3396+ free (boot_path);
3397+
3398+ core_path = grub_util_get_path (dir, core_file);
3399+ core_size = grub_util_get_image_size (core_path);
3400+#ifdef GRUB_SETUP_BIOS
3401+ core_sectors = ((core_size + GRUB_DISK_SECTOR_SIZE - 1)
3402+ >> GRUB_DISK_SECTOR_BITS);
3403+#endif
3404+ if (core_size < GRUB_DISK_SECTOR_SIZE)
3405+ grub_util_error (_("the size of `%s' is too small"), core_path);
3406+#ifdef GRUB_SETUP_BIOS
3407+ if (core_size > 0xFFFF * GRUB_DISK_SECTOR_SIZE)
3408+ grub_util_error (_("the size of `%s' is too large"), core_path);
3409+#endif
3410+
3411+ core_img = grub_util_read_image (core_path);
3412+
3413+ /* Have FIRST_BLOCK to point to the first blocklist. */
3414+ bl.first_block = (struct grub_boot_blocklist *) (core_img
3415+ + GRUB_DISK_SECTOR_SIZE
3416+ - sizeof (*bl.block));
3417+ grub_util_info ("root is `%s', dest is `%s'", root, dest);
3418+
3419+ grub_util_info ("Opening dest");
3420+ dest_dev = grub_device_open (dest);
3421+ if (! dest_dev)
3422+ grub_util_error ("%s", grub_errmsg);
3423+
3424+ core_dev = dest_dev;
3425+
3426+ {
3427+ char **root_devices = grub_guess_root_devices (dir);
3428+ char **cur;
3429+ int found = 0;
3430+
3431+ for (cur = root_devices; *cur; cur++)
3432+ {
3433+ char *drive;
3434+ grub_device_t try_dev;
3435+
3436+ drive = grub_util_get_grub_dev (*cur);
3437+ if (!drive)
3438+ continue;
3439+ try_dev = grub_device_open (drive);
3440+ if (! try_dev)
3441+ continue;
3442+ if (!found && try_dev->disk->id == dest_dev->disk->id
3443+ && try_dev->disk->dev->id == dest_dev->disk->dev->id)
3444+ {
3445+ if (root_dev)
3446+ grub_device_close (root_dev);
3447+ free (root);
3448+ root_dev = try_dev;
3449+ root = drive;
3450+ found = 1;
3451+ continue;
3452+ }
3453+ if (!root_dev)
3454+ {
3455+ root_dev = try_dev;
3456+ root = drive;
3457+ continue;
3458+ }
3459+ grub_device_close (try_dev);
3460+ free (drive);
3461+ }
3462+ if (!root_dev)
3463+ {
3464+ grub_util_error ("guessing the root device failed, because of `%s'",
3465+ grub_errmsg);
3466+ }
3467+ grub_util_info ("guessed root_dev `%s' from "
3468+ "dir `%s'", root_dev->disk->name, dir);
3469+ }
3470+
3471+ grub_util_info ("setting the root device to `%s'", root);
3472+ if (grub_env_set ("root", root) != GRUB_ERR_NONE)
3473+ grub_util_error ("%s", grub_errmsg);
3474+
3475+#ifdef GRUB_SETUP_BIOS
3476+ {
3477+ char *tmp_img;
3478+ grub_uint8_t *boot_drive_check;
3479+
3480+ /* Read the original sector from the disk. */
3481+ tmp_img = xmalloc (GRUB_DISK_SECTOR_SIZE);
3482+ if (grub_disk_read (dest_dev->disk, 0, 0, GRUB_DISK_SECTOR_SIZE, tmp_img))
3483+ grub_util_error ("%s", grub_errmsg);
3484+
3485+ boot_drive_check = (grub_uint8_t *) (boot_img
3486+ + GRUB_BOOT_MACHINE_DRIVE_CHECK);
3487+ /* Copy the possible DOS BPB. */
3488+ memcpy (boot_img + GRUB_BOOT_MACHINE_BPB_START,
3489+ tmp_img + GRUB_BOOT_MACHINE_BPB_START,
3490+ GRUB_BOOT_MACHINE_BPB_END - GRUB_BOOT_MACHINE_BPB_START);
3491+
3492+ /* If DEST_DRIVE is a hard disk, enable the workaround, which is
3493+ for buggy BIOSes which don't pass boot drive correctly. Instead,
3494+ they pass 0x00 or 0x01 even when booted from 0x80. */
3495+ if (!allow_floppy && !grub_util_biosdisk_is_floppy (dest_dev->disk))
3496+ {
3497+ /* Replace the jmp (2 bytes) with double nop's. */
3498+ boot_drive_check[0] = 0x90;
3499+ boot_drive_check[1] = 0x90;
3500+ }
3501+
3502+ struct identify_partmap_ctx ctx = {
3503+ .dest_partmap = NULL,
3504+ .container = dest_dev->disk->partition,
3505+ .multiple_partmaps = 0
3506+ };
3507+ int is_ldm;
3508+ grub_err_t err;
3509+ grub_disk_addr_t *sectors;
3510+ int i;
3511+ grub_fs_t fs;
3512+ unsigned int nsec, maxsec;
3513+
3514+ grub_partition_iterate (dest_dev->disk, identify_partmap, &ctx);
3515+
3516+ /* Copy the partition table. */
3517+ if (ctx.dest_partmap ||
3518+ (!allow_floppy && !grub_util_biosdisk_is_floppy (dest_dev->disk)))
3519+ memcpy (boot_img + GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC,
3520+ tmp_img + GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC,
3521+ GRUB_BOOT_MACHINE_PART_END - GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC);
3522+
3523+ free (tmp_img);
3524+
3525+ if (ctx.container
3526+ && grub_strcmp (ctx.container->partmap->name, "msdos") == 0
3527+ && ctx.dest_partmap
3528+ && (ctx.container->msdostype == GRUB_PC_PARTITION_TYPE_NETBSD
3529+ || ctx.container->msdostype == GRUB_PC_PARTITION_TYPE_OPENBSD))
3530+ {
3531+ grub_util_warn ("%s", _("Attempting to install GRUB to a disk with multiple partition labels or both partition label and filesystem. This is not supported yet."));
3532+ goto unable_to_embed;
3533+ }
3534+
3535+ fs = grub_fs_probe (dest_dev);
3536+ if (!fs)
3537+ grub_errno = GRUB_ERR_NONE;
3538+
3539+ is_ldm = grub_util_is_ldm (dest_dev->disk);
3540+
3541+ if (fs_probe)
3542+ {
3543+ if (!fs && !ctx.dest_partmap)
3544+ grub_util_error (_("unable to identify a filesystem in %s; safety check can't be performed"),
3545+ dest_dev->disk->name);
3546+ if (fs && !fs->reserved_first_sector)
3547+ /* TRANSLATORS: Filesystem may reserve the space just GRUB isn't sure about it. */
3548+ grub_util_error (_("%s appears to contain a %s filesystem which isn't known to "
3549+ "reserve space for DOS-style boot. Installing GRUB there could "
3550+ "result in FILESYSTEM DESTRUCTION if valuable data is overwritten "
3551+ "by grub-setup (--skip-fs-probe disables this "
3552+ "check, use at your own risk)"), dest_dev->disk->name, fs->name);
3553+
3554+ if (ctx.dest_partmap && strcmp (ctx.dest_partmap->name, "msdos") != 0
3555+ && strcmp (ctx.dest_partmap->name, "gpt") != 0
3556+ && strcmp (ctx.dest_partmap->name, "bsd") != 0
3557+ && strcmp (ctx.dest_partmap->name, "netbsd") != 0
3558+ && strcmp (ctx.dest_partmap->name, "openbsd") != 0
3559+ && strcmp (ctx.dest_partmap->name, "sunpc") != 0)
3560+ /* TRANSLATORS: Partition map may reserve the space just GRUB isn't sure about it. */
3561+ grub_util_error (_("%s appears to contain a %s partition map which isn't known to "
3562+ "reserve space for DOS-style boot. Installing GRUB there could "
3563+ "result in FILESYSTEM DESTRUCTION if valuable data is overwritten "
3564+ "by grub-setup (--skip-fs-probe disables this "
3565+ "check, use at your own risk)"), dest_dev->disk->name, ctx.dest_partmap->name);
3566+ if (is_ldm && ctx.dest_partmap && strcmp (ctx.dest_partmap->name, "msdos") != 0
3567+ && strcmp (ctx.dest_partmap->name, "gpt") != 0)
3568+ grub_util_error (_("%s appears to contain a %s partition map and "
3569+ "LDM which isn't known to be a safe combination."
3570+ " Installing GRUB there could "
3571+ "result in FILESYSTEM DESTRUCTION if valuable data"
3572+ " is overwritten "
3573+ "by grub-setup (--skip-fs-probe disables this "
3574+ "check, use at your own risk)"),
3575+ dest_dev->disk->name, ctx.dest_partmap->name);
3576+
3577+ }
3578+
3579+ if (! ctx.dest_partmap && ! fs && !is_ldm)
3580+ {
3581+ grub_util_warn ("%s", _("Attempting to install GRUB to a partitionless disk or to a partition. This is a BAD idea."));
3582+ goto unable_to_embed;
3583+ }
3584+ if (ctx.multiple_partmaps || (ctx.dest_partmap && fs) || (is_ldm && fs))
3585+ {
3586+ grub_util_warn ("%s", _("Attempting to install GRUB to a disk with multiple partition labels. This is not supported yet."));
3587+ goto unable_to_embed;
3588+ }
3589+
3590+ if (ctx.dest_partmap && !ctx.dest_partmap->embed)
3591+ {
3592+ grub_util_warn (_("Partition style `%s' doesn't support embedding"),
3593+ ctx.dest_partmap->name);
3594+ goto unable_to_embed;
3595+ }
3596+
3597+ if (fs && !fs->embed)
3598+ {
3599+ grub_util_warn (_("File system `%s' doesn't support embedding"),
3600+ fs->name);
3601+ goto unable_to_embed;
3602+ }
3603+
3604+ nsec = core_sectors;
3605+
3606+ if (add_rs_codes)
3607+ maxsec = 2 * core_sectors;
3608+ else
3609+ maxsec = core_sectors;
3610+
3611+ if (maxsec > ((0x78000 - GRUB_KERNEL_I386_PC_LINK_ADDR)
3612+ >> GRUB_DISK_SECTOR_BITS))
3613+ maxsec = ((0x78000 - GRUB_KERNEL_I386_PC_LINK_ADDR)
3614+ >> GRUB_DISK_SECTOR_BITS);
3615+
3616+ if (is_ldm)
3617+ err = grub_util_ldm_embed (dest_dev->disk, &nsec, maxsec,
3618+ GRUB_EMBED_PCBIOS, &sectors);
3619+ else if (ctx.dest_partmap)
3620+ err = ctx.dest_partmap->embed (dest_dev->disk, &nsec, maxsec,
3621+ GRUB_EMBED_PCBIOS, &sectors);
3622+ else
3623+ err = fs->embed (dest_dev, &nsec, maxsec,
3624+ GRUB_EMBED_PCBIOS, &sectors);
3625+ if (!err && nsec < core_sectors)
3626+ {
3627+ err = grub_error (GRUB_ERR_OUT_OF_RANGE,
3628+ N_("Your embedding area is unusually small. "
3629+ "core.img won't fit in it."));
3630+ }
3631+
3632+ if (err)
3633+ {
3634+ grub_util_warn ("%s", grub_errmsg);
3635+ grub_errno = GRUB_ERR_NONE;
3636+ goto unable_to_embed;
3637+ }
3638+
3639+ assert (nsec <= maxsec);
3640+
3641+ /* Clean out the blocklists. */
3642+ bl.block = bl.first_block;
3643+ while (bl.block->len)
3644+ {
3645+ grub_memset (bl.block, 0, sizeof (bl.block));
3646+
3647+ bl.block--;
3648+
3649+ if ((char *) bl.block <= core_img)
3650+ grub_util_error ("%s", _("no terminator in the core image"));
3651+ }
3652+
3653+ bl.block = bl.first_block;
3654+ for (i = 0; i < nsec; i++)
3655+ save_blocklists (sectors[i] + grub_partition_get_start (ctx.container),
3656+ 0, GRUB_DISK_SECTOR_SIZE, &bl);
3657+
3658+ /* Make sure that the last blocklist is a terminator. */
3659+ if (bl.block == bl.first_block)
3660+ bl.block--;
3661+ bl.block->start = 0;
3662+ bl.block->len = 0;
3663+ bl.block->segment = 0;
3664+
3665+ write_rootdev (root_dev, boot_img, bl.first_sector);
3666+
3667+ /* Round up to the nearest sector boundary, and zero the extra memory */
3668+ core_img = xrealloc (core_img, nsec * GRUB_DISK_SECTOR_SIZE);
3669+ assert (core_img && (nsec * GRUB_DISK_SECTOR_SIZE >= core_size));
3670+ memset (core_img + core_size, 0, nsec * GRUB_DISK_SECTOR_SIZE - core_size);
3671+
3672+ bl.first_block = (struct grub_boot_blocklist *) (core_img
3673+ + GRUB_DISK_SECTOR_SIZE
3674+ - sizeof (*bl.block));
3675+
3676+ grub_size_t no_rs_length;
3677+ no_rs_length = grub_target_to_host16
3678+ (grub_get_unaligned16 (core_img
3679+ + GRUB_DISK_SECTOR_SIZE
3680+ + GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_LENGTH));
3681+
3682+ if (no_rs_length == 0xffff)
3683+ grub_util_error ("%s", _("core.img version mismatch"));
3684+
3685+ if (add_rs_codes)
3686+ {
3687+ grub_set_unaligned32 ((core_img + GRUB_DISK_SECTOR_SIZE
3688+ + GRUB_KERNEL_I386_PC_REED_SOLOMON_REDUNDANCY),
3689+ grub_host_to_target32 (nsec * GRUB_DISK_SECTOR_SIZE - core_size));
3690+
3691+ void *tmp = xmalloc (core_size);
3692+ grub_memcpy (tmp, core_img, core_size);
3693+ grub_reed_solomon_add_redundancy (core_img + no_rs_length + GRUB_DISK_SECTOR_SIZE,
3694+ core_size - no_rs_length - GRUB_DISK_SECTOR_SIZE,
3695+ nsec * GRUB_DISK_SECTOR_SIZE
3696+ - core_size);
3697+ assert (grub_memcmp (tmp, core_img, core_size) == 0);
3698+ free (tmp);
3699+ }
3700+
3701+ /* Write the core image onto the disk. */
3702+ for (i = 0; i < nsec; i++)
3703+ grub_disk_write (dest_dev->disk, sectors[i], 0,
3704+ GRUB_DISK_SECTOR_SIZE,
3705+ core_img + i * GRUB_DISK_SECTOR_SIZE);
3706+
3707+ grub_free (sectors);
3708+
3709+ goto finish;
3710+ }
3711+
3712+unable_to_embed:
3713+#endif
3714+
3715+ if (dest_dev->disk->dev->id != root_dev->disk->dev->id)
3716+ grub_util_error ("%s", _("embedding is not possible, but this is required for "
3717+ "RAID and LVM install"));
3718+
3719+ {
3720+ grub_fs_t fs;
3721+ fs = grub_fs_probe (root_dev);
3722+ if (!fs)
3723+ grub_util_error (_("can't determine filesystem on %s"), root);
3724+
3725+ if (!fs->blocklist_install)
3726+ grub_util_error (_("filesystem `%s' doesn't support blocklists"),
3727+ fs->name);
3728+ }
3729+
3730+#ifdef GRUB_SETUP_BIOS
3731+ if (dest_dev->disk->id != root_dev->disk->id
3732+ || dest_dev->disk->dev->id != root_dev->disk->dev->id)
3733+ /* TRANSLATORS: cross-disk refers to /boot being on one disk
3734+ but MBR on another. */
3735+ grub_util_error ("%s", _("embedding is not possible, but this is required for "
3736+ "cross-disk install"));
3737+#else
3738+ core_dev = root_dev;
3739+#endif
3740+
3741+ grub_util_warn ("%s", _("Embedding is not possible. GRUB can only be installed in this "
3742+ "setup by using blocklists. However, blocklists are UNRELIABLE and "
3743+ "their use is discouraged."));
3744+ if (! force)
3745+ /* TRANSLATORS: Here GRUB refuses to continue with blocklist install. */
3746+ grub_util_error ("%s", _("will not proceed with blocklists"));
3747+
3748+ /* The core image must be put on a filesystem unfortunately. */
3749+ grub_util_info ("will leave the core image on the filesystem");
3750+
3751+ grub_util_biosdisk_flush (root_dev->disk);
3752+
3753+ /* Clean out the blocklists. */
3754+ bl.block = bl.first_block;
3755+ while (bl.block->len)
3756+ {
3757+ bl.block->start = 0;
3758+ bl.block->len = 0;
3759+#ifdef GRUB_SETUP_BIOS
3760+ bl.block->segment = 0;
3761+#endif
3762+
3763+ bl.block--;
3764+
3765+ if ((char *) bl.block <= core_img)
3766+ grub_util_error ("%s", _("no terminator in the core image"));
3767+ }
3768+
3769+ bl.block = bl.first_block;
3770+
3771+ grub_install_get_blocklist (root_dev, core_path, core_img, core_size,
3772+ save_blocklists, &bl);
3773+
3774+ if (bl.first_sector == (grub_disk_addr_t)-1)
3775+ grub_util_error ("%s", _("can't retrieve blocklists"));
3776+
3777+#ifdef GRUB_SETUP_SPARC64
3778+ {
3779+ char *boot_devpath;
3780+ boot_devpath = (char *) (boot_img
3781+ + GRUB_BOOT_AOUT_HEADER_SIZE
3782+ + GRUB_BOOT_MACHINE_BOOT_DEVPATH);
3783+ if (dest_dev->disk->id != root_dev->disk->id
3784+ || dest_dev->disk->dev->id != root_dev->disk->dev->id)
3785+ {
3786+ const char *dest_ofpath;
3787+ dest_ofpath
3788+ = grub_util_devname_to_ofpath (grub_util_biosdisk_get_osdev (root_dev->disk));
3789+ grub_util_info ("dest_ofpath is `%s'", dest_ofpath);
3790+ strncpy (boot_devpath, dest_ofpath,
3791+ GRUB_BOOT_MACHINE_BOOT_DEVPATH_END
3792+ - GRUB_BOOT_MACHINE_BOOT_DEVPATH - 1);
3793+ boot_devpath[GRUB_BOOT_MACHINE_BOOT_DEVPATH_END
3794+ - GRUB_BOOT_MACHINE_BOOT_DEVPATH - 1] = 0;
3795+ }
3796+ else
3797+ {
3798+ grub_util_info ("non cross-disk install");
3799+ memset (boot_devpath, 0, GRUB_BOOT_MACHINE_BOOT_DEVPATH_END
3800+ - GRUB_BOOT_MACHINE_BOOT_DEVPATH);
3801+ }
3802+ grub_util_info ("boot device path %s", boot_devpath);
3803+ }
3804+#endif
3805+
3806+ write_rootdev (root_dev, boot_img, bl.first_sector);
3807+
3808+ /* Write the first two sectors of the core image onto the disk. */
3809+ grub_util_info ("opening the core image `%s'", core_path);
3810+ fp = grub_util_fd_open (core_path, GRUB_UTIL_FD_O_WRONLY);
3811+ if (! GRUB_UTIL_FD_IS_VALID (fp))
3812+ grub_util_error (_("cannot open `%s': %s"), core_path,
3813+ grub_util_fd_strerror ());
3814+
3815+ if (grub_util_fd_write (fp, core_img, GRUB_DISK_SECTOR_SIZE * 2)
3816+ != GRUB_DISK_SECTOR_SIZE * 2)
3817+ grub_util_error (_("cannot write to `%s': %s"),
3818+ core_path, strerror (errno));
3819+ grub_util_fd_sync (fp);
3820+ grub_util_fd_close (fp);
3821+ grub_util_biosdisk_flush (root_dev->disk);
3822+
3823+ grub_disk_cache_invalidate_all ();
3824+
3825+ {
3826+ char *buf, *ptr = core_img;
3827+ size_t len = core_size;
3828+ grub_uint64_t blk;
3829+ grub_partition_t container = core_dev->disk->partition;
3830+ grub_err_t err;
3831+
3832+ core_dev->disk->partition = 0;
3833+
3834+ buf = xmalloc (core_size);
3835+ blk = bl.first_sector;
3836+ err = grub_disk_read (core_dev->disk, blk, 0, GRUB_DISK_SECTOR_SIZE, buf);
3837+ if (err)
3838+ grub_util_error (_("cannot read `%s': %s"), core_dev->disk->name,
3839+ grub_errmsg);
3840+ if (grub_memcmp (buf, ptr, GRUB_DISK_SECTOR_SIZE) != 0)
3841+ grub_util_error ("%s", _("blocklists are invalid"));
3842+
3843+ ptr += GRUB_DISK_SECTOR_SIZE;
3844+ len -= GRUB_DISK_SECTOR_SIZE;
3845+
3846+ bl.block = bl.first_block;
3847+ while (bl.block->len)
3848+ {
3849+ size_t cur = grub_target_to_host16 (bl.block->len) << GRUB_DISK_SECTOR_BITS;
3850+ blk = grub_target_to_host64 (bl.block->start);
3851+
3852+ if (cur > len)
3853+ cur = len;
3854+
3855+ err = grub_disk_read (core_dev->disk, blk, 0, cur, buf);
3856+ if (err)
3857+ grub_util_error (_("cannot read `%s': %s"), core_dev->disk->name,
3858+ grub_errmsg);
3859+
3860+ if (grub_memcmp (buf, ptr, cur) != 0)
3861+ grub_util_error ("%s", _("blocklists are invalid"));
3862+
3863+ ptr += cur;
3864+ len -= cur;
3865+ bl.block--;
3866+
3867+ if ((char *) bl.block <= core_img)
3868+ grub_util_error ("%s", _("no terminator in the core image"));
3869+ }
3870+ if (len)
3871+ grub_util_error ("%s", _("blocklists are incomplete"));
3872+ core_dev->disk->partition = container;
3873+ free (buf);
3874+ }
3875+
3876+#ifdef GRUB_SETUP_BIOS
3877+ finish:
3878+#endif
3879+
3880+ /* Write the boot image onto the disk. */
3881+ if (grub_disk_write (dest_dev->disk, BOOT_SECTOR,
3882+ 0, GRUB_DISK_SECTOR_SIZE, boot_img))
3883+ grub_util_error ("%s", grub_errmsg);
3884+
3885+ grub_util_biosdisk_flush (root_dev->disk);
3886+ grub_util_biosdisk_flush (dest_dev->disk);
3887+
3888+ free (core_path);
3889+ free (core_img);
3890+ free (boot_img);
3891+ grub_device_close (dest_dev);
3892+ grub_device_close (root_dev);
3893+}
3894+
3895
3896=== added directory '.pc/default_grub_d.patch'
3897=== added directory '.pc/default_grub_d.patch/grub-core'
3898=== added directory '.pc/default_grub_d.patch/grub-core/osdep'
3899=== added directory '.pc/default_grub_d.patch/grub-core/osdep/unix'
3900=== added file '.pc/default_grub_d.patch/grub-core/osdep/unix/config.c'
3901--- .pc/default_grub_d.patch/grub-core/osdep/unix/config.c 1970-01-01 00:00:00 +0000
3902+++ .pc/default_grub_d.patch/grub-core/osdep/unix/config.c 2014-08-24 23:28:48 +0000
3903@@ -0,0 +1,139 @@
3904+/*
3905+ * GRUB -- GRand Unified Bootloader
3906+ * Copyright (C) 1999,2000,2001,2002,2003,2004,2006,2007,2008,2009,2010,2011,2012,2013 Free Software Foundation, Inc.
3907+ *
3908+ * GRUB is free software: you can redistribute it and/or modify
3909+ * it under the terms of the GNU General Public License as published by
3910+ * the Free Software Foundation, either version 3 of the License, or
3911+ * (at your option) any later version.
3912+ *
3913+ * GRUB is distributed in the hope that it will be useful,
3914+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3915+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3916+ * GNU General Public License for more details.
3917+ *
3918+ * You should have received a copy of the GNU General Public License
3919+ * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
3920+ */
3921+
3922+#include <config.h>
3923+#include <config-util.h>
3924+
3925+#include <grub/emu/hostdisk.h>
3926+#include <grub/emu/exec.h>
3927+#include <grub/emu/config.h>
3928+#include <grub/util/install.h>
3929+#include <grub/util/misc.h>
3930+#include <string.h>
3931+#include <sys/types.h>
3932+#include <sys/wait.h>
3933+#include <errno.h>
3934+#include <stdlib.h>
3935+
3936+const char *
3937+grub_util_get_config_filename (void)
3938+{
3939+ static char *value = NULL;
3940+ if (!value)
3941+ value = grub_util_path_concat (3, GRUB_SYSCONFDIR,
3942+ "default", "grub");
3943+ return value;
3944+}
3945+
3946+const char *
3947+grub_util_get_pkgdatadir (void)
3948+{
3949+ const char *ret = getenv ("pkgdatadir");
3950+ if (ret)
3951+ return ret;
3952+ return GRUB_DATADIR "/" PACKAGE;
3953+}
3954+
3955+const char *
3956+grub_util_get_pkglibdir (void)
3957+{
3958+ return GRUB_LIBDIR "/" PACKAGE;
3959+}
3960+
3961+const char *
3962+grub_util_get_localedir (void)
3963+{
3964+ return LOCALEDIR;
3965+}
3966+
3967+void
3968+grub_util_load_config (struct grub_util_config *cfg)
3969+{
3970+ pid_t pid;
3971+ const char *argv[4];
3972+ char *script, *ptr;
3973+ const char *cfgfile, *iptr;
3974+ FILE *f = NULL;
3975+ int fd;
3976+ const char *v;
3977+
3978+ memset (cfg, 0, sizeof (*cfg));
3979+
3980+ v = getenv ("GRUB_ENABLE_CRYPTODISK");
3981+ if (v && v[0] == 'y' && v[1] == '\0')
3982+ cfg->is_cryptodisk_enabled = 1;
3983+
3984+ v = getenv ("GRUB_DISTRIBUTOR");
3985+ if (v)
3986+ cfg->grub_distributor = xstrdup (v);
3987+
3988+ cfgfile = grub_util_get_config_filename ();
3989+ if (!grub_util_is_regular (cfgfile))
3990+ return;
3991+
3992+ argv[0] = "sh";
3993+ argv[1] = "-c";
3994+
3995+ script = xmalloc (4 * strlen (cfgfile) + 300);
3996+
3997+ ptr = script;
3998+ memcpy (ptr, ". '", 3);
3999+ ptr += 3;
4000+ for (iptr = cfgfile; *iptr; iptr++)
4001+ {
4002+ if (*iptr == '\\')
4003+ {
4004+ memcpy (ptr, "'\\''", 4);
4005+ ptr += 4;
4006+ continue;
4007+ }
4008+ *ptr++ = *iptr;
4009+ }
4010+
4011+ strcpy (ptr, "'; printf \"GRUB_ENABLE_CRYPTODISK=%s\\nGRUB_DISTRIBUTOR=%s\\n\", "
4012+ "\"$GRUB_ENABLE_CRYPTODISK\", \"$GRUB_DISTRIBUTOR\"");
4013+
4014+ argv[2] = script;
4015+ argv[3] = '\0';
4016+
4017+ pid = grub_util_exec_pipe (argv, &fd);
4018+ if (pid)
4019+ f = fdopen (fd, "r");
4020+ if (f)
4021+ {
4022+ grub_util_parse_config (f, cfg, 1);
4023+ fclose (f);
4024+ }
4025+ if (pid)
4026+ {
4027+ close (fd);
4028+ waitpid (pid, NULL, 0);
4029+ }
4030+ if (f)
4031+ return;
4032+
4033+ f = grub_util_fopen (cfgfile, "r");
4034+ if (f)
4035+ {
4036+ grub_util_parse_config (f, cfg, 0);
4037+ fclose (f);
4038+ }
4039+ else
4040+ grub_util_warn (_("cannot open configuration file `%s': %s"),
4041+ cfgfile, strerror (errno));
4042+}
4043
4044=== added directory '.pc/default_grub_d.patch/util'
4045=== added file '.pc/default_grub_d.patch/util/grub-mkconfig.in'
4046--- .pc/default_grub_d.patch/util/grub-mkconfig.in 1970-01-01 00:00:00 +0000
4047+++ .pc/default_grub_d.patch/util/grub-mkconfig.in 2014-08-24 23:28:48 +0000
4048@@ -0,0 +1,291 @@
4049+#! /bin/sh
4050+set -e
4051+
4052+# Generate grub.cfg by inspecting /boot contents.
4053+# Copyright (C) 2006,2007,2008,2009,2010 Free Software Foundation, Inc.
4054+#
4055+# GRUB is free software: you can redistribute it and/or modify
4056+# it under the terms of the GNU General Public License as published by
4057+# the Free Software Foundation, either version 3 of the License, or
4058+# (at your option) any later version.
4059+#
4060+# GRUB is distributed in the hope that it will be useful,
4061+# but WITHOUT ANY WARRANTY; without even the implied warranty of
4062+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4063+# GNU General Public License for more details.
4064+#
4065+# You should have received a copy of the GNU General Public License
4066+# along with GRUB. If not, see <http://www.gnu.org/licenses/>.
4067+
4068+prefix="@prefix@"
4069+exec_prefix="@exec_prefix@"
4070+datarootdir="@datarootdir@"
4071+
4072+prefix="@prefix@"
4073+exec_prefix="@exec_prefix@"
4074+sbindir="@sbindir@"
4075+bindir="@bindir@"
4076+sysconfdir="@sysconfdir@"
4077+PACKAGE_NAME=@PACKAGE_NAME@
4078+PACKAGE_VERSION=@PACKAGE_VERSION@
4079+host_os=@host_os@
4080+datadir="@datadir@"
4081+if [ "x$pkgdatadir" = x ]; then
4082+ pkgdatadir="${datadir}/@PACKAGE@"
4083+fi
4084+grub_cfg=""
4085+grub_mkconfig_dir="${sysconfdir}"/grub.d
4086+
4087+self=`basename $0`
4088+
4089+grub_probe="${sbindir}/@grub_probe@"
4090+grub_file="${bindir}/@grub_file@"
4091+grub_editenv="${bindir}/@grub_editenv@"
4092+grub_script_check="${bindir}/@grub_script_check@"
4093+
4094+export TEXTDOMAIN=@PACKAGE@
4095+export TEXTDOMAINDIR="@localedir@"
4096+
4097+. "${pkgdatadir}/grub-mkconfig_lib"
4098+
4099+# Usage: usage
4100+# Print the usage.
4101+usage () {
4102+ gettext_printf "Usage: %s [OPTION]\n" "$self"
4103+ gettext "Generate a grub config file"; echo
4104+ echo
4105+ print_option_help "-o, --output=$(gettext FILE)" "$(gettext "output generated config to FILE [default=stdout]")"
4106+ print_option_help "-h, --help" "$(gettext "print this message and exit")"
4107+ print_option_help "-v, --version" "$(gettext "print the version information and exit")"
4108+ echo
4109+ gettext "Report bugs to <bug-grub@gnu.org>."; echo
4110+}
4111+
4112+argument () {
4113+ opt=$1
4114+ shift
4115+
4116+ if test $# -eq 0; then
4117+ gettext_printf "%s: option requires an argument -- \`%s'\n" "$self" "$opt" 1>&2
4118+ exit 1
4119+ fi
4120+ echo $1
4121+}
4122+
4123+# Check the arguments.
4124+while test $# -gt 0
4125+do
4126+ option=$1
4127+ shift
4128+
4129+ case "$option" in
4130+ -h | --help)
4131+ usage
4132+ exit 0 ;;
4133+ -v | --version)
4134+ echo "$self (${PACKAGE_NAME}) ${PACKAGE_VERSION}"
4135+ exit 0 ;;
4136+ -o | --output)
4137+ grub_cfg=`argument $option "$@"`; shift;;
4138+ --output=*)
4139+ grub_cfg=`echo "$option" | sed 's/--output=//'`
4140+ ;;
4141+ -*)
4142+ gettext_printf "Unrecognized option \`%s'\n" "$option" 1>&2
4143+ usage
4144+ exit 1
4145+ ;;
4146+ # Explicitly ignore non-option arguments, for compatibility.
4147+ esac
4148+done
4149+
4150+if fgrep -qs '${GRUB_PREFIX}/video.lst' "${grub_mkconfig_dir}/00_header"; then
4151+ echo "GRUB >= 2.00 has been unpacked but not yet configured." >&2
4152+ echo "grub-mkconfig will not work until the upgrade is complete." >&2
4153+ echo "It should run later as part of configuring the new GRUB packages." >&2
4154+ exit 0
4155+fi
4156+
4157+if [ "x$EUID" = "x" ] ; then
4158+ EUID=`id -u`
4159+fi
4160+
4161+if [ "$EUID" != 0 ] ; then
4162+ root=f
4163+ case "`uname 2>/dev/null`" in
4164+ CYGWIN*)
4165+ # Cygwin: Assume root if member of admin group
4166+ for g in `id -G 2>/dev/null` ; do
4167+ case $g in
4168+ 0|544) root=t ;;
4169+ esac
4170+ done ;;
4171+ esac
4172+ if [ $root != t ] ; then
4173+ gettext_printf "%s: You must run this as root\n" "$self" >&2
4174+ exit 1
4175+ fi
4176+fi
4177+
4178+set $grub_probe dummy
4179+if test -f "$1"; then
4180+ :
4181+else
4182+ gettext_print "%s: Not found.\n" "$1" 1>&2
4183+ exit 1
4184+fi
4185+
4186+# Device containing our userland. Typically used for root= parameter.
4187+GRUB_DEVICE="`${grub_probe} --target=device /`"
4188+GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" || true
4189+
4190+# Device containing our /boot partition. Usually the same as GRUB_DEVICE.
4191+GRUB_DEVICE_BOOT="`${grub_probe} --target=device /boot`"
4192+GRUB_DEVICE_BOOT_UUID="`${grub_probe} --device ${GRUB_DEVICE_BOOT} --target=fs_uuid 2> /dev/null`" || true
4193+
4194+# Filesystem for the device containing our userland. Used for stuff like
4195+# choosing Hurd filesystem module.
4196+GRUB_FS="`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2> /dev/null || echo unknown`"
4197+
4198+if [ x"$GRUB_FS" = xunknown ]; then
4199+ GRUB_FS="$(stat -f --printf=%T / || echo unknown)"
4200+fi
4201+
4202+if test -f ${sysconfdir}/default/grub ; then
4203+ . ${sysconfdir}/default/grub
4204+fi
4205+
4206+# XXX: should this be deprecated at some point?
4207+if [ "x${GRUB_TERMINAL}" != "x" ] ; then
4208+ GRUB_TERMINAL_INPUT="${GRUB_TERMINAL}"
4209+ GRUB_TERMINAL_OUTPUT="${GRUB_TERMINAL}"
4210+fi
4211+
4212+termoutdefault=0
4213+if [ "x${GRUB_TERMINAL_OUTPUT}" = "x" ]; then
4214+ GRUB_TERMINAL_OUTPUT=gfxterm;
4215+ termoutdefault=1;
4216+fi
4217+
4218+for x in ${GRUB_TERMINAL_OUTPUT}; do
4219+ case "x${x}" in
4220+ xgfxterm) ;;
4221+ xconsole | xserial | xofconsole | xvga_text)
4222+ # make sure all our children behave in conformance with ascii..
4223+ export LANG=C;;
4224+ *) echo "Invalid output terminal \"${GRUB_TERMINAL_OUTPUT}\"" >&2 ; exit 1 ;;
4225+ esac
4226+done
4227+
4228+GRUB_ACTUAL_DEFAULT="$GRUB_DEFAULT"
4229+
4230+if [ "x${GRUB_ACTUAL_DEFAULT}" = "xsaved" ] ; then GRUB_ACTUAL_DEFAULT="`"${grub_editenv}" - list | sed -n '/^saved_entry=/ s,^saved_entry=,,p'`" ; fi
4231+
4232+
4233+# These are defined in this script, export them here so that user can
4234+# override them.
4235+export GRUB_DEVICE \
4236+ GRUB_DEVICE_UUID \
4237+ GRUB_DEVICE_BOOT \
4238+ GRUB_DEVICE_BOOT_UUID \
4239+ GRUB_FS \
4240+ GRUB_FONT \
4241+ GRUB_PRELOAD_MODULES \
4242+ GRUB_ACTUAL_DEFAULT
4243+
4244+# These are optional, user-defined variables.
4245+export GRUB_DEFAULT \
4246+ GRUB_HIDDEN_TIMEOUT \
4247+ GRUB_HIDDEN_TIMEOUT_QUIET \
4248+ GRUB_TIMEOUT \
4249+ GRUB_TIMEOUT_STYLE \
4250+ GRUB_DEFAULT_BUTTON \
4251+ GRUB_HIDDEN_TIMEOUT_BUTTON \
4252+ GRUB_TIMEOUT_BUTTON \
4253+ GRUB_TIMEOUT_STYLE_BUTTON \
4254+ GRUB_BUTTON_CMOS_ADDRESS \
4255+ GRUB_BUTTON_CMOS_CLEAN \
4256+ GRUB_DISTRIBUTOR \
4257+ GRUB_CMDLINE_LINUX \
4258+ GRUB_CMDLINE_LINUX_DEFAULT \
4259+ GRUB_CMDLINE_XEN \
4260+ GRUB_CMDLINE_XEN_DEFAULT \
4261+ GRUB_CMDLINE_LINUX_XEN_REPLACE \
4262+ GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT \
4263+ GRUB_CMDLINE_NETBSD \
4264+ GRUB_CMDLINE_NETBSD_DEFAULT \
4265+ GRUB_CMDLINE_GNUMACH \
4266+ GRUB_TERMINAL_INPUT \
4267+ GRUB_TERMINAL_OUTPUT \
4268+ GRUB_SERIAL_COMMAND \
4269+ GRUB_DISABLE_LINUX_UUID \
4270+ GRUB_DISABLE_RECOVERY \
4271+ GRUB_VIDEO_BACKEND \
4272+ GRUB_GFXMODE \
4273+ GRUB_BACKGROUND \
4274+ GRUB_THEME \
4275+ GRUB_GFXPAYLOAD_LINUX \
4276+ GRUB_DISABLE_OS_PROBER \
4277+ GRUB_INIT_TUNE \
4278+ GRUB_SAVEDEFAULT \
4279+ GRUB_ENABLE_CRYPTODISK \
4280+ GRUB_BADRAM \
4281+ GRUB_OS_PROBER_SKIP_LIST \
4282+ GRUB_DISABLE_SUBMENU
4283+
4284+if test "x${grub_cfg}" != "x"; then
4285+ rm -f "${grub_cfg}.new"
4286+ oldumask=$(umask); umask 077
4287+ exec > "${grub_cfg}.new"
4288+ umask $oldumask
4289+fi
4290+gettext "Generating grub configuration file ..." >&2
4291+echo >&2
4292+
4293+cat << EOF
4294+#
4295+# DO NOT EDIT THIS FILE
4296+#
4297+# It is automatically generated by $self using templates
4298+# from ${grub_mkconfig_dir} and settings from ${sysconfdir}/default/grub
4299+#
4300+EOF
4301+
4302+
4303+for i in "${grub_mkconfig_dir}"/* ; do
4304+ case "$i" in
4305+ # emacsen backup files. FIXME: support other editors
4306+ *~) ;;
4307+ # emacsen autosave files. FIXME: support other editors
4308+ */\#*\#) ;;
4309+ *)
4310+ if grub_file_is_not_garbage "$i" && test -x "$i" ; then
4311+ echo
4312+ echo "### BEGIN $i ###"
4313+ "$i"
4314+ echo "### END $i ###"
4315+ fi
4316+ ;;
4317+ esac
4318+done
4319+
4320+if [ "x${grub_cfg}" != "x" ] && ! grep "^password" ${grub_cfg}.new >/dev/null; then
4321+ chmod 444 ${grub_cfg}.new || true
4322+fi
4323+
4324+if test "x${grub_cfg}" != "x" ; then
4325+ if ! ${grub_script_check} ${grub_cfg}.new; then
4326+ # TRANSLATORS: %s is replaced by filename
4327+ gettext_printf "Syntax errors are detected in generated GRUB config file.
4328+Ensure that there are no errors in /etc/default/grub
4329+and /etc/grub.d/* files or please file a bug report with
4330+%s file attached." "${grub_cfg}.new" >&2
4331+ echo >&2
4332+ else
4333+ # none of the children aborted with error, install the new grub.cfg
4334+ mv -f ${grub_cfg}.new ${grub_cfg}
4335+ fi
4336+fi
4337+
4338+gettext "done" >&2
4339+echo >&2
4340
4341=== added directory '.pc/disable_floppies.patch'
4342=== added directory '.pc/disable_floppies.patch/grub-core'
4343=== added directory '.pc/disable_floppies.patch/grub-core/kern'
4344=== added directory '.pc/disable_floppies.patch/grub-core/kern/emu'
4345=== added file '.pc/disable_floppies.patch/grub-core/kern/emu/hostdisk.c'
4346--- .pc/disable_floppies.patch/grub-core/kern/emu/hostdisk.c 1970-01-01 00:00:00 +0000
4347+++ .pc/disable_floppies.patch/grub-core/kern/emu/hostdisk.c 2014-08-24 23:28:48 +0000
4348@@ -0,0 +1,686 @@
4349+/* hostdisk.c - emulate biosdisk */
4350+/*
4351+ * GRUB -- GRand Unified Bootloader
4352+ * Copyright (C) 1999,2000,2001,2002,2003,2004,2006,2007,2008,2009,2010 Free Software Foundation, Inc.
4353+ *
4354+ * GRUB is free software: you can redistribute it and/or modify
4355+ * it under the terms of the GNU General Public License as published by
4356+ * the Free Software Foundation, either version 3 of the License, or
4357+ * (at your option) any later version.
4358+ *
4359+ * GRUB is distributed in the hope that it will be useful,
4360+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
4361+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4362+ * GNU General Public License for more details.
4363+ *
4364+ * You should have received a copy of the GNU General Public License
4365+ * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
4366+ */
4367+
4368+#include <config-util.h>
4369+
4370+#include <grub/disk.h>
4371+#include <grub/partition.h>
4372+#include <grub/msdos_partition.h>
4373+#include <grub/types.h>
4374+#include <grub/err.h>
4375+#include <grub/emu/misc.h>
4376+#include <grub/emu/hostdisk.h>
4377+#include <grub/emu/getroot.h>
4378+#include <grub/misc.h>
4379+#include <grub/i18n.h>
4380+#include <grub/list.h>
4381+
4382+#include <stdio.h>
4383+#include <stdlib.h>
4384+#include <string.h>
4385+#include <ctype.h>
4386+#include <assert.h>
4387+#include <unistd.h>
4388+#include <sys/types.h>
4389+#include <sys/stat.h>
4390+#include <fcntl.h>
4391+#include <errno.h>
4392+#include <limits.h>
4393+
4394+#ifdef __linux__
4395+# include <sys/ioctl.h> /* ioctl */
4396+# include <sys/mount.h>
4397+# ifndef BLKFLSBUF
4398+# define BLKFLSBUF _IO (0x12,97) /* flush buffer cache */
4399+# endif /* ! BLKFLSBUF */
4400+#endif /* __linux__ */
4401+
4402+static struct
4403+{
4404+ char *drive;
4405+ char *device;
4406+ int device_map;
4407+} map[256];
4408+
4409+static int
4410+unescape_cmp (const char *a, const char *b_escaped)
4411+{
4412+ while (*a || *b_escaped)
4413+ {
4414+ if (*b_escaped == '\\' && b_escaped[1] != 0)
4415+ b_escaped++;
4416+ if (*a < *b_escaped)
4417+ return -1;
4418+ if (*a > *b_escaped)
4419+ return +1;
4420+ a++;
4421+ b_escaped++;
4422+ }
4423+ if (*a)
4424+ return +1;
4425+ if (*b_escaped)
4426+ return -1;
4427+ return 0;
4428+}
4429+
4430+static int
4431+find_grub_drive (const char *name)
4432+{
4433+ unsigned int i;
4434+
4435+ if (name)
4436+ {
4437+ for (i = 0; i < ARRAY_SIZE (map); i++)
4438+ if (map[i].drive && unescape_cmp (map[i].drive, name) == 0)
4439+ return i;
4440+ }
4441+
4442+ return -1;
4443+}
4444+
4445+static int
4446+find_free_slot (void)
4447+{
4448+ unsigned int i;
4449+
4450+ for (i = 0; i < sizeof (map) / sizeof (map[0]); i++)
4451+ if (! map[i].drive)
4452+ return i;
4453+
4454+ return -1;
4455+}
4456+
4457+static int
4458+grub_util_biosdisk_iterate (grub_disk_dev_iterate_hook_t hook, void *hook_data,
4459+ grub_disk_pull_t pull)
4460+{
4461+ unsigned i;
4462+
4463+ if (pull != GRUB_DISK_PULL_NONE)
4464+ return 0;
4465+
4466+ for (i = 0; i < sizeof (map) / sizeof (map[0]); i++)
4467+ if (map[i].drive && hook (map[i].drive, hook_data))
4468+ return 1;
4469+
4470+ return 0;
4471+}
4472+
4473+static grub_err_t
4474+grub_util_biosdisk_open (const char *name, grub_disk_t disk)
4475+{
4476+ int drive;
4477+ struct grub_util_hostdisk_data *data;
4478+
4479+ drive = find_grub_drive (name);
4480+ grub_util_info ("drive = %d", drive);
4481+ if (drive < 0)
4482+ return grub_error (GRUB_ERR_UNKNOWN_DEVICE,
4483+ "no mapping exists for `%s'", name);
4484+
4485+ disk->id = drive;
4486+ disk->data = data = xmalloc (sizeof (struct grub_util_hostdisk_data));
4487+ data->dev = NULL;
4488+ data->access_mode = 0;
4489+ data->fd = GRUB_UTIL_FD_INVALID;
4490+ data->is_disk = 0;
4491+ data->device_map = map[drive].device_map;
4492+
4493+ /* Get the size. */
4494+ {
4495+ grub_util_fd_t fd;
4496+
4497+ fd = grub_util_fd_open (map[drive].device, GRUB_UTIL_FD_O_RDONLY);
4498+
4499+ if (!GRUB_UTIL_FD_IS_VALID(fd))
4500+ return grub_error (GRUB_ERR_UNKNOWN_DEVICE, N_("cannot open `%s': %s"),
4501+ map[drive].device, grub_util_fd_strerror ());
4502+
4503+ disk->total_sectors = grub_util_get_fd_size (fd, map[drive].device,
4504+ &disk->log_sector_size);
4505+ disk->total_sectors >>= disk->log_sector_size;
4506+ disk->max_agglomerate = GRUB_DISK_MAX_MAX_AGGLOMERATE;
4507+
4508+#if GRUB_UTIL_FD_STAT_IS_FUNCTIONAL
4509+ {
4510+ struct stat st;
4511+# if GRUB_DISK_DEVS_ARE_CHAR
4512+ if (fstat (fd, &st) < 0 || ! S_ISCHR (st.st_mode))
4513+# else
4514+ if (fstat (fd, &st) < 0 || ! S_ISBLK (st.st_mode))
4515+# endif
4516+ data->is_disk = 1;
4517+ }
4518+#endif
4519+
4520+ grub_util_fd_close (fd);
4521+
4522+ grub_util_info ("the size of %s is %" GRUB_HOST_PRIuLONG_LONG,
4523+ name, (unsigned long long) disk->total_sectors);
4524+
4525+ return GRUB_ERR_NONE;
4526+ }
4527+}
4528+
4529+const char *
4530+grub_hostdisk_os_dev_to_grub_drive (const char *os_disk, int add)
4531+{
4532+ unsigned int i;
4533+ char *canon;
4534+
4535+ canon = canonicalize_file_name (os_disk);
4536+ if (!canon)
4537+ canon = xstrdup (os_disk);
4538+
4539+ for (i = 0; i < ARRAY_SIZE (map); i++)
4540+ if (! map[i].device)
4541+ break;
4542+ else if (strcmp (map[i].device, canon) == 0)
4543+ {
4544+ free (canon);
4545+ return map[i].drive;
4546+ }
4547+
4548+ if (!add)
4549+ {
4550+ free (canon);
4551+ return NULL;
4552+ }
4553+
4554+ if (i == ARRAY_SIZE (map))
4555+ /* TRANSLATORS: it refers to the lack of free slots. */
4556+ grub_util_error ("%s", _("device count exceeds limit"));
4557+
4558+ map[i].device = canon;
4559+ map[i].drive = xmalloc (sizeof ("hostdisk/") + strlen (os_disk));
4560+ strcpy (map[i].drive, "hostdisk/");
4561+ strcpy (map[i].drive + sizeof ("hostdisk/") - 1, os_disk);
4562+ map[i].device_map = 0;
4563+
4564+ grub_hostdisk_flush_initial_buffer (os_disk);
4565+
4566+ return map[i].drive;
4567+}
4568+
4569+#ifndef __linux__
4570+grub_util_fd_t
4571+grub_util_fd_open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags,
4572+ grub_disk_addr_t *max)
4573+{
4574+ grub_util_fd_t fd;
4575+ struct grub_util_hostdisk_data *data = disk->data;
4576+
4577+ *max = ~0ULL;
4578+
4579+ flags |= GRUB_UTIL_FD_O_SYNC;
4580+
4581+ if (data->dev && strcmp (data->dev, map[disk->id].device) == 0 &&
4582+ data->access_mode == (flags & O_ACCMODE))
4583+ {
4584+ grub_dprintf ("hostdisk", "reusing open device `%s'\n", data->dev);
4585+ fd = data->fd;
4586+ }
4587+ else
4588+ {
4589+ free (data->dev);
4590+ data->dev = 0;
4591+ if (GRUB_UTIL_FD_IS_VALID(data->fd))
4592+ {
4593+ if (data->access_mode == O_RDWR || data->access_mode == O_WRONLY)
4594+ grub_util_fd_sync (data->fd);
4595+ grub_util_fd_close (data->fd);
4596+ data->fd = GRUB_UTIL_FD_INVALID;
4597+ }
4598+
4599+ fd = grub_util_fd_open (map[disk->id].device, flags);
4600+ if (GRUB_UTIL_FD_IS_VALID(fd))
4601+ {
4602+ data->dev = xstrdup (map[disk->id].device);
4603+ data->access_mode = (flags & O_ACCMODE);
4604+ data->fd = fd;
4605+ }
4606+ }
4607+
4608+ if (!GRUB_UTIL_FD_IS_VALID(data->fd))
4609+ {
4610+ grub_error (GRUB_ERR_BAD_DEVICE, N_("cannot open `%s': %s"),
4611+ map[disk->id].device, grub_util_fd_strerror ());
4612+ return GRUB_UTIL_FD_INVALID;
4613+ }
4614+
4615+ if (grub_util_fd_seek (fd, sector << disk->log_sector_size))
4616+ {
4617+ grub_util_fd_close (fd);
4618+ grub_error (GRUB_ERR_BAD_DEVICE, N_("cannot seek `%s': %s"),
4619+ map[disk->id].device, grub_util_fd_strerror ());
4620+
4621+ return GRUB_UTIL_FD_INVALID;
4622+ }
4623+
4624+ return fd;
4625+}
4626+#endif
4627+
4628+
4629+static grub_err_t
4630+grub_util_biosdisk_read (grub_disk_t disk, grub_disk_addr_t sector,
4631+ grub_size_t size, char *buf)
4632+{
4633+ while (size)
4634+ {
4635+ grub_util_fd_t fd;
4636+ grub_disk_addr_t max = ~0ULL;
4637+ fd = grub_util_fd_open_device (disk, sector, GRUB_UTIL_FD_O_RDONLY, &max);
4638+ if (!GRUB_UTIL_FD_IS_VALID (fd))
4639+ return grub_errno;
4640+
4641+#ifdef __linux__
4642+ if (sector == 0)
4643+ /* Work around a bug in Linux ez remapping. Linux remaps all
4644+ sectors that are read together with the MBR in one read. It
4645+ should only remap the MBR, so we split the read in two
4646+ parts. -jochen */
4647+ max = 1;
4648+#endif /* __linux__ */
4649+
4650+ if (max > size)
4651+ max = size;
4652+
4653+ if (grub_util_fd_read (fd, buf, max << disk->log_sector_size)
4654+ != (ssize_t) (max << disk->log_sector_size))
4655+ return grub_error (GRUB_ERR_READ_ERROR, N_("cannot read `%s': %s"),
4656+ map[disk->id].device, grub_util_fd_strerror ());
4657+ size -= max;
4658+ buf += (max << disk->log_sector_size);
4659+ sector += max;
4660+ }
4661+ return GRUB_ERR_NONE;
4662+}
4663+
4664+static grub_err_t
4665+grub_util_biosdisk_write (grub_disk_t disk, grub_disk_addr_t sector,
4666+ grub_size_t size, const char *buf)
4667+{
4668+ while (size)
4669+ {
4670+ grub_util_fd_t fd;
4671+ grub_disk_addr_t max = ~0ULL;
4672+ fd = grub_util_fd_open_device (disk, sector, GRUB_UTIL_FD_O_WRONLY, &max);
4673+ if (!GRUB_UTIL_FD_IS_VALID (fd))
4674+ return grub_errno;
4675+
4676+#ifdef __linux__
4677+ if (sector == 0)
4678+ /* Work around a bug in Linux ez remapping. Linux remaps all
4679+ sectors that are write together with the MBR in one write. It
4680+ should only remap the MBR, so we split the write in two
4681+ parts. -jochen */
4682+ max = 1;
4683+#endif /* __linux__ */
4684+
4685+ if (max > size)
4686+ max = size;
4687+
4688+ if (grub_util_fd_write (fd, buf, max << disk->log_sector_size)
4689+ != (ssize_t) (max << disk->log_sector_size))
4690+ return grub_error (GRUB_ERR_WRITE_ERROR, N_("cannot write to `%s': %s"),
4691+ map[disk->id].device, grub_util_fd_strerror ());
4692+ size -= max;
4693+ buf += (max << disk->log_sector_size);
4694+ }
4695+ return GRUB_ERR_NONE;
4696+}
4697+
4698+grub_err_t
4699+grub_util_biosdisk_flush (struct grub_disk *disk)
4700+{
4701+ struct grub_util_hostdisk_data *data = disk->data;
4702+
4703+ if (disk->dev->id != GRUB_DISK_DEVICE_BIOSDISK_ID)
4704+ return GRUB_ERR_NONE;
4705+ if (!GRUB_UTIL_FD_IS_VALID (data->fd))
4706+ {
4707+ grub_disk_addr_t max;
4708+ data->fd = grub_util_fd_open_device (disk, 0, GRUB_UTIL_FD_O_RDONLY, &max);
4709+ if (!GRUB_UTIL_FD_IS_VALID (data->fd))
4710+ return grub_errno;
4711+ }
4712+ grub_util_fd_sync (data->fd);
4713+#ifdef __linux__
4714+ if (data->is_disk)
4715+ ioctl (data->fd, BLKFLSBUF, 0);
4716+#endif
4717+ return GRUB_ERR_NONE;
4718+}
4719+
4720+static void
4721+grub_util_biosdisk_close (struct grub_disk *disk)
4722+{
4723+ struct grub_util_hostdisk_data *data = disk->data;
4724+
4725+ free (data->dev);
4726+ if (GRUB_UTIL_FD_IS_VALID (data->fd))
4727+ {
4728+ if (data->access_mode == O_RDWR || data->access_mode == O_WRONLY)
4729+ grub_util_biosdisk_flush (disk);
4730+ grub_util_fd_close (data->fd);
4731+ }
4732+ free (data);
4733+}
4734+
4735+static struct grub_disk_dev grub_util_biosdisk_dev =
4736+ {
4737+ .name = "hostdisk",
4738+ .id = GRUB_DISK_DEVICE_HOSTDISK_ID,
4739+ .iterate = grub_util_biosdisk_iterate,
4740+ .open = grub_util_biosdisk_open,
4741+ .close = grub_util_biosdisk_close,
4742+ .read = grub_util_biosdisk_read,
4743+ .write = grub_util_biosdisk_write,
4744+ .next = 0
4745+ };
4746+
4747+static int
4748+grub_util_check_file_presence (const char *p)
4749+{
4750+#if !GRUB_UTIL_FD_STAT_IS_FUNCTIONAL
4751+ grub_util_fd_t h;
4752+ h = grub_util_fd_open (p, GRUB_UTIL_FD_O_RDONLY);
4753+ if (!GRUB_UTIL_FD_IS_VALID(h))
4754+ return 0;
4755+ grub_util_fd_close (h);
4756+ return 1;
4757+#else
4758+ struct stat st;
4759+
4760+ if (stat (p, &st) == -1)
4761+ return 0;
4762+ return 1;
4763+#endif
4764+}
4765+
4766+static void
4767+read_device_map (const char *dev_map)
4768+{
4769+ FILE *fp;
4770+ char buf[1024]; /* XXX */
4771+ int lineno = 0;
4772+
4773+ if (dev_map[0] == '\0')
4774+ {
4775+ grub_util_info ("no device.map");
4776+ return;
4777+ }
4778+
4779+ fp = grub_util_fopen (dev_map, "r");
4780+ if (! fp)
4781+ {
4782+ grub_util_info (_("cannot open `%s': %s"), dev_map, strerror (errno));
4783+ return;
4784+ }
4785+
4786+ while (fgets (buf, sizeof (buf), fp))
4787+ {
4788+ char *p = buf;
4789+ char *e;
4790+ char *drive_e, *drive_p;
4791+ int drive;
4792+
4793+ lineno++;
4794+
4795+ /* Skip leading spaces. */
4796+ while (*p && grub_isspace (*p))
4797+ p++;
4798+
4799+ /* If the first character is `#' or NUL, skip this line. */
4800+ if (*p == '\0' || *p == '#')
4801+ continue;
4802+
4803+ if (*p != '(')
4804+ {
4805+ char *tmp;
4806+ tmp = xasprintf (_("missing `%c' symbol"), '(');
4807+ grub_util_error ("%s:%d: %s", dev_map, lineno, tmp);
4808+ }
4809+
4810+ p++;
4811+ /* Find a free slot. */
4812+ drive = find_free_slot ();
4813+ if (drive < 0)
4814+ grub_util_error ("%s:%d: %s", dev_map, lineno, _("device count exceeds limit"));
4815+
4816+ e = p;
4817+ p = strchr (p, ')');
4818+ if (! p)
4819+ {
4820+ char *tmp;
4821+ tmp = xasprintf (_("missing `%c' symbol"), ')');
4822+ grub_util_error ("%s:%d: %s", dev_map, lineno, tmp);
4823+ }
4824+
4825+ map[drive].drive = 0;
4826+ if ((e[0] == 'f' || e[0] == 'h' || e[0] == 'c') && e[1] == 'd')
4827+ {
4828+ char *ptr;
4829+ for (ptr = e + 2; ptr < p; ptr++)
4830+ if (!grub_isdigit (*ptr))
4831+ break;
4832+ if (ptr == p)
4833+ {
4834+ map[drive].drive = xmalloc (p - e + sizeof ('\0'));
4835+ strncpy (map[drive].drive, e, p - e + sizeof ('\0'));
4836+ map[drive].drive[p - e] = '\0';
4837+ }
4838+ if (*ptr == ',')
4839+ {
4840+ *p = 0;
4841+
4842+ /* TRANSLATORS: Only one entry is ignored. However the suggestion
4843+ is to correct/delete the whole file.
4844+ device.map is a file indicating which
4845+ devices are available at boot time. Fedora populated it with
4846+ entries like (hd0,1) /dev/sda1 which would mean that every
4847+ partition is a separate disk for BIOS. Such entries were
4848+ inactive in GRUB due to its bug which is now gone. Without
4849+ this additional check these entries would be harmful now.
4850+ */
4851+ grub_util_warn (_("the device.map entry `%s' is invalid. "
4852+ "Ignoring it. Please correct or "
4853+ "delete your device.map"), e);
4854+ continue;
4855+ }
4856+ }
4857+ drive_e = e;
4858+ drive_p = p;
4859+ map[drive].device_map = 1;
4860+
4861+ p++;
4862+ /* Skip leading spaces. */
4863+ while (*p && grub_isspace (*p))
4864+ p++;
4865+
4866+ if (*p == '\0')
4867+ grub_util_error ("%s:%d: %s", dev_map, lineno, _("filename expected"));
4868+
4869+ /* NUL-terminate the filename. */
4870+ e = p;
4871+ while (*e && ! grub_isspace (*e))
4872+ e++;
4873+ *e = '\0';
4874+
4875+ if (!grub_util_check_file_presence (p))
4876+ {
4877+ free (map[drive].drive);
4878+ map[drive].drive = NULL;
4879+ grub_util_info ("Cannot stat `%s', skipping", p);
4880+ continue;
4881+ }
4882+
4883+ /* On Linux, the devfs uses symbolic links horribly, and that
4884+ confuses the interface very much, so use realpath to expand
4885+ symbolic links. */
4886+ map[drive].device = canonicalize_file_name (p);
4887+ if (! map[drive].device)
4888+ map[drive].device = xstrdup (p);
4889+
4890+ if (!map[drive].drive)
4891+ {
4892+ char c;
4893+ map[drive].drive = xmalloc (sizeof ("hostdisk/") + strlen (p));
4894+ memcpy (map[drive].drive, "hostdisk/", sizeof ("hostdisk/") - 1);
4895+ strcpy (map[drive].drive + sizeof ("hostdisk/") - 1, p);
4896+ c = *drive_p;
4897+ *drive_p = 0;
4898+ /* TRANSLATORS: device.map is a filename. Not to be translated.
4899+ device.map specifies disk correspondance overrides. Previously
4900+ one could create any kind of device name with this. Due to
4901+ some problems we decided to limit it to just a handful
4902+ possibilities. */
4903+ grub_util_warn (_("the drive name `%s' in device.map is incorrect. "
4904+ "Using %s instead. "
4905+ "Please use the form [hfc]d[0-9]* "
4906+ "(E.g. `hd0' or `cd')"),
4907+ drive_e, map[drive].drive);
4908+ *drive_p = c;
4909+ }
4910+
4911+ grub_util_info ("adding `%s' -> `%s' from device.map", map[drive].drive,
4912+ map[drive].device);
4913+
4914+ grub_hostdisk_flush_initial_buffer (map[drive].device);
4915+ }
4916+
4917+ fclose (fp);
4918+}
4919+
4920+void
4921+grub_util_biosdisk_init (const char *dev_map)
4922+{
4923+ read_device_map (dev_map);
4924+ grub_disk_dev_register (&grub_util_biosdisk_dev);
4925+}
4926+
4927+void
4928+grub_util_biosdisk_fini (void)
4929+{
4930+ unsigned i;
4931+
4932+ for (i = 0; i < sizeof (map) / sizeof (map[0]); i++)
4933+ {
4934+ if (map[i].drive)
4935+ free (map[i].drive);
4936+ if (map[i].device)
4937+ free (map[i].device);
4938+ map[i].drive = map[i].device = NULL;
4939+ }
4940+
4941+ grub_disk_dev_unregister (&grub_util_biosdisk_dev);
4942+}
4943+
4944+const char *
4945+grub_util_biosdisk_get_compatibility_hint (grub_disk_t disk)
4946+{
4947+ if (disk->dev != &grub_util_biosdisk_dev || map[disk->id].device_map)
4948+ return disk->name;
4949+ return 0;
4950+}
4951+
4952+const char *
4953+grub_util_biosdisk_get_osdev (grub_disk_t disk)
4954+{
4955+ if (disk->dev != &grub_util_biosdisk_dev)
4956+ return 0;
4957+
4958+ return map[disk->id].device;
4959+}
4960+
4961+
4962+static char *
4963+grub_util_path_concat_real (size_t n, int ext, va_list ap)
4964+{
4965+ size_t totlen = 0;
4966+ char **l = xmalloc ((n + ext) * sizeof (l[0]));
4967+ char *r, *p, *pi;
4968+ size_t i;
4969+ int first = 1;
4970+
4971+ for (i = 0; i < n + ext; i++)
4972+ {
4973+ l[i] = va_arg (ap, char *);
4974+ if (l[i])
4975+ totlen += strlen (l[i]) + 1;
4976+ }
4977+
4978+ r = xmalloc (totlen + 10);
4979+
4980+ p = r;
4981+ for (i = 0; i < n; i++)
4982+ {
4983+ pi = l[i];
4984+ if (!pi)
4985+ continue;
4986+ while (*pi == '/')
4987+ pi++;
4988+ if ((p != r || (pi != l[i] && first)) && (p == r || *(p - 1) != '/'))
4989+ *p++ = '/';
4990+ first = 0;
4991+ p = grub_stpcpy (p, pi);
4992+ while (p != r && p != r + 1 && *(p - 1) == '/')
4993+ p--;
4994+ }
4995+
4996+ if (ext && l[i])
4997+ p = grub_stpcpy (p, l[i]);
4998+
4999+ *p = '\0';
5000+
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: