dib: cleanup logs at end of build

Recently, diskimage-builder moved the log cleanup from the 'base'
element to disk-image-create proper; the cleanup done is:
- truncate any file in /var/log
- remove *.log files in /root

This was implemented in diskimage-builder upstream as
commit 022d93ee822e71245af52c4cf8f8a8e82f599af3.
This commit is contained in:
Pino Toscano
2017-02-10 16:10:10 +01:00
parent 8ee51ee396
commit c8236b2f1c

View File

@@ -895,6 +895,13 @@ let main () =
flush_all ();
g#mount blockdev "/";
Array.iter (fun x -> g#rm_rf ("/tmp/" ^ x)) (g#ls "/tmp");
(* Truncate /var/log files in preparation for first boot. *)
truncate_recursive g "/var/log";
let non_log fn =
not (String.is_suffix fn ".log")
in
(* Remove root logs. *)
rm_rf_only_files g ~filter:non_log "/root";
flush_all ();