stages/kickstart: add noswap to autopart

Allow passing the `noswap` option to `autopart`.
This commit is contained in:
Simon de Vlieger 2024-03-09 11:05:43 +01:00
parent 29159189f1
commit a895aa177c
2 changed files with 9 additions and 1 deletions

View file

@ -402,6 +402,10 @@ SCHEMA = r"""
"nohome": {
"description": "Disables automatic creation of the /home partition",
"type": "boolean"
},
"noswap": {
"description": "Disables automatic creation of a swap partition",
"type": "boolean"
}
}
},
@ -536,7 +540,8 @@ def make_autopart(options: Dict) -> str:
cmd = "autopart"
for key in ["type", "fstype", "nolvm", "encrypted", "passphrase",
"escrowcert", "backuppassphrase", "cipher", "luks-version",
"pbkdf", "pbkdf-memory", "pbkdf-time", "pbkdf-iterations", "nohome"]:
"pbkdf", "pbkdf-memory", "pbkdf-time", "pbkdf-iterations", "nohome",
"noswap"]:
if key not in autopart:
continue
val = autopart[key]

View file

@ -140,7 +140,10 @@ TEST_INPUT = [
({"autopart": {"pbkdf-time": 128}}, "autopart --pbkdf-time=128"),
({"autopart": {"pbkdf-iterations": 256}}, "autopart --pbkdf-iterations=256"),
({"autopart": {"nohome": True}}, "autopart --nohome"),
({"autopart": {"noswap": True}}, "autopart --noswap"),
({"autopart": {"type": "plain", "fstype": "xfs", "nohome": True}}, "autopart --type=plain --fstype=xfs --nohome"),
({"autopart": {"type": "plain", "fstype": "xfs", "nohome": True, "noswap": True}},
"autopart --type=plain --fstype=xfs --nohome --noswap"),
({
"lang": "en_US.UTF-8",
"keyboard": "us",