diff --git a/artix_scripts/after-chroot.sh b/artix_scripts/after-chroot.sh new file mode 100644 index 0000000..f6007c9 --- /dev/null +++ b/artix_scripts/after-chroot.sh @@ -0,0 +1,77 @@ +#!/bin/bash + +source env.sh + + +#locale +echo -e "en_US.UTF-8 UTF-8" >> /etc/locale.gen && \ +echo -e "cs_CZ.UTF-8 UTF-8" >> /etc/locale.gen && \ +locale-gen && \ +echo LANG=cs_CZ.UTF-8 > /etc/locale.conf && \ +export LANG=cs_CZ.UTF-8 && \ + +#timezone +ln -s /usr/share/zoneinfo/$TIMEZONE /etc/localtime && \ + +#hostname +echo "hostname=$HOSTNAME" > /etc/conf.d/hostname && \ + +#mk +sed -i "s/consolefont block/consolefont block encrypt lvm2 resume/g" /etc/mkinitcpio.conf && \ + +#key-gen and cryptoset +dd if=/dev/random of=/crypto_keyfile.bin bs=512 count=8 iflag=fullblock && \ +chmod 000 /crypto_keyfile.bin && \ +sed -i "s/FILES=(/FILES=(\/crypto_keyfile.bin/g" /etc/mkinitcpio.conf && \ +pacman -S lvm2 lvm2-openrc cryptsetup cryptsetup-openrc && \ +cryptsetup luksAddKey $DISK\2 /crypto_keyfile.bin && \ +mkinitcpio -p linux-hardened && \ + +#passset +passwd && \ + +#bootloader +pacman -Sy && \ +yes | pacman -S dosfstools freetype2 fuse2 gptfdisk libisoburn mtools os-prober grub efibootmgr && \ +sed -i "s/quiet/quiet resume=UUID=`blkid -s UUID -o value /dev/lvmSystem/volSwap`/g" /etc/default/grub && \ +sed -i "s/GRUB_CMDLINE_LINUX=\"\"/GRUB_CMDLINE_LINUX=\"cryptdevice=UUID=`blkid -s UUID -o value $DISK\2`:lvm-system\"/g" /etc/default/grub && \ +sed -i "s/#GRUB_ENABLE_CRYPTODISK/GRUB_ENABLE_CRYPTODISK/g" /etc/default/grub && \ +grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=artix --recheck $DISK && \ +grub-mkconfig -o /boot/grub/grub.cfg + +#services +yes | pacman -S haveged haveged-openrc && \ +rc-update add haveged default && \ +yes | pacman -S cronie cronie-openrc && \ +rc-update add cronie default && \ + +#user +useradd -m -G wheel -s /bin/bash $USERNAME && \ +passwd $USERNAME && \ +sed -i "s/# %wheel ALL=(ALL:ALL) NOPASSWD: ALL/%wheel ALL=(ALL:ALL) NOPASSWD: ALL/g" /etc/sudoers + +#network +yes | pacman -S networkmanager networkmanager-openrc networkmanager-openvpn network-manager-applet && \ +rc-update add NetworkManager default && \ + +#ssh +yes | pacman -S openssh openssh-openrc && \ +rc-update add sshd default && \ + +#other deamons +yes | pacman -S ntp ntp-openrc acpid acpid-openrc syslog-ng syslog-ng-openrc && \ +rc-update add ntpd default && \ +rc-update add acpid default && \ +rc-update add syslog-ng default && \ + +#Usefull utils +yes | pacman -S vi artools bash-completion lsof strace && \ +yes | pacman -S wget htop mc zip samba unrar p7zip unzip && \ +yes | pacman -S hdparm smartmontools hwinfo dmidecode && \ +yes | pacman -S whois rsync nmap tcpdump inetutils net-tools ndisc6 && \ + + + + + + diff --git a/artix_scripts/env.sh b/artix_scripts/env.sh index f9b8f20..36c9630 100644 --- a/artix_scripts/env.sh +++ b/artix_scripts/env.sh @@ -4,4 +4,7 @@ DISK="/dev/sda" CRYPT_N="lvm-system" -LVM_N="lvmSystem" \ No newline at end of file +LVM_N="lvmSystem" +HOSTNAME="4rt1x" +TIMEZONE="Europe/Prague" +USERNAME="warezjoe" \ No newline at end of file diff --git a/artix_scripts/pre-chroot.sh b/artix_scripts/pre-chroot.sh index 32a306f..12ea245 100755 --- a/artix_scripts/pre-chroot.sh +++ b/artix_scripts/pre-chroot.sh @@ -4,7 +4,7 @@ source env.sh #Parted pacman -Sy && \ -pacman -S parted && \ +yes | pacman -S parted && \ parted -s $DISK mklabel gpt && \ parted -s -a optimal $DISK mkpart "primary" "fat32" "0%" "512MiB" && \ parted -s $DISK set 1 esp on && \ @@ -39,4 +39,5 @@ mount $DISK\1 /mnt/boot/efi && \ basestrap /mnt base base-devel openrc elogind-openrc linux-hardened linux-hardened-headers linux-firmware && \ fstabgen -U /mnt >> /mnt/etc/fstab && \ echo "tmpfs /tmp tmpfs rw,nosuid,noatime,nodev,size=4G,mode=1777 0 0" >> /mnt/etc/fstab && \ +cp after-chroot.sh env.sh /mnt/root/ && \ artix-chroot /mnt /bin/bash \ No newline at end of file