summaryrefslogtreecommitdiff
path: root/src/rootfs.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/rootfs.rs')
-rw-r--r--src/rootfs.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/rootfs.rs b/src/rootfs.rs
index 3f06045..9af2e57 100644
--- a/src/rootfs.rs
+++ b/src/rootfs.rs
@@ -641,6 +641,33 @@ pub fn build_rootfs(
let result = run_all_install_steps(&group.packages, &installing, target_dir);
+ if result.is_ok() && !group.install_steps.trim().is_empty() {
+ println!("{} Running group install_steps in chroot...", ">>>".cyan());
+ let shell_result = find_working_shell(target_dir)
+ .ok_or_else(|| "No working shell found for group install_steps".to_string());
+ match shell_result {
+ Ok((shell, subcmd)) => {
+ if let Err(e) = run_install_steps_in_chroot(
+ &group.name,
+ &group.install_steps,
+ target_dir,
+ shell,
+ subcmd,
+ ) {
+ println!("{} Unmounting virtual filesystems...", ">>>".cyan());
+ umount_virtual_fs(target_dir);
+ return Err(e);
+ }
+ println!("{} Group install_steps done.", ">>>".green());
+ }
+ Err(e) => {
+ println!("{} Unmounting virtual filesystems...", ">>>".cyan());
+ umount_virtual_fs(target_dir);
+ return Err(e);
+ }
+ }
+ }
+
println!("{} Unmounting virtual filesystems...", ">>>".cyan());
umount_virtual_fs(target_dir);