]> code.delx.au - refind/commitdiff
Sort Fedora's rescue kernel (vmlinuz-0-rescue*) to the end of the list
authorsrs5694 <srs5694@users.sourceforge.net>
Thu, 10 Dec 2015 02:25:21 +0000 (21:25 -0500)
committersrs5694 <srs5694@users.sourceforge.net>
Thu, 10 Dec 2015 02:25:21 +0000 (21:25 -0500)
to keep it from becoming the default when kernel folding is enabled.

Makefile
NEWS.txt
debian/changelog
refind/main.c

index 829d1a62b022d883cda8f966269e3b40ce1c1462..c7d97995aabb606d8381683d430ba539ddc652bc 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -12,7 +12,7 @@ MOK_DIR=mok
 GPTSYNC_DIR=gptsync
 EFILIB_DIR=EfiLib
 export EDK2BASE=/usr/local/UDK2014/MyWorkSpace
-export REFIND_VERSION='L"0.10.0.13"'
+export REFIND_VERSION='L"0.10.0.14"'
 
 # The "all" target builds with the TianoCore library if possible, but falls
 # back on the more easily-installed GNU-EFI library if TianoCore isn't
index 0beac951e670df70ede9714badd48ef779100127..81d43bb41bc2fe0f95b4871eca6b5a68b27ae389 100644 (file)
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -1,14 +1,22 @@
 0.10.1 (??/??/201?):
 --------------------
 
+- Modified time-based sorting of loaders in a single directory to push
+  anything starting with "vmlinuz-0-rescue" to the end of the list. Fedora
+  gives its rescue kernels filenames that begin with that string, and if
+  such a kernel happens to be the most recent, treating it normally will
+  cause it to become the default when kernel folding is in use. This is
+  almost certainly undesirable, so this change keeps the rescue kernel at
+  the end of the list instead, which is saner.
+
 - Significantly reworked the project's Makefiles. This should have no
   impact on ordinary users, and even most developers should barely notice
   it; but it should make future extensions to additional platforms or
   building in different environments easier.
 
 - Added workaround to gptsync for issue with some Macs' EFIs that caused
-  the program to skip through all prompts accepting the default option.
-  This would normally cause gptsync to do nothing.
+  the program to skip through all prompts, thus accepting the default
+  option. This would normally cause gptsync to do nothing.
 
 - Added type code 53746F72-6167-11AA-AA11-00306543ECAC (Apple Core Storage,
   gdisk type AF05) to list of partition types recognized by gptsync.
index afdd6143d15a440476d2bd37a54b110a7a9bd5d8..daaa9d47c4bc4038044fae9d2a9d9bf973b40aad 100644 (file)
@@ -1,4 +1,4 @@
-refind (0.10.0.12-0ppa1) wily; urgency=medium
+refind (0.10.0.14-0ppa1) wily; urgency=medium
 
   * Version bump
 
index 6b574edf1c4eca99dfe2b38d9dcc2cba8eb02e9e..36cf2029a9791a4794cbbf0a5ea5e6b46b6f6f7b 100644 (file)
@@ -1177,16 +1177,22 @@ INTN TimeComp(IN EFI_TIME *Time1, IN EFI_TIME *Time2) {
     return 0;
 } // INTN TimeComp()
 
-// Adds a loader list element, keeping it sorted by date. Returns the new
-// first element (the one with the most recent date).
+// Adds a loader list element, keeping it sorted by date. EXCEPTION: Fedora's rescue
+// kernel, which begins with "vmlinuz-0-rescue," should not be at the top of the list,
+// since that will make it the default if kernel folding is enabled, so float it to
+// the end.
+// Returns the new first element (the one with the most recent date).
 static struct LOADER_LIST * AddLoaderListEntry(struct LOADER_LIST *LoaderList, struct LOADER_LIST *NewEntry) {
     struct LOADER_LIST *LatestEntry, *CurrentEntry, *PrevEntry = NULL;
+    BOOLEAN LinuxRescue = FALSE;
 
     LatestEntry = CurrentEntry = LoaderList;
     if (LoaderList == NULL) {
         LatestEntry = NewEntry;
     } else {
-        while ((CurrentEntry != NULL) && (TimeComp(&(NewEntry->TimeStamp), &(CurrentEntry->TimeStamp)) < 0)) {
+        if (StriSubCmp(L"vmlinuz-0-rescue", NewEntry->FileName))
+            LinuxRescue = TRUE;
+        while ((CurrentEntry != NULL) && (LinuxRescue || (TimeComp(&(NewEntry->TimeStamp), &(CurrentEntry->TimeStamp)) < 0))) {
             PrevEntry = CurrentEntry;
             CurrentEntry = CurrentEntry->NextEntry;
         } // while