]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Merge mainline into legacy_parser
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Fri, 27 Aug 2010 17:05:06 +0000 (19:05 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Fri, 27 Aug 2010 17:05:06 +0000 (19:05 +0200)
1  2 
grub-core/Makefile.core.def
grub-core/commands/legacycfg.c
grub-core/loader/i386/efi/xnu.c
grub-core/loader/i386/pc/xnu.c

index 0000000000000000000000000000000000000000,0257bbac474232d1fded7fb3e219cfcaf1d22912..5ddb99fa6da6fcf8247fc5dc4c6f56ab499eca53
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,1405 +1,1411 @@@
+ AutoGen definitions Makefile.tpl;
+ kernel = {
+   name = kernel;
+   nostrip = emu;
+   emu_ldflags              = '-Wl,-r,-d';
+   x86_efi_ldflags          = '-Wl,-r,-d';
+   x86_efi_stripflags       = '--strip-unneeded -K start -R .note -R .comment';
+   i386_pc_ldflags          = '$(TARGET_IMG_LDFLAGS)';
+   i386_pc_ldflags          = '$(TARGET_IMG_BASE_LDOPT),$(GRUB_KERNEL_MACHINE_LINK_ADDR)';
+   i386_qemu_ldflags        = '$(TARGET_IMG_LDFLAGS)';
+   i386_qemu_ldflags        = '$(TARGET_IMG_BASE_LDOPT),$(GRUB_KERNEL_MACHINE_LINK_ADDR)';
+   i386_coreboot_ldflags    = '-Wl,-Ttext=$(GRUB_KERNEL_MACHINE_LINK_ADDR)';
+   i386_multiboot_ldflags   = '-Wl,-Ttext=$(GRUB_KERNEL_MACHINE_LINK_ADDR)';
+   i386_ieee1275_ldflags    = '-Wl,-Ttext=$(GRUB_KERNEL_MACHINE_LINK_ADDR)';
+   mips_yeeloong_ldflags    = '-Wl,-Ttext,$(GRUB_KERNEL_MACHINE_LINK_ADDR)';
+   powerpc_ieee1275_ldflags = '-Wl,-Ttext,$(GRUB_KERNEL_MACHINE_LINK_ADDR)';
+   mips_yeeloong_cppflags = '-DUSE_ASCII_FAILBACK';
+   i386_qemu_cppflags     = '-DGRUB_BOOT_MACHINE_LINK_ADDR=$(GRUB_BOOT_MACHINE_LINK_ADDR)';
+   i386_qemu_ccasflags    = '-DGRUB_KERNEL_MACHINE_LINK_ADDR=$(GRUB_KERNEL_MACHINE_LINK_ADDR)';
+   emu_cflags = '$(CFLAGS_GNULIB)';
+   emu_cppflags = '$(CPPFLAGS_GNULIB)';
+   mips_ldadd = '-lgcc';
+   powerpc_ldadd = '-lgcc';
+   sparc64_ldadd = '-lgcc';
+   i386_pc_startup = kern/i386/pc/startup.S;
+   i386_efi_startup = kern/i386/efi/startup.S;
+   x86_64_efi_startup = kern/x86_64/efi/startup.S;
+   i386_qemu_startup = kern/i386/qemu/startup.S;
+   i386_ieee1275_startup = kern/i386/ieee1275/startup.S;
+   i386_coreboot_multiboot_startup = kern/i386/coreboot/startup.S;
+   mips_yeeloong_startup = kern/mips/startup.S;
+   sparc64_ieee1275_startup = kern/sparc64/ieee1275/crt0.S;
+   powerpc_ieee1275_startup = kern/powerpc/ieee1275/startup.S;
+   common = kern/command.c;
+   common = kern/corecmd.c;
+   common = kern/device.c;
+   common = kern/disk.c;
+   common = kern/dl.c;
+   common = kern/env.c;
+   common = kern/err.c;
+   common = kern/file.c;
+   common = kern/fs.c;
+   common = kern/list.c;
+   common = kern/main.c;
+   common = kern/misc.c;
+   common = kern/parser.c;
+   common = kern/partition.c;
+   common = kern/rescue_parser.c;
+   common = kern/rescue_reader.c;
+   common = kern/term.c;
+   noemu = kern/mm.c;
+   noemu = kern/time.c;
+   noemu = kern/generic/millisleep.c;
+   noemu_nodist = symlist.c;
+   noemu_noieee1275 = kern/generic/rtc_get_time_ms.c;
+   ieee1275 = disk/ieee1275/ofdisk.c;
+   ieee1275 = kern/ieee1275/cmain.c;
+   ieee1275 = kern/ieee1275/ieee1275.c;
+   ieee1275 = kern/ieee1275/mmap.c;
+   ieee1275 = kern/ieee1275/openfw.c;
+   ieee1275 = term/ieee1275/ofconsole.c;
+   ieee1275_mips = term/terminfo.c;
+   ieee1275_mips = term/tparm.c;
+   i386 = kern/i386/dl.c;
+   i386_coreboot_multiboot_qemu = kern/i386/coreboot/init.c;
+   i386_coreboot_multiboot_qemu = kern/i386/halt.c;
+   i386_coreboot_multiboot_qemu = term/i386/pc/vga_text.c;
+   i386_pc_coreboot_multiboot_qemu = term/i386/vga_common.c;
+   i386_noefi = kern/i386/misc.S;
+   x86_noieee1275 = kern/i386/pit.c;
+   x86_efi = disk/efi/efidisk.c;
+   x86_efi = kern/efi/efi.c;
+   x86_efi = kern/efi/init.c;
+   x86_efi = kern/efi/mm.c;
+   x86_efi = kern/i386/efi/init.c;
+   x86_efi = term/efi/console.c;
+   i386_efi = kern/i386/tsc.c;
+   x86_64_efi = kern/i386/tsc.c;
+   x86_64_efi = kern/x86_64/dl.c;
+   x86_64_efi = kern/x86_64/efi/callwrap.S;
+   i386_pc = kern/i386/pc/init.c;
+   i386_pc = kern/i386/pc/mmap.c;
+   i386_pc = kern/i386/tsc.c;
+   i386_pc = term/i386/pc/console.c;
+   i386_qemu = bus/pci.c;
+   i386_qemu = kern/i386/qemu/init.c;
+   i386_qemu = kern/i386/qemu/mmap.c;
+   i386_qemu = kern/i386/tsc.c;
+   i386_coreboot = kern/i386/coreboot/mmap.c;
+   i386_coreboot = kern/i386/tsc.c;
+   i386_multiboot = kern/i386/multiboot_mmap.c;
+   i386_multiboot = kern/i386/tsc.c;
+   i386_ieee1275 = kern/i386/ieee1275/init.c;
+   i386_ieee1275 = kern/ieee1275/init.c;
+   mips_yeeloong = term/ns8250.c;
+   mips_yeeloong = bus/bonito.c;
+   mips_yeeloong = bus/cs5536.c;
+   mips_yeeloong = bus/pci.c;
+   mips_yeeloong = commands/extcmd.c;
+   mips_yeeloong = font/font.c;
+   mips_yeeloong = font/font_cmd.c;
+   mips_yeeloong = io/bufio.c;
+   mips_yeeloong = kern/mips/cache.S;
+   mips_yeeloong = kern/mips/dl.c;
+   mips_yeeloong = kern/mips/init.c;
+   mips_yeeloong = kern/mips/yeeloong/init.c;
+   mips_yeeloong = lib/arg.c;
+   mips_yeeloong = term/at_keyboard.c;
+   mips_yeeloong = term/gfxterm.c;
+   mips_yeeloong = term/serial.c;
+   mips_yeeloong = video/bitmap.c;
+   mips_yeeloong = video/bitmap_scale.c;
+   mips_yeeloong = video/fb/fbblit.c;
+   mips_yeeloong = video/fb/fbfill.c;
+   mips_yeeloong = video/fb/fbutil.c;
+   mips_yeeloong = video/fb/video_fb.c;
+   mips_yeeloong = video/sm712.c;
+   mips_yeeloong = video/video.c;
+   powerpc_ieee1275 = kern/ieee1275/init.c;
+   powerpc_ieee1275 = kern/powerpc/cache.S;
+   powerpc_ieee1275 = kern/powerpc/dl.c;
+   sparc64_ieee1275 = kern/sparc64/cache.S;
+   sparc64_ieee1275 = kern/sparc64/dl.c;
+   sparc64_ieee1275 = kern/sparc64/ieee1275/ieee1275.c;
+   sparc64_ieee1275 = kern/sparc64/ieee1275/init.c;
+   emu = disk/host.c;
+   emu = gnulib/progname.c;
+   emu = kern/emu/console.c;
+   emu = kern/emu/getroot.c;
+   emu = kern/emu/hostdisk.c;
+   emu = kern/emu/hostfs.c;
+   emu = kern/emu/main.c;
+   emu = kern/emu/misc.c;
+   emu = kern/emu/mm.c;
+   emu = kern/emu/time.c;
+   extra_dist = kern/i386/loader.S;
+   extra_dist = kern/i386/realmode.S;
+   extra_dist = kern/i386/pc/lzma_decode.S;
+ };
+ program = {
+   name = grub-emu;
+   mansection = 1;
+   emu = kern/emu/full.c;
+   emu_nodist = grub_emu_init.c;
+   ldadd = 'kernel.img$(EXEEXT)';
+   ldadd = '$(MODULE_FILES)';
+   ldadd = '$(LIBUTIL) $(LIBCURSES) $(LIBSDL) $(LIBUSB) $(LIBPCIACCESS) $(LIBDEVMAPPER)';
+   enable = emu;
+ };
+ program = {
+   name = grub-emu-lite;
+   emu = kern/emu/lite.c;
+   emu = kern/emu/cache.S;
+   emu_nodist = symlist.c;
+   ldadd = 'kernel.img$(EXEEXT)';
+   ldadd = '$(LIBUTIL) $(LIBCURSES) $(LIBSDL) $(LIBUSB) $(LIBPCIACCESS) $(LIBDEVMAPPER)';
+   enable = emu;
+ };
+ image = {
+   name = boot;
+   i386_pc = boot/i386/pc/boot.S;
+   i386_qemu = boot/i386/qemu/boot.S;
+   sparc64_ieee1275 = boot/sparc64/ieee1275/boot.S;
+   i386_pc_ldflags = '$(TARGET_IMG_LDFLAGS)';
+   i386_pc_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x7C00';
+   i386_qemu_ldflags = '$(TARGET_IMG_LDFLAGS)';
+   i386_qemu_ldflags = '$(TARGET_IMG_BASE_LDOPT),$(GRUB_BOOT_MACHINE_LINK_ADDR)';
+   i386_qemu_ccasflags = '-DGRUB_BOOT_MACHINE_LINK_ADDR=$(GRUB_BOOT_MACHINE_LINK_ADDR)';
+   sparc64_ieee1275_objcopyflags = '-O a.out-sunos-big';
+   sparc64_ieee1275_ldflags = ' -Wl,-Ttext=0x4000';
+   objcopyflags = '-O binary';
+   enable = i386_pc;
+   enable = i386_qemu;
+   enable = sparc64_ieee1275;
+ };
+ image = {
+   name = cdboot;
+   i386_pc = boot/i386/pc/cdboot.S;
+   i386_pc_ldflags = '$(TARGET_IMG_LDFLAGS)';
+   i386_pc_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x7C00';
+   objcopyflags = '-O binary';
+   enable = i386_pc;
+ };
+ image = {
+   name = pxeboot;
+   i386_pc = boot/i386/pc/pxeboot.S;
+   i386_pc_ldflags = '$(TARGET_IMG_LDFLAGS)';
+   i386_pc_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x7C00';
+   objcopyflags = '-O binary';
+   enable = i386_pc;
+ };
+ image = {
+   name = diskboot;
+   i386_pc = boot/i386/pc/diskboot.S;
+   i386_pc_ldflags = '$(TARGET_IMG_LDFLAGS)';
+   i386_pc_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x8000';
+   sparc64_ieee1275 = boot/sparc64/ieee1275/diskboot.S;
+   sparc64_ieee1275_ldflags = '-Wl,-Ttext=0x4200';
+   objcopyflags = '-O binary';
+   enable = i386_pc;
+   enable = sparc64_ieee1275;
+ };
+ image = {
+   name = lnxboot;
+   i386_pc = boot/i386/pc/lnxboot.S;
+   i386_pc_ldflags = '$(TARGET_IMG_LDFLAGS)';
+   i386_pc_ldflags = '$(TARGET_IMG_BASE_LDOPT),0x6000';
+   objcopyflags = '-O binary';
+   enable = i386_pc;
+ };
+ image = {
+   name = fwstart;
+   mips_yeeloong = boot/mips/yeeloong/fwstart.S;
+   objcopyflags = '-O binary';
+   enable = mips_yeeloong;
+ };
+ module = {
+   name = trig;
+   common_nodist = trigtables.c;
+   extra_dist = gentrigtables.c;
+ };
+ module = {
+   name = cs5536;
+   x86 = bus/cs5536.c;
+   enable = x86;
+ };
+ module = {
+   name = libusb;
+   emu = bus/usb/emu/usb.c;
+   enable = emu;
+   condition = COND_GRUB_EMU_USB;
+ };
+ module = {
+   name = lsspd;
+   mips_yeeloong = commands/mips/yeeloong/lsspd.c;
+   enable = mips_yeeloong;
+ };
+ module = {
+   name = usb;
+   common = bus/usb/usb.c;
+   noemu = bus/usb/usbtrans.c;
+   noemu = bus/usb/usbhub.c;
+   enable = emu;
+   enable = i386;
+   enable = mips_yeeloong;
+   emu_condition = COND_GRUB_EMU_USB;
+ };
+ module = {
+   name = usbserial_common;
+   common = bus/usb/serial/common.c;
+   enable = emu;
+   enable = i386_pc;
+   enable = mips_yeeloong;
+   emu_condition = COND_GRUB_EMU_USB;
+ };
+ module = {
+   name = usbserial_pl2303;
+   common = bus/usb/serial/pl2303.c;
+   enable = emu;
+   enable = i386_pc;
+   enable = mips_yeeloong;
+   emu_condition = COND_GRUB_EMU_USB;
+ };
+ module = {
+   name = usbserial_ftdi;
+   common = bus/usb/serial/ftdi.c;
+   enable = emu;
+   enable = i386_pc;
+   enable = mips_yeeloong;
+   emu_condition = COND_GRUB_EMU_USB;
+ };
+ module = {
+   name = uhci;
+   common = bus/usb/uhci.c;
+   enable = i386_pc;
+ };
+ module = {
+   name = ohci;
+   common = bus/usb/ohci.c;
+   enable = i386_pc;
+   enable = mips_yeeloong;
+ };
+ module = {
+   name = pci;
+   noemu = bus/pci.c;
+   emu = bus/emu/pci.c;
+   emu = commands/lspci.c;
+   enable = emu;
+   enable = i386_pc;
+   enable = x86_efi;
+   enable = i386_ieee1275;
+   enable = i386_coreboot;
+   emu_condition = COND_GRUB_EMU_PCI;
+ };
+ library = {
+   name = libgnulib.a;
+   common = gnulib/regex.c;
+   extra_dist = gnulib/regcomp.c;
+   extra_dist = gnulib/regexec.c;
+   extra_dist = gnulib/fnmatch_loop.c;
+   extra_dist = gnulib/regex_internal.c;
+   cflags = '$(CFLAGS_POSIX) $(CFLAGS_GNULIB)';
+   cppflags = '$(CPPFLAGS_POSIX) $(CPPFLAGS_GNULIB)';
+ };
+ module = {
+   name = cmostest;
+   i386 = commands/i386/cmostest.c;
+   enable = i386_pc;
+   enable = i386_coreboot;
+ };
+ module = {
+   name = iorw;
+   common = commands/iorw.c;
+   enable = x86;
+ };
+ module = {
+   name = regexp;
+   common = commands/regexp.c;
+   ldadd = libgnulib.a;
+   cflags = '$(CFLAGS_POSIX) $(CFLAGS_GNULIB)';
+   cppflags = '$(CPPFLAGS_POSIX) $(CPPFLAGS_GNULIB)';
+ };
+ module = {
+   name = acpi;
+   i386 = commands/acpi.c;
+   x86_efi = commands/efi/acpi.c;
+   i386_pc = commands/i386/pc/acpi.c;
+   enable = x86_efi;
+   enable = i386_pc;
+ };
+ module = {
+   name = blocklist;
+   common = commands/blocklist.c;
+ };
+ module = {
+   name = boot;
+   common = commands/boot.c;
+   i386_pc = lib/i386/pc/biosnum.c;
+ };
+ module = {
+   name = cat;
+   common = commands/cat.c;
+ };
+ module = {
+   name = cmp;
+   common = commands/cmp.c;
+ };
+ module = {
+   name = configfile;
+   common = commands/configfile.c;
+ };
+ module = {
+   name = cpuid;
+   x86 = commands/i386/cpuid.c;
+   enable = x86;
+ };
+ module = {
+   name = crc;
+   common = commands/crc.c;
+   common = lib/crc.c;
+ };
+ module = {
+   name = date;
+   common = commands/date.c;
+ };
+ module = {
+   name = drivemap;
+   i386_pc = commands/i386/pc/drivemap.c;
+   i386_pc = commands/i386/pc/drivemap_int13h.S;
+   enable = i386_pc;
+ };
+ module = {
+   name = echo;
+   common = commands/echo.c;
+ };
+ module = {
+   name = extcmd;
+   common = commands/extcmd.c;
+   common = lib/arg.c;
+ };
+ module = {
+   name = fixvideo;
+   x86_efi = commands/efi/fixvideo.c;
+   enable = x86_efi;
+ };
+ module = {
+   name = gptsync;
+   common = commands/gptsync.c;
+ };
+ module = {
+   name = halt;
+   nopc = commands/halt.c;
+   i386_pc = commands/i386/pc/halt.c;
+ };
+ module = {
+   name = hashsum;
+   common = commands/hashsum.c;
+ };
+ module = {
+   name = hdparm;
+   common = commands/hdparm.c;
+   common = lib/hexdump.c;
+   enable = i386_pc;
+ };
+ module = {
+   name = help;
+   common = commands/help.c;
+ };
+ module = {
+   name = hexdump;
+   common = commands/hexdump.c;
+   common = lib/hexdump.c;
+ };
+ module = {
+   name = keystatus;
+   common = commands/keystatus.c;
+ };
+ module = {
+   name = loadbios;
+   x86_efi = commands/efi/loadbios.c;
+   enable = x86_efi;
+ };
+ module = {
+   name = loadenv;
+   common = commands/loadenv.c;
+   common = lib/envblk.c;
+ };
+ module = {
+   name = ls;
+   common = commands/ls.c;
+ };
+ module = {
+   name = lsmmap;
+   common = commands/lsmmap.c;
+ };
+ module = {
+   name = lspci;
+   common = commands/lspci.c;
+   enable = x86;
+   enable = mips;
+ };
+ module = {
+   name = memrw;
+   common = commands/memrw.c;
+ };
+ module = {
+   name = minicmd;
+   common = commands/minicmd.c;
+ };
+ module = {
+   name = parttool;
+   common = commands/parttool.c;
+ };
+ module = {
+   name = password;
+   common = commands/password.c;
+ };
+ module = {
+   name = password_pbkdf2;
+   common = commands/password_pbkdf2.c;
+ };
+ module = {
+   name = play;
+   x86 = commands/i386/pc/play.c;
+   enable = x86;
+ };
+ module = {
+   name = probe;
+   common = commands/probe.c;
+ };
+ module = {
+   name = pxecmd;
+   i386_pc = commands/i386/pc/pxecmd.c;
+   enable = i386_pc;
+ };
+ module = {
+   name = read;
+   common = commands/read.c;
+ };
+ module = {
+   name = reboot;
+   common = commands/reboot.c;
+ };
+ module = {
+   name = search;
+   common = commands/search_wrap.c;
+   extra_dist = commands/search.c;
+ };
+ module = {
+   name = search_fs_file;
+   common = commands/search_file.c;
+ };
+ module = {
+   name = search_fs_uuid;
+   common = commands/search_uuid.c;
+ };
+ module = {
+   name = search_label;
+   common = commands/search_label.c;
+ };
+ module = {
+   name = setpci;
+   common = commands/setpci.c;
+   enable = x86;
+ };
+ module = {
+   name = sleep;
+   common = commands/sleep.c;
+ };
+ module = {
+   name = suspend;
+   ieee1275 = commands/ieee1275/suspend.c;
+   enable = i386_ieee1275;
+   enable = powerpc_ieee1275;
+ };
+ module = {
+   name = terminal;
+   common = commands/terminal.c;
+ };
+ module = {
+   name = test;
+   common = commands/test.c;
+ };
+ module = {
+   name = true;
+   common = commands/true.c;
+ };
+ module = {
+   name = usbtest;
+   common = commands/usbtest.c;
+   enable = i386_pc;
+   enable = mips_yeeloong;
+   enable = emu;
+   emu_condition = COND_GRUB_EMU_USB;
+ };
+ module = {
+   name = vbeinfo;
+   i386_pc = commands/i386/pc/vbeinfo.c;
+   enable = i386_pc;
+ };
+ module = {
+   name = vbetest;
+   i386_pc = commands/i386/pc/vbetest.c;
+   enable = i386_pc;
+ };
+ module = {
+   name = videotest;
+   common = commands/videotest.c;
+ };
+ module = {
+   name = xnu_uuid;
+   common = commands/xnu_uuid.c;
+ };
+ module = {
+   name = dm_nv;
+   common = disk/dmraid_nvidia.c;
+ };
+ module = {
+   name = loopback;
+   common = disk/loopback.c;
+ };
+ module = {
+   name = lvm;
+   common = disk/lvm.c;
+ };
+ module = {
+   name = mdraid;
+   common = disk/mdraid_linux.c;
+ };
+ module = {
+   name = raid;
+   common = disk/raid.c;
+ };
+ module = {
+   name = raid5rec;
+   common = disk/raid5_recover.c;
+ };
+ module = {
+   name = raid6rec;
+   common = disk/raid6_recover.c;
+ };
+ module = {
+   name = scsi;
+   common = disk/scsi.c;
+ };
+ module = {
+   name = memdisk;
+   common = disk/memdisk.c;
+ };
+ module = {
+   name = ata;
+   common = disk/ata.c;
+   enable = x86;
+   enable = mips;
+ };
+ module = {
+   name = ata_pthru;
+   common = disk/ata_pthru.c;
+   enable = x86;
+   enable = mips_yeeloong;
+ };
+ module = {
+   name = biosdisk;
+   i386_pc = disk/i386/pc/biosdisk.c;
+   enable = i386_pc;
+ };
+ module = {
+   name = usbms;
+   common = disk/usbms.c;
+   enable = i386_pc;
+   enable = mips_yeeloong;
+   enable = emu;
+   emu_condition = COND_GRUB_EMU_USB;
+ };
+ module = {
+   name = nand;
+   ieee1275 = disk/ieee1275/nand.c;
+   enable = i386_ieee1275;
+ };
+ module = {
+   name = efiemu;
+   i386_pc = efiemu/main.c;
+   i386_pc = efiemu/i386/loadcore32.c;
+   i386_pc = efiemu/i386/loadcore64.c;
+   i386_pc = efiemu/i386/pc/cfgtables.c;
+   i386_pc = efiemu/mm.c;
+   i386_pc = efiemu/loadcore_common.c;
+   i386_pc = efiemu/symbols.c;
+   i386_pc = efiemu/loadcore32.c;
+   i386_pc = efiemu/loadcore64.c;
+   i386_pc = efiemu/prepare32.c;
+   i386_pc = efiemu/prepare64.c;
+   i386_pc = efiemu/pnvram.c;
+   i386_pc = efiemu/i386/coredetect.c;
+   extra_dist = efiemu/prepare.c;
+   extra_dist = efiemu/loadcore.c;
+   extra_dist = efiemu/runtime/efiemu.S;
+   extra_dist = efiemu/runtime/efiemu.c;
+   enable = i386_pc;
+ };
+ module = {
+   name = font;
+   common = font/font.c;
+   common = font/font_cmd.c;
+   enable = emu;
+   enable = x86;
+   enable = sparc64;
+   enable = powerpc;
+ };
+ module = {
+   name = affs;
+   common = fs/affs.c;
+ };
+ module = {
+   name = afs;
+   common = fs/afs.c;
+ };
+ module = {
+   name = afs_be;
+   common = fs/afs_be.c;
+ };
+ module = {
+   name = befs;
+   common = fs/befs.c;
+ };
+ module = {
+   name = befs_be;
+   common = fs/befs_be.c;
+ };
+ module = {
+   name = cpio;
+   common = fs/cpio.c;
+ };
+ module = {
+   name = ext2;
+   common = fs/ext2.c;
+ };
+ module = {
+   name = fat;
+   common = fs/fat.c;
+ };
+ module = {
+   name = fshelp;
+   common = fs/fshelp.c;
+ };
+ module = {
+   name = hfs;
+   common = fs/hfs.c;
+ };
+ module = {
+   name = hfsplus;
+   common = fs/hfsplus.c;
+ };
+ module = {
+   name = iso9660;
+   common = fs/iso9660.c;
+ };
+ module = {
+   name = jfs;
+   common = fs/jfs.c;
+ };
+ module = {
+   name = minix;
+   common = fs/minix.c;
+ };
+ module = {
+   name = nilfs2;
+   common = fs/nilfs2.c;
+ };
+ module = {
+   name = ntfs;
+   common = fs/ntfs.c;
+ };
+ module = {
+   name = ntfscomp;
+   common = fs/ntfscomp.c;
+ };
+ module = {
+   name = reiserfs;
+   common = fs/reiserfs.c;
+ };
+ module = {
+   name = sfs;
+   common = fs/sfs.c;
+ };
+ module = {
+   name = tar;
+   common = fs/tar.c;
+ };
+ module = {
+   name = udf;
+   common = fs/udf.c;
+ };
+ module = {
+   name = ufs1;
+   common = fs/ufs.c;
+ };
+ module = {
+   name = ufs2;
+   common = fs/ufs2.c;
+ };
+ module = {
+   name = xfs;
+   common = fs/xfs.c;
+ };
+ module = {
+   name = pxe;
+   i386_pc = fs/i386/pc/pxe.c;
+   enable = i386_pc;
+ };
+ module = {
+   name = gettext;
+   common = gettext/gettext.c;
+ };
+ module = {
+   name = gfxmenu;
+   common = gfxmenu/gfxmenu.c;
+   common = gfxmenu/model.c;
+   common = gfxmenu/view.c;
+   common = gfxmenu/font.c;
+   common = gfxmenu/icon_manager.c;
+   common = gfxmenu/theme_loader.c;
+   common = gfxmenu/widget-box.c;
+   common = gfxmenu/gui_canvas.c;
+   common = gfxmenu/gui_circular_progress.c;
+   common = gfxmenu/gui_box.c;
+   common = gfxmenu/gui_label.c;
+   common = gfxmenu/gui_list.c;
+   common = gfxmenu/gui_image.c;
+   common = gfxmenu/gui_progress_bar.c;
+   common = gfxmenu/gui_util.c;
+   common = gfxmenu/gui_string_util.c;
+   common = gfxmenu/named_colors.c;
+ };
+ module = {
+   name = hello;
+   common = hello/hello.c;
+ };
+ module = {
+   name = gzio;
+   common = io/gzio.c;
+ };
+ module = {
+   name = bufio;
+   common = io/bufio.c;
+   enable = emu;
+   enable = x86;
+   enable = sparc64;
+   enable = powerpc;
+ };
+ module = {
+   name = elf;
+   common = kern/elf.c;
+ };
+ module = {
+   name = crypto;
+   common = lib/crypto.c;
+   extra_dist = lib/libgcrypt-grub/cipher/crypto.lst;
+ };
+ module = {
+   name = pbkdf2;
+   common = lib/pbkdf2.c;
+ };
+ module = {
+   name = relocator;
+   mips = lib/mips/relocator.c;
+   mips = lib/mips/relocator_asm.S;
+   x86 = lib/i386/relocator.c;
+   x86 = lib/i386/relocator_asm.S;
+   x86 = lib/i386/relocator_backward.S;
+   extra_dist = lib/relocator.c;
+   enable = mips;
+   enable = x86;
+ };
+ module = {
+   name = datetime;
+   x86_noefi_mips = lib/cmos_datetime.c;
+   x86_efi = lib/efi/datetime.c;
+   sparc64_ieee1275 = lib/ieee1275/datetime.c;
+   powerpc_ieee1275 = lib/ieee1275/datetime.c;
+   enable = x86;
+   enable = mips;
+   enable = sparc64_ieee1275;
+   enable = powerpc_ieee1275;
+ };
+ module = {
+   name = setjmp;
+   common = lib/setjmp.S;
+   extra_dist = lib/i386/setjmp.S;
+   extra_dist = lib/mips/setjmp.S;
+   extra_dist = lib/x86_64/setjmp.S;
+   extra_dist = lib/sparc64/setjmp.S;
+   extra_dist = lib/powerpc/setjmp.S;
+ };
+ module = {
+   name = aout;
+   common = loader/aout.c;
+   enable = i386_pc;
+   enable = i386_qemu;
+   enable = i386_coreboot;
+   enable = i386_multiboot;
+   enable = i386_ieee1275;
+ };
+ module = {
+   name = bsd;
+   i386 = loader/i386/bsd.c;
+   i386 = loader/i386/bsd32.c;
+   i386 = loader/i386/bsd64.c;
+   i386 = loader/i386/bsd_helper.S;
+   i386 = loader/i386/bsd_trampoline.S;
+   extra_dist = loader/i386/bsdXX.c;
+   extra_dist = loader/i386/bsd_pagetable.c;
+   enable = i386_pc;
+   enable = i386_qemu;
+   enable = i386_coreboot;
+   enable = i386_multiboot;
+ };
+ module = {
+   name = linux16;
+   i386_pc = loader/i386/pc/linux.c;
+   enable = i386_pc;
+ };
+ module = {
+   name = multiboot2;
+   cppflags = "-DGRUB_USE_MULTIBOOT2";
+   common = loader/multiboot.c;
+   common = loader/multiboot_mbi2.c;
+   enable = x86;
+   enable = mips;
+ };
+ module = {
+   name = multiboot;
+   common = loader/multiboot.c;
+   x86 = loader/i386/multiboot_mbi.c;
+   extra_dist = loader/multiboot_elfxx.c;
+   enable = x86;
+ };
+ module = {
+   name = linux;
+   i386_noefi_noieee1275 = loader/i386/linux.c;
+   x86_efi = loader/i386/efi/linux.c;
+   x86_64_efi = loader/i386/linux_trampoline.S;
+   i386_ieee1275 = loader/i386/ieee1275/linux.c;
+   mips = loader/mips/linux.c;
+   powerpc_ieee1275 = loader/powerpc/ieee1275/linux.c;
+   sparc64_ieee1275 = loader/sparc64/ieee1275/linux.c;
+   enable = noemu;
+ };
+ module = {
+   name = xnu;
+   x86_efi_pc = loader/xnu_resume.c;
+   x86_efi_pc = loader/i386/xnu.c;
+   x86_efi_pc = loader/macho32.c;
+   x86_efi_pc = loader/macho64.c;
+   x86_efi_pc = loader/macho.c;
+   x86_efi_pc = loader/xnu.c;
+   extra_dist = loader/machoXX.c;
+   enable = i386_pc;
+   enable = x86_efi;
+ };
+ module = {
+   name = appleldr;
+   x86_efi = loader/efi/appleloader.c;
+   enable = x86_efi;
+ };
+ module = {
+   name = chain;
+   x86_efi = loader/efi/chainloader.c;
+   i386_pc = loader/i386/pc/chainloader.c;
+   enable = i386_pc;
+   enable = x86_efi;
+ };
+ module = {
+   name = mmap;
+   i386_pc = mmap/mmap.c;
+   i386_pc = mmap/i386/uppermem.c;
+   i386_pc = mmap/i386/mmap.c;
+   i386_pc = mmap/i386/pc/mmap.c;
+   i386_pc = mmap/i386/pc/mmap_helper.S;
+   x86_efi = mmap/mmap.c;
+   x86_efi = mmap/i386/uppermem.c;
+   x86_efi = mmap/i386/mmap.c;
+   x86_efi = mmap/efi/mmap.c;
+   i386_coreboot = mmap/mmap.c;
+   i386_coreboot = mmap/i386/uppermem.c;
+   i386_coreboot = mmap/i386/mmap.c;
+   i386_multiboot = mmap/mmap.c;
+   i386_multiboot = mmap/i386/uppermem.c;
+   i386_multiboot = mmap/i386/mmap.c;
+   i386_qemu = mmap/mmap.c;
+   i386_qemu = mmap/i386/uppermem.c;
+   i386_qemu = mmap/i386/mmap.c;
+   i386_ieee1275 = mmap/mmap.c;
+   i386_ieee1275 = mmap/i386/uppermem.c;
+   i386_ieee1275 = mmap/i386/mmap.c;
+   mips_yeeloong = mmap/mmap.c;
+   mips_yeeloong = mmap/mips/yeeloong/uppermem.c;
+   enable = x86;
+   enable = mips_yeeloong;
+ };
+ module = {
+   name = normal;
+   common = normal/main.c;
+   common = normal/cmdline.c;
+   common = normal/dyncmd.c;
+   common = normal/auth.c;
+   common = normal/autofs.c;
+   common = normal/color.c;
+   common = normal/completion.c;
+   common = normal/datetime.c;
+   common = normal/menu.c;
+   common = normal/menu_entry.c;
+   common = normal/menu_text.c;
+   common = normal/misc.c;
+   common = normal/crypto.c;
+   common = normal/term.c;
+   common = normal/context.c;
+   common = normal/charset.c;
+   common = script/main.c;
+   common = script/script.c;
+   common = script/execute.c;
+   common = script/function.c;
+   common = script/lexer.c;
+   common = script/argv.c;
+   common = unidata.c;
+   common_nodist = grub_script.tab.c;
+   common_nodist = grub_script.yy.c;
+   common_nodist = grub_script.tab.h;
+   common_nodist = grub_script.yy.h;
+   extra_dist = script/yylex.l;
+   extra_dist = script/parser.y;
+   cflags = '$(CFLAGS_POSIX) -Wno-error';
+   cppflags = '$(CPPFLAGS_POSIX)';
+ };
+ module = {
+   name = part_acorn;
+   common = partmap/acorn.c;
+ };
+ module = {
+   name = part_amiga;
+   common = partmap/amiga.c;
+ };
+ module = {
+   name = part_apple;
+   common = partmap/apple.c;
+ };
+ module = {
+   name = part_gpt;
+   common = partmap/gpt.c;
+ };
+ module = {
+   name = part_msdos;
+   common = partmap/msdos.c;
+ };
+ module = {
+   name = part_sun;
+   common = partmap/sun.c;
+ };
+ module = {
+   name = part_bsd;
+   common = partmap/bsdlabel.c;
+ };
+ module = {
+   name = part_sunpc;
+   common = partmap/sunpc.c;
+ };
+ module = {
+   name = msdospart;
+   common = parttool/msdospart.c;
+ };
+ module = {
+   name = at_keyboard;
+   common = term/at_keyboard.c;
+   enable = x86;
+ };
+ module = {
+   name = gfxterm;
+   common = term/gfxterm.c;
+   enable = emu;
+   enable = x86;
+   enable = sparc64;
+   enable = powerpc;
+ };
+ module = {
+   name = serial;
+   common = term/serial.c;
+   x86 = term/ns8250.c;
+   enable = emu;
+   enable = i386;
+   enable = x86_64_efi;
+   emu_condition = COND_GRUB_EMU_USB;
+ };
+ module = {
+   name = sendkey;
+   i386_pc = commands/i386/pc/sendkey.c;
+   enable = i386_pc;
+ };
+ module = {
+   name = terminfo;
+   common = term/terminfo.c;
+   common = term/tparm.c;
+ };
+ module = {
+   name = usb_keyboard;
+   common = term/usb_keyboard.c;
+   enable = i386_pc;
+   enable = mips_yeeloong;
+ };
+ module = {
+   name = vga;
+   i386_pc = video/i386/pc/vga.c;
+   enable = i386_pc;
+ };
+ module = {
+   name = vga_text;
+   x86 = term/i386/pc/vga_text.c;
+   x86 = term/i386/vga_common.c;
+   enable = x86;
+ };
+ module = {
+   name = video_cirrus;
+   x86 = video/cirrus.c;
+   enable = x86;
+ };
+ module = {
+   name = video_bochs;
+   x86 = video/bochs.c;
+   enable = x86;
+ };
+ module = {
+   name = functional_test;
+   common = tests/lib/functional_test.c;
+   common = tests/lib/test.c;
+ };
+ module = {
+   name = example_functional_test;
+   common = tests/example_functional_test.c;
+   cflags = -Wno-format;
+ };
+ module = {
+   name = bitmap;
+   common = video/bitmap.c;
+   enable = emu;
+   enable = x86;
+   enable = sparc64;
+   enable = powerpc;
+ };
+ module = {
+   name = bitmap_scale;
+   common = video/bitmap_scale.c;
+   enable = emu;
+   enable = x86;
+   enable = sparc64;
+   enable = powerpc;
+ };
+ module = {
+   name = efi_gop;
+   x86_efi = video/efi_gop.c;
+   enable = x86_efi;
+ };
+ module = {
+   name = efi_uga;
+   x86_efi = video/efi_uga.c;
+   enable = x86_efi;
+ };
+ module = {
+   name = jpeg;
+   common = video/readers/jpeg.c;
+ };
+ module = {
+   name = png;
+   common = video/readers/png.c;
+ };
+ module = {
+   name = tga;
+   common = video/readers/tga.c;
+ };
+ module = {
+   name = vbe;
+   i386_pc = video/i386/pc/vbe.c;
+   enable = i386_pc;
+ };
+ module = {
+   name = video_fb;
+   common = video/fb/video_fb.c;
+   common = video/fb/fbblit.c;
+   common = video/fb/fbfill.c;
+   common = video/fb/fbutil.c;
+   enable = emu;
+   enable = x86;
+   enable = sparc64;
+   enable = powerpc;
+ };
+ module = {
+   name = video;
+   common = video/video.c;
+   enable = emu;
+   enable = x86;
+   enable = sparc64;
+   enable = powerpc;
+ };
+ module = {
+   name = ieee1275_fb;
+   ieee1275 = video/ieee1275.c;
+   enable = powerpc;
+   enable = sparc64;
+ };
+ module = {
+   name = sdl;
+   emu = video/emu/sdl.c;
+   enable = emu;
+   condition = COND_GRUB_EMU_SDL;
+ };
+ module = {
+   name = datehook;
+   common = hook/datehook.c;
+ };
++
++module = {
++  name = legacycfg;
++  common = commands/legacycfg.c;
++  enable = i386_pc;
++};
index 10e8972266915157ef74a87e007c6d5bbb7ee1d2,0000000000000000000000000000000000000000..772f48c151da98c35c299a696f1932e2ba7ade34
mode 100644,000000..100644
--- /dev/null
@@@ -1,650 -1,0 +1,651 @@@
-     TYPE_TYPE_OPTION,
 +/*
 + *  GRUB  --  GRand Unified Bootloader
 + *  Copyright (C) 2010  Free Software Foundation, Inc.
 + *
 + *  GRUB is free software: you can redistribute it and/or modify
 + *  it under the terms of the GNU General Public License as published by
 + *  the Free Software Foundation, either version 3 of the License, or
 + *  (at your option) any later version.
 + *
 + *  GRUB is distributed in the hope that it will be useful,
 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + *  GNU General Public License for more details.
 + *
 + *  You should have received a copy of the GNU General Public License
 + *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
 + */
 +
 +#include <grub/types.h>
 +#include <grub/misc.h>
 +#include <grub/command.h>
 +#include <grub/mm.h>
 +#include <grub/err.h>
 +#include <grub/dl.h>
 +#include <grub/file.h>
 +#include <grub/gzio.h>
 +#include <grub/normal.h>
 +#include <grub/script_sh.h>
 +#include <grub/i18n.h>
 +#include <grub/term.h>
 +
 +struct legacy_command
 +{
 +  const char *name;
 +  const char *map;
 +  unsigned argc;
 +  enum arg_type {
 +    TYPE_VERBATIM,
 +    TYPE_FORCE_OPTION,
 +    TYPE_NOAPM_OPTION,
-   } argt[3];
++    TYPE_TYPE_OR_NOMEM_OPTION,
 +    TYPE_FILE,
 +    TYPE_PARTITION,
 +    TYPE_BOOL,
 +    TYPE_INT,
 +    TYPE_REST_VERBATIM
-     {"makeactive", "parttool \"$root\" boot+\n", 0, {}, 0, 0
++  } argt[4];
 +  enum {
 +    FLAG_IGNORE_REST = 1
 +  } flags;
 +  const char *shortdesc;
 +  const char *longdesc;
 +};
 +
 +struct legacy_command legacy_commands[] =
 +  {
 +    {"blocklist", "blocklist '%s'\n", 1, {TYPE_FILE}, 0, "FILE",
 +     "Print the blocklist notation of the file FILE."
 +    },
 +    {"boot", "boot\n", 0, {}, 0, 0,
 +     "Boot the OS/chain-loader which has been loaded."},
 +    /* bootp unsupported.  */
 +    {"cat", "cat '%s'\n", 1, {TYPE_FILE}, 0, "FILE",
 +     "Print the contents of the file FILE."},
 +    {"chainloader", "chainloader %s '%s'\n", 2, {TYPE_FORCE_OPTION, TYPE_FILE},
 +     0, "[--force] FILE",
 +     "Load the chain-loader FILE. If --force is specified, then load it"
 +     " forcibly, whether the boot loader signature is present or not."},
 +    {"cmp", "cmp '%s' '%s'\n", 2, {TYPE_FILE, TYPE_FILE}, FLAG_IGNORE_REST,
 +     "FILE1 FILE2",
 +     "Compare the file FILE1 with the FILE2 and inform the different values"
 +     " if any."},
 +    /* FIXME: Implement command.  */
 +    {"color", "legacy_color '%s' '%s'\n", 2, {TYPE_VERBATIM, TYPE_VERBATIM},
 +     FLAG_IGNORE_REST, "NORMAL [HIGHLIGHT]",
 +     "Change the menu colors. The color NORMAL is used for most"
 +     " lines in the menu, and the color HIGHLIGHT is used to highlight the"
 +     " line where the cursor points. If you omit HIGHLIGHT, then the"
 +     " inverted color of NORMAL is used for the highlighted line."
 +     " The format of a color is \"FG/BG\". FG and BG are symbolic color names."
 +     " A symbolic color name must be one of these: black, blue, green,"
 +     " cyan, red, magenta, brown, light-gray, dark-gray, light-blue,"
 +     " light-green, light-cyan, light-red, light-magenta, yellow and white."
 +     " But only the first eight names can be used for BG. You can prefix"
 +     " \"blink-\" to FG if you want a blinking foreground color."},
 +    {"configfile", "legacy_configfile '%s'\n", 1, {TYPE_FILE}, 0, "FILE",
 +     "Load FILE as the configuration file."},
 +    {"debug",
 +     "if [ -z \"$debug\" ]; then set debug=all; else set debug=; fi\n",
 +     0, {}, 0, 0, "Turn on/off the debug mode."},
 +    {"default",
 +     "set default='%s'; if [ x\"$default\" = xsaved ]; then load_env; "
 +     "set default=\"$saved_entry\"; fi\n", 1, {TYPE_VERBATIM}, 0, 
 +     "[NUM | `saved']",
 +     "Set the default entry to entry number NUM (if not specified, it is"
 +     " 0, the first entry) or the entry number saved by savedefault."},
 +    /* dhcp unsupported.  */
 +    /* displayapm unsupported.  */
 +    {"displaymem", "lsmmap\n", 0, {}, 0, 0, 
 +     "Display what GRUB thinks the system address space map of the"
 +     " machine is, including all regions of physical RAM installed."},
 +    /* embed unsupported.  */
 +    {"fallback", "set fallback='%s'\n", 1, {TYPE_VERBATIM}, 0, "NUM...",
 +     "Go into unattended boot mode: if the default boot entry has any"
 +     " errors, instead of waiting for the user to do anything, it"
 +     " immediately starts over using the NUM entry (same numbering as the"
 +     " `default' command). This obviously won't help if the machine"
 +     " was rebooted by a kernel that GRUB loaded."},
 +    {"find", "search -f '%s'\n", 1, {TYPE_FILE}, 0, "FILENAME",
 +     "Search for the filename FILENAME in all of partitions and print the list of"
 +     " the devices which contain the file."},
 +    /* fstest unsupported.  */
 +    /* geometry unsupported.  */
 +    {"halt", "halt %s\n", 1, {TYPE_NOAPM_OPTION}, 0, "[--no-apm]",
 +     "Halt your system. If APM is available on it, turn off the power using"
 +     " the APM BIOS, unless you specify the option `--no-apm'."},
 +    /* help unsupported.  */    /* NUL_TERMINATE */
 +    /* hiddenmenu unsupported.  */
 +    {"hide", "parttool '%s' hidden+\n", 1, {TYPE_PARTITION}, 0, "PARTITION",
 +     "Hide PARTITION by setting the \"hidden\" bit in"
 +     " its partition type code."},
 +    /* ifconfig unsupported.  */
 +    /* impsprobe unsupported.  */
 +    /* FIXME: Implement command.  */
 +    {"initrd", "legacy_initrd '%s' %s\n", 2, {TYPE_FILE, TYPE_REST_VERBATIM}, 0,
 +     "FILE [ARG ...]",
 +     "Load an initial ramdisk FILE for a Linux format boot image and set the"
 +     " appropriate parameters in the Linux setup area in memory."},
 +    /* install unsupported.  */
 +    /* ioprobe unsupported.  */
 +    /* FIXME: implement command. */
 +    {"kernel", "legacy_kernel %s '%s' %s\n", 4, {TYPE_TYPE_OR_NOMEM_OPTION,
 +                                               TYPE_TYPE_OR_NOMEM_OPTION,
 +                                               TYPE_FILE,
 +                                               TYPE_REST_VERBATIM}, 0,
 +     "[--no-mem-option] [--type=TYPE] FILE [ARG ...]",
 +     "Attempt to load the primary boot image from FILE. The rest of the"
 +     " line is passed verbatim as the \"kernel command line\".  Any modules"
 +     " must be reloaded after using this command. The option --type is used"
 +     " to suggest what type of kernel to be loaded. TYPE must be either of"
 +     " \"netbsd\", \"freebsd\", \"openbsd\", \"linux\", \"biglinux\" and"
 +     " \"multiboot\". The option --no-mem-option tells GRUB not to pass a"
 +     " Linux's mem option automatically."},
 +    /* lock is handled separately. */
-     case TYPE_TYPE_OPTION:
++    {"makeactive", "parttool \"$root\" boot+\n", 0, {}, 0, 0,
 +     "Set the active partition on the root disk to GRUB's root device."
 +     " This command is limited to _primary_ PC partitions on a hard disk."},
 +    {"map", "drivemap '%s' '%s'\n", 2, {TYPE_PARTITION, TYPE_PARTITION},
 +     FLAG_IGNORE_REST, "TO_DRIVE FROM_DRIVE",
 +     "Map the drive FROM_DRIVE to the drive TO_DRIVE. This is necessary"
 +     " when you chain-load some operating systems, such as DOS, if such an"
 +     " OS resides at a non-first drive."},
 +    /* md5crypt unsupported.  */
 +    {"module", "legacy_initrd '%s' %s\n", 1, {TYPE_FILE, TYPE_REST_VERBATIM}, 0,
 +     "FILE [ARG ...]",
 +     "Load a boot module FILE for a Multiboot format boot image (no"
 +     " interpretation of the file contents is made, so users of this"
 +     " command must know what the kernel in question expects). The"
 +     " rest of the line is passed as the \"module command line\", like"
 +     " the `kernel' command."},
 +    /* modulenounzip unsupported.  */
 +    /* FIXME: allow toggle.  */
 +    {"pager", "set pager=%d\n", 1, {TYPE_BOOL}, 0, "[FLAG]",
 +     "Toggle pager mode with no argument. If FLAG is given and its value"
 +     " is `on', turn on the mode. If FLAG is `off', turn off the mode."},
 +    /* partnew unsupported.  */
 +    {"parttype", "parttool '%s' type=%s\n", 2, {TYPE_PARTITION, TYPE_INT}, 0,
 +     "PART TYPE", "Change the type of the partition PART to TYPE."},
 +    /* password unsupported.  */    /* NUL_TERMINATE */
 +    /* pause unsupported.  */
 +    /* rarp unsupported.  */
 +    {"read", "read_dword %s\n", 1, {TYPE_INT}, 0, "ADDR",
 +     "Read a 32-bit value from memory at address ADDR and"
 +     " display it in hex format."},
 +    {"reboot", "reboot\n", 0, {}, 0, 0, "Reboot your system."},
 +    /* FIXME: Support HDBIAS.  */
 +    {"root", "set root='%s'\n", 1, {TYPE_PARTITION}, 0, "[DEVICE [HDBIAS]]",
 +     "Set the current \"root device\" to the device DEVICE, then"
 +     " attempt to mount it to get the partition size (for passing the"
 +     " partition descriptor in `ES:ESI', used by some chain-loaded"
 +     " bootloaders), the BSD drive-type (for booting BSD kernels using"
 +     " their native boot format), and correctly determine "
 +     " the PC partition where a BSD sub-partition is located. The"
 +     " optional HDBIAS parameter is a number to tell a BSD kernel"
 +     " how many BIOS drive numbers are on controllers before the current"
 +     " one. For example, if there is an IDE disk and a SCSI disk, and your"
 +     " FreeBSD root partition is on the SCSI disk, then use a `1' for HDBIAS."},
 +    {"rootnoverify", "set root='%s'\n", 1, {TYPE_PARTITION}, 0,
 +     "[DEVICE [HDBIAS]]",
 +     "Similar to `root', but don't attempt to mount the partition. This"
 +     " is useful for when an OS is outside of the area of the disk that"
 +     " GRUB can read, but setting the correct root device is still"
 +     " desired. Note that the items mentioned in `root' which"
 +     " derived from attempting the mount will NOT work correctly."},
 +    /* FIXME: support arguments.  */
 +    {"savedefault", "saved_entry=${chosen}; save_env saved_entry\n", 0, {}, 0,
 +     "[NUM | `fallback']",
 +     "Save the current entry as the default boot entry if no argument is"
 +     " specified. If a number is specified, this number is saved. If"
 +     " `fallback' is used, next fallback entry is saved."},
 +    {"serial", "serial %s\n", 1, {TYPE_REST_VERBATIM}, 0, 
 +     "[--unit=UNIT] [--port=PORT] [--speed=SPEED] [--word=WORD] "
 +     "[--parity=PARITY] [--stop=STOP] [--device=DEV]",
 +     "Initialize a serial device. UNIT is a digit that specifies which serial"
 +     " device is used (e.g. 0 == COM1). If you need to specify the port number,"
 +     " set it by --port. SPEED is the DTE-DTE speed. WORD is the word length,"
 +     " PARITY is the type of parity, which is one of `no', `odd' and `even'."
 +     " STOP is the length of stop bit(s). The option --device can be used only"
 +     " in the grub shell, which specifies the file name of a tty device. The"
 +     " default values are COM1, 9600, 8N1."},
 +    /* setkey unsupported.  */    /* NUL_TERMINATE */
 +    /* setup unsupported.  */
 +    /* terminal unsupported.  */    /* NUL_TERMINATE */
 +    /* terminfo unsupported.  */    /* NUL_TERMINATE */
 +    /* testload unsupported.  */
 +    /* testvbe unsupported.  */
 +    /* tftpserver unsupported.  */
 +    {"timeout", "set timeout=%s\n", 1, {TYPE_INT}, 0, "SEC",
 +     "Set a timeout, in SEC seconds, before automatically booting the"
 +     " default entry (normally the first entry defined)."},
 +    /* title is handled separately. */
 +    {"unhide", "parttool '%s' hidden-\n", 1, {TYPE_PARTITION}, 0, "PARTITION",
 +     "Unhide PARTITION by clearing the \"hidden\" bit in its"
 +     " partition type code."},
 +    /* uppermem unsupported.  */
 +    {"uuid", "search -u '%s'\n", 1, {TYPE_VERBATIM}, 0, "UUID",
 +     "Find root by UUID"},
 +    /* vbeprobe unsupported.  */
 +  };
 +
 +static char *
 +escape (const char *in)
 +{
 +  const char *ptr;
 +  char *ret, *outptr;
 +  int overhead = 0;
 +  for (ptr = in; *ptr; ptr++)
 +    if (*ptr == '\'' || *ptr == '\\')
 +      overhead++;
 +  ret = grub_malloc (ptr - in + overhead);
 +  if (!ret)
 +    return NULL;
 +  outptr = ret;
 +  for (ptr = in; *ptr; ptr++)
 +    {
 +      if (*ptr == '\'' || *ptr == '\\')
 +      *outptr++ = '\\';
 +      
 +      *outptr++ = *ptr;
 +    }
 +  *outptr++ = 0;
 +  return ret;
 +}
 +
 +static char *
 +adjust_file (const char *in)
 +{
 +  const char *comma, *ptr, *rest;
 +  char *ret, *outptr;
 +  int overhead = 0;
 +  int part;
 +  if (in[0] != '(')
 +    return escape (in);
 +  for (ptr = in + 1; *ptr && *ptr != ')' && *ptr != ','; ptr++)
 +    if (*ptr == '\'' || *ptr == '\\')
 +      overhead++;
 +  comma = ptr;
 +  if (*comma != ',')
 +    return escape (in);
 +  part = grub_strtoull (comma + 1, (char **) &rest, 0);
 +  for (ptr = rest; *ptr; ptr++)
 +    if (*ptr == '\'' || *ptr == '\\')
 +      overhead++;
 +
 +  /* 30 is enough for any number.  */
 +  ret = grub_malloc (ptr - in + overhead + 30);
 +  if (!ret)
 +    return NULL;
 +
 +  outptr = ret;
 +  for (ptr = in; ptr <= comma; ptr++)
 +    {
 +      if (*ptr == '\'' || *ptr == '\\')
 +      *outptr++ = '\\';
 +      
 +      *outptr++ = *ptr;
 +    }
 +  grub_snprintf (outptr, 30, "%d", part + 1);
 +  while (*outptr)
 +    outptr++;
 +  for (ptr = rest; ptr <= comma; ptr++)
 +    {
 +      if (*ptr == '\'' || *ptr == '\\')
 +      *outptr++ = '\\';
 +      
 +      *outptr++ = *ptr;
 +    }
 +  return ret;
 +}
 +
 +static int
 +is_option (enum arg_type opt, const char *curarg)
 +{
 +  switch (opt)
 +    {
 +    case TYPE_NOAPM_OPTION:
 +      return grub_strcmp (curarg, "--no-apm") == 0;
 +    case TYPE_FORCE_OPTION:
 +      return grub_strcmp (curarg, "--force") == 0;
-       || grub_strcmp (curarg, "--type=multiboot") == 0;
++    case TYPE_TYPE_OR_NOMEM_OPTION:
 +      return grub_strcmp (curarg, "--type=netbsd") == 0
 +      || grub_strcmp (curarg, "--type=freebsd") == 0
 +      || grub_strcmp (curarg, "--type=openbsd") == 0
 +      || grub_strcmp (curarg, "--type=linux") == 0
 +      || grub_strcmp (curarg, "--type=biglinux") == 0
-         case TYPE_TYPE_OPTION:
++      || grub_strcmp (curarg, "--type=multiboot") == 0
++      || grub_strcmp (curarg, "--no-mem-option") == 0;
 +    default:
 +      return 0;
 +    } 
 +}
 +
 +static char *
 +legacy_parse (char *buf, char **entryname)
 +{
 +  char *ptr;
 +  char *cmdname;
 +  unsigned i, cmdnum;
 +
 +  for (ptr = buf; *ptr && grub_isspace (*ptr); ptr++);
 +  if ((!*ptr || *ptr == '#') && entryname && *entryname)
 +    {
 +      char *ret = grub_xasprintf ("%s\n", buf);
 +      grub_free (buf);
 +      return ret;
 +    }
 +  if (!*ptr || *ptr == '#')
 +    {
 +      grub_free (buf);
 +      return NULL;
 +    }
 +
 +  cmdname = ptr;
 +  for (ptr = buf; *ptr && !grub_isspace (*ptr) && *ptr != '='; ptr++);
 +
 +  if (entryname && grub_strncmp ("title", cmdname, ptr - cmdname) == 0
 +      && ptr - cmdname == sizeof ("title") - 1)
 +    {
 +      for (; grub_isspace (*ptr) || *ptr == '='; ptr++);
 +      *entryname = grub_strdup (ptr);
 +      grub_free (buf);
 +      return NULL;
 +    }
 +
 +  if (grub_strncmp ("lock", cmdname, ptr - cmdname) == 0
 +      && ptr - cmdname == sizeof ("lock") - 1)
 +    {
 +      /* FIXME */
 +    }
 +
 +  for (cmdnum = 0; cmdnum < ARRAY_SIZE (legacy_commands); cmdnum++)
 +    if (grub_strncmp (legacy_commands[cmdnum].name, cmdname, ptr - cmdname) == 0
 +      && legacy_commands[cmdnum].name[ptr - cmdname] == 0)
 +      break;
 +  if (cmdnum == ARRAY_SIZE (legacy_commands))
 +    return grub_xasprintf ("# Unsupported legacy command: %s\n", buf);
 +
 +  for (; grub_isspace (*ptr) || *ptr == '='; ptr++);
 +
 +  char *args[ARRAY_SIZE (legacy_commands[0].argt)];
 +  memset (args, 0, sizeof (args));
 +
 +  {
 +    unsigned j = 0;
 +    for (i = 0; i < legacy_commands[cmdnum].argc; i++)
 +      {
 +      char *curarg, *cptr = NULL, c = 0;
 +      for (; grub_isspace (*ptr); ptr++);
 +      curarg = ptr;
 +      for (; !grub_isspace (*ptr); ptr++);
 +      if (i != legacy_commands[cmdnum].argc - 1
 +          || (legacy_commands[cmdnum].flags & FLAG_IGNORE_REST))
 +        {
 +          cptr = ptr;
 +          c = *cptr;
 +          *ptr = 0;
 +        }
 +      if (*ptr)
 +        ptr++;
 +      switch (legacy_commands[cmdnum].argt[i])
 +        {
 +        case TYPE_PARTITION:
 +        case TYPE_FILE:
 +          args[j++] = adjust_file (curarg);
 +          break;
 +
 +        case TYPE_REST_VERBATIM:
 +          {
 +            char *outptr, *outptr0;
 +            int overhead = 3;
 +            ptr = curarg;
 +            while (*ptr)
 +              {
 +                for (; grub_isspace (*ptr); ptr++);
 +                for (; *ptr && !grub_isspace (*ptr); ptr++)
 +                  if (*ptr == '\\' || *ptr == '\'')
 +                    overhead++;
 +                if (*ptr)
 +                  ptr++;
 +                overhead += 3;
 +              }
 +            outptr0 = args[j++] = grub_malloc (overhead + (ptr - curarg));
 +            if (!outptr0)
 +              {
 +                grub_free (buf);
 +                return NULL;
 +              }
 +            ptr = curarg;
 +            outptr = outptr0;
 +            while (*ptr)
 +              {
 +                for (; grub_isspace (*ptr); ptr++);
 +                if (outptr != outptr0)
 +                  *outptr++ = ' ';
 +                *outptr++ = '\'';
 +                for (; *ptr && !grub_isspace (*ptr); ptr++)
 +                  {
 +                    if (*ptr == '\\' || *ptr == '\'')
 +                      *outptr++ = '\\';
 +                    *outptr++ = *ptr;
 +                  }
 +                *outptr++ = '\'';
 +                if (*ptr)
 +                  ptr++;
 +                overhead += 3;
 +              }
 +            *outptr++ = 0;
 +          }
 +          break;
 +
 +        case TYPE_VERBATIM:
 +          args[j++] = escape (curarg);
 +          break;
 +        case TYPE_FORCE_OPTION:
 +        case TYPE_NOAPM_OPTION:
++        case TYPE_TYPE_OR_NOMEM_OPTION:
 +          if (is_option (legacy_commands[cmdnum].argt[i], curarg))
 +            {
 +              args[j++] = grub_strdup (curarg);
 +              break;
 +            }
 +          if (cptr)
 +            *cptr = c;
 +          ptr = curarg;
 +          args[j++] = "";
 +          break;
 +        case TYPE_INT:
 +          {
 +            char *brk;
 +            int base = 10;
 +            brk = curarg;
 +            if (brk[0] == '0' && brk[1] == 'x')
 +              base = 16;
 +            else if (brk[0] == '0')
 +              base = 8;
 +            for (; *brk; brk++)
 +              {
 +                if (base == 8 &&  (*brk == '8' || *brk == '9'))
 +                  break;
 +                if (grub_isdigit (*brk))
 +                  continue;
 +                if (base != 16)
 +                  break;
 +                if (!(*brk >= 'a' && *brk <= 'f')
 +                    && !(*brk >= 'A' && *brk <= 'F'))
 +                  break;
 +              }
 +            if (brk == curarg)
 +              args[j++] = grub_strdup ("0");
 +            else
 +              args[j++] = grub_strndup (curarg, brk - curarg);
 +          }
 +          break;
 +        case TYPE_BOOL:
 +          if (curarg[0] == 'o' && curarg[1] == 'n'
 +              && (curarg[2] == 0 || grub_isspace (curarg[2])))
 +            args[j++] = grub_strdup ("1");
 +          else
 +            args[j++] = grub_strdup ("0");
 +          break;
 +        }
 +      }
 +  }
 +  grub_free (buf);
 +  return grub_xasprintf (legacy_commands[cmdnum].map, args[0], args[1], args[2]);
 +}
 +
 +static grub_err_t
 +legacy_file (const char *filename)
 +{
 +  grub_file_t file;
 +  char *entryname = NULL, *entrysrc = NULL;
 +  grub_menu_t menu;
 +
 +  file = grub_gzfile_open (filename, 1);
 +  if (! file)
 +    return grub_errno;
 +
 +  menu = grub_env_get_menu ();
 +  if (! menu)
 +    {
 +      menu = grub_zalloc (sizeof (*menu));
 +      if (! menu)
 +      return grub_errno;
 +
 +      grub_env_set_menu (menu);
 +    }
 +
 +  while (1)
 +    {
 +      char *buf = grub_file_getline (file);
 +      char *parsed;
 +
 +      if (!buf && grub_errno)
 +      {
 +        grub_file_close (file);
 +        return grub_errno;
 +      }
 +
 +      if (!buf)
 +      break;
 +
 +      {
 +      char *oldname = NULL;
 +
 +      oldname = entryname;
 +      parsed = legacy_parse (buf, &entryname);
 +      if (oldname != entryname && oldname)
 +        {
 +          const char **args = grub_malloc (sizeof (args[0]));
 +          if (!args)
 +            {
 +              grub_file_close (file);
 +              return grub_errno;
 +            }
 +          args[0] = oldname;
 +          grub_normal_add_menu_entry (1, args, entrysrc);
 +        }
 +      }
 +
 +      if (parsed && !entryname)
 +      {
 +        auto grub_err_t getline (char **line, int cont);
 +        grub_err_t getline (char **line __attribute__ ((unused)), 
 +                            int cont __attribute__ ((unused)))
 +        {
 +          return GRUB_ERR_NONE;
 +        }
 +
 +        grub_normal_parse_line (parsed, getline);
 +        grub_print_error ();
 +        grub_free (parsed);
 +      }
 +      else if (parsed)
 +      {
 +        if (!entrysrc)
 +          entrysrc = parsed;
 +        else
 +          {
 +            char *t;
 +
 +            t = entrysrc;
 +            entrysrc = grub_realloc (entrysrc, grub_strlen (entrysrc)
 +                                     + grub_strlen (parsed) + 1);
 +            if (!entrysrc)
 +              {
 +                grub_free (t);
 +                grub_free (parsed);
 +                return grub_errno;
 +              }
 +            grub_memcpy (entrysrc + grub_strlen (entrysrc), parsed,
 +                         grub_strlen (parsed) + 1);
 +            grub_free (parsed);
 +            parsed = NULL;
 +          }
 +      }
 +    }
 +  grub_file_close (file);
 +
 +  if (entryname)
 +    {
 +      const char **args = grub_malloc (sizeof (args[0]));
 +      if (!args)
 +      {
 +        grub_file_close (file);
 +        return grub_errno;
 +      }
 +      args[0] = entryname;
 +      grub_normal_add_menu_entry (1, args, entrysrc);
 +    }
 +
 +  if (menu && menu->size)
 +    grub_show_menu (menu, 1);
 +
 +  return GRUB_ERR_NONE;
 +}
 +
 +static grub_err_t
 +grub_cmd_legacy_source (struct grub_command *cmd __attribute__ ((unused)),
 +                      int argc, char **args)
 +{
 +  if (argc != 1)
 +    return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required");
 +  return legacy_file (args[0]);
 +}
 +
 +static grub_err_t
 +grub_cmd_legacy_configfile (struct grub_command *cmd __attribute__ ((unused)),
 +                          int argc, char **args)
 +{
 +  grub_err_t ret;
 +  if (argc != 1)
 +    return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required");
 +
 +  grub_cls ();
 +  grub_env_context_open (1);
 +
 +  ret = legacy_file (args[0]);
 +  grub_env_context_close ();
 +
 +  return ret;
 +}
 +
 +static grub_command_t cmd_source, cmd_configfile;
 +
 +GRUB_MOD_INIT(legacycfg)
 +{
 +  cmd_source = grub_register_command ("legacy_source",
 +                                    grub_cmd_legacy_source,
 +                                    N_("FILE"), N_("Parse legacy config"));
 +  cmd_configfile = grub_register_command ("legacy_configfile",
 +                                        grub_cmd_legacy_configfile,
 +                                        N_("FILE"),
 +                                        N_("Parse legacy config"));
 +}
 +
 +GRUB_MOD_FINI(legacycfg)
 +{
 +  grub_unregister_command (cmd_source);
 +  grub_unregister_command (cmd_configfile);
 +}
index e80f7f3ddc37552e4d58cccd0f4293ba6d31ed37,0000000000000000000000000000000000000000..e80f7f3ddc37552e4d58cccd0f4293ba6d31ed37
mode 100644,000000..100644
--- /dev/null
index 39a595d9b78598d62865d56fdf36fde299f0d372,0000000000000000000000000000000000000000..39a595d9b78598d62865d56fdf36fde299f0d372
mode 100644,000000..100644
--- /dev/null