X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=helper%2Fappliance.c;h=c4d0b32117eedefb0604b2e3cdc723d67c61de61;hb=2e1e2d686ca8f819c202d2ed4e8a5c5758451f26;hp=e014b126626980473a299f593bcf036a5d0303e6;hpb=6066c3e245a28b55dd1c02d2dd1b524d83068ef3;p=febootstrap.git diff --git a/helper/appliance.c b/helper/appliance.c index e014b12..c4d0b32 100644 --- a/helper/appliance.c +++ b/helper/appliance.c @@ -77,6 +77,7 @@ create_appliance (const char *hostcpu, iterate_inputs (inputs, nr_inputs, writer); + writer->wr_file ("/lib/modules"); /* Kernel modules (3). */ add_kernel_modules (whitelist, modpath, writer); @@ -144,6 +145,11 @@ iterate_input_directory (const char *dirname, int dirfd, struct writer *writer) if (d->d_name[0] == '.') /* ignore ., .. and any hidden files. */ continue; + /* Ignore *~ files created by editors. */ + size_t len = strlen (d->d_name); + if (len > 0 && d->d_name[len-1] == '~') + continue; + add_string (&entries, &nr_entries, &nr_alloc, d->d_name); } @@ -191,6 +197,9 @@ static void add_kernel_modules (const char *whitelist_file, const char *modpath, struct writer *writer) { + if (verbose) + print_timestamped_message ("adding kernel modules"); + char **whitelist = NULL; if (whitelist_file != NULL) whitelist = load_file (whitelist_file); @@ -275,7 +284,9 @@ add_hostfiles (const char *hostfiles_file, struct writer *writer) if (strchr (hostfile, '*') || strchr (hostfile, '?')) { char *dirname = xstrdup (hostfile); char *patt = strrchr (dirname, '/'); - assert (patt); + if (!patt) + error (EXIT_FAILURE, 0, "%s: line %zu: invalid pattern\n(is this file a supermin appliance hostfiles file?)", + hostfiles_file, i+1); *patt++ = '\0'; char **files = read_dir (dirname);