Compare commits
11 Commits
f789963235
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5ded5b7dff | ||
|
|
d95c04f68c | ||
|
|
33894187fd | ||
|
|
e8cc6dafc3 | ||
|
|
1a52fa84a1 | ||
|
|
27db7ed863 | ||
|
|
e77444b682 | ||
|
|
159a1cecf5 | ||
|
|
e0492b0c19 | ||
|
|
6e6aedfb13 | ||
|
|
42f11e1ca7 |
@@ -24,7 +24,12 @@ dd if=/dev/random of=/crypto_keyfile.bin bs=512 count=8 iflag=fullblock && \
|
|||||||
chmod 000 /crypto_keyfile.bin && \
|
chmod 000 /crypto_keyfile.bin && \
|
||||||
sed -i "s/FILES=(/FILES=(\/crypto_keyfile.bin/g" /etc/mkinitcpio.conf && \
|
sed -i "s/FILES=(/FILES=(\/crypto_keyfile.bin/g" /etc/mkinitcpio.conf && \
|
||||||
pacman -S lvm2 lvm2-openrc cryptsetup cryptsetup-openrc && \
|
pacman -S lvm2 lvm2-openrc cryptsetup cryptsetup-openrc && \
|
||||||
cryptsetup luksAddKey $DISK\2 /crypto_keyfile.bin && \
|
if [ $BIOSorEFI == "EFI" ]; then
|
||||||
|
cryptsetup luksAddKey $DISK\2 /crypto_keyfile.bin
|
||||||
|
else
|
||||||
|
cryptsetup luksAddKey $DISK\1 /crypto_keyfile.bin
|
||||||
|
fi
|
||||||
|
|
||||||
mkinitcpio -p linux-hardened && \
|
mkinitcpio -p linux-hardened && \
|
||||||
|
|
||||||
#passset
|
#passset
|
||||||
@@ -34,21 +39,33 @@ passwd && \
|
|||||||
pacman -Sy && \
|
pacman -Sy && \
|
||||||
pacman -S dosfstools freetype2 fuse2 gptfdisk libisoburn mtools os-prober grub efibootmgr && \
|
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/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 && \
|
if [ $BIOSorEFI == "EFI" ]; then
|
||||||
sed -i "s/#GRUB_ENABLE_CRYPTODISK/GRUB_ENABLE_CRYPTODISK/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
|
||||||
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=artix --recheck $DISK && \
|
else
|
||||||
grub-mkconfig -o /boot/grub/grub.cfg
|
sed -i "s/GRUB_CMDLINE_LINUX=\"\"/GRUB_CMDLINE_LINUX=\"cryptdevice=UUID=`blkid -s UUID -o value $DISK\1`:lvm-system\"/g" /etc/default/grub
|
||||||
|
fi
|
||||||
|
sed -i "s/#GRUB_ENABLE_CRYPTODISK/GRUB_ENABLE_CRYPTODISK/g" /etc/default/grub
|
||||||
|
if [ $BIOSorEFI == "EFI" ]; then
|
||||||
|
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=artix --recheck $DISK
|
||||||
|
else
|
||||||
|
grub-install --target=i386-pc $DISK --bootloader-id=artix --recheck $DISK
|
||||||
|
fi
|
||||||
|
grub-mkconfig -o /boot/grub/grub.cfg && \
|
||||||
|
|
||||||
#services
|
#services
|
||||||
yes | pacman -S haveged haveged-openrc && \
|
pacman -S haveged haveged-openrc && \
|
||||||
rc-update add haveged default && \
|
rc-update add haveged default && \
|
||||||
yes | pacman -S cronie cronie-openrc && \
|
pacman -S cronie cronie-openrc && \
|
||||||
rc-update add cronie default && \
|
rc-update add cronie default && \
|
||||||
|
|
||||||
#user
|
#user
|
||||||
useradd -m -G wheel -s /bin/bash $USERNAME && \
|
useradd -m -G wheel -s /bin/bash $USERNAME && \
|
||||||
passwd $USERNAME && \
|
passwd $USERNAME && \
|
||||||
sed -i "s/# %wheel ALL=(ALL:ALL) NOPASSWD: ALL/%wheel ALL=(ALL:ALL) NOPASSWD: ALL/g" /etc/sudoers
|
sed -i "s/# %wheel ALL=(ALL:ALL) NOPASSWD: ALL/%wheel ALL=(ALL:ALL) NOPASSWD: ALL/g" /etc/sudoers && \
|
||||||
|
|
||||||
|
#Font set
|
||||||
|
echo 'consolefont="eurlatgr"' > /etc/conf.d/consolefont && \
|
||||||
|
rc-update add consolefont boot && \
|
||||||
|
|
||||||
#network
|
#network
|
||||||
pacman -S networkmanager networkmanager-openrc networkmanager-openvpn network-manager-applet && \
|
pacman -S networkmanager networkmanager-openrc networkmanager-openvpn network-manager-applet && \
|
||||||
@@ -66,8 +83,8 @@ rc-update add syslog-ng default && \
|
|||||||
|
|
||||||
#Usefull utils
|
#Usefull utils
|
||||||
pacman -S vi artools bash-completion lsof strace && \
|
pacman -S vi artools bash-completion lsof strace && \
|
||||||
yes a | pacman -S wget htop mc zip samba unrar p7zip unzip && \
|
yes a | pacman -S wget htop mc zip samba unrar p7zip unzip less && \
|
||||||
yes a | pacman -S hdparm smartmontools hwinfo dmidecode && \
|
yes a | pacman -S hdparm smartmontools hwinfo dmidecode vim && \
|
||||||
yes a | pacman -S whois rsync nmap tcpdump inetutils net-tools ndisc6
|
yes a | pacman -S whois rsync nmap tcpdump inetutils net-tools ndisc6
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,3 +8,9 @@ LVM_N="lvmSystem"
|
|||||||
HOSTNAME="4rt1x"
|
HOSTNAME="4rt1x"
|
||||||
TIMEZONE="Europe/Prague"
|
TIMEZONE="Europe/Prague"
|
||||||
USERNAME="warezjoe"
|
USERNAME="warezjoe"
|
||||||
|
# BIOS or EFI
|
||||||
|
if [ -f /sys/firmware/efi/fw_platform_size ]; then
|
||||||
|
BIOSorEFI="EFI"
|
||||||
|
else
|
||||||
|
BIOSorEFI="BIOS"
|
||||||
|
fi
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Plain
|
||||||
ip a add 192.168.57.132/24 dev eth1 && \
|
ip a add 192.168.57.132/24 dev eth1 && \
|
||||||
rc-service sshd start
|
rc-service sshd start
|
||||||
|
|
||||||
|
|
||||||
|
# NetworkManager
|
||||||
|
nmcli con mod "Con name" ipv4.adress "192.168.57.132/24"
|
||||||
39
artix_scripts/pre-chroot-bios.sh
Normal file
39
artix_scripts/pre-chroot-bios.sh
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
source env.sh
|
||||||
|
|
||||||
|
#Parted
|
||||||
|
pacman -Sy && \
|
||||||
|
yes | pacman -S parted && \
|
||||||
|
parted -s $DISK mklabel msdos && \
|
||||||
|
parted -s -a optimal $DISK mkpart "primary" "ext4" "0%" "100%" && \
|
||||||
|
parted -s $DISK set 1 boot on && \
|
||||||
|
parted -s $DISK set 1 lvm on && \
|
||||||
|
|
||||||
|
#Cryptosetup
|
||||||
|
cryptsetup luksFormat --type=luks1 $DISK\1 && \
|
||||||
|
cryptsetup open $DISK\1 lvm-system && \
|
||||||
|
|
||||||
|
#Lvm setup
|
||||||
|
pvcreate /dev/mapper/$CRYPT_N
|
||||||
|
vgcreate $LVM_N /dev/mapper/$CRYPT_N
|
||||||
|
|
||||||
|
lvcreate -L 2G $LVM_N -n volSwap && \
|
||||||
|
lvcreate -L 10G $LVM_N -n volRoot && \
|
||||||
|
lvcreate -L 2G $LVM_N -n volHome && \
|
||||||
|
|
||||||
|
#Filesystems and mount
|
||||||
|
mkswap /dev/$LVM_N/volSwap && \
|
||||||
|
mkfs.ext4 -L volRoot /dev/$LVM_N/volRoot && \
|
||||||
|
mkfs.ext4 -L volHome /dev/$LVM_N/volHome && \
|
||||||
|
swapon /dev/$LVM_N/volSwap && \
|
||||||
|
mount /dev/$LVM_N/volRoot /mnt && \
|
||||||
|
mkdir -p /mnt/home && \
|
||||||
|
mount /dev/$LVM_N/volHome /mnt/home && \
|
||||||
|
|
||||||
|
#basestrap, fstab, chroot
|
||||||
|
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
|
||||||
@@ -12,7 +12,7 @@ parted -s -a optimal $DISK mkpart "primary" "ext4" "512MiB" "100%" && \
|
|||||||
parted -s $DISK set 2 lvm on && \
|
parted -s $DISK set 2 lvm on && \
|
||||||
|
|
||||||
#Cryptosetup
|
#Cryptosetup
|
||||||
cryptsetup luksFormat $DISK\2 && \
|
cryptsetup luksFormat --type=luks1 $DISK\2 && \
|
||||||
cryptsetup open $DISK\2 lvm-system && \
|
cryptsetup open $DISK\2 lvm-system && \
|
||||||
|
|
||||||
#Lvm setup
|
#Lvm setup
|
||||||
@@ -7,5 +7,5 @@ lvchange -ay $LVM_N/volHome && \
|
|||||||
lvchange -ay $LVM_N/volRoot && \
|
lvchange -ay $LVM_N/volRoot && \
|
||||||
mount /dev/$LVM_N/volRoot /mnt && \
|
mount /dev/$LVM_N/volRoot /mnt && \
|
||||||
mount /dev/$LVM_N/volHome /mnt/home && \
|
mount /dev/$LVM_N/volHome /mnt/home && \
|
||||||
mount /dev/$DISK\1 /mnt/boot/efi && \
|
mount $DISK\1 /mnt/boot/efi && \
|
||||||
artix-chroot /mnt /bin/bash
|
artix-chroot /mnt /bin/bash
|
||||||
Reference in New Issue
Block a user