diff --git a/etc/base b/etc/base index a71f429..f4803fa 100644 --- a/etc/base +++ b/etc/base @@ -9,10 +9,24 @@ passwd root echo ${HOSTNAME} > /etc/hostname echo "LANG=en_US.UTF-8" > /etc/locale.conf echo "en_US.UTF-8 UTF-8" >> /etc/default/libc-locales -if ! [ "$L1" == "en_US" ]; then - echo "LANG=${L1}.UTF-8" > /etc/locale.conf +if ! [ "$LANGUAGE" == "en" ]; then echo "${L1}.UTF-8 UTF-8" >> /etc/default/libc-locales fi xbps-reconfigure -f glibc-locales echo "GRUB_ENABLE_CRYPTODISK=y" >> /etc/default/grub + +cat < ${target}/etc/fstab +tmpfs /tmp tmpfs defaults,nosuid,nodev 0 0 +/dev/mapper/vg_${TARGETNAME_UNDERSCORE}-root / btrfs defaults,subvol=root 0 0 +/dev/mapper/vg_${TARGETNAME_UNDERSCORE}-root /home btrfs defaults,subvol=home 0 0 +/dev/mapper/vg_${TARGETNAME_UNDERSCORE}-swap swap swap defaults 0 0 +EOF + +if [ "$EFI" == "1" ]; then + echo "${TARGET_PHY_WWN}-part1 /boot/efi vfat defaults 0 0" >> ${target}/etc/fstab +fi + +uuid=$(blkid -o value -s UUID ${TARGET_PHY_WWN}-part${TARGET_PART}) +sed -i "/^GRUB_CMDLINE_LINUX_DEFAULT/s/=\"/=\"rd.luks.uuid=${uuid} /" ${target}/etc/default/grub +sed -i "/^GRUB_CMDLINE_LINUX_DEFAULT/s/=\"/=\"rd.lvm.vg=vg_${TARGETNAME_UNDERSCORE} /" ${target}/etc/default/grub } \ No newline at end of file diff --git a/main.sh b/main.sh index 61941d4..7e8a1ff 100644 --- a/main.sh +++ b/main.sh @@ -199,11 +199,8 @@ printing() { lang() { input "Which language?" "de en" "unknown error" LANGUAGE=$output - L1=en_US - L2=en if [ "$LANGUAGE" == "de" ]; then L1=de_DE - L2=de fi } @@ -223,39 +220,30 @@ do_install() { do_chroot() { mkdir -p ${target}/tmp/vinstaller/run - cp etc/base ${target}/tmp/vinstaller/run + + cp ${main}/etc/base ${target}/tmp/vinstaller/run if ! [ "$DE" == "minimal" ]; then - cp etc/gfx/$GFX ${target}/tmp/vinstaller/run - cp etc/soundsystem/$SOUNDSYSTEM ${target}/tmp/vinstaller/run - cp etc/gfx/$DE ${target}/tmp/vinstaller/run + cp ${main}/etc/gfx/$GFX ${target}/tmp/vinstaller/run + cp ${main}/etc/soundsystem/$SOUNDSYSTEM ${target}/tmp/vinstaller/run + cp ${main}/etc/gfx/$DE ${target}/tmp/vinstaller/run fi + + echo "USERNAME=$USERNAME" > ${target}/tmp/vinstaller/vars + echo "HOSTNAME=$HOSTNAME" >> ${target}/tmp/vinstaller/vars + echo "EFI=$EFI" >> ${target}/tmp/vinstaller/vars + echo "LANGUAGE=$LANGUAGE" >> ${target}/tmp/vinstaller/vars + echo "TARGET_PHY_WWN=$TARGET_PHY_WWN" >> ${target}/tmp/vinstaller/vars + echo "TARGET_PART=$TARGET_PART" >> ${target}/tmp/vinstaller/vars + echo "TARGETNAME_UNDERSCORE=$TARGETNAME_UNDERSCORE" >> ${target}/tmp/vinstaller/vars cat < ${target}/tmp/vinstaller/main_chroot +. /tmp/vinstaller/vars for file in $(find /tmp/vinstaller/run -type f); do . $file config done EOF -echo "USERNAME=$USERNAME" > ${target}/tmp/vinstaller/vars -echo "HOSTNAME=$HOSTNAME" >> ${target}/tmp/vinstaller/vars -echo "EFI=$EFI" >> ${target}/tmp/vinstaller/vars -echo "LANGUAGE=$LANGUAGE" >> ${target}/tmp/vinstaller/vars - -cat < ${target}/etc/fstab -tmpfs /tmp tmpfs defaults,nosuid,nodev 0 0 -/dev/mapper/vg_${TARGETNAME_UNDERSCORE}-root / btrfs defaults,subvol=root 0 0 -/dev/mapper/vg_${TARGETNAME_UNDERSCORE}-root /home btrfs defaults,subvol=home 0 0 -/dev/mapper/vg_${TARGETNAME_UNDERSCORE}-swap swap swap defaults 0 0 -EOF - -if [ "$EFI" == "1" ]; then - echo "${TARGET_PHY_WWN}-part1 /boot/efi vfat defaults 0 0" >> ${target}/etc/fstab -fi - -uuid=$(blkid -o value -s UUID ${TARGET_PHY_WWN}-part${TARGET_PART}) -sed -i "/^GRUB_CMDLINE_LINUX_DEFAULT/s/=\"/=\"rd.luks.uuid=${uuid} /" ${target}/etc/default/grub -sed -i "/^GRUB_CMDLINE_LINUX_DEFAULT/s/=\"/=\"rd.lvm.vg=vg_${TARGETNAME_UNDERSCORE} /" ${target}/etc/default/grub }