merged mainstream into gfxmenu
This commit is contained in:
commit
3dcf83ba7d
69 changed files with 2657 additions and 857 deletions
|
@ -30,6 +30,12 @@
|
|||
# define DEV_CYGDRIVE_MAJOR 98
|
||||
#endif
|
||||
|
||||
#ifdef __GNU__
|
||||
#include <hurd.h>
|
||||
#include <hurd/lookup.h>
|
||||
#include <hurd/fs.h>
|
||||
#endif
|
||||
|
||||
#include <grub/util/misc.h>
|
||||
#include <grub/util/hostdisk.h>
|
||||
#include <grub/util/getroot.h>
|
||||
|
@ -378,8 +384,65 @@ find_cygwin_root_device (const char *path, dev_t dev)
|
|||
char *
|
||||
grub_guess_root_device (const char *dir)
|
||||
{
|
||||
struct stat st;
|
||||
char *os_dev;
|
||||
#ifdef __GNU__
|
||||
file_t file;
|
||||
mach_port_t *ports;
|
||||
int *ints;
|
||||
loff_t *offsets;
|
||||
char *data;
|
||||
error_t err;
|
||||
mach_msg_type_number_t num_ports = 0, num_ints = 0, num_offsets = 0, data_len = 0;
|
||||
size_t name_len;
|
||||
|
||||
file = file_name_lookup (dir, 0, 0);
|
||||
if (file == MACH_PORT_NULL)
|
||||
return 0;
|
||||
|
||||
err = file_get_storage_info (file,
|
||||
&ports, &num_ports,
|
||||
&ints, &num_ints,
|
||||
&offsets, &num_offsets,
|
||||
&data, &data_len);
|
||||
|
||||
if (num_ints < 1)
|
||||
grub_util_error ("Storage info for `%s' does not include type", dir);
|
||||
if (ints[0] != STORAGE_DEVICE)
|
||||
grub_util_error ("Filesystem of `%s' is not stored on local disk", dir);
|
||||
|
||||
if (num_ints < 5)
|
||||
grub_util_error ("Storage info for `%s' does not include name", dir);
|
||||
name_len = ints[4];
|
||||
if (name_len < data_len)
|
||||
grub_util_error ("Bogus name length for storage info for `%s'", dir);
|
||||
if (data[name_len - 1] != '\0')
|
||||
grub_util_error ("Storage name for `%s' not NUL-terminated", dir);
|
||||
|
||||
os_dev = xmalloc (strlen ("/dev/") + data_len);
|
||||
memcpy (os_dev, "/dev/", strlen ("/dev/"));
|
||||
memcpy (os_dev + strlen ("/dev/"), data, data_len);
|
||||
|
||||
if (ports && num_ports > 0)
|
||||
{
|
||||
mach_msg_type_number_t i;
|
||||
for (i = 0; i < num_ports; i++)
|
||||
{
|
||||
mach_port_t port = ports[i];
|
||||
if (port != MACH_PORT_NULL)
|
||||
mach_port_deallocate (mach_task_self(), port);
|
||||
}
|
||||
munmap ((caddr_t) ports, num_ports * sizeof (*ports));
|
||||
}
|
||||
|
||||
if (ints && num_ints > 0)
|
||||
munmap ((caddr_t) ints, num_ints * sizeof (*ints));
|
||||
if (offsets && num_offsets > 0)
|
||||
munmap ((caddr_t) offsets, num_offsets * sizeof (*offsets));
|
||||
if (data && data_len > 0)
|
||||
munmap (data, data_len);
|
||||
mach_port_deallocate (mach_task_self (), file);
|
||||
#else /* !__GNU__ */
|
||||
struct stat st;
|
||||
|
||||
if (stat (dir, &st) < 0)
|
||||
grub_util_error ("Cannot stat `%s'", dir);
|
||||
|
@ -393,6 +456,7 @@ grub_guess_root_device (const char *dir)
|
|||
/* This might be truly slow, but is there any better way? */
|
||||
os_dev = find_root_device ("/dev", st.st_dev);
|
||||
#endif
|
||||
#endif /* !__GNU__ */
|
||||
|
||||
return os_dev;
|
||||
}
|
||||
|
|
|
@ -27,10 +27,10 @@ PACKAGE_NAME=@PACKAGE_NAME@
|
|||
PACKAGE_TARNAME=@PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION=@PACKAGE_VERSION@
|
||||
target_cpu=@target_cpu@
|
||||
native_platform=@platform@
|
||||
|
||||
coreboot_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/${target_cpu}-coreboot
|
||||
pc_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/${target_cpu}-pc
|
||||
grub_mkisofs="grub-mkisofs"
|
||||
|
||||
# Usage: usage
|
||||
# Print the usage.
|
||||
|
@ -42,7 +42,7 @@ Make GRUB rescue image.
|
|||
-h, --help print this message and exit
|
||||
-v, --version print the version information and exit
|
||||
--modules=MODULES pre-load specified modules MODULES
|
||||
--output=FILE save output in FILE
|
||||
--output=FILE save output in FILE [required]
|
||||
|
||||
$0 generates a bootable rescue image with specified source files or directories.
|
||||
|
||||
|
@ -63,6 +63,12 @@ for option in "$@"; do
|
|||
modules=`echo "$option" | sed 's/--modules=//'` ;;
|
||||
--output=*)
|
||||
output_image=`echo "$option" | sed 's/--output=//'` ;;
|
||||
# Intentionally undocumented
|
||||
--override-directory=*)
|
||||
override_dir=`echo "${option}/" | sed 's/--override-directory=//'`
|
||||
PATH=${override_dir}:$PATH
|
||||
export PATH
|
||||
;;
|
||||
-*)
|
||||
echo "Unrecognized option \`$option'" 1>&2
|
||||
usage
|
||||
|
@ -73,25 +79,49 @@ for option in "$@"; do
|
|||
esac
|
||||
done
|
||||
|
||||
if [ "x${output_image}" = x ] ; then
|
||||
echo "output file must be given" >&2
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
iso9660_dir=`mktemp -d`
|
||||
mkdir -p ${iso9660_dir}/boot/grub
|
||||
|
||||
for platform in pc coreboot ; do
|
||||
input_dir=${libdir}/$(echo ${PACKAGE_TARNAME} | sed ${transform})/${target_cpu}-${platform}
|
||||
if test -e ${input_dir} ; then
|
||||
mkdir -p ${iso9660_dir}/boot/grub/${target_cpu}-${platform}
|
||||
for file in ${input_dir}/*.mod ${input_dir}/efiemu??.o \
|
||||
${input_dir}/command.lst ${input_dir}/moddep.lst ${input_dir}/fs.lst \
|
||||
${input_dir}/handler.lst ${input_dir}/parttool.lst; do
|
||||
if test -f "$file"; then
|
||||
cp -f "$file" ${iso9660_dir}/boot/grub/${target_cpu}-${platform}/
|
||||
fi
|
||||
done
|
||||
process_input_dir ()
|
||||
{
|
||||
input_dir="$1"
|
||||
platform="$2"
|
||||
mkdir -p ${iso9660_dir}/boot/grub/${target_cpu}-${platform}
|
||||
for file in ${input_dir}/*.mod ${input_dir}/efiemu??.o \
|
||||
${input_dir}/command.lst ${input_dir}/moddep.lst ${input_dir}/fs.lst \
|
||||
${input_dir}/handler.lst ${input_dir}/parttool.lst; do
|
||||
if test -f "$file"; then
|
||||
cp -f "$file" ${iso9660_dir}/boot/grub/${target_cpu}-${platform}/
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
if [ "${override_dir}" = "" ] ; then
|
||||
if test -e "${coreboot_dir}" ; then
|
||||
process_input_dir ${coreboot_dir} coreboot
|
||||
fi
|
||||
done
|
||||
if test -e "${pc_dir}" ; then
|
||||
process_input_dir ${pc_dir} pc
|
||||
fi
|
||||
else
|
||||
process_input_dir ${override_dir} ${native_platform}
|
||||
coreboot_dir=
|
||||
pc_dir=
|
||||
case "${native_platform}" in
|
||||
coreboot) coreboot_dir=${override_dir} ;;
|
||||
pc) pc_dir=${override_dir} ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# build coreboot core.img
|
||||
if test -e ${coreboot_dir} ; then
|
||||
if test -e "${coreboot_dir}" ; then
|
||||
echo "Generates coreboot"
|
||||
memdisk_img=`mktemp`
|
||||
memdisk_dir=`mktemp -d`
|
||||
mkdir -p ${memdisk_dir}/boot/grub
|
||||
|
@ -115,18 +145,12 @@ EOF
|
|||
memdisk tar search iso9660 configfile sh \
|
||||
ata at_keyboard
|
||||
rm -f ${memdisk_img}
|
||||
grub_mkisofs="${grub_mkisofs} --modification-date=$(echo ${iso_uuid} | sed -e s/-//g)"
|
||||
fi
|
||||
|
||||
if [ "${source}" != "" ] ; then
|
||||
for d in ${source}; do
|
||||
echo "Processing $d"
|
||||
cp -dpRl "${d}" ${iso9660_dir}/
|
||||
done
|
||||
grub_mkisofs_arguments="${grub_mkisofs_arguments} --modification-date=$(echo ${iso_uuid} | sed -e s/-//g)"
|
||||
fi
|
||||
|
||||
# build eltorito core.img
|
||||
if test -e ${pc_dir} ; then
|
||||
if test -e "${pc_dir}" ; then
|
||||
echo "Generates eltorito"
|
||||
core_img=`mktemp`
|
||||
grub-mkimage -d ${pc_dir}/ -o ${core_img} --prefix=/boot/grub/i386-pc \
|
||||
memdisk tar search iso9660 configfile sh \
|
||||
|
@ -141,11 +165,11 @@ if test -e ${pc_dir} ; then
|
|||
echo "source /boot/grub/grub.cfg") \
|
||||
> ${iso9660_dir}/boot/grub/i386-pc/grub.cfg
|
||||
|
||||
grub_mkisofs="${grub_mkisofs} -b boot/grub/i386-pc/eltorito.img -boot-info-table"
|
||||
grub_mkisofs_arguments="${grub_mkisofs_arguments} -b boot/grub/i386-pc/eltorito.img -boot-info-table"
|
||||
fi
|
||||
|
||||
# build iso image
|
||||
${grub_mkisofs} -o ${output_image} -r -J ${iso9660_dir}
|
||||
grub-mkisofs ${grub_mkisofs_arguments} -o ${output_image} -r ${iso9660_dir} ${source}
|
||||
rm -rf ${iso9660_dir}
|
||||
|
||||
exit 0
|
||||
|
|
|
@ -22,6 +22,8 @@ prefix=@prefix@
|
|||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
grub_prefix=`echo /boot/grub | sed ${transform}`
|
||||
locale_dir=`echo /boot/grub/locale | sed ${transform}`
|
||||
grub_lang=`echo $LANG | cut -d _ -f 1`
|
||||
|
||||
. ${libdir}/grub/grub-mkconfig_lib
|
||||
|
||||
|
@ -108,6 +110,15 @@ EOF
|
|||
;;
|
||||
esac
|
||||
|
||||
# Gettext variables and module
|
||||
if [ "x${LANG}" != "xC" ] ; then
|
||||
cat << EOF
|
||||
set locale_dir=${locale_dir}
|
||||
set lang=${grub_lang}
|
||||
insmod gettext
|
||||
EOF
|
||||
fi
|
||||
|
||||
if [ "x${GRUB_HIDDEN_TIMEOUT}" != "x" ] ; then
|
||||
if [ "x${GRUB_HIDDEN_TIMEOUT_QUIET}" = "xtrue" ] ; then
|
||||
verbose=
|
||||
|
|
|
@ -89,11 +89,16 @@ EOF
|
|||
LLABEL="${LONGNAME}"
|
||||
fi
|
||||
|
||||
if [ "${LROOT}" != "${LBOOT}" ]; then
|
||||
LKERNEL="${LKERNEL#/boot}"
|
||||
LINITRD="${LINITRD#/boot}"
|
||||
fi
|
||||
|
||||
cat << EOF
|
||||
menuentry "${LLABEL} (on ${DEVICE})" {
|
||||
EOF
|
||||
if [ -z "${prepare_boot_cache}" ]; then
|
||||
prepare_boot_cache="$(prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/")"
|
||||
prepare_boot_cache="$(prepare_grub_to_access_device ${LBOOT} | sed -e "s/^/\t/")"
|
||||
fi
|
||||
printf '%s\n' "${prepare_boot_cache}"
|
||||
cat << EOF
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include <grub/util/misc.h>
|
||||
#include <grub/util/hostdisk.h>
|
||||
#include <grub/misc.h>
|
||||
#include <grub/i18n.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -127,7 +128,7 @@ find_grub_drive (const char *name)
|
|||
|
||||
if (name)
|
||||
{
|
||||
for (i = 0; i < sizeof (map) / sizeof (map[0]); i++)
|
||||
for (i = 0; i < ARRAY_SIZE (map); i++)
|
||||
if (map[i].drive && ! strcmp (map[i].drive, name))
|
||||
return i;
|
||||
}
|
||||
|
@ -565,7 +566,10 @@ read_device_map (const char *dev_map)
|
|||
|
||||
fp = fopen (dev_map, "r");
|
||||
if (! fp)
|
||||
grub_util_error ("Cannot open `%s'", dev_map);
|
||||
{
|
||||
grub_util_info (_("Cannot open `%s'"), dev_map);
|
||||
return;
|
||||
}
|
||||
|
||||
while (fgets (buf, sizeof (buf), fp))
|
||||
{
|
||||
|
@ -670,34 +674,27 @@ grub_util_biosdisk_fini (void)
|
|||
static char *
|
||||
make_device_name (int drive, int dos_part, int bsd_part)
|
||||
{
|
||||
int len = strlen(map[drive].drive);
|
||||
char *p;
|
||||
char *ret;
|
||||
char *dos_part_str = NULL;
|
||||
char *bsd_part_str = NULL;
|
||||
|
||||
if (dos_part >= 0)
|
||||
{
|
||||
/* Add in char length of dos_part+1 */
|
||||
int tmp = dos_part + 1;
|
||||
len++;
|
||||
while ((tmp /= 10) != 0)
|
||||
len++;
|
||||
}
|
||||
if (bsd_part >= 0)
|
||||
len += 2;
|
||||
|
||||
/* Length to alloc is: char length of map[drive].drive, plus
|
||||
* char length of (dos_part+1) or of bsd_part, plus
|
||||
* 2 for the comma and a null/end of string (\0)
|
||||
*/
|
||||
p = xmalloc (len + 2);
|
||||
sprintf (p, "%s", map[drive].drive);
|
||||
|
||||
if (dos_part >= 0)
|
||||
sprintf (p + strlen (p), ",%d", dos_part + 1);
|
||||
asprintf (&dos_part_str, ",%d", dos_part + 1);
|
||||
|
||||
if (bsd_part >= 0)
|
||||
sprintf (p + strlen (p), ",%c", bsd_part + 'a');
|
||||
asprintf (&bsd_part_str, ",%c", dos_part + 'a');
|
||||
|
||||
return p;
|
||||
asprintf (&ret, "%s%s%s", map[drive].drive,
|
||||
dos_part_str ? : "",
|
||||
bsd_part_str ? : "");
|
||||
|
||||
if (dos_part_str)
|
||||
free (dos_part_str);
|
||||
|
||||
if (bsd_part_str)
|
||||
free (bsd_part_str);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static char *
|
||||
|
@ -706,7 +703,7 @@ convert_system_partition_to_system_disk (const char *os_dev)
|
|||
#if defined(__linux__)
|
||||
char *path = xmalloc (PATH_MAX);
|
||||
if (! realpath (os_dev, path))
|
||||
return 0;
|
||||
return NULL;
|
||||
|
||||
if (strncmp ("/dev/", path, 5) == 0)
|
||||
{
|
||||
|
@ -876,22 +873,29 @@ device_is_wholedisk (const char *os_dev)
|
|||
static int
|
||||
find_system_device (const char *os_dev)
|
||||
{
|
||||
int i;
|
||||
unsigned int i;
|
||||
char *os_disk;
|
||||
|
||||
os_disk = convert_system_partition_to_system_disk (os_dev);
|
||||
if (! os_disk)
|
||||
return -1;
|
||||
|
||||
for (i = 0; i < (int) (sizeof (map) / sizeof (map[0])); i++)
|
||||
if (map[i].device && strcmp (map[i].device, os_disk) == 0)
|
||||
for (i = 0; i < ARRAY_SIZE (map); i++)
|
||||
if (! map[i].device)
|
||||
break;
|
||||
else if (strcmp (map[i].device, os_disk) == 0)
|
||||
{
|
||||
free (os_disk);
|
||||
return i;
|
||||
}
|
||||
|
||||
free (os_disk);
|
||||
return -1;
|
||||
if (i == ARRAY_SIZE (map))
|
||||
grub_util_error (_("device count exceeds limit"));
|
||||
|
||||
map[i].device = os_disk;
|
||||
map[i].drive = xstrdup (os_disk);
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
char *
|
||||
|
|
|
@ -114,14 +114,14 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[],
|
|||
if (memdisk_path)
|
||||
{
|
||||
memdisk_size = ALIGN_UP(grub_util_get_image_size (memdisk_path), 512);
|
||||
grub_util_info (_("the size of memory disk is 0x%x"), memdisk_size);
|
||||
grub_util_info ("the size of memory disk is 0x%x", memdisk_size);
|
||||
total_module_size += memdisk_size + sizeof (struct grub_module_header);
|
||||
}
|
||||
|
||||
if (config_path)
|
||||
{
|
||||
config_size = grub_util_get_image_size (config_path) + 1;
|
||||
grub_util_info (_("the size of config file is 0x%x"), config_size);
|
||||
grub_util_info ("the size of config file is 0x%x", config_size);
|
||||
total_module_size += config_size + sizeof (struct grub_module_header);
|
||||
}
|
||||
|
||||
|
@ -129,7 +129,7 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[],
|
|||
total_module_size += (grub_util_get_image_size (p->name)
|
||||
+ sizeof (struct grub_module_header));
|
||||
|
||||
grub_util_info (_("the total module size is 0x%x"), total_module_size);
|
||||
grub_util_info ("the total module size is 0x%x", total_module_size);
|
||||
|
||||
kernel_img = xmalloc (kernel_size + total_module_size);
|
||||
grub_util_load_image (kernel_path, kernel_img);
|
||||
|
@ -196,7 +196,7 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[],
|
|||
compress_kernel (kernel_img, kernel_size + total_module_size,
|
||||
&core_img, &core_size);
|
||||
|
||||
grub_util_info (_("the core size is 0x%x"), core_size);
|
||||
grub_util_info ("the core size is 0x%x", core_size);
|
||||
|
||||
#if defined(GRUB_MACHINE_PCBIOS)
|
||||
{
|
||||
|
|
|
@ -159,7 +159,7 @@ setup (const char *dir,
|
|||
void NESTED_FUNC_ATTR save_first_sector (grub_disk_addr_t sector, unsigned offset,
|
||||
unsigned length)
|
||||
{
|
||||
grub_util_info (_("the first sector is <%llu,%u,%u>"),
|
||||
grub_util_info ("the first sector is <%llu,%u,%u>",
|
||||
sector, offset, length);
|
||||
|
||||
if (offset != 0 || length != GRUB_DISK_SECTOR_SIZE)
|
||||
|
@ -173,7 +173,7 @@ setup (const char *dir,
|
|||
{
|
||||
struct boot_blocklist *prev = block + 1;
|
||||
|
||||
grub_util_info (_("saving <%llu,%u,%u> with the segment 0x%x"),
|
||||
grub_util_info ("saving <%llu,%u,%u> with the segment 0x%x",
|
||||
sector, offset, length, (unsigned) current_segment);
|
||||
|
||||
if (offset != 0 || last_length != GRUB_DISK_SECTOR_SIZE)
|
||||
|
@ -244,7 +244,7 @@ setup (const char *dir,
|
|||
if (! dest_dev)
|
||||
grub_util_error ("%s", grub_errmsg);
|
||||
|
||||
grub_util_info (_("setting the root device to `%s'"), root);
|
||||
grub_util_info ("setting the root device to `%s'", root);
|
||||
if (grub_env_set ("root", root) != GRUB_ERR_NONE)
|
||||
grub_util_error ("%s", grub_errmsg);
|
||||
|
||||
|
@ -322,7 +322,7 @@ setup (const char *dir,
|
|||
bsd_part = grub_le_to_cpu32 (*install_bsd_part);
|
||||
}
|
||||
|
||||
grub_util_info (_("dos partition is %d, bsd partition is %d"),
|
||||
grub_util_info ("dos partition is %d, bsd partition is %d",
|
||||
dos_part, bsd_part);
|
||||
|
||||
if (! dest_dev->disk->has_partitions)
|
||||
|
@ -378,7 +378,7 @@ setup (const char *dir,
|
|||
}
|
||||
|
||||
|
||||
grub_util_info (_("the core image will be embedded at sector 0x%llx"), embed_region.start);
|
||||
grub_util_info ("the core image will be embedded at sector 0x%llx", embed_region.start);
|
||||
|
||||
*install_dos_part = grub_cpu_to_le32 (dos_part);
|
||||
*install_bsd_part = grub_cpu_to_le32 (bsd_part);
|
||||
|
@ -446,11 +446,11 @@ unable_to_embed:
|
|||
if (file)
|
||||
{
|
||||
if (grub_file_size (file) != core_size)
|
||||
grub_util_info (_("succeeded in opening the core image but the size is different (%d != %d)"),
|
||||
grub_util_info ("succeeded in opening the core image but the size is different (%d != %d)",
|
||||
(int) grub_file_size (file), (int) core_size);
|
||||
else if (grub_file_read (file, tmp_img, core_size)
|
||||
!= (grub_ssize_t) core_size)
|
||||
grub_util_info (_("succeeded in opening the core image but cannot read %d bytes"),
|
||||
grub_util_info ("succeeded in opening the core image but cannot read %d bytes",
|
||||
(int) core_size);
|
||||
else if (memcmp (core_img, tmp_img, core_size) != 0)
|
||||
{
|
||||
|
@ -473,7 +473,7 @@ unable_to_embed:
|
|||
}
|
||||
|
||||
#endif
|
||||
grub_util_info (_("succeeded in opening the core image but the data is different"));
|
||||
grub_util_info ("succeeded in opening the core image but the data is different");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -484,10 +484,10 @@ unable_to_embed:
|
|||
grub_file_close (file);
|
||||
}
|
||||
else
|
||||
grub_util_info (_("couldn't open the core image"));
|
||||
grub_util_info ("couldn't open the core image");
|
||||
|
||||
if (grub_errno)
|
||||
grub_util_info (_("error message = %s"), grub_errmsg);
|
||||
grub_util_info ("error message = %s", grub_errmsg);
|
||||
|
||||
grub_errno = GRUB_ERR_NONE;
|
||||
sync ();
|
||||
|
@ -541,7 +541,7 @@ unable_to_embed:
|
|||
*install_bsd_part = grub_cpu_to_le32 (bsd_part);
|
||||
|
||||
/* Write the first two sectors of the core image onto the disk. */
|
||||
grub_util_info (_("opening the core image `%s'"), core_path);
|
||||
grub_util_info ("opening the core image `%s'", core_path);
|
||||
fp = fopen (core_path, "r+b");
|
||||
if (! fp)
|
||||
grub_util_error (_("Cannot open `%s'"), core_path);
|
||||
|
@ -763,7 +763,7 @@ main (int argc, char *argv[])
|
|||
root_dev = grub_util_get_grub_dev (grub_guess_root_device (dir ? : DEFAULT_DIRECTORY));
|
||||
if (! root_dev)
|
||||
{
|
||||
grub_util_info (_("guessing the root device failed, because of `%s'"),
|
||||
grub_util_info ("guessing the root device failed, because of `%s'",
|
||||
grub_errmsg);
|
||||
grub_util_error (_("Cannot guess the root device. Specify the option ``--root-device''."));
|
||||
}
|
||||
|
|
|
@ -36,8 +36,6 @@
|
|||
#include <grub/mm.h>
|
||||
#include <grub/term.h>
|
||||
#include <grub/time.h>
|
||||
#include <grub/machine/time.h>
|
||||
#include <grub/machine/machine.h>
|
||||
|
||||
/* Include malloc.h, only if memalign is available. It is known that
|
||||
memalign is declared in malloc.h in all systems, if present. */
|
||||
|
|
|
@ -200,107 +200,107 @@ struct ld_option
|
|||
static const struct ld_option ld_options[] =
|
||||
{
|
||||
{ {"all-files", no_argument, NULL, 'a'},
|
||||
'a', NULL, "Process all files (don't skip backup files)", ONE_DASH },
|
||||
'a', NULL, N_("Process all files (don't skip backup files)"), ONE_DASH },
|
||||
{ {"abstract", required_argument, NULL, OPTION_ABSTRACT},
|
||||
'\0', "FILE", "Set Abstract filename" , ONE_DASH },
|
||||
'\0', "FILE", N_("Set Abstract filename"), ONE_DASH },
|
||||
{ {"appid", required_argument, NULL, 'A'},
|
||||
'A', "ID", "Set Application ID" , ONE_DASH },
|
||||
'A', "ID", N_("Set Application ID"), ONE_DASH },
|
||||
{ {"biblio", required_argument, NULL, OPTION_BIBLIO},
|
||||
'\0', "FILE", "Set Bibliographic filename" , ONE_DASH },
|
||||
'\0', "FILE", N_("Set Bibliographic filename"), ONE_DASH },
|
||||
{ {"copyright", required_argument, NULL, OPTION_COPYRIGHT},
|
||||
'\0', "FILE", "Set Copyright filename" , ONE_DASH },
|
||||
'\0', "FILE", N_("Set Copyright filename"), ONE_DASH },
|
||||
{ {"eltorito-boot", required_argument, NULL, 'b'},
|
||||
'b', "FILE", "Set El Torito boot image name" , ONE_DASH },
|
||||
'b', "FILE", N_("Set El Torito boot image name"), ONE_DASH },
|
||||
{ {"eltorito-catalog", required_argument, NULL, 'c'},
|
||||
'c', "FILE", "Set El Torito boot catalog name" , ONE_DASH },
|
||||
'c', "FILE", N_("Set El Torito boot catalog name"), ONE_DASH },
|
||||
{ {"boot-info-table", no_argument, NULL, OPTION_BOOT_INFO_TABLE },
|
||||
'\0', NULL, "Patch Boot Info Table in El Torito boot image" , ONE_DASH },
|
||||
'\0', NULL, N_("Patch Boot Info Table in El Torito boot image"), ONE_DASH },
|
||||
{ {"no-emul-boot", no_argument, NULL, OPTION_NO_EMUL_BOOT },
|
||||
'\0', NULL, "Dummy option for backward compatibility" , ONE_DASH },
|
||||
'\0', NULL, N_("Dummy option for backward compatibility"), ONE_DASH },
|
||||
{ {"eltorito-emul-floppy", no_argument, NULL, OPTION_ELTORITO_EMUL_FLOPPY },
|
||||
'\0', NULL, "Enable floppy drive emulation for El Torito" , TWO_DASHES },
|
||||
'\0', NULL, N_("Enable floppy drive emulation for El Torito"), TWO_DASHES },
|
||||
{ {"cdwrite-params", required_argument, NULL, 'C'},
|
||||
'C', "PARAMS", "Magic parameters from cdrecord" , ONE_DASH },
|
||||
'C', "PARAMS", N_("Magic parameters from cdrecord"), ONE_DASH },
|
||||
{ {"omit-period", no_argument, NULL, 'd'},
|
||||
'd', NULL, "Omit trailing periods from filenames", ONE_DASH },
|
||||
'd', NULL, N_("Omit trailing periods from filenames"), ONE_DASH },
|
||||
{ {"disable-deep-relocation", no_argument, NULL, 'D'},
|
||||
'D', NULL, "Disable deep directory relocation", ONE_DASH },
|
||||
'D', NULL, N_("Disable deep directory relocation"), ONE_DASH },
|
||||
{ {"follow-links", no_argument, NULL, 'f'},
|
||||
'f', NULL, "Follow symbolic links", ONE_DASH },
|
||||
'f', NULL, N_("Follow symbolic links"), ONE_DASH },
|
||||
{ {"help", no_argument, NULL, OPTION_HELP},
|
||||
'\0', NULL, "Print option help", ONE_DASH },
|
||||
'\0', NULL, N_("Print option help"), ONE_DASH },
|
||||
{ {"help", no_argument, NULL, OPTION_HELP},
|
||||
'\0', NULL, "Print option help", TWO_DASHES },
|
||||
'\0', NULL, N_("Print option help"), TWO_DASHES },
|
||||
{ {"version", no_argument, NULL, OPTION_VERSION},
|
||||
'\0', NULL, "Print version information and exit", TWO_DASHES },
|
||||
'\0', NULL, N_("Print version information and exit"), TWO_DASHES },
|
||||
{ {"hide", required_argument, NULL, OPTION_I_HIDE},
|
||||
'\0', "GLOBFILE", "Hide ISO9660/RR file" , ONE_DASH },
|
||||
'\0', "GLOBFILE", N_("Hide ISO9660/RR file"), ONE_DASH },
|
||||
{ {"hide-joliet", required_argument, NULL, OPTION_J_HIDE},
|
||||
'\0', "GLOBFILE", "Hide Joliet file" , ONE_DASH },
|
||||
'\0', "GLOBFILE", N_("Hide Joliet file"), ONE_DASH },
|
||||
{ {NULL, required_argument, NULL, 'i'},
|
||||
'i', "ADD_FILES", "No longer supported" , TWO_DASHES },
|
||||
'i', "ADD_FILES", N_("No longer supported"), TWO_DASHES },
|
||||
{ {"joliet", no_argument, NULL, 'J'},
|
||||
'J', NULL, "Generate Joliet directory information", ONE_DASH },
|
||||
'J', NULL, N_("Generate Joliet directory information"), ONE_DASH },
|
||||
{ {"full-iso9660-filenames", no_argument, NULL, 'l'},
|
||||
'l', NULL, "Allow full 32 character filenames for iso9660 names", ONE_DASH },
|
||||
'l', NULL, N_("Allow full 32 character filenames for iso9660 names"), ONE_DASH },
|
||||
{ {"allow-leading-dots", no_argument, NULL, 'L'},
|
||||
'L', NULL, "Allow iso9660 filenames to start with '.'", ONE_DASH },
|
||||
'L', NULL, N_("Allow iso9660 filenames to start with '.'"), ONE_DASH },
|
||||
{ {"log-file", required_argument, NULL, OPTION_LOG_FILE},
|
||||
'\0', "LOG_FILE", "Re-direct messages to LOG_FILE", ONE_DASH },
|
||||
'\0', "LOG_FILE", N_("Re-direct messages to LOG_FILE"), ONE_DASH },
|
||||
{ {"exclude", required_argument, NULL, 'm'},
|
||||
'm', "GLOBFILE", "Exclude file name" , ONE_DASH },
|
||||
'm', "GLOBFILE", N_("Exclude file name"), ONE_DASH },
|
||||
{ {"prev-session", required_argument, NULL, 'M'},
|
||||
'M', "FILE", "Set path to previous session to merge" , ONE_DASH },
|
||||
'M', "FILE", N_("Set path to previous session to merge"), ONE_DASH },
|
||||
{ {"omit-version-number", no_argument, NULL, 'N'},
|
||||
'N', NULL, "Omit version number from iso9660 filename", ONE_DASH },
|
||||
'N', NULL, N_("Omit version number from iso9660 filename"), ONE_DASH },
|
||||
{ {"no-split-symlink-components", no_argument, NULL, 0},
|
||||
0, NULL, "Inhibit splitting symlink components" , ONE_DASH },
|
||||
0, NULL, N_("Inhibit splitting symlink components"), ONE_DASH },
|
||||
{ {"no-split-symlink-fields", no_argument, NULL, 0},
|
||||
0, NULL, "Inhibit splitting symlink fields" , ONE_DASH },
|
||||
0, NULL, N_("Inhibit splitting symlink fields"), ONE_DASH },
|
||||
{ {"output", required_argument, NULL, 'o'},
|
||||
'o', "FILE", "Set output file name" , ONE_DASH },
|
||||
'o', "FILE", N_("Set output file name"), ONE_DASH },
|
||||
{ {"preparer", required_argument, NULL, 'p'},
|
||||
'p', "PREP", "Set Volume preparer" , ONE_DASH },
|
||||
'p', "PREP", N_("Set Volume preparer"), ONE_DASH },
|
||||
{ {"print-size", no_argument, NULL, OPTION_PRINT_SIZE},
|
||||
'\0', NULL, "Print estimated filesystem size and exit", ONE_DASH },
|
||||
'\0', NULL, N_("Print estimated filesystem size and exit"), ONE_DASH },
|
||||
{ {"publisher", required_argument, NULL, 'P'},
|
||||
'P', "PUB", "Set Volume publisher" , ONE_DASH },
|
||||
'P', "PUB", N_("Set Volume publisher"), ONE_DASH },
|
||||
{ {"quiet", no_argument, NULL, OPTION_QUIET},
|
||||
'\0', NULL, "Run quietly", ONE_DASH },
|
||||
'\0', NULL, N_("Run quietly"), ONE_DASH },
|
||||
{ {"rational-rock", no_argument, NULL, 'r'},
|
||||
'r', NULL, "Generate rationalized Rock Ridge directory information", ONE_DASH },
|
||||
'r', NULL, N_("Generate rationalized Rock Ridge directory information"), ONE_DASH },
|
||||
{ {"rock", no_argument, NULL, 'R'},
|
||||
'R', NULL, "Generate Rock Ridge directory information", ONE_DASH },
|
||||
'R', NULL, N_("Generate Rock Ridge directory information"), ONE_DASH },
|
||||
{ {"split-output", no_argument, NULL, OPTION_SPLIT_OUTPUT},
|
||||
'\0', NULL, "Split output into files of approx. 1GB size", ONE_DASH },
|
||||
'\0', NULL, N_("Split output into files of approx. 1GB size"), ONE_DASH },
|
||||
{ {"sysid", required_argument, NULL, OPTION_SYSID},
|
||||
'\0', "ID", "Set System ID" , ONE_DASH },
|
||||
'\0', "ID", N_("Set System ID"), ONE_DASH },
|
||||
{ {"translation-table", no_argument, NULL, 'T'},
|
||||
'T', NULL, "Generate translation tables for systems that don't understand long filenames", ONE_DASH },
|
||||
'T', NULL, N_("Generate translation tables for systems that don't understand long filenames"), ONE_DASH },
|
||||
{ {"verbose", no_argument, NULL, 'v'},
|
||||
'v', NULL, "Verbose", ONE_DASH },
|
||||
'v', NULL, N_("Verbose"), ONE_DASH },
|
||||
{ {"volid", required_argument, NULL, 'V'},
|
||||
'V', "ID", "Set Volume ID" , ONE_DASH },
|
||||
'V', "ID", N_("Set Volume ID"), ONE_DASH },
|
||||
{ {"volset", required_argument, NULL, OPTION_VOLSET},
|
||||
'\0', "ID", "Set Volume set ID" , ONE_DASH },
|
||||
'\0', "ID", N_("Set Volume set ID"), ONE_DASH },
|
||||
{ {"volset-size", required_argument, NULL, OPTION_VOLSET_SIZE},
|
||||
'\0', "#", "Set Volume set size" , ONE_DASH },
|
||||
'\0', "#", N_("Set Volume set size"), ONE_DASH },
|
||||
{ {"volset-seqno", required_argument, NULL, OPTION_VOLSET_SEQ_NUM},
|
||||
'\0', "#", "Set Volume set sequence number" , ONE_DASH },
|
||||
'\0', "#", N_("Set Volume set sequence number"), ONE_DASH },
|
||||
{ {"old-exclude", required_argument, NULL, 'x'},
|
||||
'x', "FILE", "Exclude file name(depreciated)" , ONE_DASH },
|
||||
'x', "FILE", N_("Exclude file name (deprecated)"), ONE_DASH },
|
||||
#ifdef ERIC_neverdef
|
||||
{ {"transparent-compression", no_argument, NULL, 'z'},
|
||||
'z', NULL, "Enable transparent compression of files", ONE_DASH },
|
||||
#endif
|
||||
{ {"creation-date", required_argument, NULL, OPTION_CREAT_DATE },
|
||||
'\0', NULL, "Override creation date", TWO_DASHES },
|
||||
'\0', NULL, N_("Override creation date"), TWO_DASHES },
|
||||
{ {"modification-date", required_argument, NULL, OPTION_MODIF_DATE },
|
||||
'\0', NULL, "Override modification date", TWO_DASHES },
|
||||
'\0', NULL, N_("Override modification date"), TWO_DASHES },
|
||||
{ {"expiration-date", required_argument, NULL, OPTION_EXPIR_DATE },
|
||||
'\0', NULL, "Override expiration date", TWO_DASHES },
|
||||
'\0', NULL, N_("Override expiration date"), TWO_DASHES },
|
||||
{ {"effective-date", required_argument, NULL, OPTION_EFFEC_DATE },
|
||||
'\0', NULL, "Override effective date", TWO_DASHES },
|
||||
'\0', NULL, N_("Override effective date"), TWO_DASHES },
|
||||
};
|
||||
|
||||
#define OPTION_COUNT (sizeof ld_options / sizeof ld_options[0])
|
||||
|
@ -545,7 +545,7 @@ void usage(){
|
|||
for (; len < 30; len++)
|
||||
putchar (' ');
|
||||
|
||||
printf ("%s\n", ld_options[i].doc);
|
||||
printf ("%s\n", gettext (ld_options[i].doc));
|
||||
}
|
||||
}
|
||||
exit(1);
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include <locale.h>
|
||||
#include <libintl.h>
|
||||
#define _(str) gettext(str)
|
||||
#define N_(str) str
|
||||
|
||||
/* This symbol is used to indicate that we do not have things like
|
||||
symlinks, devices, and so forth available. Just files and dirs */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue