From 82cf9772dcf73c00d3cdb7f9e73fa08425b5a7a6 Mon Sep 17 00:00:00 2001 From: teldra Date: Tue, 16 Mar 2021 22:38:22 +0100 Subject: [PATCH] small fixes --- main.sh | 6 +++++- modules/10-disk/pre | 3 ++- modules/30-users/pre | 3 ++- run_in_chroot.sh | 6 ++++++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/main.sh b/main.sh index 73f9de2..8038f8b 100755 --- a/main.sh +++ b/main.sh @@ -38,6 +38,10 @@ cp -rf "${modules}" "${dest}"/tmp/installer cp -rf "${functions}" "${dest}"/tmp/installer cp -rf ./run_in_chroot.sh "${dest}"/tmp/installer -chroot "${dest}" "/tmp/installer/run_in_chroot.sh" +for i in $(seq 1 "${users[amount]}"); do + pw+=( "${i}" ) +done + +chroot "${dest}" "/tmp/installer/run_in_chroot.sh" "${cfg[diskpw]}" "${pw[@]}" #umounter "${dest}" diff --git a/modules/10-disk/pre b/modules/10-disk/pre index 9e03a27..5b9bdc0 100644 --- a/modules/10-disk/pre +++ b/modules/10-disk/pre @@ -106,7 +106,8 @@ if [[ ! "${cfg[fde_key_store]}" == "none" ]]; then addpkg "cryptsetup" #input_pw "Disk Password" output="oem" - setconf "add" "diskpw" "${output}" + #setconf "add" "diskpw" "${output}" + cfg+=( "${output}" ) fi if check yesno "Do you want to hibernate?" "y"; then diff --git a/modules/30-users/pre b/modules/30-users/pre index e1acbcd..43634b8 100644 --- a/modules/30-users/pre +++ b/modules/30-users/pre @@ -64,7 +64,8 @@ while echo $((index++)) > /dev/null; do #input_pw "User ${users[name${counter}]} password" output="oem" - useradder "pw" "${counter}" "${output}" + #useradder "pw" "${counter}" "${output}" + users+=( [pw${counter}]="${output}" ) if [[ "${standalone}" == "1" ]]; then if ! yesno "More users?" "n"; then diff --git a/run_in_chroot.sh b/run_in_chroot.sh index 030b293..5f6c753 100755 --- a/run_in_chroot.sh +++ b/run_in_chroot.sh @@ -17,6 +17,12 @@ for i in $(find "${vars}" -type f); do echo "${i}" source "${i}" done +cfg+=( [diskpw]="${1}" ) + +input="${@}" +for i in $(seq 1 "${#input[@]}"); do + [[ ! "${i}" == "1" ]] && users+=( [pw$i]="${input[$i]}" ) +done export run="install" for i in $(find "${modules}" -mindepth 1 -maxdepth 1 -type d | sort -n ); do