[grub] Add symbolic link support for the uefi filesystem (mjg59)

Peter Jones pjones at fedoraproject.org
Mon Apr 16 20:53:27 UTC 2012


commit 883b65acf8f60809ced00c51851f01d9f2f921f5
Author: Peter Jones <pjones at redhat.com>
Date:   Mon Apr 16 16:53:17 2012 -0400

    Add symbolic link support for the uefi filesystem (mjg59)

 grub-fedora-18.patch |   44 +++++++++++++++++++++++++++++++++++++++-----
 grub.spec            |    5 ++++-
 2 files changed, 43 insertions(+), 6 deletions(-)
---
diff --git a/grub-fedora-18.patch b/grub-fedora-18.patch
index 2e1400b..db4fb35 100644
--- a/grub-fedora-18.patch
+++ b/grub-fedora-18.patch
@@ -1,5 +1,5 @@
 From: Peter Jones <pjones at redhat.com>" 
-Date: Fri Apr 13 17:09:54 EDT 2012
+Date: Mon Apr 16 16:52:38 EDT 2012
 Subject: [PATCH] Changes from grub-0.97 to master
 
 This patch is a bundle of the changes between grub-0.97 and master.
@@ -127,7 +127,7 @@ git diff grub-0.97 master
  stage2/fsys_jfs.c              |   12 
  stage2/fsys_minix.c            |   10 
  stage2/fsys_reiserfs.c         |   44 
- stage2/fsys_uefi.c             |  231 +
+ stage2/fsys_uefi.c             |  265 +
  stage2/fsys_vstafs.c           |   28 
  stage2/fsys_xfs.c              |   22 
  stage2/gpt.h                   |   69 
@@ -153,7 +153,7 @@ git diff grub-0.97 master
  util/Makefile.in               |  478 --
  util/grub-crypt.in             |   80 
  util/grub-install.in           |  334 +
- 142 files changed, 26279 insertions(+), 17652 deletions(-)
+ 142 files changed, 26313 insertions(+), 17652 deletions(-)
 
 diff --git a/.gitignore b/.gitignore
 new file mode 100644
@@ -43892,10 +43892,10 @@ index 93ec5f8..f46fcb2 100644
  }
 diff --git a/stage2/fsys_uefi.c b/stage2/fsys_uefi.c
 new file mode 100644
-index 0000000..ecdb30f
+index 0000000..58b7050
 --- /dev/null
 +++ b/stage2/fsys_uefi.c
-@@ -0,0 +1,231 @@
+@@ -0,0 +1,265 @@
 +/*
 + *  GRUB  --  GRand Unified Bootloader
 + *  Copyright (C) 2001   Free Software Foundation, Inc.
@@ -44027,6 +44027,7 @@ index 0000000..ecdb30f
 +      grub_printf(" ");
 +    }
 +  } else {
++    char *data = NULL;
 +    dir_name_w = grub_malloc (2 * dirlen + 2);
 +    if (!dir_name_w)
 +      goto done;
@@ -44072,6 +44073,39 @@ index 0000000..ecdb30f
 +	break;
 +    }
 +
++    if (fileinfo->filesize < 256 && fileinfo->filesize > 3)
++      {
++	data = grub_malloc(fileinfo->filesize);
++	filepos = 0;
++
++	uefi_read(data, fileinfo->filesize);
++
++	/*
++	 * UEFI doesn't really support symlinks. Apple's UEFI driver exposes
++	 * them as files containing the path of the target. This provides
++	 * hacky support in the absence of a real driver.
++	 */
++	if (data[0] == '.' && data[1] == '.' && data[2] == '/')
++	  {
++	    int j;
++	    char *tmpdir = grub_malloc(dirlen + fileinfo->filesize);
++
++	    for (j=0; j<dirlen+1; j++)
++	      tmpdir[j] = dirname[j];
++	    for (j=0; j<fileinfo->filesize; j++)
++	      tmpdir[j+dirlen+1] = data[j];
++	    tmpdir[j+dirlen+1] = '\0';
++
++	    /* Open the new file */
++	    ret = uefi_dir(tmpdir);
++	    grub_free (tmpdir);
++	    grub_free (data);
++	    goto done;
++	  }
++      }
++
++    if (data)
++      grub_free(data);
 +    ret = 1;
 +    filemax = fileinfo->filesize;
 +    filepos = 0;
diff --git a/grub.spec b/grub.spec
index 26e2e93..9e2886f 100644
--- a/grub.spec
+++ b/grub.spec
@@ -1,6 +1,6 @@
 Name: grub
 Version: 0.97
-Release: 89%{?dist}
+Release: 90%{?dist}
 Epoch: 1
 Summary: Grand Unified Boot Loader.
 Group: System Environment/Base
@@ -120,6 +120,9 @@ fi
 /sbin/grub-crypt
 
 %changelog
+* Mon Apr 16 2012 Peter Jones <pjones at redhat.com> - 0.97-90
+- Add symbolic link support for the uefi filesystem (mjg59)
+
 * Fri Apr 13 2012 Peter Jones <pjones at redhat.com> - 0.97-89
 - Workaround Apple CD oddities (mjg59)
 


More information about the scm-commits mailing list