diff options
author | xengineering <mail2xengineering@protonmail.com> | 2019-12-17 14:01:08 +0100 |
---|---|---|
committer | xengineering <mail2xengineering@protonmail.com> | 2019-12-17 14:01:08 +0100 |
commit | 0286fe576b48b6e7c191f37fea364cde1e21a713 (patch) | |
tree | 48a00b9fcb574f08029daf04b1bb878728d57c4e | |
parent | f5d7884eb22ab15a5a5c7a70cfcecec8cce360b8 (diff) | |
download | archinstall-0286fe576b48b6e7c191f37fea364cde1e21a713.tar archinstall-0286fe576b48b6e7c191f37fea364cde1e21a713.tar.zst archinstall-0286fe576b48b6e7c191f37fea364cde1e21a713.zip |
Implemented system encryption in write_config.py and first_stage.sh.
-rw-r--r-- | stages/first_stage.sh | 9 | ||||
-rw-r--r-- | util/write_config.py | 14 |
2 files changed, 22 insertions, 1 deletions
diff --git a/stages/first_stage.sh b/stages/first_stage.sh index a491067..cb1503a 100644 --- a/stages/first_stage.sh +++ b/stages/first_stage.sh @@ -37,6 +37,7 @@ export main_partition_path="${disk_path}2" export hostname=$(python $REPOSITORY_PATH/util/read_config_string.py $CONFIG_FILE_PATH "hostname") export desktop=$(python $REPOSITORY_PATH/util/read_config_string.py $CONFIG_FILE_PATH "desktop") export admin_username=$(python $REPOSITORY_PATH/util/read_config_string.py $CONFIG_FILE_PATH "admin_username") +export system_encryption=$(python $REPOSITORY_PATH/util/read_config_string.py $CONFIG_FILE_PATH "system_encryption") bash confirm_installation.sh $disk @@ -45,6 +46,14 @@ bash check_bootmode.sh bash partition_disk.sh $disk_path +if [ $system_encryption == "yes" ];then + + bash create_crypto_partition.sh $main_partition_path + + bash create_logical_volumes.sh + +fi + bash create_filesystems.sh $efi_partition_path $main_partition_path bash mount_filesystems.sh $main_partition_path diff --git a/util/write_config.py b/util/write_config.py index 8f9dae9..17653f1 100644 --- a/util/write_config.py +++ b/util/write_config.py @@ -42,7 +42,7 @@ print("Please type in the hostname of your new machine:") config["hostname"] = input() -# Desktop or no Desktop +# Desktop or no desktop print("Do you want to install a desktop? [Y/n]:") answer = input() @@ -58,6 +58,18 @@ print("Please select your username (like 'paul' or 'alice'):") config["admin_username"] = input() +# System encryption + +print("System encryption protects all your data if your device is stolen.") +print("A second password will be required at startup to decrypt the system.") +print("Do you want to encrypt your system? [Y/n]") +answer = input() +if answer in ["", "Y", "y", "Yes", "yes"]: + config["system_encryption"] = "yes" +else: + config["system_encryption"] = "no" + + # Write config to json file config_json = json.dumps(config, indent=4) |