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

Proposed by Doug Brunner
Status: Needs review
Proposed branch: lp:~madengineer10/ubuntu/utopic/grub/linux-pref-substr
Merge into: lp:ubuntu/utopic/grub
Diff against target: 1258018 lines (+1243836/-0) (has conflicts)
2695 files modified
.pc/.quilt_patches (+1/-0)
.pc/.quilt_series (+1/-0)
.pc/.version (+1/-0)
.pc/applied-patches (+55/-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-kernels-infloop.patch/util/grub.d/10_hurd.in (+180/-0)
.pc/mkconfig-kernels-infloop.patch/util/grub.d/10_kfreebsd.in (+241/-0)
.pc/mkconfig-kernels-infloop.patch/util/grub.d/10_linux.in (+356/-0)
.pc/mkconfig-kernels-infloop.patch/util/grub.d/20_linux_xen.in (+277/-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/net-ramp-up-interval.patch/grub-core/net/arp.c (+187/-0)
.pc/net-ramp-up-interval.patch/grub-core/net/icmp6.c (+534/-0)
.pc/net-ramp-up-interval.patch/grub-core/net/net.c (+1743/-0)
.pc/net-ramp-up-interval.patch/grub-core/net/tftp.c (+490/-0)
.pc/net-ramp-up-interval.patch/include/grub/net.h (+536/-0)
.pc/net-receive-packets-yield.patch/grub-core/net/net.c (+1743/-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/probe_nvme.patch/grub-core/osdep/linux/getroot.c (+1097/-0)
.pc/probe_nvme.patch/util/deviceiter.c (+973/-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 (+145/-0)
debian/changelog (+4103/-0)
debian/clean (+1/-0)
debian/compat (+1/-0)
debian/config.in (+76/-0)
debian/control (+694/-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.install.sparc64.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-ieee1275.install.sparc64.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-kernels-infloop.patch (+82/-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/net-ramp-up-interval.patch (+94/-0)
debian/patches/net-receive-packets-yield.patch (+34/-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/probe_nvme.patch (+89/-0)
debian/patches/quick_boot.patch (+333/-0)
debian/patches/restore_mkdevicemap.patch (+1249/-0)
debian/patches/series (+56/-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/ko.po (+395/-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 (+742/-0)
debian/postrm.in (+51/-0)
debian/preinst.in (+15/-0)
debian/rules (+457/-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 (+188/-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 (+535/-0)
grub-core/net/ip.c (+716/-0)
grub-core/net/net.c (+1744/-0)
grub-core/net/netbuff.c (+113/-0)
grub-core/net/tcp.c (+998/-0)
grub-core/net/tftp.c (+491/-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 (+1111/-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 (+537/-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 (+1002/-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/utopic/grub/linux-pref-substr
Reviewer Review Type Date Requested Status
Colin Watson Disapprove
Review via email: mp+232023@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 :

Thanks for your work.

Proposing this for merging into grub rather than grub2 yields an unhelpfully large merge. The grub source package is GRUB Legacy, not GRUB 2.

Anyway, grub2 is actually maintained in git in Debian; I don't want to introduce an Ubuntu delta again. Changes would be best proposed as Debian bugs with a diff against current git master. And, for configuration changes like this, it's really best to get these accepted upstream first, so that we don't have too much skew between distributions.

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

I'm sorry, I really tried my best to submit this appropriately. I thought that the grub2 packages were now just dummies and so the correct package name would be grub.

Are there any good rules to decide when proposals go upstream and when to Ubuntu? The documentation I found didn't mention anything about it.

Revision history for this message
Colin Watson (cjwatson) wrote :

The grub2 binary packages are metapackages depending on grub-*, but the source package is still grub2 and will almost certainly stay that way.

I don't have an algorithm for you for the latter; it's often a judgement call. However, a good rule of thumb is that you should generally start by sending proposals as far upstream as possible; so changes to upstream configuration should start out upstream, changes to Debian packaging should start out with Debian, etc. There are cases where that doesn't apply but it's a decent starting point.

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

OK, thanks for the clarification Colin. I've submitted Debian bug 759308 with the patch inlined.

I see you're on the GNU GRUB mailing list - would it make sense to submit the patch to that team as well, or is that something that Debian would normally handle if they like it?

Revision history for this message
Colin Watson (cjwatson) wrote :

You should normally do the initial submission of a patch as far upstream
as possible. While it's possible for Debian to forward patches, that's
basically me at the moment; my time is limited and doesn't normally
manage to extend to forwarding patches around on everyone's behalf, so
I'd appreciate it if you could do that.

Unmerged revisions

195. By Doug Brunner

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

194. By Doug Brunner

debian/patches/99-linux-pref-substr.patch: Add config var to allow user to prefer Linux kernel versions with a particular substring

193. By Doug Brunner

debian/patches/series/99-linux-pref-substr.patch: Add config var to allow user to prefer Linux kernel versions with a particular substring

192. By Colin Watson

* Force grub-pc/mixed_legacy_and_grub2 to be reshown, rather than failing
  when it was already seen (closes: #749571).
* Build with GCC 4.9 (closes: #748003).
* Build for sparc64 (closes: #753784).
* Fix an infinite loop in grub-mkconfig when kernel paths contain regex
  metacharacters. Thanks to Heimo Stranner for the report.
* On upgrade, if we find that one of the install devices no longer exists,
  ask the debconf question at priority critical rather than high.

191. By Colin Watson

[ Colin Watson ]
* Add the true module to the signed image, since 05_debian_theme uses it.
  Thanks to Dimitri John Ledkov for the report.
* Limit test suite parallelisation to 1; the test suite seems to have some
  isolation problems at higher levels at the moment (closes: #746856).
* Simplify override_dh_install a bit.
* Backport patches from upstream to make the network stack more responsive
  on busy networks (LP: #1314134).

[ Dimitri John Ledkov ]
* Add support for nvme device in grub-mkdevicemap (closes: #746396,
  LP: #1275162).

[ Debconf translations ]
* Korean (Changwoo Ryu, closes: #745559).

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.

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

Subscribers

People subscribed via source and target branches

to all changes: