From 2697bb2bc7e353da24c914a527e044894334c6a3 Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Thu, 22 Mar 2018 12:25:27 -0700 Subject: [PATCH] Add support for building ext4 filesystem images. --- share/composer/ext4-filesystem.ks | 46 +++++++++++++++++++++++++++++++ src/pylorax/api/compose.py | 22 ++++++++++++++- 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 share/composer/ext4-filesystem.ks diff --git a/share/composer/ext4-filesystem.ks b/share/composer/ext4-filesystem.ks new file mode 100644 index 00000000..dd054896 --- /dev/null +++ b/share/composer/ext4-filesystem.ks @@ -0,0 +1,46 @@ +# Lorax Composer filesystem output kickstart template + +# +sshpw --username=root --plaintext randOmStrinGhERE +# Firewall configuration +firewall --enabled + +# Root password +rootpw --plaintext removethispw +# Network information +network --bootproto=dhcp --onboot=on --activate +# System authorization information +auth --useshadow --enablemd5 +# System keyboard +keyboard --xlayouts=us --vckeymap=us +# System language +lang en_US.UTF-8 +# SELinux configuration +selinux --enforcing +# Installation logging level +logging --level=info +# Shutdown after installation +shutdown +# System timezone +timezone US/Eastern +# System bootloader configuration +bootloader --location=none +# Clear the Master Boot Record +zerombr +# Partition clearing information +clearpart --all +# Disk partitioning information +part / --fstype="ext4" --size=4000 +part swap --size=1000 + +%post +# Remove root password +passwd -d root > /dev/null + +# Remove random-seed +rm /var/lib/systemd/random-seed +%end + +%packages --nobase + +# NOTE lorax-composer will add the recipe packages below here, including the final %end diff --git a/src/pylorax/api/compose.py b/src/pylorax/api/compose.py index 0efb7384..5e3d1273 100644 --- a/src/pylorax/api/compose.py +++ b/src/pylorax/api/compose.py @@ -341,6 +341,26 @@ def compose_args(compose_type): "app_template": None, "app_file": None }, + "ext4-filesystem": {"make_iso": False, + "make_disk": False, + "make_fsimage": True, + "make_appliance": False, + "make_ami": False, + "make_tar": False, + "make_pxe_live": False, + "make_ostree_live": False, + "ostree": False, + "live_rootfs_keep_size": False, + "live_rootfs_size": 0, + "qcow2": False, + "qcow2_args": [], + "image_name": "filesystem.img", + "fs_label": "", + "image_only": True, + "app_name": None, + "app_template": None, + "app_file": None + }, } return _MAP[compose_type] @@ -357,7 +377,7 @@ def move_compose_results(cfg, results_dir): elif cfg["make_iso"]: # Output from live iso is always a boot.iso under images/, move and rename it shutil.move(joinpaths(cfg["result_dir"], "images/boot.iso"), joinpaths(results_dir, cfg["image_name"])) - elif cfg["make_disk"]: + elif cfg["make_disk"] or cfg["make_fsimage"]: shutil.move(joinpaths(cfg["result_dir"], cfg["image_name"]), joinpaths(results_dir, cfg["image_name"]))