2008-01-12 Robert Millan <rmh@aybabtu.com>
* include/grub/util/getroot.h (grub_dev_abstraction_types): New enum.
        (grub_util_get_dev_abstraction): New function prototype.
        * util/getroot.c: Include `<grub/util/getroot.h>'
        (grub_util_get_grub_dev): Move detection of abstraction type to ...
        (grub_util_get_dev_abstraction): ... here (new function).
        * util/grub-probe.c: Convert PRINT_* to an enum.  Add
        `PRINT_ABSTRACTION'.
        (probe): Probe for abstraction type when requested.
        (main): Understand `--target=abstraction'.
        * util/i386/efi/grub-install.in: Add abstraction module to core
        image when it is found to be necessary.
        * util/i386/pc/grub-install.in: Likewise.
        * util/powerpc/ieee1275/grub-install.in: Likewise.
        * util/update-grub_lib.in (font_path): Return system path without
        converting to GRUB path.
        * util/update-grub.in: Convert system path returned by font_path()
        to a GRUB path.  Use `grub-probe -t abstraction' to determine what
        abstraction module is needed for loading fonts (if any).  Export
        that as `GRUB_PRELOAD_MODULES'.
        * util/grub.d/00_header.in: Process `GRUB_PRELOAD_MODULES' (print
        insmod commands).
			
			
This commit is contained in:
		
							parent
							
								
									52bd3de956
								
							
						
					
					
						commit
						1eb8c80241
					
				
					 10 changed files with 135 additions and 43 deletions
				
			
		
							
								
								
									
										28
									
								
								ChangeLog
									
										
									
									
									
								
							
							
						
						
									
										28
									
								
								ChangeLog
									
										
									
									
									
								
							|  | @ -1,3 +1,31 @@ | ||||||
|  | 2008-01-12  Robert Millan  <rmh@aybabtu.com> | ||||||
|  | 
 | ||||||
|  | 	* include/grub/util/getroot.h (grub_dev_abstraction_types): New enum. | ||||||
|  | 	(grub_util_get_dev_abstraction): New function prototype. | ||||||
|  | 
 | ||||||
|  | 	* util/getroot.c: Include `<grub/util/getroot.h>' | ||||||
|  | 	(grub_util_get_grub_dev): Move detection of abstraction type to ... | ||||||
|  | 	(grub_util_get_dev_abstraction): ... here (new function). | ||||||
|  | 
 | ||||||
|  | 	* util/grub-probe.c: Convert PRINT_* to an enum.  Add | ||||||
|  | 	`PRINT_ABSTRACTION'. | ||||||
|  | 	(probe): Probe for abstraction type when requested. | ||||||
|  | 	(main): Understand `--target=abstraction'. | ||||||
|  | 
 | ||||||
|  | 	* util/i386/efi/grub-install.in: Add abstraction module to core | ||||||
|  | 	image when it is found to be necessary. | ||||||
|  | 	* util/i386/pc/grub-install.in: Likewise. | ||||||
|  | 	* util/powerpc/ieee1275/grub-install.in: Likewise. | ||||||
|  | 
 | ||||||
|  | 	* util/update-grub_lib.in (font_path): Return system path without | ||||||
|  | 	converting to GRUB path. | ||||||
|  | 	* util/update-grub.in: Convert system path returned by font_path() | ||||||
|  | 	to a GRUB path.  Use `grub-probe -t abstraction' to determine what | ||||||
|  | 	abstraction module is needed for loading fonts (if any).  Export | ||||||
|  | 	that as `GRUB_PRELOAD_MODULES'. | ||||||
|  | 	* util/grub.d/00_header.in: Process `GRUB_PRELOAD_MODULES' (print | ||||||
|  | 	insmod commands). | ||||||
|  | 
 | ||||||
| 2008-01-12  Yoshinori K. Okuji  <okuji@enbug.org> | 2008-01-12  Yoshinori K. Okuji  <okuji@enbug.org> | ||||||
| 
 | 
 | ||||||
| 	Remove some unused code from reiserfs. | 	Remove some unused code from reiserfs. | ||||||
|  |  | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| /*
 | /*
 | ||||||
|  *  GRUB  --  GRand Unified Bootloader |  *  GRUB  --  GRand Unified Bootloader | ||||||
|  *  Copyright (C) 2003, 2007  Free Software Foundation, Inc. |  *  Copyright (C) 2003, 2007, 2008  Free Software Foundation, Inc. | ||||||
|  * |  * | ||||||
|  *  GRUB is free software: you can redistribute it and/or modify |  *  GRUB is free software: you can redistribute it and/or modify | ||||||
|  *  it under the terms of the GNU General Public License as published by |  *  it under the terms of the GNU General Public License as published by | ||||||
|  | @ -19,8 +19,15 @@ | ||||||
| #ifndef GRUB_UTIL_GETROOT_HEADER | #ifndef GRUB_UTIL_GETROOT_HEADER | ||||||
| #define GRUB_UTIL_GETROOT_HEADER	1 | #define GRUB_UTIL_GETROOT_HEADER	1 | ||||||
| 
 | 
 | ||||||
|  | enum grub_dev_abstraction_types { | ||||||
|  |   GRUB_DEV_ABSTRACTION_NONE, | ||||||
|  |   GRUB_DEV_ABSTRACTION_LVM, | ||||||
|  |   GRUB_DEV_ABSTRACTION_RAID, | ||||||
|  | }; | ||||||
|  | 
 | ||||||
| char *grub_guess_root_device (const char *dir); | char *grub_guess_root_device (const char *dir); | ||||||
| char *grub_get_prefix (const char *dir); | char *grub_get_prefix (const char *dir); | ||||||
|  | int grub_util_get_dev_abstraction (const char *os_dev); | ||||||
| char *grub_util_get_grub_dev (const char *os_dev); | char *grub_util_get_grub_dev (const char *os_dev); | ||||||
| 
 | 
 | ||||||
| #endif /* ! GRUB_UTIL_GETROOT_HEADER */ | #endif /* ! GRUB_UTIL_GETROOT_HEADER */ | ||||||
|  |  | ||||||
|  | @ -1,7 +1,7 @@ | ||||||
| /* getroot.c - Get root device */ | /* getroot.c - Get root device */ | ||||||
| /*
 | /*
 | ||||||
|  *  GRUB  --  GRand Unified Bootloader |  *  GRUB  --  GRand Unified Bootloader | ||||||
|  *  Copyright (C) 1999,2000,2001,2002,2003,2006,2007  Free Software Foundation, Inc. |  *  Copyright (C) 1999,2000,2001,2002,2003,2006,2007,2008  Free Software Foundation, Inc. | ||||||
|  * |  * | ||||||
|  *  GRUB is free software: you can redistribute it and/or modify |  *  GRUB is free software: you can redistribute it and/or modify | ||||||
|  *  it under the terms of the GNU General Public License as published by |  *  it under the terms of the GNU General Public License as published by | ||||||
|  | @ -24,6 +24,7 @@ | ||||||
| 
 | 
 | ||||||
| #include <grub/util/misc.h> | #include <grub/util/misc.h> | ||||||
| #include <grub/util/biosdisk.h> | #include <grub/util/biosdisk.h> | ||||||
|  | #include <grub/util/getroot.h> | ||||||
| 
 | 
 | ||||||
| static void | static void | ||||||
| strip_extra_slashes (char *dir) | strip_extra_slashes (char *dir) | ||||||
|  | @ -239,27 +240,42 @@ grub_guess_root_device (const char *dir) | ||||||
|   return os_dev; |   return os_dev; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| char * | int | ||||||
| grub_util_get_grub_dev (const char *os_dev) | grub_util_get_dev_abstraction (const char *os_dev) | ||||||
| { | { | ||||||
|   /* Check for LVM.  */ |   /* Check for LVM.  */ | ||||||
|   if (!strncmp (os_dev, "/dev/mapper/", 12)) |   if (!strncmp (os_dev, "/dev/mapper/", 12)) | ||||||
|     { |     return GRUB_DEV_ABSTRACTION_LVM; | ||||||
|       char *grub_dev = xmalloc (strlen (os_dev) - 12 + 1); |  | ||||||
| 
 |  | ||||||
|       strcpy (grub_dev, os_dev+12); |  | ||||||
| 
 |  | ||||||
|       return grub_dev; |  | ||||||
|     } |  | ||||||
| 
 | 
 | ||||||
