-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for building multiple filesystems and add exFAT
- Loading branch information
Showing
6 changed files
with
76 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
SRCDIR = grub | ||
|
||
VPATH = $(SRCDIR) | ||
FS_NAME = ntfs | ||
|
||
LOCAL_CPPFLAGS = -I$(SRCDIR)/include | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters