diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2008-09-18 09:43:31 +0000 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2008-09-18 09:43:31 +0000 |
commit | 35cc272d0742cdc5838bfed3f86ee73386f30f7f (patch) | |
tree | 5aaedc312871fa993ec88b19fc8134c105c2224f /pkgs/tools/misc/grub/symlink.patch | |
parent | 74669a825ca3bfb8b36e7f3d02148da8075e7c1e (diff) | |
download | nixpkgs-35cc272d0742cdc5838bfed3f86ee73386f30f7f.tar nixpkgs-35cc272d0742cdc5838bfed3f86ee73386f30f7f.tar.gz nixpkgs-35cc272d0742cdc5838bfed3f86ee73386f30f7f.tar.bz2 nixpkgs-35cc272d0742cdc5838bfed3f86ee73386f30f7f.tar.lz nixpkgs-35cc272d0742cdc5838bfed3f86ee73386f30f7f.tar.xz nixpkgs-35cc272d0742cdc5838bfed3f86ee73386f30f7f.tar.zst nixpkgs-35cc272d0742cdc5838bfed3f86ee73386f30f7f.zip |
* Handle symlinks such as /dev/disk/by-label/bla. Previously
Grub installation barfed. svn path=/nixpkgs/trunk/; revision=12877
Diffstat (limited to 'pkgs/tools/misc/grub/symlink.patch')
-rw-r--r-- | pkgs/tools/misc/grub/symlink.patch | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/pkgs/tools/misc/grub/symlink.patch b/pkgs/tools/misc/grub/symlink.patch new file mode 100644 index 00000000000..ac38be04618 --- /dev/null +++ b/pkgs/tools/misc/grub/symlink.patch @@ -0,0 +1,37 @@ +diff -rc grub-0.97-orig/util/grub-install.in grub-0.97/util/grub-install.in +*** grub-0.97-orig/util/grub-install.in 2008-09-18 11:32:13.000000000 +0200 +--- grub-0.97/util/grub-install.in 2008-09-18 11:36:40.000000000 +0200 +*************** +*** 194,217 **** + # Usage: resolve_symlink file + # Find the real file/device that file points at + resolve_symlink () { +! tmp_fname=$1 +! # Resolve symlinks +! while test -L $tmp_fname; do +! tmp_new_fname=`ls -al $tmp_fname | sed -n 's%.*-> \(.*\)%\1%p'` +! if test -z "$tmp_new_fname"; then +! echo "Unrecognized ls output" 2>&1 +! exit 1 +! fi +! +! # Convert relative symlinks +! case $tmp_new_fname in +! /*) tmp_fname="$tmp_new_fname" +! ;; +! *) tmp_fname="`echo $tmp_fname | sed 's%/[^/]*$%%'`/$tmp_new_fname" +! ;; +! esac +! done +! echo "$tmp_fname" + } + + # Usage: find_device file +--- 194,200 ---- + # Usage: resolve_symlink file + # Find the real file/device that file points at + resolve_symlink () { +! readlink -f $1 + } + + # Usage: find_device file |