merge with emu-reorg

This commit is contained in:
BVK Chaitanya 2010-05-06 13:06:51 +05:30
commit 1828cb6098
13 changed files with 82 additions and 87 deletions

View file

@ -105,14 +105,14 @@ grub_usb_root_hub (grub_usb_controller_t controller __attribute__((unused)))
grub_usb_err_t grub_usb_err_t
grub_usb_control_msg (grub_usb_device_t dev, grub_uint8_t reqtype, grub_usb_control_msg (grub_usb_device_t dev, grub_uint8_t reqtype,
grub_uint8_t request, grub_uint16_t value, grub_uint8_t request, grub_uint16_t value,
grub_uint16_t index, grub_size_t size, char *data) grub_uint16_t idx, grub_size_t size, char *data)
{ {
usb_dev_handle *devh; usb_dev_handle *devh;
struct usb_device *d = dev->data; struct usb_device *d = dev->data;
devh = usb_open (d); devh = usb_open (d);
if (usb_control_msg (devh, reqtype, request, if (usb_control_msg (devh, reqtype, request,
value, index, data, size, 20) < 0) value, idx, data, size, 20) < 0)
{ {
usb_close (devh); usb_close (devh);
return GRUB_USB_ERR_STALL; return GRUB_USB_ERR_STALL;

View file

@ -16,7 +16,7 @@ kernel_img_SOURCES = kern/device.c kern/disk.c kern/dl.c kern/env.c \
\ \
gnulib/progname.c disk/host.c gnulib/progname.c disk/host.c
kernel_img_HEADERS += datetime.h emu/misc.h kernel_img_HEADERS += datetime.h emu/misc.h
kernel_img_CFLAGS = $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-undef -I$(srcdir)/gnulib kernel_img_CFLAGS = $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-char-subscripts -Wno-unused -Wno-deprecated-declarations -Wno-undef -I$(srcdir)/gnulib
kernel_img_LDFLAGS = $(COMMON_LDFLAGS) kernel_img_LDFLAGS = $(COMMON_LDFLAGS)
TARGET_NO_STRIP = yes TARGET_NO_STRIP = yes

View file

@ -67,18 +67,17 @@ sbin_UTILITIES = grub-setup
# For grub-mkimage. # For grub-mkimage.
grub_mkimage_SOURCES = gnulib/progname.c util/grub-mkrawimage.c util/misc.c \ grub_mkimage_SOURCES = gnulib/progname.c util/grub-mkrawimage.c util/misc.c \
util/resolve.c lib/LzmaEnc.c lib/LzFind.c kern/emu/misc.c util/resolve.c lib/LzmaEnc.c lib/LzFind.c
grub_mkimage_CFLAGS = -DGRUB_KERNEL_MACHINE_LINK_ADDR=$(GRUB_KERNEL_MACHINE_LINK_ADDR) grub_mkimage_CFLAGS = -DGRUB_KERNEL_MACHINE_LINK_ADDR=$(GRUB_KERNEL_MACHINE_LINK_ADDR)
util/grub-mkrawimage.c_DEPENDENCIES = Makefile util/grub-mkrawimage.c_DEPENDENCIES = Makefile
# For grub-setup. # For grub-setup.
util/i386/pc/grub-setup.c_DEPENDENCIES = grub_setup_init.h util/i386/pc/grub-setup.c_DEPENDENCIES = grub_setup_init.h
grub_setup_SOURCES = gnulib/progname.c \ grub_setup_SOURCES = gnulib/progname.c util/i386/pc/grub-setup.c \
util/i386/pc/grub-setup.c util/hostdisk.c \ util/misc.c kern/emu/misc.c kern/emu/getroot.c \
util/misc.c util/getroot.c kern/device.c kern/disk.c \ kern/emu/hostdisk.c kern/device.c kern/disk.c kern/err.c \
kern/err.c kern/misc.c kern/parser.c kern/partition.c \ kern/misc.c kern/parser.c kern/partition.c kern/file.c \
kern/file.c kern/fs.c kern/env.c kern/list.c \ kern/emu/mm.c kern/fs.c kern/env.c kern/list.c fs/fshelp.c \
fs/fshelp.c \
\ \
fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \
fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \
@ -90,7 +89,7 @@ grub_setup_SOURCES = gnulib/progname.c \
partmap/gpt.c \ partmap/gpt.c \
\ \
disk/raid.c disk/mdraid_linux.c disk/lvm.c \ disk/raid.c disk/mdraid_linux.c disk/lvm.c \
util/raid.c util/lvm.c util/mm.c \ util/raid.c util/lvm.c \
grub_setup_init.c grub_setup_init.c
sbin_SCRIPTS += grub-install sbin_SCRIPTS += grub-install

View file

@ -14,7 +14,7 @@ boot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)$(GRUB_BOOT_MACHINE_LI
boot_img_FORMAT = binary boot_img_FORMAT = binary
bin_UTILITIES += grub-mkimage bin_UTILITIES += grub-mkimage
grub_mkimage_SOURCES = util/grub-mkrawimage.c util/misc.c \ grub_mkimage_SOURCES = util/grub-mkrawimage.c util/misc.c kern/emu/misc.c \
util/resolve.c gnulib/progname.c util/resolve.c gnulib/progname.c
grub_mkimage_CFLAGS = -DGRUB_KERNEL_MACHINE_LINK_ADDR=$(GRUB_KERNEL_MACHINE_LINK_ADDR) grub_mkimage_CFLAGS = -DGRUB_KERNEL_MACHINE_LINK_ADDR=$(GRUB_KERNEL_MACHINE_LINK_ADDR)
util/grub-mkrawimage.c_DEPENDENCIES = Makefile util/grub-mkrawimage.c_DEPENDENCIES = Makefile

View file

@ -13,7 +13,7 @@ bin_SCRIPTS =
# For grub-mkimage. # For grub-mkimage.
bin_UTILITIES += grub-mkimage bin_UTILITIES += grub-mkimage
grub_mkimage_SOURCES = gnulib/progname.c util/grub-mkrawimage.c util/misc.c \ grub_mkimage_SOURCES = gnulib/progname.c util/grub-mkrawimage.c util/misc.c \
util/resolve.c lib/LzmaEnc.c lib/LzFind.c kern/emu/misc.c util/resolve.c lib/LzmaEnc.c lib/LzFind.c
grub_mkimage_CFLAGS = -DGRUB_KERNEL_MACHINE_LINK_ADDR=$(LINK_BASE) grub_mkimage_CFLAGS = -DGRUB_KERNEL_MACHINE_LINK_ADDR=$(LINK_BASE)
util/grub-mkrawimage.c_DEPENDENCIES = Makefile util/grub-mkrawimage.c_DEPENDENCIES = Makefile

View file

@ -44,16 +44,16 @@ bin_UTILITIES = grub-mkimage
sbin_UTILITIES = grub-setup grub-ofpathname sbin_UTILITIES = grub-setup grub-ofpathname
# For grub-mkimage. # For grub-mkimage.
grub_mkimage_SOURCES = util/grub-mkrawimage.c util/misc.c \ grub_mkimage_SOURCES = util/grub-mkrawimage.c util/misc.c kern/emu/misc.c \
util/resolve.c gnulib/progname.c util/resolve.c gnulib/progname.c
# For grub-setup. # For grub-setup.
util/sparc64/ieee1275/grub-setup.c_DEPENDENCIES = grub_setup_init.h util/sparc64/ieee1275/grub-setup.c_DEPENDENCIES = grub_setup_init.h
grub_setup_SOURCES = util/sparc64/ieee1275/grub-setup.c util/hostdisk.c \ grub_setup_SOURCES = util/sparc64/ieee1275/grub-setup.c \
util/ieee1275/ofpath.c \ util/ieee1275/ofpath.c util/misc.c kern/emu/hostdisk.c \
util/misc.c util/getroot.c kern/device.c kern/disk.c \ kern/emu/misc.c kern/emu/getroot.c kern/emu/mm.c kern/device.c \
kern/err.c kern/misc.c kern/parser.c kern/partition.c \ kern/disk.c kern/err.c kern/misc.c kern/parser.c \
kern/file.c kern/fs.c kern/env.c kern/list.c \ kern/partition.c kern/file.c kern/fs.c kern/env.c kern/list.c \
fs/fshelp.c \ fs/fshelp.c \
\ \
fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \
@ -65,13 +65,13 @@ grub_setup_SOURCES = util/sparc64/ieee1275/grub-setup.c util/hostdisk.c \
partmap/amiga.c partmap/apple.c partmap/msdos.c \ partmap/amiga.c partmap/apple.c partmap/msdos.c \
partmap/bsdlabel.c partmap/sun.c partmap/acorn.c \ partmap/bsdlabel.c partmap/sun.c partmap/acorn.c \
\ \
disk/raid.c disk/mdraid_linux.c disk/lvm.c \ disk/raid.c disk/mdraid_linux.c disk/lvm.c util/raid.c \
util/raid.c util/lvm.c util/mm.c gnulib/progname.c \ util/lvm.c gnulib/progname.c grub_setup_init.c
grub_setup_init.c
# For grub-ofpathname. # For grub-ofpathname.
grub_ofpathname_SOURCES = util/ieee1275/grub-ofpathname.c \ grub_ofpathname_SOURCES = util/ieee1275/grub-ofpathname.c \
util/ieee1275/ofpath.c util/misc.c gnulib/progname.c util/ieee1275/ofpath.c util/misc.c kern/emu/misc.c \
gnulib/progname.c
# Scripts. # Scripts.
sbin_SCRIPTS = grub-install sbin_SCRIPTS = grub-install

View file

@ -5,7 +5,7 @@ bin_UTILITIES = grub-mkimage
# For grub-mkimage. # For grub-mkimage.
grub_mkimage_SOURCES = gnulib/progname.c util/i386/efi/grub-mkimage.c \ grub_mkimage_SOURCES = gnulib/progname.c util/i386/efi/grub-mkimage.c \
util/misc.c util/resolve.c util/misc.c kern/emu/misc.c util/resolve.c
util/i386/efi/grub-mkimage.c_DEPENDENCIES = Makefile util/i386/efi/grub-mkimage.c_DEPENDENCIES = Makefile
# Scripts. # Scripts.

View file

@ -4,6 +4,13 @@
#include <grub/symbol.h> #include <grub/symbol.h>
#include <grub/types.h> #include <grub/types.h>
#ifdef __CYGWIN__
# include <sys/fcntl.h>
# include <sys/cygwin.h>
# include <limits.h>
# define DEV_CYGDRIVE_MAJOR 98
#endif
#ifdef __NetBSD__ #ifdef __NetBSD__
/* NetBSD uses /boot for its boot block. */ /* NetBSD uses /boot for its boot block. */
# define DEFAULT_DIRECTORY "/grub" # define DEFAULT_DIRECTORY "/grub"

View file

@ -19,6 +19,8 @@
#include <config.h> #include <config.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h> #include <unistd.h>
#include <string.h> #include <string.h>
#include <dirent.h> #include <dirent.h>
@ -27,13 +29,6 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdint.h> #include <stdint.h>
#ifdef __CYGWIN__
# include <sys/fcntl.h>
# include <sys/cygwin.h>
# include <limits.h>
# define DEV_CYGDRIVE_MAJOR 98
#endif
#ifdef __GNU__ #ifdef __GNU__
#include <hurd.h> #include <hurd.h>
#include <hurd/lookup.h> #include <hurd/lookup.h>

View file

@ -176,6 +176,26 @@ grub_get_rtc (void)
* GRUB_TICKS_PER_SECOND / 1000000)); * GRUB_TICKS_PER_SECOND / 1000000));
} }
#ifdef __CYGWIN__
/* Convert POSIX path to Win32 path,
remove drive letter, replace backslashes. */
static char *
get_win32_path (const char *path)
{
char winpath[PATH_MAX];
if (cygwin_conv_path (CCP_POSIX_TO_WIN_A, path, winpath, sizeof(winpath)))
grub_util_error ("cygwin_conv_path() failed");
int len = strlen (winpath);
int offs = (len > 2 && winpath[1] == ':' ? 2 : 0);
int i;
for (i = offs; i < len; i++)
if (winpath[i] == '\\')
winpath[i] = '/';
return xstrdup (winpath + offs);
}
#endif
/* This function never prints trailing slashes (so that its output /* This function never prints trailing slashes (so that its output
can be appended a slash unconditionally). */ can be appended a slash unconditionally). */

View file

@ -28,14 +28,14 @@
#include <grub/msdos_partition.h> #include <grub/msdos_partition.h>
#include <grub/gpt_partition.h> #include <grub/gpt_partition.h>
#include <grub/env.h> #include <grub/env.h>
#include <grub/util/hostdisk.h> #include <grub/emu/hostdisk.h>
#include <grub/machine/boot.h> #include <grub/machine/boot.h>
#include <grub/machine/kernel.h> #include <grub/machine/kernel.h>
#include <grub/term.h> #include <grub/term.h>
#include <grub/i18n.h> #include <grub/i18n.h>
#include <grub/util/raid.h> #include <grub/util/raid.h>
#include <grub/util/lvm.h> #include <grub/util/lvm.h>
#include <grub/util/getroot.h> #include <grub/emu/getroot.h>
static const grub_gpt_part_type_t grub_gpt_partition_type_bios_boot = GRUB_GPT_PARTITION_TYPE_BIOS_BOOT; static const grub_gpt_part_type_t grub_gpt_partition_type_bios_boot = GRUB_GPT_PARTITION_TYPE_BIOS_BOOT;
@ -423,7 +423,7 @@ unable_to_embed:
/* Make sure that GRUB reads the identical image as the OS. */ /* Make sure that GRUB reads the identical image as the OS. */
tmp_img = xmalloc (core_size); tmp_img = xmalloc (core_size);
core_path_dev_full = grub_util_get_path (dir, core_file); core_path_dev_full = grub_util_get_path (dir, core_file);
core_path_dev = make_system_path_relative_to_its_root (core_path_dev_full); core_path_dev = grub_make_system_path_relative_to_its_root (core_path_dev_full);
free (core_path_dev_full); free (core_path_dev_full);
/* It is a Good Thing to sync two times. */ /* It is a Good Thing to sync two times. */

View file

@ -53,11 +53,6 @@
# include <malloc.h> # include <malloc.h>
#endif #endif
#ifdef __CYGWIN__
# include <sys/cygwin.h>
# define DEV_CYGDRIVE_MAJOR 98
#endif
#ifdef __MINGW32__ #ifdef __MINGW32__
#include <windows.h> #include <windows.h>
#include <winioctl.h> #include <winioctl.h>
@ -302,27 +297,6 @@ canonicalize_file_name (const char *path)
return ret; return ret;
} }
#ifdef __CYGWIN__
/* Convert POSIX path to Win32 path,
remove drive letter, replace backslashes. */
static char *
get_win32_path (const char *path)
{
char winpath[PATH_MAX];
if (cygwin_conv_path (CCP_POSIX_TO_WIN_A, path, winpath, sizeof(winpath)))
grub_util_error ("cygwin_conv_path() failed");
int len = strlen (winpath);
int offs = (len > 2 && winpath[1] == ':' ? 2 : 0);
int i;
for (i = offs; i < len; i++)
if (winpath[i] == '\\')
winpath[i] = '/';
return xstrdup (winpath + offs);
}
#endif
#ifdef GRUB_UTIL #ifdef GRUB_UTIL
void void
grub_util_init_nls (void) grub_util_init_nls (void)

View file

@ -29,7 +29,7 @@
#include <grub/msdos_partition.h> #include <grub/msdos_partition.h>
#include <grub/gpt_partition.h> #include <grub/gpt_partition.h>
#include <grub/env.h> #include <grub/env.h>
#include <grub/util/hostdisk.h> #include <grub/emu/hostdisk.h>
#include <grub/machine/boot.h> #include <grub/machine/boot.h>
#include <grub/machine/kernel.h> #include <grub/machine/kernel.h>
#include <grub/term.h> #include <grub/term.h>
@ -46,7 +46,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <dirent.h> #include <dirent.h>
#include <grub/util/getroot.h> #include <grub/emu/getroot.h>
#define _GNU_SOURCE 1 #define _GNU_SOURCE 1
#include <getopt.h> #include <getopt.h>
@ -627,7 +627,7 @@ main (int argc, char *argv[])
find_dest_dev (&ginfo, argv); find_dest_dev (&ginfo, argv);
ginfo.prefix = make_system_path_relative_to_its_root (ginfo.dir ? ginfo.prefix = grub_make_system_path_relative_to_its_root (ginfo.dir ?
: DEFAULT_DIRECTORY); : DEFAULT_DIRECTORY);
check_root_dev (&ginfo); check_root_dev (&ginfo);