Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Hvornum <anton.feeds@gmail.com>2021-11-11 09:43:06 +0000
committerAnton Hvornum <anton.feeds@gmail.com>2021-11-11 09:43:06 +0000
commit813afa150719d99418bbb79cb1c4d25e7f07a0f6 (patch)
tree81b80982722fa16b735bf3cfc00786a139c483ef
parent9fe4dbc50e3a85e16af655b3f6071e35db837ae4 (diff)
Only adding disk encryption to user_credentials.json when supplied.
-rw-r--r--examples/guided.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/guided.py b/examples/guided.py
index 73bf7712..1b571d17 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -243,15 +243,16 @@ def perform_filesystem_operations():
fs.load_layout(archinstall.storage['disk_layouts'][drive.path])
def perform_installation(mountpoint):
- user_credentials = json.dumps({
+ user_credentials = {
"!users" : archinstall.arguments['!users'],
"!superusers" : archinstall.arguments['!users'],
"!root-password" : archinstall.arguments['!users'],
- "!encryption-password" : archinstall.arguments['!encryption-password'],
- }, indent=4, sort_keys=True, cls=archinstall.UNSAFE_JSON)
+ }
+ if archinstall.arguments.get('!encryption-password'):
+ user_credentials["!encryption-password"] = archinstall.arguments.get('!encryption-password')
with open("/var/log/archinstall/user_credentials.json", "w") as config_file:
- config_file.write(user_credentials)
+ config_file.write(json.dumps(user_credentials, indent=4, sort_keys=True, cls=archinstall.UNSAFE_JSON))
"""
Performs the installation steps on a block device.