diff --git a/etc/base b/etc/base index 78c5935..a5dece9 100644 --- a/etc/base +++ b/etc/base @@ -6,9 +6,9 @@ config() { chown root:root / chmod 755 / echo ${HOSTNAME} > /etc/hostname -ln -sf "/usr/share/zoneinfo/${timezone}" /etc/localtime +ln -sf "/usr/share/zoneinfo/${TIMEZONE}" /etc/localtime sed -i "s/#HOSTNAME=\"void-live\"/HOSTNAME=${HOSTNAME}/g" /etc/rc.conf -sed -i "s/Europe\/Madrid/${timezone//\//\\/}/" /etc/rc.conf +sed -i "s/Europe\/Madrid/${TIMEZONE//\//\\/}/" /etc/rc.conf sed -i "/HARDWARECLOCK/s/^#//g" /etc/rc.conf sed -i "/FONT=/s/^#//g" /etc/rc.conf @@ -47,7 +47,7 @@ sed -i "/^GRUB_CMDLINE_LINUX_DEFAULT/s/=\"/=\"rd.lvm.vg=vg_${TARGETNAME_UNDERSCO if [ "$ENCRYPTION_STYLE" == "a" ] || [ "$ENCRYPTION_STYLE" == "d" ]; then dd bs=1 count=64 if=/dev/urandom of=/boot/volume.key - echo -n $pass | cryptsetup luksAddKey $TARGET_PHY_ID-part${TARGET_PART} /boot/volume.key + echo -n "${PASS}" | cryptsetup luksAddKey $TARGET_PHY_ID-part${TARGET_PART} /boot/volume.key chmod 000 /boot/volume.key chmod -R g-rwx,o-rwx /boot if [ "$ENCRYPTION_STYLE" == "a" ]; then @@ -57,7 +57,7 @@ if [ "$ENCRYPTION_STYLE" == "a" ] || [ "$ENCRYPTION_STYLE" == "d" ]; then fi if [ "$ENC" == "1" ]; then - echo "echo \"Disk pw is '${pass}'\"" > /etc/runit/core-services/99-changepwdisk.sh + echo "echo \"Disk pw is '${PASS}'\"" > /etc/runit/core-services/99-changepwdisk.sh echo "read -p \"Change PW for disk? y/n \" answer" >> /etc/runit/core-services/99-changepwdisk.sh echo "if [ \"\${answer}\" = \"y\" ]; then" >> /etc/runit/core-services/99-changepwdisk.sh echo " while ! cryptsetup luksChangeKey /dev/disk/by-uuid/${cfg[partuuid]}; do" >> /etc/runit/core-services/99-changepwdisk.sh @@ -68,11 +68,11 @@ if [ "$ENC" == "1" ]; then fi useradd -G wheel -m -s /usr/bin/bash -c "${USERNAME}" "${USERNAME}" -echo -e "${pass}\n${pass}" | passwd "${USERNAME}" +echo -e "${PASS}\n${PASS}" | passwd "${USERNAME}" passwd -dl root -echo "echo \"User pw is '${pass}'\"" > /etc/runit/core-services/99-changepwuser.sh +echo "echo \"User pw is '${PASS}'\"" > /etc/runit/core-services/99-changepwuser.sh echo "echo \"You should change it before login\"" > /etc/runit/core-services/99-changepwuser.sh echo "read -p \"Change PW for ${USERNAME}? y/n \" answer" >> /etc/runit/core-services/99-changepwuser.sh echo "if [ \"\${answer}\" = \"y\" ]; then" >> /etc/runit/core-services/99-changepwuser.sh diff --git a/main.sh b/main.sh index 8163b92..9931dda 100755 --- a/main.sh +++ b/main.sh @@ -1,7 +1,7 @@ #!/bin/bash -pass="oem" -timezone="Europe/Berlin" +PASS="oem" +TIMEZONE="Europe/Berlin" main="/tmp/vinstall" @@ -157,11 +157,7 @@ do_partition() { fi fi - for dir in dev proc sys run; do - mkdir -p "${target}/${dir}" - mount --rbind "/${dir}" "${target}/${dir}" - mount --make-rslave "${target}/${dir}" - done + } user() { @@ -216,6 +212,7 @@ lang() { LANGUAGE="${output}" if [ "${LANGUAGE}" == "de" ]; then L1="de_DE" + L2="de-latin1-nodeadkeys" fi } @@ -238,7 +235,7 @@ do_chroot() { cp -rf "${tmp_target}" "${target}/tmp/vinstaller/run" echo "USERNAME=${USERNAME}" > "${vars}" - echo "pass=${pass}" >> "${vars}" + echo "PASS=${PASS}" >> "${vars}" echo "HOSTNAME=${HOSTNAME}" >> "${vars}" echo "EFI=${EFI}" >> "${vars}" echo "LANGUAGE=${LANGUAGE}" >> "${vars}" @@ -247,7 +244,7 @@ do_chroot() { echo "TARGET_PART=${TARGET_PART}" >> "${vars}" echo "TARGETNAME_UNDERSCORE=${TARGETNAME_UNDERSCORE}" >> "${vars}" echo "ENCRYPTION_STYLE=${ENCRYPTION_STYLE}" >> "${vars}" - echo "timezone=${timezone}" >> "${vars}" + echo "TIMEZONE=${TIMEZONE}" >> "${vars}" echo "ENC=${ENC}" >> "${vars}" echo "HIBERNATE=${HIBERNATE}" >> "${vars}" @@ -271,6 +268,12 @@ for file in \$(find /tmp/vinstaller/run -type f); do done EOF +for dir in dev proc sys run; do + mkdir -p "${target}/${dir}" + mount --rbind "/${dir}" "${target}/${dir}" + mount --make-rslave "${target}/${dir}" +done + chmod +x "${target}/tmp/vinstaller/main_chroot" chroot "${target}" "/tmp/vinstaller/main_chroot" }