From: srs5694 Date: Mon, 7 Dec 2015 22:49:34 +0000 (-0500) Subject: Add warning to refind-install when --alldrivers is used without X-Git-Url: https://code.delx.au/refind/commitdiff_plain/0386a1c85f867b60fc6e792655714e0835444366 Add warning to refind-install when --alldrivers is used without --usedefault. Also a few misc. small changes. --- diff --git a/BUILDING.txt b/BUILDING.txt index 890e178..14096c5 100644 --- a/BUILDING.txt +++ b/BUILDING.txt @@ -11,7 +11,10 @@ To compile rEFInd, you'll need the following: normally run Linux, you can run it in a VirtualBox or similar virtual machine. (I describe some unsupported non-Linux build options shortly.) -* A standard set of Linux development tools, based on GCC. +* A standard set of Linux development tools, based on GCC. (I've tried + using clang 3.4 under Ubuntu, with partial success. The main rEFInd + binary, gptsync, and some drivers compile successfully; but only gptsync + runs normally. The drivers I've tried and the main rEFInd binary crash.) * One of the following: diff --git a/Make.common b/Make.common index d46be77..1ebce50 100644 --- a/Make.common +++ b/Make.common @@ -65,8 +65,7 @@ OPTIMFLAGS = -Os -fno-strict-aliasing CFLAGS = $(OPTIMFLAGS) -fno-stack-protector -fshort-wchar -Wall # ...for GNU-EFI.... -GNUEFI_CFLAGS = -I$(EFIINC) -I$(EFIINC)/$(ARCH) -I$(EFIINC)/protocol -I../include -I../refind -I../libeg -I../mok -#GNUEFI_CFLAGS = -I$(EFIINC) -I$(EFIINC)/$(ARCH) -I$(EFIINC)/protocol -I. -I./../include -I./../libeg -I./../mok -I../include -I../refind -I../libeg +GNUEFI_CFLAGS = -fpic -I$(EFIINC) -I$(EFIINC)/$(ARCH) -I$(EFIINC)/protocol -I../include -I../refind -I../libeg -I../mok # ...and for TianoCore.... TIANO_INCLUDE_DIRS = -I $(EDK2BASE)/MdePkg \ @@ -98,8 +97,6 @@ TIANO_LDSCRIPT = $(EDK2BASE)/BaseTools/Scripts/gcc4.4-ld-script TIANO_LDFLAGS = -nostdlib -n -q --gc-sections --script=$(EDK2BASE)/BaseTools/Scripts/gcc4.4-ld-script \ --entry $(ENTRYPOINT) -u $(ENTRYPOINT) -m $(LD_CODE) - - # # objcopy flags for GNU-EFI # @@ -107,7 +104,6 @@ TIANO_LDFLAGS = -nostdlib -n -q --gc-sections --script=$(EDK2BASE)/BaseTools/S FORMAT = --target=efi-app-$(ARCH) FORMAT_DRIVER = --target=efi-bsdrv-$(ARCH) - # # Modifications on a per-architecture basis.... # @@ -118,9 +114,6 @@ ifeq ($(ARCH),x86_64) ARCH_CFLAGS = -DEFIX64 -DEFI_FUNCTION_WRAPPER -m64 -mno-red-zone ifeq ($(MAKEWITH),TIANO) ARCH_CFLAGS += -mcmodel=large "-DEFIAPI=__attribute__((ms_abi))" -endif -ifeq ($(MAKEWITH),GNUEFI) - ARCH_CFLAGS += -fpic endif ARCHDIR = X64 UC_ARCH = X64 @@ -140,9 +133,6 @@ ifeq ($(ARCH),ia32) endif ARCH_CFLAGS = -m32 -DEFI32 -malign-double -ifeq ($(MAKEWITH),GNUEFI) - ARCH_CFLAGS += -fpic -endif ARCHDIR = Ia32 UC_ARCH = IA32 FILENAME_CODE = ia32 diff --git a/filesystems/Makefile b/filesystems/Makefile index 563b52f..99452ed 100644 --- a/filesystems/Makefile +++ b/filesystems/Makefile @@ -21,10 +21,6 @@ TEXTFILES = $(FILESYSTEMS:=*.txt) all: $(FILESYSTEMS) -xfs: - rm -f fsw_efi.obj - +make DRIVERNAME=xfs -f Make.tiano - ext2: rm -f fsw_efi.obj +make DRIVERNAME=ext2 -f Make.tiano @@ -59,10 +55,6 @@ gnuefi: $(FILESYSTEMS_GNUEFI) all_gnuefi: $(FILESYSTEMS_GNUEFI) -xfs_gnuefi: - rm -f fsw_efi.o - +make DRIVERNAME=xfs -f Make.gnuefi - ext2_gnuefi: rm -f fsw_efi.o +make DRIVERNAME=ext2 -f Make.gnuefi diff --git a/libeg/lodepng.h b/libeg/lodepng.h index 4593949..2b2cc89 100644 --- a/libeg/lodepng.h +++ b/libeg/lodepng.h @@ -46,7 +46,6 @@ int MyStrlen(const char *InString); #else #include "../include/tiano_includes.h" #endif -#define memcpy(a, b, c) CopyMem(a, b, c) #ifdef __cplusplus #include diff --git a/libeg/lodepng_xtra.c b/libeg/lodepng_xtra.c index 343fbff..684e10e 100644 --- a/libeg/lodepng_xtra.c +++ b/libeg/lodepng_xtra.c @@ -85,6 +85,16 @@ int MyStrlen(const char *InString) { return Length; } // int MyStrlen() +VOID *memset (VOID *s, int c, size_t n) { + SetMem(s, c, n); + return s; +} + +VOID *memcpy (void *__restrict __dest, const void *__restrict __src, size_t __n) { + CopyMem(__dest, __src, __n); + return __dest; +} + typedef struct _lode_color { UINT8 red; UINT8 green; diff --git a/refind-install b/refind-install index 495892f..32aa8d9 100755 --- a/refind-install +++ b/refind-install @@ -40,7 +40,8 @@ # Revision history: # # 0.10.1 -- Improve extraction of default kernel options from /proc/cmdline. -# Add support for AMD64 (aka AARCH64, aa64) platform. +# Add support for AMD64 (aka AARCH64, aa64) platform. Added +# warning when --alldrivers used without --usedefault. # 0.10.0 -- Enable running under OS X's recovery system & add warning about # SIP & brief instructions on how to deal with it if SIP is # detected to be enabled. Also change way refind_linux.conf default @@ -181,6 +182,17 @@ GetParams() { echo "The --keepname option is incompatible with --usedefault! Aborting!" exit 1 fi + if [[ "$InstallDrivers" == "all" && "$TargetDir" != "/EFI/BOOT" ]] ; then + echo "The --alldrivers option is meant for creating USB flash drives with (near-)" + echo "universal boot support. Using it on a hard disk partition runs the risk of" + echo "creating serious problems, up to and including rendering your computer" + echo -n "unbootable. Are you SURE you want to proceed (Y/N)? " + ReadYesNo + if [[ "$YesNo" != "Y" && "$YesNo" != "y" ]] ; then + echo "Aborting installation!" + exit 0 + fi + fi RLConfFile="$RootDir/boot/refind_linux.conf" EtcKeysDir="$RootDir/etc/refind.d/keys" } # GetParams() diff --git a/refind/menu.c b/refind/menu.c index 35a8f26..4fa93b1 100644 --- a/refind/menu.c +++ b/refind/menu.c @@ -970,17 +970,15 @@ static VOID DrawMainMenuEntry(REFIT_MENU_ENTRY *Entry, BOOLEAN selected, UINTN X { EG_IMAGE *Background; - if (SelectionImages != NULL) { - if (selected) { - Background = egCropImage(GlobalConfig.ScreenBackground, XPos, YPos, + if (selected) { + Background = egCropImage(GlobalConfig.ScreenBackground, XPos, YPos, + SelectionImages[Entry->Row]->Width, SelectionImages[Entry->Row]->Height); + egComposeImage(Background, SelectionImages[Entry->Row], 0, 0); + BltImageCompositeBadge(Background, Entry->Image, Entry->BadgeImage, XPos, YPos); + } else { // Image not selected; copy background + egDrawImageWithTransparency(Entry->Image, Entry->BadgeImage, XPos, YPos, SelectionImages[Entry->Row]->Width, SelectionImages[Entry->Row]->Height); - egComposeImage(Background, SelectionImages[Entry->Row], 0, 0); - BltImageCompositeBadge(Background, Entry->Image, Entry->BadgeImage, XPos, YPos); - } else { // Image not selected; copy background - egDrawImageWithTransparency(Entry->Image, Entry->BadgeImage, XPos, YPos, - SelectionImages[Entry->Row]->Width, SelectionImages[Entry->Row]->Height); - } // if/else - } // if + } // if/else } // VOID DrawMainMenuEntry() static VOID PaintAll(IN REFIT_MENU_SCREEN *Screen, IN SCROLL_STATE *State, UINTN *itemPosX,