32 lines
1.2 KiB
Plaintext
32 lines
1.2 KiB
Plaintext
packages() {
|
|
addpkg base-system lvm2 cryptsetup htop tmux wireguard-tools
|
|
}
|
|
|
|
config() {
|
|
chown root:root /
|
|
chmod 755 /
|
|
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 ! [ "$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 <<EOF > ${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
|
|
} |