iterate_inputs (inputs, nr_inputs, writer);
+ writer->wr_file ("/lib/modules");
/* Kernel modules (3). */
add_kernel_modules (whitelist, modpath, 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);
}
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);
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);