This commit is contained in:
teldra 2022-02-07 16:35:25 +01:00
parent 6ce9a0476c
commit 78ea01d7fd
3 changed files with 45 additions and 0 deletions

View File

@ -6,6 +6,12 @@ config() {
chown root:root /
chmod 755 /
echo ${HOSTNAME} > /etc/hostname
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 "/HARDWARECLOCK/s/^#//g" /etc/rc.conf
sed -i "/FONT=/s/^#//g" /etc/rc.conf
echo "LANG=en_US.UTF-8" > /etc/locale.conf
echo "en_US.UTF-8 UTF-8" >> /etc/default/libc-locales
if ! [ "$LANGUAGE" == "en" ]; then
@ -39,9 +45,31 @@ if [ "$ENCRYPTION_STYLE" == "a" ] || [ "$ENCRYPTION_STYLE" == "d" ]; then
echo "luks_${TARGETNAME_UNDERSCORE} $TARGET_PHY_ID-part${TARGET_PART} /boot/volume.key luks" >> /etc/crypttab
echo "install_items+=\" /boot/volume.key /etc/crypttab \"" > /etc/dracut.conf.d/10-crypt.conf
fi
if [ "$ENC" == "1" ]; then
echo "echo \"Install 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
echo " echo \"Again, please\"" >> /etc/runit/core-services/99-changepwdisk.sh
echo " done" >> /etc/runit/core-services/99-changepwdisk.sh
echo " rm -rf /etc/runit/core-services/99-changepwdisk.sh" >> /etc/runit/core-services/99-changepwdisk.sh
echo "fi" >> /etc/runit/core-services/99-changepwdisk.sh
fi
useradd -G wheel -m -s /usr/bin/bash $USERNAME
echo "$USERNAME:$pass" | chpasswd
passwd -dl root
echo "echo \"Install pw is ${pass}\"" > /etc/runit/core-services/99-changepwuser.sh
echo "read -p \"Change PW for ${users[name1]}? y/n \" answer" >> /etc/runit/core-services/99-changepwuser.sh
echo "if [ \"\${answer}\" = \"y\" ]; then" >> /etc/runit/core-services/99-changepwuser.sh
echo " while ! passwd ${users[name1]}; do" >> /etc/runit/core-services/99-changepwuser.sh
echo " echo \"Again, please\"" >> /etc/runit/core-services/99-changepwuser.sh
echo " done" >> /etc/runit/core-services/99-changepwuser.sh
echo " rm -rf /etc/runit/core-services/99-changepwuser.sh" >> /etc/runit/core-services/99-changepwuser.sh
echo "fi" >> /etc/runit/core-services/99-changepwuser.sh
}

View File

@ -1,3 +1,18 @@
packages() {
addpkg "xorg-minimal" "xorg-apps"
}
config() {
ln -s /usr/share/fontconfig/conf.avail/70-no-bitmaps.conf "${dest}"/etc/fonts/conf.d/
if [ "$LANGUAGE" == "de" ]; then
mkdir -p /etc/X11/xorg.conf.d
{ echo "Section \"InputClass\"";
echo " Identifier \"keyboard\"";
echo " MatchIsKeyboard \"yes\"";
echo " Option \"XkbLayout\" \"de\"";
echo " Option \"XkbVariant\" \"nodeadkeys\"";
echo " #Option \"XkbOptions\" \"grp:alt_shift_toggle\"";
echo "EndSection"; } > /etc/X11/xorg.conf.d/10-keyboard.conf
fi
}

View File

@ -4,6 +4,7 @@ main="/tmp/vinstall"
target="${main}/target"
tmp_target="${main}/tmp_target"
pass="oem"
timezone="Europe/Berlin"
if [ $DEBUG ]; then
umount -R ${target}/boot/efi ${target}/boot ${target}/tmp/vinstaller/ ${target}
@ -343,6 +344,7 @@ do_chroot() {
echo "TARGET_PART=$TARGET_PART" >> ${target}/tmp/vinstaller/vars
echo "TARGETNAME_UNDERSCORE=$TARGETNAME_UNDERSCORE" >> ${target}/tmp/vinstaller/vars
echo "ENCRYPTION_STYLE=$ENCRYPTION_STYLE" >> ${target}/tmp/vinstaller/vars
echo "timezone=$timezone" >> ${target}/tmp/vinstaller/vars
cat <<EOF > ${target}/tmp/vinstaller/main_chroot
#!/bin/bash