X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=febootstrap.ml;h=3c634c419e7dafd2ac53cff135d95987b949b049;hb=fb6a900047ba372ec933ebf1b3d7339c4f33243c;hp=966a3163635df465cabb125dc68aefffa1e00234;hpb=66a9d53e48f14d7fe1d9f4b801a1c5582d83efa6;p=febootstrap.git diff --git a/febootstrap.ml b/febootstrap.ml index 966a316..3c634c4 100644 --- a/febootstrap.ml +++ b/febootstrap.ml @@ -126,7 +126,8 @@ let () = else ( insert_dir parent; let newdir = (parent, { ft_dir = true; ft_config = false; - ft_ghost = false; ft_mode = 0o40755 }, + ft_ghost = false; ft_mode = 0o40755; + ft_size = 0 }, "") in newdir :: loop parent ) @@ -140,23 +141,25 @@ let () = if false then ( List.iter ( fun (name, { ft_dir = dir; ft_ghost = ghost; ft_config = config; - ft_mode = mode }, pkg) -> - printf "%s [%s%s%s%o] from %s\n" name + ft_mode = mode; ft_size = size }, pkg) -> + printf "%s [%s%s%s%o %d] from %s\n" name (if dir then "dir " else "") (if ghost then "ghost " else "") (if config then "config " else "") - mode + mode size pkg ) files ); (* Split the list of files into ones for hostfiles and ones for base image. *) - let p_hmac = Str.regexp "/\\.*\\.hmac$" in + let p_hmac = Str.regexp "^\\..*\\.hmac$" in let hostfiles = ref [] and baseimgfiles = ref [] in List.iter ( fun (path, {ft_dir = dir; ft_ghost = ghost; ft_config = config} ,_ as f) -> + let file = Filename.basename path in + (* Ignore boot files, kernel, kernel modules. Supermin appliances * are booted from external kernel and initrd, and * febootstrap-supermin-helper copies the host kernel modules. @@ -176,7 +179,7 @@ let () = hostfiles := f :: !hostfiles (* Ignore FIPS files (.*.hmac) (RHBZ#654638). *) - else if Str.string_match p_hmac path 0 then () + else if Str.string_match p_hmac file 0 then () (* Ghost files are created empty in the base image. *) else if ghost then @@ -374,19 +377,22 @@ let () = (match !warn_unreadable with | [] -> () | paths -> - eprintf "febootstrap: warning: some host files are unreadable by non-root\nGet your distro to fix these files:\n"; + eprintf "febootstrap: warning: some host files are unreadable by non-root\n"; + eprintf "febootstrap: warning: get your distro to fix these files:\n"; List.iter - (fun path -> eprintf "\t%s\n" path) + (fun path -> eprintf "\t%s\n%!" path) (List.sort compare paths) ); ); (* Near-atomically copy files to the final output directory. *) + debug "writing %s ..." (outputdir // "base.img"); let cmd = sprintf "mv %s %s" (Filename.quote (tmpdir // "base.img")) (Filename.quote (outputdir // "base.img")) in run_command cmd; + debug "writing %s ..." (outputdir // "hostfiles"); let cmd = sprintf "mv %s %s" (Filename.quote (tmpdir // "hostfiles"))