|   /* Check for RAID.  */ |   /* Check for RAID.  */ | ||||||
|   if (!strncmp (os_dev, "/dev/md", 7)) |   if (!strncmp (os_dev, "/dev/md", 7)) | ||||||
|  |     return GRUB_DEV_ABSTRACTION_RAID; | ||||||
|  | 
 | ||||||
|  |   /* No abstraction found.  */ | ||||||
|  |   return GRUB_DEV_ABSTRACTION_NONE; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | char * | ||||||
|  | grub_util_get_grub_dev (const char *os_dev) | ||||||
| { | { | ||||||
|       const char *p; |   char *grub_dev; | ||||||
|       char *grub_dev = xmalloc (20); | 
 | ||||||
|  |   switch (grub_util_get_dev_abstraction (os_dev)) | ||||||
|  |     { | ||||||
|  |     case GRUB_DEV_ABSTRACTION_LVM: | ||||||
|  |       grub_dev = xmalloc (strlen (os_dev) - 12 + 1); | ||||||
|  | 
 | ||||||
|  |       strcpy (grub_dev, os_dev + 12); | ||||||
|  | 
 | ||||||
|  |       break; | ||||||
|  | 
 | ||||||
|  |     case GRUB_DEV_ABSTRACTION_RAID: | ||||||
|  |       grub_dev = xmalloc (20); | ||||||
| 
 | 
 | ||||||
|       if (os_dev[7] == '_' && os_dev[8] == 'd') |       if (os_dev[7] == '_' && os_dev[8] == 'd') | ||||||
| 	{ | 	{ | ||||||
|  | 	  const char *p; | ||||||
|  | 
 | ||||||
| 	  /* This a partitionable RAID device of the form /dev/md_dNNpMM. */ | 	  /* This a partitionable RAID device of the form /dev/md_dNNpMM. */ | ||||||
| 	  int i; | 	  int i; | ||||||
| 
 | 
 | ||||||
|  | @ -297,17 +313,17 @@ grub_util_get_grub_dev (const char *os_dev) | ||||||
| 	} | 	} | ||||||
|       else if (os_dev[7] >= '0' && os_dev[7] <= '9') |       else if (os_dev[7] >= '0' && os_dev[7] <= '9') | ||||||
| 	{ | 	{ | ||||||
| 	  p = os_dev + 5; | 	  memcpy (grub_dev, os_dev + 5, 7); | ||||||
| 	  memcpy (grub_dev, p, 7); |  | ||||||
| 	  grub_dev[7] = '\0'; | 	  grub_dev[7] = '\0'; | ||||||
| 	} | 	} | ||||||
|       else |       else | ||||||
| 	grub_util_error ("Unknown kind of RAID device `%s'", os_dev); | 	grub_util_error ("Unknown kind of RAID device `%s'", os_dev); | ||||||
| 
 | 
 | ||||||
|  |       break; | ||||||
|  | 
 | ||||||
|  |     default:  /* GRUB_DEV_ABSTRACTION_NONE */ | ||||||
|  |       grub_dev = grub_util_biosdisk_get_grub_dev (os_dev); | ||||||
|  |     } | ||||||
| 
 | 
 | ||||||
|   return grub_dev; |   return grub_dev; | ||||||
| } | } | ||||||
| 
 |  | ||||||
