@@ -82,6 +82,7 @@ static gboolean guess_update_information = FALSE;
8282gchar * bintray_user = NULL ;
8383gchar * bintray_repo = NULL ;
8484gchar * sqfs_comp = "gzip" ;
85+ gchar * * sqfs_opts = NULL ;
8586gchar * exclude_file = NULL ;
8687gchar * runtime_file = NULL ;
8788gchar * sign_args = NULL ;
@@ -142,7 +143,10 @@ int sfs_mksquashfs(char *source, char *destination, int offset) {
142143 gchar * offset_string ;
143144 offset_string = g_strdup_printf ("%i" , offset );
144145
145- char * args [32 ];
146+ guint sqfs_opts_len = sqfs_opts ? g_strv_length (sqfs_opts ) : 0 ;
147+
148+ int max_num_args = sqfs_opts_len + 22 ;
149+ char * args [max_num_args ];
146150 bool use_xz = strcmp (sqfs_comp , "xz" ) >= 0 ;
147151
148152 int i = 0 ;
@@ -155,8 +159,8 @@ int sfs_mksquashfs(char *source, char *destination, int offset) {
155159 args [i ++ ] = destination ;
156160 args [i ++ ] = "-offset" ;
157161 args [i ++ ] = offset_string ;
158- args [i ++ ] = "-comp" ;
159162
163+ args [i ++ ] = "-comp" ;
160164 if (use_xz )
161165 args [i ++ ] = "xz" ;
162166 else
@@ -200,6 +204,10 @@ int sfs_mksquashfs(char *source, char *destination, int offset) {
200204 args [i ++ ] = "-mkfs-time" ;
201205 args [i ++ ] = "0" ;
202206
207+ for (guint sqfs_opts_idx = 0 ; sqfs_opts_idx < sqfs_opts_len ; ++ sqfs_opts_idx ) {
208+ args [i ++ ] = sqfs_opts [sqfs_opts_idx ];
209+ }
210+
203211 args [i ++ ] = 0 ;
204212
205213 if (verbose ) {
@@ -505,6 +513,7 @@ static GOptionEntry entries[] =
505513 { "verbose" , 'v' , 0 , G_OPTION_ARG_NONE , & verbose , "Produce verbose output" , NULL },
506514 { "sign" , 's' , 0 , G_OPTION_ARG_NONE , & sign , "Sign with gpg[2]" , NULL },
507515 { "comp" , 0 , 0 , G_OPTION_ARG_STRING , & sqfs_comp , "Squashfs compression" , NULL },
516+ { "mksquashfs-opt" , 0 , 0 , G_OPTION_ARG_STRING_ARRAY , & sqfs_opts , "Argument to pass through to mksquashfs; can be specified multiple times" , NULL },
508517 { "no-appstream" , 'n' , 0 , G_OPTION_ARG_NONE , & no_appstream , "Do not check AppStream metadata" , NULL },
509518 { "exclude-file" , 0 , 0 , G_OPTION_ARG_STRING , & exclude_file , _exclude_file_desc , NULL },
510519 { "runtime-file" , 0 , 0 , G_OPTION_ARG_STRING , & runtime_file , "Runtime file to use" , NULL },
0 commit comments