Add support for building ext4 filesystem images.

This commit is contained in:
Brian C. Lane 2018-03-22 12:25:27 -07:00
parent 020d9de4b3
commit 2697bb2bc7
2 changed files with 67 additions and 1 deletions

View File

@ -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

View File

@ -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"]))