|   /* If it's not RAID or LVM, it should be a biosdisk.  */ |  | ||||||
|   return grub_util_biosdisk_get_grub_dev (os_dev); |  | ||||||
| } |  | ||||||
|  |  | ||||||
|  | @ -1,7 +1,7 @@ | ||||||
| /* grub-probe.c - probe device information for a given path */ | /* grub-probe.c - probe device information for a given path */ | ||||||
| /*
 | /*
 | ||||||
|  *  GRUB  --  GRand Unified Bootloader |  *  GRUB  --  GRand Unified Bootloader | ||||||
|  *  Copyright (C) 2005,2006,2007 Free Software Foundation, Inc. |  *  Copyright (C) 2005,2006,2007,2008 Free Software Foundation, Inc. | ||||||
|  * |  * | ||||||
|  *  GRUB is free software: you can redistribute it and/or modify |  *  GRUB is free software: you can redistribute it and/or modify | ||||||
|  *  it under the terms of the GNU General Public License as published by |  *  it under the terms of the GNU General Public License as published by | ||||||
|  | @ -39,10 +39,13 @@ | ||||||
| #define _GNU_SOURCE	1 | #define _GNU_SOURCE	1 | ||||||
| #include <getopt.h> | #include <getopt.h> | ||||||
| 
 | 
 | ||||||
| #define PRINT_FS	0 | enum { | ||||||
| #define PRINT_DRIVE	1 |   PRINT_FS, | ||||||
| #define PRINT_DEVICE	2 |   PRINT_DRIVE, | ||||||
| #define PRINT_PARTMAP	3 |   PRINT_DEVICE, | ||||||
|  |   PRINT_PARTMAP, | ||||||
|  |   PRINT_ABSTRACTION, | ||||||
|  | }; | ||||||
| 
 | 
 | ||||||
| int print = PRINT_FS; | int print = PRINT_FS; | ||||||
| 
 | 
 | ||||||
|  | @ -74,6 +77,7 @@ probe (const char *path) | ||||||
| { | { | ||||||
|   char *device_name; |   char *device_name; | ||||||
|   char *drive_name = NULL; |   char *drive_name = NULL; | ||||||
|  |   int abstraction_type; | ||||||
|   grub_device_t dev; |   grub_device_t dev; | ||||||
|   grub_fs_t fs; |   grub_fs_t fs; | ||||||
|    |    | ||||||
|  | @ -87,6 +91,28 @@ probe (const char *path) | ||||||
|       goto end; |       goto end; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |   abstraction_type = grub_util_get_dev_abstraction (device_name); | ||||||
|  |   /* No need to check for errors; lack of abstraction is permissible.  */ | ||||||
|  |    | ||||||
|  |   if (print == PRINT_ABSTRACTION) | ||||||
|  |     { | ||||||
|  |       char *abstraction_name; | ||||||
|  |       switch (abstraction_type) | ||||||
|  | 	{ | ||||||
|  | 	case GRUB_DEV_ABSTRACTION_NONE: | ||||||
|  | 	  grub_util_info ("did not find LVM/RAID in %s, assuming raw device", device_name); | ||||||
|  | 	  goto end; | ||||||
|  | 	case GRUB_DEV_ABSTRACTION_LVM: | ||||||
|  | 	  abstraction_name = "lvm"; | ||||||
|  | 	  break; | ||||||
|  | 	case GRUB_DEV_ABSTRACTION_RAID: | ||||||
|  | 	  abstraction_name = "raid"; | ||||||
|  | 	  break; | ||||||
|  | 	} | ||||||
|  |       printf ("%s\n", abstraction_name); | ||||||
|  |       goto end; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|   drive_name = grub_util_get_grub_dev (device_name); |   drive_name = grub_util_get_grub_dev (device_name); | ||||||
|   if (! drive_name) |   if (! drive_name) | ||||||
|     grub_util_error ("cannot find a GRUB drive for %s.\n", device_name); |     grub_util_error ("cannot find a GRUB drive for %s.\n", device_name); | ||||||
|  | @ -159,8 +185,8 @@ Usage: grub-probe [OPTION]... PATH\n\ | ||||||
| Probe device information for a given path.\n\ | Probe device information for a given path.\n\ | ||||||
| \n\ | \n\ | ||||||
|   -m, --device-map=FILE     use FILE as the device map [default=%s]\n\ |   -m, --device-map=FILE     use FILE as the device map [default=%s]\n\ | ||||||
|   -t, --target=(fs|drive|device|partmap)\n\ |   -t, --target=(fs|drive|device|partmap|abstraction)\n\ | ||||||
|                             print filesystem module, GRUB drive, system device or partition map module [default=fs]\n\ |                             print filesystem module, GRUB drive, system device, partition map module or abstraction module [default=fs]\n\ | ||||||
|   -h, --help                display this message and exit\n\ |   -h, --help                display this message and exit\n\ | ||||||
|   -V, --version             print version information and exit\n\ |   -V, --version             print version information and exit\n\ | ||||||
|   -v, --verbose             print verbose messages\n\ |   -v, --verbose             print verbose messages\n\ | ||||||
|  | @ -206,6 +232,8 @@ main (int argc, char *argv[]) | ||||||
| 	      print = PRINT_DEVICE; | 	      print = PRINT_DEVICE; | ||||||
| 	    else if (!strcmp (optarg, "partmap")) | 	    else if (!strcmp (optarg, "partmap")) | ||||||
| 	      print = PRINT_PARTMAP; | 	      print = PRINT_PARTMAP; | ||||||
|  | 	    else if (!strcmp (optarg, "abstraction")) | ||||||
|  | 	      print = PRINT_ABSTRACTION; | ||||||
| 	    else | 	    else | ||||||
| 	      usage (1); | 	      usage (1); | ||||||
| 	    break; | 	    break; | ||||||
|  |  | ||||||
|  | @ -1,7 +1,7 @@ | ||||||
| #! /bin/sh -e | #! /bin/sh -e | ||||||
| 
 | 
 | ||||||
| # update-grub helper script. | # update-grub helper script. | ||||||
| # Copyright (C) 2006,2007  Free Software Foundation, Inc. | # Copyright (C) 2006,2007,2008  Free Software Foundation, Inc. | ||||||
| # | # | ||||||
| # GRUB is free software: you can redistribute it and/or modify | # GRUB is free software: you can redistribute it and/or modify | ||||||
| # it under the terms of the GNU General Public License as published by | # it under the terms of the GNU General Public License as published by | ||||||
|  | @ -24,6 +24,12 @@ platform=@platform@ | ||||||
| # for convert_system_path_to_grub_path() | # for convert_system_path_to_grub_path() | ||||||
| . ${libdir}/grub/update-grub_lib | . ${libdir}/grub/update-grub_lib | ||||||
| 
 | 
 | ||||||
|  | # Do this as early as possible, since other commands might depend on it. | ||||||
|  | # (e.g. the `font' command might need lvm or raid modules) | ||||||
|  | for i in ${GRUB_PRELOAD_MODULES} ; do | ||||||
|  |   echo "insmod $i" | ||||||
|  | done | ||||||
|  | 
 | ||||||
| if [ "x${GRUB_DEFAULT}" = "x" ] ; then GRUB_DEFAULT=0 ; fi | if [ "x${GRUB_DEFAULT}" = "x" ] ; then GRUB_DEFAULT=0 ; fi | ||||||
| if [ "x${GRUB_TIMEOUT}" = "x" ] ; then GRUB_TIMEOUT=5 ; fi | if [ "x${GRUB_TIMEOUT}" = "x" ] ; then GRUB_TIMEOUT=5 ; fi | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,7 +1,7 @@ | ||||||
| #! /bin/sh | #! /bin/sh | ||||||
| 
 | 
 | ||||||
| # Install GRUB on your EFI partition. | # Install GRUB on your EFI partition. | ||||||
| # Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007  Free Software Foundation, Inc. | # Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008  Free Software Foundation, Inc. | ||||||
| # | # | ||||||
| # GRUB is free software: you can redistribute it and/or modify | # GRUB is free software: you can redistribute it and/or modify | ||||||
| # it under the terms of the GNU General Public License as published by | # it under the terms of the GNU General Public License as published by | ||||||
|  | @ -190,8 +190,11 @@ fi | ||||||
| # filesystem will be accessible). | # filesystem will be accessible). | ||||||
| partmap_module=`$grub_probe --target=partmap --device-map=${device_map} ${grubdir} 2> /dev/null` | partmap_module=`$grub_probe --target=partmap --device-map=${device_map} ${grubdir} 2> /dev/null` | ||||||
| 
 | 
 | ||||||
|  | # Device abstraction module, if any (lvm, raid). | ||||||
|  | devabstraction_module=`$grub_probe --target=abstraction --device-map=${device_map} ${grubdir}` | ||||||
|  | 
 | ||||||
| # _chain is often useful | # _chain is often useful | ||||||
| modules="$modules $fs_module $partmap_module _chain" | modules="$modules $fs_module $partmap_module $devabstraction_module _chain" | ||||||
| 
 | 
 | ||||||
| $grub_mkimage --output=${grubdir}/grub.efi $modules || exit 1 | $grub_mkimage --output=${grubdir}/grub.efi $modules || exit 1 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,7 +1,7 @@ | ||||||
| #! /bin/sh | #! /bin/sh | ||||||
| 
 | 
 | ||||||
| # Install GRUB on your drive. | # Install GRUB on your drive. | ||||||
| # Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007  Free Software Foundation, Inc. | # Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008  Free Software Foundation, Inc. | ||||||
| # | # | ||||||
| # GRUB is free software: you can redistribute it and/or modify | # GRUB is free software: you can redistribute it and/or modify | ||||||
| # it under the terms of the GNU General Public License as published by | # it under the terms of the GNU General Public License as published by | ||||||
|  | @ -223,8 +223,11 @@ fi | ||||||
| # filesystem will be accessible). | # filesystem will be accessible). | ||||||
| partmap_module=`$grub_probe --target=partmap --device-map=${device_map} ${grubdir} 2> /dev/null` | partmap_module=`$grub_probe --target=partmap --device-map=${device_map} ${grubdir} 2> /dev/null` | ||||||
| 
 | 
 | ||||||
|  | # Device abstraction module, if any (lvm, raid). | ||||||
|  | devabstraction_module=`$grub_probe --target=abstraction --device-map=${device_map} ${grubdir}` | ||||||
|  | 
 | ||||||
| # _chain is often useful | # _chain is often useful | ||||||
| modules="$modules $fs_module $partmap_module biosdisk _chain" | modules="$modules $fs_module $partmap_module biosdisk $devabstraction_module _chain" | ||||||
| 
 | 
 | ||||||
| $grub_mkimage --output=${grubdir}/core.img --prefix=`make_system_path_relative_to_its_root ${grubdir}` $modules || exit 1 | $grub_mkimage --output=${grubdir}/core.img --prefix=`make_system_path_relative_to_its_root ${grubdir}` $modules || exit 1 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,7 +1,7 @@ | ||||||
| #! /bin/sh | #! /bin/sh | ||||||
| 
 | 
 | ||||||
| # Install GRUB on your drive. | # Install GRUB on your drive. | ||||||
| # Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007  Free Software Foundation, Inc. | # Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008  Free Software Foundation, Inc. | ||||||
| # | # | ||||||
| # GRUB is free software: you can redistribute it and/or modify | # GRUB is free software: you can redistribute it and/or modify | ||||||
| # it under the terms of the GNU General Public License as published by | # it under the terms of the GNU General Public License as published by | ||||||
|  | @ -176,7 +176,10 @@ fi | ||||||
| # filesystem will be accessible). | # filesystem will be accessible). | ||||||
| partmap_module=`$grub_probe --target=partmap --device-map=${device_map} ${grubdir} 2> /dev/null` | partmap_module=`$grub_probe --target=partmap --device-map=${device_map} ${grubdir} 2> /dev/null` | ||||||
| 
 | 
 | ||||||
| modules="$modules $fs_module $partmap_module" | # Device abstraction module, if any (lvm, raid). | ||||||
|  | devabstraction_module=`$grub_probe --target=abstraction --device-map=${device_map} ${grubdir}` | ||||||
|  | 
 | ||||||
|  | modules="$modules $fs_module $partmap_module $devabstraction_module" | ||||||
| 
 | 
 | ||||||
| # Now perform the installation. | # Now perform the installation. | ||||||
| "$grub_mkimage" --output=${grubdir}/grub $modules || exit 1 | "$grub_mkimage" --output=${grubdir}/grub $modules || exit 1 | ||||||
|  |  | ||||||
|  | @ -103,7 +103,10 @@ esac | ||||||
| # check for terminals that require fonts | # check for terminals that require fonts | ||||||
| case ${GRUB_TERMINAL} in | case ${GRUB_TERMINAL} in | ||||||
|   gfxterm) |   gfxterm) | ||||||
|     if GRUB_FONT_PATH=`font_path` ; then : ; else |     if path=`font_path` ; then | ||||||
|  |       GRUB_FONT_PATH="`convert_system_path_to_grub_path ${path}`" | ||||||
|  |       GRUB_PRELOAD_MODULES="`${GRUB_PRELOAD_MODULES} ${grub_probe} -t abstraction ${path}`" | ||||||
|  |     else | ||||||
|       # fallback to console |       # fallback to console | ||||||
|       GRUB_TERMINAL=console |       GRUB_TERMINAL=console | ||||||
|     fi |     fi | ||||||
|  | @ -121,7 +124,7 @@ esac | ||||||
| 
 | 
 | ||||||
