mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
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:
@@ -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 ();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user