diff --git a/etc/functions b/etc/functions index b74bd35..5f02974 100644 --- a/etc/functions +++ b/etc/functions @@ -5,17 +5,18 @@ err() { } header() { - if [ "$DEBUG" == "1" ]; then + if [ "$DEBUG" -ge "1" ]; then echo please enter enter read a - if [ "$a" == "2" ]; then + if [ "$a" -ge "2" ]; then set -x - elif [ "$a" == "0" ]; then + fi + if [ "$a" == "0" ]; then DEBUG=0 fi fi clear - echo "#### $1" + echo "#### $1 ####" } addpkg() { diff --git a/main.sh b/main.sh index 3ef6f0d..0ae5125 100755 --- a/main.sh +++ b/main.sh @@ -252,13 +252,35 @@ do_install() { for i in "${ignorepkgs[@]}"; do echo "ignorepkg=${i}" >> "${target}/etc/xbps.d/10-ignore-pkg.conf" done - if [ "${DEBUG}" == "1" ]; then + if [ "${DEBUG}" -ge "1" ]; then + echo_vars + read xbps-install -S -R https://alpha.de.repo.voidlinux.org/current -r "${target}" "${pkgs[@]}" else xbps-install -Sy -R https://alpha.de.repo.voidlinux.org/current -r "${target}" "${pkgs[@]}" fi } +echo_vars() { + echo "USERNAME=${USERNAME}" > "${vars}" + echo "PASS=${PASS}" >> "${vars}" + echo "HOSTNAME=${HOSTNAME}" >> "${vars}" + if [ "${DEBUG}" -ge "1" ]; then + echo "EFI=${EFI}" >> "${vars}" + echo "LANGUAGE_=${LANGUAGE_}" >> "${vars}" + echo "L1=${L1}" >> "${vars}" + echo "L2=${L2}" >> "${vars}" + echo "TARGET_PHY_ID=${TARGET_PHY_ID}" >> "${vars}" + echo "TARGET_PART=${TARGET_PART}" >> "${vars}" + echo "TARGETNAME_UNDERSCORE=${TARGETNAME_UNDERSCORE}" >> "${vars}" + echo "ENCRYPTION_STYLE=${ENCRYPTION_STYLE}" >> "${vars}" + echo "TIMEZONE=${TIMEZONE}" >> "${vars}" + echo "ENC=${ENC}" >> "${vars}" + echo "HIBERNATE=${HIBERNATE}" >> "${vars}" + echo "KEY_LANG=${KEY_LANG}" >> "${vars}" + fi +} + do_chroot() { header "Chroot into new System" mkdir -p "${target}/tmp/vinstaller/" @@ -333,7 +355,7 @@ ready() { echo "${ignorepkgs[@]}" echo "" echo "vars:" - cat ${vars} + echo_vars echo "" }