| # These are defined in this script, export them here so that user can | # These are defined in this script, export them here so that user can | ||||||
| # override them. | # override them. | ||||||
| export GRUB_DEVICE GRUB_FS GRUB_DRIVE GRUB_DRIVE_BOOT GRUB_DRIVE_BOOT_GRUB GRUB_FONT_PATH | export GRUB_DEVICE GRUB_FS GRUB_DRIVE GRUB_DRIVE_BOOT GRUB_DRIVE_BOOT_GRUB GRUB_FONT_PATH GRUB_PRELOAD_MODULES | ||||||
| 
 | 
 | ||||||
| # These are optional, user-defined variables. | # These are optional, user-defined variables. | ||||||
| export GRUB_DEFAULT GRUB_TIMEOUT GRUB_DISTRIBUTOR GRUB_CMDLINE_LINUX GRUB_TERMINAL GRUB_SERIAL_COMMAND | export GRUB_DEFAULT GRUB_TIMEOUT GRUB_DISTRIBUTOR GRUB_CMDLINE_LINUX GRUB_TERMINAL GRUB_SERIAL_COMMAND | ||||||
|  |  | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| # Helper library for update-grub | # Helper library for update-grub | ||||||
| # Copyright (C) 2007  Free Software Foundation, Inc. | # Copyright (C) 2007,2008  Free Software Foundation, Inc. | ||||||
| # | # | ||||||
| # GRUB is free software: you can redistribute it and/or modify | # GRUB is free software: you can redistribute it and/or modify | ||||||
| # it under the terms of the GNU General Public License as published by | # it under the terms of the GNU General Public License as published by | ||||||
|  | @ -93,19 +93,14 @@ convert_system_path_to_grub_path () | ||||||
| 
 | 
 | ||||||
