Skip to contentSkip to conversation

Support to disable reed-solomon codes

PATCH Superseded Jon McCune 1 participant 1 message Nov 7, 2013

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Jon McCune

author
#0 lore raw

PATCH 1/1 Support to disable reed-solomon codes

[v0] new grub-*-setup flag to disable insertion of reed solomon codes [v0] grub-install support for option --no-rs-codes
[v1] bugfix: also change the maxsec value in util/setup.c

---
 include/grub/util/install.h |  4 ++--
 util/grub-install.in        |  7 +++++-
 util/grub-setup.c           | 12 +++++++++-
 util/setup.c                | 53 +++++++++++++++++++++++++--------------------
 4 files changed, 48 insertions(+), 28 deletions(-)
include/grub/util/install.h +2 -2
index 7eb6141..9b33368 100644
@@ -53,12 +53,12 @@ void
 grub_util_bios_setup (const char *dir,
 		      const char *boot_file, const char *core_file,
 		      const char *dest, int force,
-		      int fs_probe, int allow_floppy);
+		      int fs_probe, int allow_floppy, int no_rs_codes);
 void
 grub_util_sparc_setup (const char *dir,
 		       const char *boot_file, const char *core_file,
 		       const char *dest, int force,
-		       int fs_probe, int allow_floppy);
+		       int fs_probe, int allow_floppy, int no_rs_codes);
 
 char *
 grub_install_get_image_targets_string (void);
util/grub-install.in +6 -1
index 7cd089b..79d103f 100644
@@ -87,6 +87,7 @@ usage () {
     print_option_help  "--removable" "$(gettext "the installation device is removable. This option is only available on EFI.")"
     print_option_help  "--bootloader-id=$(gettext "ID")" "$(gettext "the ID of bootloader. This option is only available on EFI.")"
     print_option_help "--efi-directory=$(gettext "DIR")" "$(gettext "use DIR as the EFI System Partition root.")"
+    print_option_help "--no-rs-codes" "$(gettext "Do not apply any reed-solomon codes, even if there is enough space.")"
 echo
 gettext "INSTALL_DEVICE must be system device filename.";echo
 echo
@@ -100,6 +101,7 @@ gettext "Report bugs to <[email protected]>."; echo
 allow_floppy=""
 force_file_id=
 efidir=
+no_rs_codes=""
 
 # Check the arguments.
 while test $# -gt 0
@@ -199,6 +201,9 @@ do
     --no-nvram)
 	update_nvram=no ;;
 
+    --no-rs-codes)
+	no_rs_codes="--no-rs-codes" ;;
+
     # This is an undocumented feature...
     --debug)
 	debug=yes ;;
@@ -680,7 +685,7 @@ fi
 # Perform the grub_modinfo_platform-dependent install
 if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = "i386-pc" ] || [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = "sparc64-ieee1275" ] ; then
     # Now perform the installation.
-    "$grub_setup" ${allow_floppy} ${setup_verbose} ${setup_force} --directory="${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform" \
+    "$grub_setup" ${allow_floppy} ${setup_verbose} ${setup_force} ${no_rs_codes} --directory="${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_platform" \
 	--device-map="${device_map}" "${install_device}" || exit 1
 elif [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = "i386-ieee1275" ] || [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = "powerpc-ieee1275" ]; then
 
util/grub-setup.c +11 -1
index 90b9de0..088efcf 100644
@@ -83,6 +83,10 @@ static struct argp_option options[] = {
       likely to make the install unbootable from HDD.  */
    N_("make the drive also bootable as floppy (default for fdX devices). May break on some BIOSes."), 0},
 
+  {"no-rs-codes", 'n', 0,      0,
+   N_("Do not apply any reed-solomon codes, even if there is enough space."), 0},
+
+
   { 0, 0, 0, 0, 0, 0 }
 };
 
@@ -118,6 +122,7 @@ struct arguments
   int  fs_probe;
   int allow_floppy;
   char *device;
+  int no_rs_codes;
 };
 
 static error_t
@@ -173,6 +178,10 @@ argp_parser (int key, char *arg, struct argp_state *state)
         verbosity++;
         break;
 
+      case 'n':
+        arguments->no_rs_codes = 1;
+        break;
+
       case ARGP_KEY_ARG:
         if (state->arg_num == 0)
           arguments->device = xstrdup(arg);
@@ -292,7 +301,8 @@ main (int argc, char *argv[])
 		   arguments.boot_file ? : DEFAULT_BOOT_FILE,
 		   arguments.core_file ? : DEFAULT_CORE_FILE,
 		   dest_dev, arguments.force,
-		   arguments.fs_probe, arguments.allow_floppy);
+		   arguments.fs_probe, arguments.allow_floppy,
+		   arguments.no_rs_codes);
 
   /* Free resources.  */
   grub_fini_all ();
util/setup.c +29 -24

74 lines not on this page · raw message

Signature · 1 line
1.8.4.1