]> code.delx.au - refind/commitdiff
0.4.1 release
authorsrs5694 <srs5694@users.sourceforge.net>
Sat, 26 May 2012 00:53:25 +0000 (20:53 -0400)
committersrs5694 <srs5694@users.sourceforge.net>
Sat, 26 May 2012 00:53:25 +0000 (20:53 -0400)
24 files changed:
NEWS.txt
docs/refind/bootmode.html
docs/refind/configfile.html
docs/refind/drivers.html
docs/refind/features.html
docs/refind/getting.html
docs/refind/index.html
docs/refind/installing.html
docs/refind/linux.html
docs/refind/revisions.html
docs/refind/themes.html
docs/refind/todo.html
docs/refind/using.html
filesystems/Make.common
filesystems/Makefile
filesystems/fsw_efi.c
filesystems/fsw_ext2.c
filesystems/fsw_hfs.c
install.sh [changed mode: 0755->0644]
libeg/libeg.h
libeg/screen.c
libeg/text.c
refind/main.c
refind/screen.c

index 44b6ec66ffe69ede2848c120713a97df23d501d1..5c89c5e5dad1bb921faf3130710f10534beb31f2 100644 (file)
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -1,7 +1,23 @@
-0.4.1 (?/??/2012):
+0.4.1 (5/25/2012):
 ------------------
 
+- Added "scanning for new boot loaders" message to the re-scan function
+  (hitting Esc at the main menu). It usually flashes up too quickly to
+  be of importance, but if the scan function takes a while because of
+  access to a CD that must be spun up, it should make it clear that the
+  system hasn't hung.
 
+- Modified install.sh script to detect rEFItBlesser on Macs, and if
+  present, to ask the user if it should be removed.
+
+- Cleaned up the Make.common file for the filesystem drivers.
+
+- Changed HFS+ driver to return volume label of "HFS+ volume" rather than
+  an empty label. (The driver doesn't currently read the real volume
+  label.)
+
+- Fixed bug that could cause rEFInd to appear in its own menu after
+  running a shell and then re-scanning for boot loaders.
 
 0.4.0 (5/20/2012):
 ------------------
index 7082ca8596a1420c011b6031b6b5cd887e004a66..37c26e867ecc67e13063ee513910cc1d288c6d83 100644 (file)
@@ -15,7 +15,7 @@
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>\r
 \r
 <p>Originally written: 3/14/2012; last Web page update:\r
-5/20/2012, referencing rEFInd 0.4.0</p>\r
+5/25/2012, referencing rEFInd 0.4.1</p>\r
 \r
 \r
 <p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>\r
index ca6b444ee2ed947afe063adaf1a940889b816c6a..d6ee318aaa1704403ba28383b3e3efc14fe89963 100644 (file)
@@ -15,7 +15,7 @@
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p>Originally written: 3/14/2012; last Web page update:
-5/20/2012, referencing rEFInd 0.4.0</p>
+5/25/2012, referencing rEFInd 0.4.1</p>
 
 
 <p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
index 579ddac56169cb0f6877283c508257761d1798eb..0946e1756ba7984c3350dcd9c2c61a5c5b3d0b17 100644 (file)
@@ -15,7 +15,7 @@
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p>Originally written: 4/19/2012; last Web page update:
-5/20/2012, referencing rEFInd 0.4.0</p>
+5/25/2012, referencing rEFInd 0.4.1</p>
 
 
 <p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
index 0fdd59b617d44bb35de2357b9f39d087603e7ca9..d779d5706018172fa667c022abb08c6baddf0275 100644 (file)
@@ -15,7 +15,7 @@
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p>Originally written: 3/14/2012; last Web page update:
-5/20/2012, referencing rEFInd 0.4.0</p>
+5/25/2012, referencing rEFInd 0.4.1</p>
 
 <p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
 
index 1a43a2f5d27c26d10e006aa3592a903ea1129b0c..54c450039119a4d86de93f5391ec62b6e11ff534 100644 (file)
@@ -15,7 +15,7 @@
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p>Originally written: 3/14/2012; last Web page update:
-5/20/2012, referencing rEFInd 0.4.0</p>
+5/25/2012, referencing rEFInd 0.4.1</p>
 
 <p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
 
@@ -97,7 +97,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <ul>
 
-<li><b><a href="http://sourceforge.net/projects/refind/files/0.4.0/refind-src-0.4.0.zip/download">A
+<li><b><a href="http://sourceforge.net/projects/refind/files/0.4.1/refind-src-0.4.1.zip/download">A
     source code zip file</a></b>&mdash;This is useful if you want to
     compile the software locally. Note that I use Linux with the <a
     href="http://sourceforge.net/projects/gnu-efi">GNU-EFI</a> development
@@ -108,7 +108,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
     possible, but I've not attempted it.</li>
 
 <li><b><a
-    href="http://sourceforge.net/projects/refind/files/0.4.0/refind-bin-0.4.0.zip/download">A
+    href="http://sourceforge.net/projects/refind/files/0.4.1/refind-bin-0.4.1.zip/download">A
     binary zip file</a></b>&mdash;Download this if you want to install
     rEFInd and/or its filesystem drivers on an <i>x</i>86 or <i>x</i>86-64
     computer and have no need to test rEFInd first by booting it on an
@@ -118,7 +118,7 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
     href="installing.html">Installing rEFInd</a> page.</li>
 
 <li><b><a
-    href="http://sourceforge.net/projects/refind/files/0.4.0/refind-cd-0.4.0.zip/download">A
+    href="http://sourceforge.net/projects/refind/files/0.4.1/refind-cd-0.4.1.zip/download">A
     CD-R image file</a></b>&mdash;This download contains the same files as
     the zip file, but you can burn it to a CD-R to test rEFInd (and its
     filesystem drivers) without installing it first. (It boots on UEFI PCs,
index 7e79b57b4a35d0ba0f7a459fc41b7abc92e68a5b..191373f7849440f4549b54b36876a40ebb73ef68 100644 (file)
@@ -15,7 +15,7 @@
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p>Originally written: 3/14/2012; last Web page update:
-5/20/2012, referencing rEFInd 0.4.0</p>
+5/25/2012, referencing rEFInd 0.4.1</p>
 
 
 <p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
index 0b2886436ad40eb25e66912799a699ce1740298a..938fc02d08aa05a78dfe96f5ee7e1680757ff2dd 100644 (file)
@@ -15,7 +15,7 @@
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p>Originally written: 3/14/2012; last Web page update:
-5/20/2012, referencing rEFInd 0.4.0</p>
+5/25/2012, referencing rEFInd 0.4.1</p>
 
 
 <p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
@@ -169,6 +169,19 @@ Installation has completed successfully.</pre>
     href="https://sourceforge.net/p/refind/discussion/general/thread/5c7d0195/">this
     forum thread</a> for a discussion of the topic.</li>
 
+<li>If you're replacing rEFIt with rEFInd on a Mac, there's a chance that
+    <tt>install.sh</tt> will warn you about the presence of a file called
+    <tt>/Library/StartupItems/rEFItBlesser</tt> and ask if you want to
+    delete the file. This file is designed to keep rEFIt set as the boot
+    manager by automatically re-blessing it if the default boot manager
+    changes. This is obviously undesirable if you install rEFInd as your
+    primary boot manager, so it's generally best to remove this file. If
+    you prefer to keep your options open, you can answer <tt
+    class="userinput">N</tt> when <tt>install.sh</tt> asks if you want to
+    delete rEFItBlesser, and instead manually copy it elsewhere. If you
+    subsequently decide to go back to using rEFIt as your primary boot
+    manager, you can restore rEFItBlesser to its place.</li>
+
 <li>If you're using OS X and an Advanced Format disk, heed the warning that
     <tt>install.sh</tt> displays and <i><b>do not</b></i> use <tt>bless
     --info</tt> to check your installation status; this combination has
index d9b47d147e68cb1b0f4316d33a190b62c95c1a0a..ccc26565f5e0769d2c8ef335be8c3da8a7be6be4 100644 (file)
@@ -15,7 +15,7 @@
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p>Originally written: 3/19/2012; last Web page update:
-5/20/2012, referencing rEFInd 0.4.0</p>
+5/25/2012, referencing rEFInd 0.4.1</p>
 
 
 <p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
index 8bac8053dce6012801d4e91b39fb2d026cd4de9f..6fda6e4d6752c4d300297ab9f4af0f08de89dfdb 100644 (file)
@@ -14,7 +14,7 @@
 <p class="subhead">by Roderick W. Smith, <a
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
-<p>Last Web page update: 5/20/2012</p>
+<p>Last Web page update: 5/25/2012</p>
 
 
 <p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
@@ -93,6 +93,8 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <ul>
 
+<li><b>0.4.1 (5/25/2012)</b>&mdash;This version provides a number of small bug fixes and improvements: When re-scanning (initiated by pressing Esc in the main menu), a message that re-scanning is occurring appears on the screen; I've fixed a bug that could cause rEFInd to appear as an option in its own menu after running a shell program and re-scanning; the <tt>install.sh</tt> script now checks for, and optionally deletes, the rEFItBlesser program when run under OS X; and the HFS+ driver now returns a volume label of <tt>HFS+ volume</tt>, rather than nothing at all (unlike other drivers, the HFS+ driver can't yet return the volume's true label).</li>
+
 <li><b>0.4.0 (5/20/2012)</b>&mdash;I've bumped up this version number more than usual to reflect the addition of four filesystem drivers (for ext2fs, ReiserFS, HFS+, and ISO-9660) to the rEFInd package. These drivers originate with the original rEFIt, VirtualBox, and Clover boot loader projects. You can learn more on the <a href="drivers.html">drivers page.</a> To facilitate inclusion of drivers on the CD image, rEFInd also now supports reading drivers from architecture-specific subdirectories&mdash;<tt>drivers_x64</tt> and <tt>drivers_ia32</tt> for <i>x</i>86-64 and <i>x</i>86 systems, respectively. This version also adds the ability to eject removable media on some Macs (this won't work on UEFI-based PCs, unfortunately). Finally, this version fixes a problem that could cause GRUB 2 to be unable to read its configuration file in some settings when launched from rEFInd.</li>
 
 <li><b>0.3.5 (5/15/2012)</b>&mdash;This version's biggest new feature is the ability to re-scan for boot loaders after launching the program. This is done by pressing the Esc key, which causes rEFInd to re-read its configuration file, to tell the EFI to reconnect all disks, and to do a fresh scan of all disks for loaders. This is useful if you insert a removable disk after starting the computer, if rEFInd starts before a disk has fully settled, if you make a change to the configuration file, or if you manually load a driver. This version also fixes a minor bug that could cause the scroll-right arrow to be replaced with a left-pointing arrow under some circumstances; and I've removed the scan for a BIOS Boot Partition that I added in 0.3.2, since I'm told it isn't launching correctly. (BIOS-mode GRUB 2 can still be launched on Macs from its boot code in the MBR.)</li>
index 9daac49dd1272a4cf3c30742ba6413fae3a17f8a..c9067fc9960cdb26aa9d99d5f1c4f9dce0da6352 100644 (file)
@@ -15,7 +15,7 @@
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p>Originally written: 4/19/2012; last Web page update:
-5/20/2012, referencing rEFInd 0.4.0</p>
+5/25/2012, referencing rEFInd 0.4.1</p>
 
 
 <p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
index 9201b69dfe3fb0c263a41ea47fa7263b3c4ca3f2..952e74e3412b32b0df957687fa118cf17a8b8069 100644 (file)
@@ -157,6 +157,20 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
        from the partition data is harder than extracting the volume's
        label or counting up the filesystem numbers.</li>
 
+    <li>The default_selection option in refind.conf could be improved by
+       supporting a list of default options, so that if the first item
+       isn't found, rEFInd will try to boot the second one in the list,
+       and so on. This could be handy in case a driver fails to load, or
+       to provide an override in case the user inserts a specific
+       removable disk&mdash;by placing the removable disk's name first in
+       the list, it will take precedence over the normal hard disk
+       default.</li>
+
+    <li>Along the lines of the previous item, the default_selection might
+       be expanded to support some form of specification of disk types, as
+       in a special entry for any optical disk or any external disk, no
+       matter what its name is.</li>
+
     <li>It would be useful to be able to specify paths to boot loaders
        and/or initial RAM disks relative to the rEFInd directory (or the
        boot loader's directory, in the case of initrds).</li>
@@ -193,9 +207,9 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
        implementation, and a dismal one at that, so I'm inclined to just
        let it go.</li>
 
-    <li>The Shutdown option works correctly on Macs, but not on UEFI-based PCs.
-        On such systems, Shutdown reboots the computer. This should be
-        fixed.</li>
+    <li>The Shutdown option works correctly on Macs, but not on UEFI-based
+       PCs. On such systems, Shutdown reboots the computer. This should be
+       fixed.</li>
 
     <li>The media-ejection feature (F12) should be extended to work on
        UEFI-based PCs and early Macs. At the moment, it relies on an
@@ -206,10 +220,16 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
        ignoring new media or keeping old media that have been ejected.
        This should be investigated and fixed.</li>
 
-    <li>The re-scan feature renders the user interface immobile until
-        the re-scan is complete. This is usually just a second or two,
-       but it can be longer if an optical disc needs to be spun up.
-       Adding a temporary "scanning media" notice would be helpful.</li>
+    <li>The "scanning for new boot loaders" message that appears during the
+       re-scan feature is primitive. Some sort of dynamic icon would be
+       nice, but perhaps impractical, given the single-tasking nature of
+       EFI.</li>
+
+    <li>On my Mac Mini, launching a shell, returning, and performing a
+       re-scan causes the system to be unable to launch the shell again. I
+       have not observed this behavior on UEFI-based PCs. It seems to be
+       caused by a truncated DevicePath to the shell, which includes the
+       shell's pathname but not the device identifier.</li>
 
     <li>The code is in need of review to search for memory leaks and
        similar problems.</p>
@@ -289,10 +309,13 @@ href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
        the problem is worst with VirtualBox, and the next worst is a
        system that uses <a
        href="http://www.rodsbooks.com/bios2uefi/">DUET</a>). Nonetheless,
-       I'd like to track down the cause and fix it.
+       I'd like to track down the cause and fix it.</li>
 
     <li>The driver installation procedure could be improved, perhaps by
-        adding support for drivers to the <tt>install.sh</tt> script.
+        adding support for drivers to the <tt>install.sh</tt> script.</li>
+
+    <li>The HFS+ driver returns a volume label of "HFS+ volume", no matter
+        what the volume's real label is.</li>
 
     </ul></li> <!-- Drivers -->
 
index 4d62aa15c1141b6a66546c2647a99e1344b45897..0eb39422d1a040bbee9164a780743b293aa28b02 100644 (file)
@@ -15,7 +15,7 @@
 href="mailto:rodsmith@rodsbooks.com">rodsmith@rodsbooks.com</a></p>
 
 <p>Originally written: 3/14/2012; last Web page update:
-5/20/2012, referencing rEFInd 0.4.0</p>
+5/25/2012, referencing rEFInd 0.4.1</p>
 
 
 <p>I'm a technical writer and consultant specializing in Linux technologies. This Web page is provided free of charge and with no annoying outside ads; however, I did take time to prepare it, and Web hosting does cost money. If you find this Web page useful, please consider making a small donation to help keep this site up and running. Thanks!</p>
index f636bade732f0273ddcdbde8d76da8ce1bc08ff5..13011507532fd35868b613e48ad2dc7edcbfc94c 100644 (file)
@@ -3,20 +3,24 @@
 # Build control file for rEFInd's EFI filesystem drivers
 #
 
-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
+  # TODO: Add ARCHDIR and FILENAME_CODE as appropriate
+endif
+
 ifeq ($(ARCH),ia32)
+  ARCH_C_FLAGS = -m32
   ARCHDIR = Ia32
   FILENAME_CODE = ia32
 endif
 
 ifeq ($(ARCH),x86_64)
-  ARCH_C_FLAGS = "-DEFIAPI=__attribute__((ms_abi))" -mcmodel=large
+  ARCH_C_FLAGS = "-DEFIAPI=__attribute__((ms_abi))" -mcmodel=large -m64
   ARCHDIR = X64
   FILENAME_CODE = x64
 endif
@@ -26,29 +30,23 @@ EDK2BASE = /usr/local/UDK2010/MyWorkSpace
 # Below file defines TARGET (RELEASE or DEBUG), TARGET_ARCH (X64 or IA32), and TOOL_CHAIN_TAG (GCC44, GCC45, GCC46, or GCC47)
 include $(EDK2BASE)/Conf/target.txt
 
-EFIINC = $(EDK2BASE)/MdePkg/Include/
 EFILIB          = $(EDK2BASE)/Build/MdeModule/$(TARGET)_$(TOOL_CHAIN_TAG)/$(TARGET_ARCH)/MdePkg/Library
-ALL_EFILIBS     = $(EDK2BASE)/Build/MdeModule/$(TARGET)_$(TOOL_CHAIN_TAG)/$(TARGET_ARCH)/MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib/OUTPUT/BaseDebugPrintErrorLevelLib.lib \
-                 $(EDK2BASE)/Build/MdeModule/$(TARGET)_$(TOOL_CHAIN_TAG)/$(TARGET_ARCH)/MdePkg/Library/BasePrintLib/BasePrintLib/OUTPUT/BasePrintLib.lib \
-                 $(EDK2BASE)/Build/MdeModule/$(TARGET)_$(TOOL_CHAIN_TAG)/$(TARGET_ARCH)/MdePkg/Library/BasePcdLibNull/BasePcdLibNull/OUTPUT/BasePcdLibNull.lib \
-                 $(EDK2BASE)/Build/MdeModule/$(TARGET)_$(TOOL_CHAIN_TAG)/$(TARGET_ARCH)/MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut/OUTPUT/UefiDebugLibConOut.lib \
-                 $(EDK2BASE)/Build/MdeModule/$(TARGET)_$(TOOL_CHAIN_TAG)/$(TARGET_ARCH)/MdePkg/Library/BaseLib/BaseLib/OUTPUT/BaseLib.lib \
-                 $(EDK2BASE)/Build/MdeModule/$(TARGET)_$(TOOL_CHAIN_TAG)/$(TARGET_ARCH)/MdePkg/Library/BaseMemoryLib/BaseMemoryLib/OUTPUT/BaseMemoryLib.lib \
-                 $(EDK2BASE)/Build/MdeModule/$(TARGET)_$(TOOL_CHAIN_TAG)/$(TARGET_ARCH)/MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib/OUTPUT/UefiBootServicesTableLib.lib \
-                 $(EDK2BASE)/Build/MdeModule/$(TARGET)_$(TOOL_CHAIN_TAG)/$(TARGET_ARCH)/MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib/OUTPUT/UefiMemoryAllocationLib.lib \
-                 $(EDK2BASE)/Build/MdeModule/$(TARGET)_$(TOOL_CHAIN_TAG)/$(TARGET_ARCH)/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib/OUTPUT/UefiDevicePathLib.lib \
-                 $(EDK2BASE)/Build/MdeModule/$(TARGET)_$(TOOL_CHAIN_TAG)/$(TARGET_ARCH)/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib/OUTPUT/UefiRuntimeServicesTableLib.lib \
-                 $(EDK2BASE)/Build/MdeModule/$(TARGET)_$(TOOL_CHAIN_TAG)/$(TARGET_ARCH)/MdePkg/Library/UefiLib/UefiLib/OUTPUT/UefiLib.lib \
-                 $(EDK2BASE)/Build/MdeModule/$(TARGET)_$(TOOL_CHAIN_TAG)/$(TARGET_ARCH)/MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint/OUTPUT/UefiDriverEntryPoint.lib
-
-OS             = $(shell uname -s)
-CPPFLAGS        = -I$(EFIINC) -I$(EFIINC)/$(ARCH) -I$(EFIINC)/Protocol -I$(EFIINC)/$(ARCHDIR) -DNO_BUILTIN_VA_FUNCS
+ALL_EFILIBS     = $(EFILIB)/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib/OUTPUT/BaseDebugPrintErrorLevelLib.lib \
+                 $(EFILIB)/BasePrintLib/BasePrintLib/OUTPUT/BasePrintLib.lib \
+                 $(EFILIB)/BasePcdLibNull/BasePcdLibNull/OUTPUT/BasePcdLibNull.lib \
+                 $(EFILIB)/UefiDebugLibConOut/UefiDebugLibConOut/OUTPUT/UefiDebugLibConOut.lib \
+                 $(EFILIB)/BaseLib/BaseLib/OUTPUT/BaseLib.lib \
+                 $(EFILIB)/BaseMemoryLib/BaseMemoryLib/OUTPUT/BaseMemoryLib.lib \
+                 $(EFILIB)/UefiBootServicesTableLib/UefiBootServicesTableLib/OUTPUT/UefiBootServicesTableLib.lib \
+                 $(EFILIB)/UefiMemoryAllocationLib/UefiMemoryAllocationLib/OUTPUT/UefiMemoryAllocationLib.lib \
+                 $(EFILIB)/UefiDevicePathLib/UefiDevicePathLib/OUTPUT/UefiDevicePathLib.lib \
+                 $(EFILIB)/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib/OUTPUT/UefiRuntimeServicesTableLib.lib \
+                 $(EFILIB)/UefiLib/UefiLib/OUTPUT/UefiLib.lib \
+                 $(EFILIB)/UefiDriverEntryPoint/UefiDriverEntryPoint/OUTPUT/UefiDriverEntryPoint.lib
 
 INCLUDE_DIRS    = -I $(EDK2BASE)/MdePkg \
                   -I $(EDK2BASE)/MdePkg/Include \
-                  -I $(EDK2BASE)/MdePkg/Include/$(ARCHDIR) \
-                 -I $(EDK2BASE)/IntelFrameworkModulePkg \
-                 -I $(EDK2BASE)/IntelFrameworkModulePkg/Include \
+                  -I $(EDK2BASE)/MdePkg/Include/$(ARCHDIR)
 
 FSW_NAMES       = fsw_efi fsw_core fsw_efi_lib fsw_lib AutoGen
 OBJS            = $(FSW_NAMES:=.o)
@@ -56,12 +54,8 @@ OBJS            = $(FSW_NAMES:=.o)
 BUILDME          = $(DRIVERNAME)_$(FILENAME_CODE).efi
 
 OPTIMFLAGS      = -fno-strict-aliasing -mno-red-zone -Wno-address -Os
-#OPTIMFLAGS      = -fno-strict-aliasing -mno-red-zone -Wno-address -mcmodel=large -Os 
-DEBUGFLAGS      = -Wall -Werror -Wno-missing-braces -Wno-array-bounds -ffunction-sections -fdata-sections -c -include AutoGen.h
-#CFLAGS          = $(ARCH3264) $(OPTIMFLAGS) -fpic -fshort-wchar $(DEBUGFLAGS)
-CFLAGS          = $(ARCH3264) $(OPTIMFLAGS) -g -fshort-wchar -fno-stack-protector $(DEBUGFLAGS)
-ASFLAGS         = $(ARCH3264)
-LDFLAGS         = -nostdlib -znocombreloc -dp --entry=fsw_efi_main
+DEBUGFLAGS      = -Wall -Wno-missing-braces -Wno-array-bounds -ffunction-sections -fdata-sections
+CFLAGS          = $(OPTIMFLAGS) -g -fshort-wchar -fno-stack-protector $(DEBUGFLAGS) -c -include AutoGen.h
 
 prefix          = /usr/bin/
 CC              = $(prefix)gcc
@@ -70,40 +64,19 @@ LD              = $(prefix)ld
 AR              = $(prefix)ar
 RANLIB          = $(prefix)ranlib
 OBJCOPY         = $(prefix)objcopy
-GENFW           = $(EDK2BASE)/BaseTools/BinWrappers/PosixLike/GenFw
-
-ifeq ($(ARCH),ia64)
-  # EFI specs allows only lower floating point partition to be used
-  CFLAGS       += -frename-registers -mfixed-range=f32-f127
-endif
-
-ifeq ($(ARCH),x86_64)
-#  CFLAGS += -DEFI_FUNCTION_WRAPPER
-#  CPPFLAGS += -DEFIX64
-
-  ARCH3264 = -m64
-endif
-
-ifeq ($(ARCH),ia32)
-#  CPPFLAGS += -DEFI32
-
-  ARCH3264 = -m32
-
-endif
+GENFW           = $(EDK2BASE)/BaseTools/Source/C/bin/GenFw
 
 
 LDSCRIPT = $(EDK2BASE)/BaseTools/Scripts/gcc4.4-ld-script
 
 LDFLAGS         = -nostdlib -n -q --gc-sections --script=$(EDK2BASE)/BaseTools/Scripts/gcc4.4-ld-script \
                   --entry _ModuleEntryPoint -u _ModuleEntryPoint
-LIBS            = $(shell $(CC) $(ARCH3264) -print-libgcc-file-name)
 
 %.o: %.c
-       $(CC) $(CPPFLAGS) $(ARCH_C_FLAGS) $(CFLAGS) $(INCLUDE_DIRS) -DFSTYPE=$(DRIVERNAME) -c $< -o $@
+       $(CC) $(ARCH_C_FLAGS) $(CFLAGS) $(INCLUDE_DIRS) -DFSTYPE=$(DRIVERNAME) -DNO_BUILTIN_VA_FUNCS -c $< -o $@
 
 ifneq (,$(filter %.efi,$(BUILDME)))
 
-SHLIB_TARGET = $(subst .efi,.lib,$(BUILDME))
 DLL_TARGET = $(subst .efi,.dll,$(BUILDME))
 
 all: $(BUILDME)
@@ -113,12 +86,11 @@ $(DLL_TARGET): $(OBJS) fsw_$(DRIVERNAME).o
 
 $(BUILDME): $(DLL_TARGET)
        $(OBJCOPY) --strip-unneeded $(DLL_TARGET)
-       $(OBJCOPY) $(DLL_TARGET)
        $(GENFW) -e UEFI_DRIVER -o $(BUILDME) $(DLL_TARGET)
+#      $(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel \
+#                 -j .rela -j .reloc --rename-section .data=.hii --target=efi-bsdrv-$(ARCH) $< $@
        mkdir -p ../drivers
        cp $(BUILDME) ../drivers
-#      $(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel \
-#                 -j .rela -j .reloc --target=efi-bsdrv-$(ARCH) $< $@
 
 endif
 
index de697bfeca46f855e9e7d136945254f4b26abda2..902df494f93da66dd8af691cce34af391b096e47 100644 (file)
@@ -8,7 +8,10 @@
 
 INSTALL_DIR = /boot/efi/EFI/refind/drivers
 
-all:   ext2 reiserfs iso9660 hfs
+FILESYSTEMS = ext2 reiserfs iso9660 hfs
+TEXTFILES = $(FILESYSTEMS:=*.txt)
+
+all:   $(FILESYSTEMS)
 
 ext2:
        rm -f fsw_efi.o
@@ -29,7 +32,7 @@ hfs:
 # utility rules
 
 clean:
-       rm -f *~ *.so *.o *.efi *.dll err.txt ext2*.txt hfs*.txt iso9660*.txt reiserfs*.txt
+       rm -f *~ *.bak *.o *.efi *.dll err.txt $(TEXTFILES)
 
 
 install:
index 2f5a4c69c68eab3ae25bb4bdc7c2e918aff6f9d0..a364a2d4ab00c36337e011fbd09b07c51c0d340f 100644 (file)
@@ -77,7 +77,7 @@
 /** Helper macro for stringification. */
 #define FSW_EFI_STRINGIFY(x) #x
 /** Expands to the EFI driver name given the file system type name. */
-#define FSW_EFI_DRIVER_NAME(t) L"rEFInd 0.4.0 " FSW_EFI_STRINGIFY(t) L" File System Driver"
+#define FSW_EFI_DRIVER_NAME(t) L"rEFInd 0.4.1 " FSW_EFI_STRINGIFY(t) L" File System Driver"
 
 // function prototypes
 
index 5c98eded135c139e0c71db3ac68acb7912c5e103..a6e88bfbd962438e31b3337f38e064b3b2eec8ab 100644 (file)
@@ -54,7 +54,7 @@ struct fsw_fstype_table   FSW_FSTYPE_TABLE_NAME(ext2) = {
     { FSW_STRING_TYPE_ISO88591, 4, 4, "ext2" },
     sizeof(struct fsw_ext2_volume),
     sizeof(struct fsw_ext2_dnode),
-    
+
     fsw_ext2_volume_mount,
     fsw_ext2_volume_free,
     fsw_ext2_volume_stat,
@@ -81,12 +81,12 @@ static fsw_status_t fsw_ext2_volume_mount(struct fsw_ext2_volume *vol)
     struct ext2_group_desc *gdesc;
     int             i;
     struct fsw_string s;
-    
+
     // allocate memory to keep the superblock around
     status = fsw_alloc(sizeof(struct ext2_super_block), &vol->sb);
     if (status)
         return status;
-    
+
     // read the superblock into its buffer
     fsw_set_blocksize(vol, EXT2_SUPERBLOCK_BLOCKSIZE, EXT2_SUPERBLOCK_BLOCKSIZE);
     status = fsw_block_get(vol, EXT2_SUPERBLOCK_BLOCKNO, 0, &buffer);
@@ -94,7 +94,7 @@ static fsw_status_t fsw_ext2_volume_mount(struct fsw_ext2_volume *vol)
         return status;
     fsw_memcpy(vol->sb, buffer, sizeof(struct ext2_super_block));
     fsw_block_release(vol, EXT2_SUPERBLOCK_BLOCKNO, buffer);
-    
+
     // check the superblock
     if (vol->sb->s_magic != EXT2_SUPER_MAGIC)
         return FSW_UNSUPPORTED;
@@ -148,14 +148,14 @@ static fsw_status_t fsw_ext2_volume_mount(struct fsw_ext2_volume *vol)
         vol->inotab_bno[groupno] = gdesc->bg_inode_table;
         fsw_block_release(vol, gdesc_bno, buffer);
     }
-    
+
     // setup the root dnode
     status = fsw_dnode_create_root(vol, EXT2_ROOT_INO, &vol->g.root);
     if (status)
         return status;
-    
+
     FSW_MSG_DEBUG((FSW_MSGSTR("fsw_ext2_volume_mount: success, blocksize %d\n"), blocksize));
-    
+
     return FSW_SUCCESS;
 }
 
@@ -197,12 +197,12 @@ static fsw_status_t fsw_ext2_dnode_fill(struct fsw_ext2_volume *vol, struct fsw_
     fsw_status_t    status;
     fsw_u32         groupno, ino_in_group, ino_bno, ino_index;
     fsw_u8          *buffer;
-    
+
     if (dno->raw)
         return FSW_SUCCESS;
-    
+
     FSW_MSG_DEBUG((FSW_MSGSTR("fsw_ext2_dnode_fill: inode %d\n"), dno->g.dnode_id));
-    
+
     // read the inode block
     groupno = (dno->g.dnode_id - 1) / vol->sb->s_inodes_per_group;
     ino_in_group = (dno->g.dnode_id - 1) % vol->sb->s_inodes_per_group;
@@ -212,13 +212,13 @@ static fsw_status_t fsw_ext2_dnode_fill(struct fsw_ext2_volume *vol, struct fsw_
     status = fsw_block_get(vol, ino_bno, 2, (void **)&buffer);
     if (status)
         return status;
-    
+
     // keep our inode around
     status = fsw_memdup((void **)&dno->raw, buffer + ino_index * vol->inode_size, vol->inode_size);
     fsw_block_release(vol, ino_bno, buffer);
     if (status)
         return status;
-    
+
     // get info from the inode
     dno->g.size = dno->raw->i_size;
     // TODO: check docs for 64-bit sized files
@@ -230,7 +230,7 @@ static fsw_status_t fsw_ext2_dnode_fill(struct fsw_ext2_volume *vol, struct fsw_
         dno->g.type = FSW_DNODE_TYPE_SYMLINK;
     else
         dno->g.type = FSW_DNODE_TYPE_SPECIAL;
-    
+
     return FSW_SUCCESS;
 }
 
@@ -261,7 +261,7 @@ static fsw_status_t fsw_ext2_dnode_stat(struct fsw_ext2_volume *vol, struct fsw_
     sb->store_time_posix(sb, FSW_DNODE_STAT_ATIME, dno->raw->i_atime);
     sb->store_time_posix(sb, FSW_DNODE_STAT_MTIME, dno->raw->i_mtime);
     sb->store_attr_posix(sb, dno->raw->i_mode);
-    
+
     return FSW_SUCCESS;
 }
 
@@ -285,22 +285,22 @@ static fsw_status_t fsw_ext2_get_extent(struct fsw_ext2_volume *vol, struct fsw_
     fsw_u32         bno, release_bno, buf_bcnt, file_bcnt;
     fsw_u32         *buffer;
     int             path[5], i;
-    
+
     // Preconditions: The caller has checked that the requested logical block
     //  is within the file's size. The dnode has complete information, i.e.
     //  fsw_ext2_dnode_read_info was called successfully on it.
-    
+
     extent->type = FSW_EXTENT_TYPE_PHYSBLOCK;
     extent->log_count = 1;
     bno = extent->log_start;
-    
+
     // try direct block pointers in the inode
     if (bno < EXT2_NDIR_BLOCKS) {
         path[0] = bno;
         path[1] = -1;
     } else {
         bno -= EXT2_NDIR_BLOCKS;
-        
+
         // try indirect block
         if (bno < vol->ind_bcnt) {
             path[0] = EXT2_IND_BLOCK;
@@ -308,7 +308,7 @@ static fsw_status_t fsw_ext2_get_extent(struct fsw_ext2_volume *vol, struct fsw_
             path[2] = -1;
         } else {
             bno -= vol->ind_bcnt;
-        
+
             // try double-indirect block
             if (bno < vol->dind_bcnt) {
                 path[0] = EXT2_DIND_BLOCK;
@@ -317,7 +317,7 @@ static fsw_status_t fsw_ext2_get_extent(struct fsw_ext2_volume *vol, struct fsw_
                 path[3] = -1;
             } else {
                 bno -= vol->dind_bcnt;
-                
+
                 // use the triple-indirect block
                 path[0] = EXT2_TIND_BLOCK;
                 path[1] = bno / vol->dind_bcnt;
@@ -327,7 +327,7 @@ static fsw_status_t fsw_ext2_get_extent(struct fsw_ext2_volume *vol, struct fsw_
             }
         }
     }
-    
+
     // follow the indirection path
     buffer = dno->raw->i_block;
     buf_bcnt = EXT2_NDIR_BLOCKS;
@@ -342,7 +342,7 @@ static fsw_status_t fsw_ext2_get_extent(struct fsw_ext2_volume *vol, struct fsw_
         }
         if (path[i+1] < 0)
             break;
-        
+
         if (release_bno)
             fsw_block_release(vol, release_bno, buffer);
         status = fsw_block_get(vol, bno, 1, (void **)&buffer);
@@ -352,7 +352,7 @@ static fsw_status_t fsw_ext2_get_extent(struct fsw_ext2_volume *vol, struct fsw_
         buf_bcnt = vol->ind_bcnt;
     }
     extent->phys_start = bno;
-    
+
     // check if the following blocks can be aggregated into one extent
     file_bcnt = (fsw_u32)((dno->g.size + vol->g.log_blocksize - 1) & (vol->g.log_blocksize - 1));
     while (path[i]           + extent->log_count < buf_bcnt &&    // indirect block has more block pointers
@@ -362,7 +362,7 @@ static fsw_status_t fsw_ext2_get_extent(struct fsw_ext2_volume *vol, struct fsw_
         else
             break;
     }
-    
+
     if (release_bno)
         fsw_block_release(vol, release_bno, buffer);
     return FSW_SUCCESS;
@@ -383,16 +383,16 @@ static fsw_status_t fsw_ext2_dir_lookup(struct fsw_ext2_volume *vol, struct fsw_
     fsw_u32         child_ino;
     struct ext2_dir_entry entry;
     struct fsw_string entry_name;
-    
+
     // Preconditions: The caller has checked that dno is a directory node.
-    
+
     entry_name.type = FSW_STRING_TYPE_ISO88591;
-    
+
     // setup handle to read the directory
     status = fsw_shandle_open(dno, &shand);
     if (status)
         return status;
-    
+
     // scan the directory for the file
     child_ino = 0;
     while (child_ino == 0) {
@@ -405,7 +405,7 @@ static fsw_status_t fsw_ext2_dir_lookup(struct fsw_ext2_volume *vol, struct fsw_
             status = FSW_NOT_FOUND;
             goto errorexit;
         }
-        
+
         // compare name
         entry_name.len = entry_name.size = entry.name_len;
         entry_name.data = entry.name;
@@ -414,10 +414,10 @@ static fsw_status_t fsw_ext2_dir_lookup(struct fsw_ext2_volume *vol, struct fsw_
             break;
         }
     }
-    
+
     // setup a dnode for the child item
     status = fsw_dnode_create(dno, child_ino, FSW_DNODE_TYPE_UNKNOWN, &entry_name, child_dno_out);
-    
+
 errorexit:
     fsw_shandle_close(&shand);
     return status;
@@ -437,11 +437,11 @@ static fsw_status_t fsw_ext2_dir_read(struct fsw_ext2_volume *vol, struct fsw_ex
     fsw_status_t    status;
     struct ext2_dir_entry entry;
     struct fsw_string entry_name;
-    
+
     // Preconditions: The caller has checked that dno is a directory node. The caller
     //  has opened a storage handle to the directory's storage and keeps it around between
     //  calls.
-    
+
     while (1) {
         // read next entry
         status = fsw_ext2_read_dentry(shand, &entry);
@@ -449,22 +449,22 @@ static fsw_status_t fsw_ext2_dir_read(struct fsw_ext2_volume *vol, struct fsw_ex
             return status;
         if (entry.inode == 0)   // end of directory
             return FSW_NOT_FOUND;
-        
+
         // skip . and ..
         if ((entry.name_len == 1 && entry.name[0] == '.') ||
             (entry.name_len == 2 && entry.name[0] == '.' && entry.name[1] == '.'))
             continue;
         break;
     }
-    
+
     // setup name
     entry_name.type = FSW_STRING_TYPE_ISO88591;
     entry_name.len = entry_name.size = entry.name_len;
     entry_name.data = entry.name;
-    
+
     // setup a dnode for the child item
     status = fsw_dnode_create(dno, entry.inode, FSW_DNODE_TYPE_UNKNOWN, &entry_name, child_dno_out);
-    
+
     return status;
 }
 
@@ -478,14 +478,14 @@ static fsw_status_t fsw_ext2_read_dentry(struct fsw_shandle *shand, struct ext2_
 {
     fsw_status_t    status;
     fsw_u32         buffer_size;
-    
+
     while (1) {
         // read dir_entry header (fixed length)
         buffer_size = 8;
         status = fsw_shandle_read(shand, &buffer_size, entry);
         if (status)
             return status;
-        
+
         if (buffer_size < 8 || entry->rec_len == 0) {
             // end of directory reached
             entry->inode = 0;
@@ -499,11 +499,11 @@ static fsw_status_t fsw_ext2_read_dentry(struct fsw_shandle *shand, struct ext2_
                 return FSW_VOLUME_CORRUPTED;
             break;
         }
-        
+
         // valid, but unused entry, skip it
         shand->pos += entry->rec_len - 8;
     }
-    
+
     // read file name (variable length)
     buffer_size = entry->name_len;
     status = fsw_shandle_read(shand, &buffer_size, entry->name);
@@ -511,10 +511,10 @@ static fsw_status_t fsw_ext2_read_dentry(struct fsw_shandle *shand, struct ext2_
         return status;
     if (buffer_size < entry->name_len)
         return FSW_VOLUME_CORRUPTED;
-    
+
     // skip any remaining padding
     shand->pos += entry->rec_len - (8 + entry->name_len);
-    
+
     return FSW_SUCCESS;
 }
 
@@ -535,12 +535,12 @@ static fsw_status_t fsw_ext2_readlink(struct fsw_ext2_volume *vol, struct fsw_ex
     fsw_status_t    status;
     int             ea_blocks;
     struct fsw_string s;
-    
+
     if (dno->g.size > FSW_PATH_MAX)
         return FSW_VOLUME_CORRUPTED;
-    
+
     ea_blocks = dno->raw->i_file_acl ? (vol->g.log_blocksize >> 9) : 0;
-    
+
     if (dno->raw->i_blocks - ea_blocks == 0) {
         // "fast" symlink, path is stored inside the inode
         s.type = FSW_STRING_TYPE_ISO88591;
@@ -551,7 +551,7 @@ static fsw_status_t fsw_ext2_readlink(struct fsw_ext2_volume *vol, struct fsw_ex
         // "slow" symlink, path is stored in normal inode data
         status = fsw_dnode_readlink_data(dno, link_target);
     }
-    
+
     return status;
 }
 
index 59823c6e9bb197421e48b06cc9fb27f79ff9cc63..27195680ac79a24b4449d9a32b5c7c54ae9bd4c0 100644 (file)
@@ -215,13 +215,13 @@ HFSGetDescription(CICell ih, char *str, long strMaxLen)
 
 static fsw_status_t fsw_hfs_volume_mount(struct fsw_hfs_volume *vol)
 {
-    fsw_status_t           status, rv;
-    void                  *buffer = NULL;
-    HFSPlusVolumeHeader   *voldesc;
-    fsw_u32                blockno;
-    struct fsw_string      s;
-  HFSMasterDirectoryBlock* mdb;
-  UINTN i;
+    fsw_status_t              status, rv;
+    void                      *buffer = NULL;
+    HFSPlusVolumeHeader       *voldesc;
+    fsw_u32                   blockno;
+    struct fsw_string         s;
+    HFSMasterDirectoryBlock*  mdb;
+//    UINTN                     i;
 
     rv = FSW_UNSUPPORTED;
 
@@ -253,7 +253,7 @@ static fsw_status_t fsw_hfs_volume_mount(struct fsw_hfs_volume *vol)
         {
             if (vol->hfs_kind == 0)
             {
-    //            DPRINT("found HFS+\n");
+//                DPRINT("found HFS+\n");
                 vol->hfs_kind = FSW_HFS_PLUS;
             }
         }
@@ -298,15 +298,9 @@ static fsw_status_t fsw_hfs_volume_mount(struct fsw_hfs_volume *vol)
         fsw_set_blocksize(vol, block_size, block_size);
 
         /* get volume name */
-      for (i = kHFSMaxVolumeNameChars; i > 0; i--)
-        if (mdb->drVN[i-1] != ' ')
-          break;
-      
         s.type = FSW_STRING_TYPE_ISO88591;
-        s.size = s.len = 0;
-      s.data = NULL; //&mdb->drVN; //"HFS+ volume";
-      
-       //fsw_status_t fsw_strdup_coerce(struct fsw_string *dest, int type, struct fsw_string *src)
+        s.size = s.len = kHFSMaxVolumeNameChars;
+        s.data = "HFS+ volume";
         status = fsw_strdup_coerce(&vol->g.label, vol->g.host_string_type, &s);
         CHECK(status);
 
@@ -349,6 +343,13 @@ static fsw_status_t fsw_hfs_volume_mount(struct fsw_hfs_volume *vol)
         vol->catalog_tree.root_node = be32_to_cpu (tree_header.rootNode);
         vol->catalog_tree.node_size = be16_to_cpu (tree_header.nodeSize);
 
+//         /* get volume name */
+//         s.type = FSW_STRING_TYPE_ISO88591;
+//         s.size = s.len = kHFSMaxVolumeNameChars;
+//         s.data = vol->catalog_tree.file->g.name.data;
+//         status = fsw_strdup_coerce(&vol->g.label, vol->g.host_string_type, &s);
+//         CHECK(status);
+
         /* Read extents overflow file */
         r = fsw_hfs_read_file(vol->extents_tree.file,
                               sizeof (BTNodeDescriptor),
old mode 100755 (executable)
new mode 100644 (file)
index c70c803..87bc4cb
@@ -17,6 +17,7 @@
 #
 # Revision history:
 #
+# 0.4.1   -- Added check for rEFItBlesser in OS X
 # 0.3.3.1 -- Fixed OS X 10.7 bug; also works as make target
 # 0.3.2.1 -- Check for presence of source files; aborts if not present
 # 0.3.2   -- Initial version
@@ -160,6 +161,19 @@ InstallOnOSX() {
    if [[ $? != 0 ]] ; then
       Problems=1
    fi
+   if [[ -f /Library/StartupItems/rEFItBlesser ]] ; then
+      echo
+      echo "/Library/StartupItems/rEFItBlesser file found!"
+      echo "This program is part of rEFIt, and will cause rEFInd to fail to work after"
+      echo -n "its first boot. Do you want to remove rEFItBlesser (Y/N)? "
+      read YesNo
+      if [[ $YesNo == "Y" || $YesNo == "y" ]] ; then
+         echo "Deleting /Library/StartupItems/rEFItBlesser..."
+        rm /Library/StartupItems/rEFItBlesser
+      else
+         echo "Not deleting rEFItBlesser."
+      fi
+   fi
    echo
    echo "WARNING: If you have an Advanced Format disk, *DO NOT* attempt to check the"
    echo "bless status with 'bless --info', since this is known to cause disk corruption"
index 6a2b3c5816456030bb3fb17fc7f23cd62b7bb8dd..498db619b4f899d78cc5f8ba4af1ad17b3729e2d 100644 (file)
@@ -118,7 +118,7 @@ VOID egDrawImageArea(IN EG_IMAGE *Image,
                      IN UINTN AreaPosX, IN UINTN AreaPosY,
                      IN UINTN AreaWidth, IN UINTN AreaHeight,
                      IN UINTN ScreenPosX, IN UINTN ScreenPosY);
-
+VOID egDisplayMessage(IN CHAR16 *Text, EG_PIXEL *BGColor);
 VOID egScreenShot(VOID);
 
 
index a183578570be45b40a9922854682bb037d693451..fd441febe9e5821d439a9f473786b31c167b9694 100644 (file)
@@ -39,7 +39,6 @@
 #include "refit_call_wrapper.h"
 
 #include <efiUgaDraw.h>
-/* #include <efiGraphicsOutput.h> */
 #include <efiConsoleControl.h>
 
 // Console defines and variables
@@ -253,7 +252,7 @@ VOID egDrawImage(IN EG_IMAGE *Image, IN UINTN ScreenPosX, IN UINTN ScreenPosY)
         Image->HasAlpha = FALSE;
         egSetPlane(PLPTR(Image, a), 0, Image->Width * Image->Height);
     }
-    
+
     if (GraphicsOutput != NULL) {
         refit_call10_wrapper(GraphicsOutput->Blt, GraphicsOutput, (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *)Image->PixelData, EfiBltBufferToVideo,
                             0, 0, ScreenPosX, ScreenPosY, Image->Width, Image->Height, 0);
@@ -270,16 +269,16 @@ VOID egDrawImageArea(IN EG_IMAGE *Image,
 {
     if (!egHasGraphics)
         return;
-    
+
     egRestrictImageArea(Image, AreaPosX, AreaPosY, &AreaWidth, &AreaHeight);
     if (AreaWidth == 0)
         return;
-    
+
     if (Image->HasAlpha) {
         Image->HasAlpha = FALSE;
         egSetPlane(PLPTR(Image, a), 0, Image->Width * Image->Height);
     }
-    
+
     if (GraphicsOutput != NULL) {
         refit_call10_wrapper(GraphicsOutput->Blt, GraphicsOutput, (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *)Image->PixelData, EfiBltBufferToVideo,
                             AreaPosX, AreaPosY, ScreenPosX, ScreenPosY, AreaWidth, AreaHeight, Image->Width * 4);
@@ -289,6 +288,24 @@ VOID egDrawImageArea(IN EG_IMAGE *Image,
     }
 }
 
+// Display a message in the center of the screen, surrounded by a box of the
+// specified color. For the moment, uses graphics calls only. (It still works
+// in text mode on GOP/UEFI systems, but not on UGA/EFI 1.x systems.)
+VOID egDisplayMessage(IN CHAR16 *Text, EG_PIXEL *BGColor) {
+   UINTN BoxWidth, BoxHeight;
+   EG_IMAGE *Box;
+
+   if ((Text != NULL) && (BGColor != NULL)) {
+      BoxWidth = (StrLen(Text) + 2) * FONT_CELL_WIDTH;
+      if (BoxWidth > egScreenWidth)
+         BoxWidth = egScreenWidth;
+      BoxHeight = 2 * FONT_CELL_HEIGHT;
+      Box = egCreateFilledImage(BoxWidth, BoxHeight, FALSE, BGColor);
+      egRenderText(Text, Box, FONT_CELL_WIDTH, FONT_CELL_HEIGHT / 2);
+      egDrawImage(Box, (egScreenWidth - BoxWidth) / 2, (egScreenHeight - BoxHeight) / 2);
+   } // if non-NULL inputs
+} // VOID egDisplayMessage()
+
 //
 // Make a screenshot
 //
@@ -300,17 +317,17 @@ VOID egScreenShot(VOID)
     UINT8           *FileData;
     UINTN           FileDataLength;
     UINTN           Index;
-    
+
     if (!egHasGraphics)
         return;
-    
+
     // allocate a buffer for the whole screen
     Image = egCreateImage(egScreenWidth, egScreenHeight, FALSE);
     if (Image == NULL) {
         Print(L"Error egCreateImage returned NULL\n");
         goto bailout_wait;
     }
-    
+
     // get full screen image
     if (GraphicsOutput != NULL) {
         refit_call10_wrapper(GraphicsOutput->Blt, GraphicsOutput, (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *)Image->PixelData, EfiBltVideoToBltBuffer,
@@ -319,7 +336,7 @@ VOID egScreenShot(VOID)
         refit_call10_wrapper(UgaDraw->Blt, UgaDraw, (EFI_UGA_PIXEL *)Image->PixelData, EfiUgaVideoToBltBuffer,
                      0, 0, 0, 0, Image->Width, Image->Height, 0);
     }
-    
+
     // encode as BMP
     egEncodeBMP(Image, &FileData, &FileDataLength);
     egFreeImage(Image);
@@ -327,7 +344,7 @@ VOID egScreenShot(VOID)
         Print(L"Error egEncodeBMP returned NULL\n");
         goto bailout_wait;
     }
-    
+
     // save to file on the ESP
     Status = egSaveFile(NULL, L"screenshot.bmp", FileData, FileDataLength);
     FreePool(FileData);
@@ -335,9 +352,9 @@ VOID egScreenShot(VOID)
         Print(L"Error egSaveFile: %x\n", Status);
         goto bailout_wait;
     }
-    
+
     return;
-    
+
     // DEBUG: switch to text mode
 bailout_wait:
     egSetGraphicsModeEnabled(FALSE);
index a59e8cb2287d1f5e09332d8b91b65ea22dd295fd..d84eeb7de3ca3c7e13816af6e458512acc104e26 100644 (file)
@@ -35,6 +35,7 @@
  */
 
 #include "libegint.h"
+//#include "../refind/screen.h"
 
 #include "egemb_font.h"
 #define FONT_CELL_WIDTH (7)
@@ -61,7 +62,7 @@ VOID egRenderText(IN CHAR16 *Text, IN OUT EG_IMAGE *CompImage, IN UINTN PosX, IN
     UINTN           BufferLineOffset, FontLineOffset;
     UINTN           TextLength;
     UINTN           i, c;
-    
+
     // clip the text
     TextLength = StrLen(Text);
     if (TextLength * FONT_CELL_WIDTH + PosX > CompImage->Width)
@@ -70,7 +71,7 @@ VOID egRenderText(IN CHAR16 *Text, IN OUT EG_IMAGE *CompImage, IN UINTN PosX, IN
     // load the font
     if (FontImage == NULL)
         FontImage = egPrepareEmbeddedImage(&egemb_font, TRUE);
-    
+
     // render it
     BufferPtr = CompImage->PixelData;
     BufferLineOffset = CompImage->Width;
index 8dd041e843bcaef0db470d9637e80d43c936a62f..1e4dfd1286c5d4253bbb72c4150bbccee54d2907 100644 (file)
@@ -106,7 +106,7 @@ static VOID AboutrEFInd(VOID)
 {
     if (AboutMenu.EntryCount == 0) {
         AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT);
-        AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.4.0");
+        AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.4.1");
         AddMenuInfoLine(&AboutMenu, L"");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer");
         AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012 Roderick W. Smith");
@@ -156,6 +156,8 @@ static EFI_STATUS StartEFIImageList(IN EFI_DEVICE_PATH **DevicePaths,
     // load the image into memory
     ReturnStatus = Status = EFI_NOT_FOUND;  // in case the list is empty
     for (DevicePathIndex = 0; DevicePaths[DevicePathIndex] != NULL; DevicePathIndex++) {
+//        Print(L"About to try loading '%s' from '%s'\n", ImageTitle, DevicePathToStr(DevicePaths[DevicePathIndex]));
+//        PauseForKey();
         ReturnStatus = Status = refit_call6_wrapper(BS->LoadImage, FALSE, SelfImageHandle, DevicePaths[DevicePathIndex], NULL, 0, &ChildImageHandle);
         if (ReturnStatus != EFI_NOT_FOUND)
             break;
@@ -350,9 +352,6 @@ static REFIT_MENU_ENTRY* CopyMenuEntry(REFIT_MENU_ENTRY *Entry) {
       }
       if (Entry->SubScreen != NULL) {
          NewEntry->SubScreen = CopyMenuScreen(Entry->SubScreen);
-//          NewEntry->SubScreen = AllocatePool(sizeof(REFIT_MENU_SCREEN));
-//          if (NewEntry->SubScreen != NULL)
-//             CopyMem(NewEntry->SubScreen, Entry->SubScreen, sizeof(REFIT_MENU_SCREEN));
       }
    } // if
    return (NewEntry);
@@ -788,7 +787,7 @@ static VOID ScanLoaderDir(IN REFIT_VOLUME *Volume, IN CHAR16 *Path, IN CHAR16 *P
     CHAR16                  FileName[256], *Extension;
     struct LOADER_LIST      *LoaderList = NULL, *NewLoader;
 
-    if (!SelfDirPath || !Path || ((StriCmp(Path, SelfDirPath) == 0) && Volume != SelfVolume) ||
+    if (!SelfDirPath || !Path || ((StriCmp(Path, SelfDirPath) == 0) && Volume->DeviceHandle != SelfVolume->DeviceHandle) ||
         (StriCmp(Path, SelfDirPath) != 0)) {
        // look through contents of the directory
        DirIterOpen(Volume->RootDir, Path, &DirIter);
@@ -1494,10 +1493,28 @@ static VOID ScanForTools(VOID) {
    } // for
 } // static VOID ScanForTools
 
+// Rescan for boot loaders
+VOID RescanAll(VOID) {
+   EG_PIXEL           BGColor;
+
+   BGColor.b = 255;
+   BGColor.g = 175;
+   BGColor.r = 100;
+   BGColor.a = 0;
+   egDisplayMessage(L"Scanning for new boot loaders; please wait....", &BGColor);
+   FreeList((VOID ***) &(MainMenu.Entries), &MainMenu.EntryCount);
+   MainMenu.Entries = NULL;
+   MainMenu.EntryCount = 0;
+   ReadConfig();
+   ConnectAllDriversToAllControllers();
+   ScanForBootloaders();
+   ScanForTools();
+   SetupScreen();
+} // VOID RescanAll()
+
 //
 // main entry point
 //
-
 EFI_STATUS
 EFIAPI
 efi_main (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
@@ -1533,16 +1550,9 @@ efi_main (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
     while (MainLoopRunning) {
         MenuExit = RunMainMenu(&MainMenu, Selection, &ChosenEntry);
 
-        // We don't allow exiting the main menu with the Escape key.
+        // The Escape key triggers a re-scan operation....
         if (MenuExit == MENU_EXIT_ESCAPE) {
-            FreeList((VOID ***) &(MainMenu.Entries), &MainMenu.EntryCount);
-            MainMenu.Entries = NULL;
-            MainMenu.EntryCount = 0;
-            ReadConfig();
-            ConnectAllDriversToAllControllers();
-            ScanForBootloaders();
-            ScanForTools();
-            SetupScreen();
+            RescanAll();
             continue;
         }
 
index a5628c089d3de8b61598eed7fecd06da49cb1567..0ad950fd5f07f3b56808598cf152e2195cedf64d 100644 (file)
@@ -208,7 +208,7 @@ VOID TerminateScreen(VOID)
     // clear text screen
     refit_call2_wrapper(ST->ConOut->SetAttribute, ST->ConOut, ATTR_BASIC);
     refit_call1_wrapper(ST->ConOut->ClearScreen, ST->ConOut);
-    
+
     // enable cursor
     refit_call2_wrapper(ST->ConOut->EnableCursor, ST->ConOut, TRUE);
 }
@@ -262,9 +262,9 @@ static BOOLEAN ReadAllKeyStrokes(VOID)
 VOID PauseForKey(VOID)
 {
     UINTN index;
-    
+
     Print(L"\n* Hit any key to continue *");
-    
+
     if (ReadAllKeyStrokes()) {  // remove buffered key strokes
         refit_call1_wrapper(BS->Stall, 5000000);     // 5 seconds delay
         ReadAllKeyStrokes();    // empty the buffer again
@@ -385,11 +385,11 @@ VOID BltImage(IN EG_IMAGE *Image, IN UINTN XPos, IN UINTN YPos)
 VOID BltImageAlpha(IN EG_IMAGE *Image, IN UINTN XPos, IN UINTN YPos, IN EG_PIXEL *BackgroundPixel)
 {
     EG_IMAGE *CompImage;
-    
+
     // compose on background
     CompImage = egCreateFilledImage(Image->Width, Image->Height, FALSE, BackgroundPixel);
     egComposeImage(CompImage, Image, 0, 0);
-    
+
     // blit to screen and clean up
     egDrawImage(CompImage, XPos, YPos);
     egFreeImage(CompImage);
@@ -416,7 +416,7 @@ VOID BltImageAlpha(IN EG_IMAGE *Image, IN UINTN XPos, IN UINTN YPos, IN EG_PIXEL
 //         CompHeight = TotalHeight;
 //     OffsetY = (TotalHeight - CompHeight) >> 1;
 //     egComposeImage(CompImage, TopImage, OffsetX, OffsetY);
-//     
+//
 //     // blit to screen and clean up
 //     egDrawImage(CompImage, XPos, YPos);
 //     egFreeImage(CompImage);
@@ -447,7 +447,7 @@ VOID BltImageCompositeBadge(IN EG_IMAGE *BaseImage, IN EG_IMAGE *TopImage, IN EG
          OffsetY = (TotalHeight - CompHeight) >> 1;
          egComposeImage(CompImage, TopImage, OffsetX, OffsetY);
      }
-      
+
      // place the badge image
      if (BadgeImage != NULL && CompImage != NULL && (BadgeImage->Width + 8) < CompWidth && (BadgeImage->Height + 8) < CompHeight) {
          OffsetX += CompWidth  - 8 - BadgeImage->Width;