diff --git a/Make.common b/Make.common index 452c2b9..774fa8f 100644 --- a/Make.common +++ b/Make.common @@ -8,8 +8,6 @@ EFIINC = /usr/include/efi GNUEFILIB = /usr/lib EFILIB = /usr/lib EFICRT0 = /usr/lib -# Directory where you want the driver files to be copied into with 'make install' -INSTALL_DIR = /boot/efi/EFI/refind/drivers_x64/ # You shouldn't have to edit anything below this HOSTARCH = $(shell uname -m | sed s,i[3456789]86,ia32,) diff --git a/Makefile b/Makefile index 12073b0..a15c92e 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,6 @@ SRCDIR = grub VPATH = $(SRCDIR) -FS_NAME = ntfs LOCAL_CPPFLAGS = -I$(SRCDIR)/include diff --git a/src/Make.gnuefi b/src/Make.gnuefi new file mode 100644 index 0000000..1fe08b5 --- /dev/null +++ b/src/Make.gnuefi @@ -0,0 +1,49 @@ +# +# Build control file for the EFI drivers, as built with GNU-EFI +# + +SRCDIR = . +VPATH = $(SRCDIR) +HOSTARCH = $(shell uname -m | sed s,i[3456789]86,ia32,) +ARCH ?= $(HOSTARCH) + +# Note: IA64 options are untested; taken from Debian's rEFIt package. +ifeq ($(ARCH),ia64) + # EFI specs allows only lower floating point partition to be used + ARCH_C_CFLAGS = -frename-registers -mfixed-range=f32-f127 + DRIVER_ARCH = ia64 +endif + +ifeq ($(ARCH),ia32) + LIBEG = build32 + ARCH_C_FLAGS = -m32 -malign-double + DRIVERARCH = ia32 + LD_CODE = elf_i386 +endif + +ifeq ($(ARCH),x86_64) + LIBEG = build64 + ARCH_C_FLAGS = "-DEFIAPI=__attribute__((ms_abi))" -m64 + DRIVERARCH = x64 + LD_CODE = elf_x86_64 +endif + +LOCAL_CPPFLAGS = -DDRIVERNAME=$(DRIVERNAME) $(ARCH_C_FLAGS) -I$(SRCDIR)/../include -I$(SRCDIR)/../grub -I$(SRCDIR)/../grub/include +LOCAL_LIBS = -lgrub +LOCAL_LDFLAGS = -L. +GRUB_FS_DIR = ../grub/grub-core/fs +OBJS = grubberize.o $(GRUB_FS_DIR)/fshelp.o $(GRUB_FS_DIR)/$(DRIVERNAME).o fs_driver.o +TARGET = $(DRIVERNAME)_$(DRIVERARCH).efi + +all: $(TARGET) + +include $(SRCDIR)/../Make.common + +$(TARGET): $(SHLIB_TARGET) + @echo [OBJ] $@ + @$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel \ + -j .rela -j .reloc --target=$(FORMAT_DRIVER) $< $@ + @chmod a-x $(TARGET) + +clean: + rm -f $(GRUB_FS_DIR)/*.o $(GRUB_FS_DIR)/*.d *.o *.d *.so *.efi diff --git a/src/Makefile b/src/Makefile index 16dc295..e0076aa 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,52 +1,27 @@ -# -# Build control file for the EFI drivers, as built with GNU-EFI +# meta-Makefile for the filesystem drivers # -DRIVERNAME = ntfs -SRCDIR = . -VPATH = $(SRCDIR) -HOSTARCH = $(shell uname -m | sed s,i[3456789]86,ia32,) -ARCH ?= $(HOSTARCH) - -# Note: IA64 options are untested; taken from Debian's rEFIt package. -ifeq ($(ARCH),ia64) - # EFI specs allows only lower floating point partition to be used - ARCH_C_CFLAGS = -frename-registers -mfixed-range=f32-f127 - DRIVER_ARCH = ia64 -endif - -ifeq ($(ARCH),ia32) - LIBEG = build32 - ARCH_C_FLAGS = -m32 -malign-double - DRIVERARCH = ia32 - LD_CODE = elf_i386 -endif - -ifeq ($(ARCH),x86_64) - LIBEG = build64 - ARCH_C_FLAGS = "-DEFIAPI=__attribute__((ms_abi))" -m64 - DRIVERARCH = x64 - LD_CODE = elf_x86_64 -endif - -LOCAL_CPPFLAGS = -DDRIVERNAME=$(DRIVERNAME) $(ARCH_C_FLAGS) -I$(SRCDIR)/../include -I$(SRCDIR)/../grub -I$(SRCDIR)/../grub/include -LOCAL_LIBS = -lgrub -LOCAL_LDFLAGS = -L. -OBJS = fs_driver.o grubberize.o ../grub/grub-core/fs/fshelp.o ../grub/grub-core/fs/$(DRIVERNAME).o -TARGET = $(DRIVERNAME)_$(DRIVERARCH).efi - -all: $(TARGET) - -include $(SRCDIR)/../Make.common - -$(TARGET): $(SHLIB_TARGET) - @echo [OBJ] $@ - @$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel \ - -j .rela -j .reloc --target=$(FORMAT_DRIVER) $< $@ - @chmod a-x $(TARGET) +INSTALL_DIR = /boot/efi/EFI/refind/drivers_x64 -clean: - rm -f $(OBJS) $(OBJS:.o=.d) *.o *.so *.efi +FILESYSTEMS = ntfs xfs + +all: $(FILESYSTEMS) + +exfat: + @rm -f fs_driver.o + +make DRIVERNAME=exfat -f Make.gnuefi -install: all - @cp -v $(TARGET) $(INSTALL_DIR) +ntfs: + @rm -f fs_driver.o + +make DRIVERNAME=ntfs -f Make.gnuefi + +xfs: + @rm -f fs_driver.o + +make DRIVERNAME=xfs -f Make.gnuefi + +install: + @mkdir -p $(INSTALL_DIR) + @cp -v *.efi $(INSTALL_DIR) + +clean: + +make -f Make.gnuefi clean diff --git a/src/fs_driver.h b/src/fs_driver.h index 554c012..9fab723 100644 --- a/src/fs_driver.h +++ b/src/fs_driver.h @@ -32,7 +32,7 @@ /* Driver version */ #define FS_DRIVER_VERSION_MAJOR 0 -#define FS_DRIVER_VERSION_MINOR 4b +#define FS_DRIVER_VERSION_MINOR 5 #undef offsetof #if defined(__GNUC__) && (__GNUC__ > 3) diff --git a/src/fs_guid.h b/src/fs_guid.h index c413d65..e052c87 100644 --- a/src/fs_guid.h +++ b/src/fs_guid.h @@ -23,8 +23,9 @@ static const struct { const CHAR16 *Name; const EFI_GUID Guid; } FSGuid[] = { - { L"ntfs", { 0x3AD33E69, 0x7966, 0x4081, {0x9A, 0x66, 0x9B, 0xA8, 0xE5, 0x4E, 0x06, 0x4B } } }, - { L"xfs", { 0xB1EC46ED, 0x896B, 0x4838, {0x8B, 0x39, 0x66, 0xFF, 0x9F, 0xEE, 0x3A, 0x9A } } }, + { L"exfat", { 0xC5372182, 0x1AD1, 0x4955, { 0xBD, 0xC9, 0x4A, 0xBC, 0xC8, 0x2B, 0x20, 0x43 } } }, + { L"ntfs", { 0x3AD33E69, 0x7966, 0x4081, { 0x9A, 0x66, 0x9B, 0xA8, 0xE5, 0x4E, 0x06, 0x4B } } }, + { L"xfs", { 0xB1EC46ED, 0x896B, 0x4838, { 0x8B, 0x39, 0x66, 0xFF, 0x9F, 0xEE, 0x3A, 0x9A } } }, }; /**