| font_path () | font_path () | ||||||
| { | { | ||||||
|   if [ "x${GRUB_FONT_PATH}" = "x" ] ; then : ; else |  | ||||||
|     echo "${GRUB_FONT_PATH}" |  | ||||||
|     return 0 |  | ||||||
|   fi |  | ||||||
| 
 |  | ||||||
|   # Prefer system path for space reasons (/boot/grub might be a very small |   # Prefer system path for space reasons (/boot/grub might be a very small | ||||||
|   # partition in case of OpenFirmware, etc). |   # partition in case of OpenFirmware, etc). | ||||||
|   for dir in ${pkgdatadir} /usr/share/grub /boot/grub ; do |   for dir in ${pkgdatadir} /usr/share/grub /boot/grub ; do | ||||||
|     # Prefer complete fonts over incomplete ones. |     # Prefer complete fonts over incomplete ones. | ||||||
|     for basename in unicode unifont ascii ; do |     for basename in unicode unifont ascii ; do | ||||||
|       if path=`convert_system_path_to_grub_path ${dir}/${basename}.pff` ; then |       path="${dir}/${basename}.pff" | ||||||
|         GRUB_FONT_PATH="${path}" |       if convert_system_path_to_grub_path ${path} > /dev/null ; then | ||||||
|         echo "${GRUB_FONT_PATH}" |         echo "${path}" | ||||||
|         return 0 |         return 0 | ||||||
|       fi |       fi | ||||||
|     done |     done | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue