Fix usb support

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-04-10 01:56:51 +02:00
parent a29e902132
commit b3d0fa12af
3 changed files with 38 additions and 2 deletions

View file

@ -7,10 +7,15 @@
(TARGET_CFLAGS): Add -DGRUB_TARGET_NO_MODULES=1 if applicable.
(CFLAGS): Likewise.
* conf/any-emu.rmk: Generate symlist.
(kernel_img_HEADERS): Add util/datetime.h.
(kernel_img_HEADERS) [sdl]: Add sdl.h.
(kernel_img_HEADERS) [libusb]: Add libusb.h.
(kernel_img_SOURCES) [TARGET_NO_MODULES = no && !x86]: Add
kern/$(target_cpu)/cache.S.
* configure.ac (grub-emu-modules): New option.
* genmk.rb: Handle multiple source lists.
* genmoddep.awk: Output all undefined symbols.
* include/grub/sdl.h: New file.
* include/grub/libusb.h: Likewise.
* util/grub-emu.c (main): Hanle (host) root.
* util/hostdisk.c (grub_util_biosdisk_get_grub_dev): Error with
GRUB_ERR_UNKNOWN_DEVICE.

View file

@ -15,7 +15,7 @@ kernel_img_SOURCES = kern/device.c kern/disk.c kern/dl.c kern/env.c \
\
gnulib/progname.c util/hostfs.c disk/host.c
kernel_img_HEADERS += datetime.h
kernel_img_CFLAGS = $(CPPFLAGS) $(CFLAGS) -Wno-undef
kernel_img_CFLAGS = $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-undef -I$(srcdir)/gnulib
kernel_img_LDFLAGS = $(COMMON_LDFLAGS)
TARGET_NO_STRIP = yes
@ -46,6 +46,8 @@ endif
grub_emu_LDFLAGS = $(LIBCURSES)
ifeq ($(enable_grub_emu_usb), yes)
kernel_img_HEADERS += libusb.h
pkglib_MODULES += libusb.mod
libusb_mod_SOURCES = util/usb.c
libusb_mod_CFLAGS =

29
include/grub/libusb.h Normal file
View file

@ -0,0 +1,29 @@
/*
* 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/>.
*/
void EXPORT_FUNC (usb_bulk_write) (void);
void EXPORT_FUNC (usb_find_busses) (void);
void EXPORT_FUNC (usb_init) (void);
void EXPORT_FUNC (usb_find_devices) (void);
void EXPORT_FUNC (usb_open) (void);
void EXPORT_FUNC (usb_get_busses) (void);
void EXPORT_FUNC (usb_control_msg) (void);
void EXPORT_FUNC (usb_release_interface) (void);
void EXPORT_FUNC (usb_close) (void);
void EXPORT_FUNC (usb_bulk_read) (void);
void EXPORT_FUNC (usb_claim_interface) (void);