diff -ru grub-2.02~beta2.orig/docs/grub.texi grub-2.02~beta2/docs/grub.texi --- grub-2.02~beta2.orig/docs/grub.texi 2013-12-24 11:40:31.000000000 -0500 +++ grub-2.02~beta2/docs/grub.texi 2016-04-27 09:22:16.599944355 -0400 @@ -6145,6 +6145,17 @@ @item address@hidden Use @var{file} as the @command{grub-mkimage} program, rather than the built-in default. + address@hidden address@hidden +The value of @var{mode} indicates the user's preference for including +Rock Ridge extensions in the created ISO image. Value 'none' requests +that file ownership and permission information be excluded. Value +'basic' (the default) requests inclusion of simplified file ownership +and permission information by which all files share a single owner and +a limited set of permissions. Value 'full' requests inclusion of full +Unix-style ownership and permission information. In some cases, the +selected Rock Ridge mode can be effectively over-ridden by flags +passed directly to the @command{xorriso} program. @end table diff -ru grub-2.02~beta2.orig/util/grub-mkrescue.c grub-2.02~beta2/util/grub-mkrescue.c --- grub-2.02~beta2.orig/util/grub-mkrescue.c 2013-12-24 11:40:31.000000000 -0500 +++ grub-2.02~beta2/util/grub-mkrescue.c 2016-04-27 08:02:06.536092536 -0400 @@ -88,7 +88,8 @@ OPTION_PRODUCT_NAME, OPTION_PRODUCT_VERSION, OPTION_SPARC_BOOT, - OPTION_ARCS_BOOT + OPTION_ARCS_BOOT, + OPTION_ROCK_RIDGE_MODE }; static struct argp_option options[] = { @@ -102,6 +103,7 @@ 0, N_("use FILE as xorriso [optional]"), 2}, {"grub-glue-efi", OPTION_GLUE_EFI, N_("FILE"), OPTION_HIDDEN, 0, 2}, {"grub-render-label", OPTION_RENDER_LABEL, N_("FILE"), OPTION_HIDDEN, 0, 2}, + {"rock-ridge-mode", OPTION_ROCK_RIDGE_MODE, N_("basic|full|none"), 0, N_("choose Rock Ridge extension mode"), 2}, {"label-font", OPTION_LABEL_FONT, N_("FILE"), 0, N_("use FILE as font for label"), 2}, {"label-color", OPTION_LABEL_COLOR, N_("COLOR"), 0, N_("use COLOR for label"), 2}, {"label-bgcolor", OPTION_LABEL_BGCOLOR, N_("COLOR"), 0, N_("use COLOR for label background"), 2}, @@ -149,6 +151,25 @@ SYS_AREA_ARCS } system_area = SYS_AREA_AUTO; +typedef enum { + ROCK_RIDGE_MODE_BASIC = 0, + ROCK_RIDGE_MODE_FULL = 1, + ROCK_RIDGE_MODE_NONE = 2, + ROCK_RIDGE_MODE_UNKNOWN = 3 +} rock_ridge_enum; + +/* Use BASIC Rock Ridge mode absent user specification. */ +static rock_ridge_enum rock_ridge = ROCK_RIDGE_MODE_BASIC; + +static rock_ridge_enum encode_rock_ridge_mode (char *arg) +{ + static const char *modes [ 4 ] = { "basic", "full", "none", 0 }; + rock_ridge_enum i; + for (i = ROCK_RIDGE_MODE_BASIC; (modes[ i ] != 0) && + (strcmp (modes[ i ], arg) != 0); i++); + return (i); +} + static error_t argp_parser (int key, char *arg, struct argp_state *state) { @@ -156,6 +177,10 @@ return 0; switch (key) { + case OPTION_ROCK_RIDGE_MODE: + rock_ridge = encode_rock_ridge_mode (arg); + return ((rock_ridge == ROCK_RIDGE_MODE_UNKNOWN) ? + ARGP_ERR_UNKNOWN : 0); case OPTION_OUTPUT: free (output_image); output_image = xstrdup (arg); @@ -843,7 +868,26 @@ xorriso_push ("--protective-msdos-label"); xorriso_push ("-o"); xorriso_push (output_image); - xorriso_push ("-r"); + switch (rock_ridge) { + case ROCK_RIDGE_MODE_BASIC: + /* Do not gratuitously suppress full Rock Ridge ownership and + permission information in the final ISO image. Do not pass a + lowercase "-r" flag to xorriso unless BASIC Rock Ridge + extensions are desired. */ + xorriso_push ("-r"); + break; + case ROCK_RIDGE_MODE_FULL: + /* Full Rock Ridge ownership and permission information is + requested. */ + xorriso_push ("-R"); + break; + case ROCK_RIDGE_MODE_NONE: + /* Rock Ridge information is deliberately suppressed. */ + xorriso_push ("--norock"); + break; + default: + break; + } xorriso_push (iso9660_dir); xorriso_push ("--sort-weight"); xorriso_push ("0");