first steps
This commit is contained in:
@@ -10,6 +10,7 @@ sgdisk -p /dev/$_SYS_DEV
|
||||
|
||||
sgdisk --zap-all /dev/${_HEADER_DEV}
|
||||
sgdisk -n 1:0:+16M -t 1:8309 -c 1:"LUKS-Header" /dev/${_HEADER_DEV}
|
||||
sgdisk -p /dev/${_HEADER_DEV}
|
||||
sync
|
||||
|
||||
#HEADER_PART=/dev/${_HEADER_DEV}1
|
||||
@@ -18,6 +19,6 @@ wipefs -a ${_HEADER_DEV}1
|
||||
#dd if=/dev/zero of=/dev/$_HEADER_DEV bs=512 count=32768 status=progress
|
||||
echo -n "$_LUKS_PASS" | cryptsetup luksFormat --type luks2 --batch-mode --key-file - --header /dev/${_HEADER_DEV}1 /dev/${_SYS_DEV}3
|
||||
echo -n "$_LUKS_PASS" | cryptsetup open /dev/${_SYS_DEV}3 --header /dev/${_HEADER_DEV}1 --key-file - cryptroot
|
||||
LUKS_UUID=$(cryptsetup luksUUID /dev/${_SYS_DEV}3 --header /dev/${_HEADER_DEV}1)
|
||||
echo "LUKS UUID: $LUKS_UUID"
|
||||
_LUKS_UUID=$(cryptsetup luksUUID /dev/${_SYS_DEV}3 --header /dev/${_HEADER_DEV}1)
|
||||
echo "LUKS UUID: $_LUKS_UUID"
|
||||
ls /dev/mapper/cryptroot
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
source .env
|
||||
|
||||
mkfs.btrfs -f -L arch /dev/mapper/cryptroot
|
||||
mkfs.fat -f -F 32 /dev/${_SYS_DEV}1
|
||||
|
||||
mount /dev/mapper/cryptroot /mnt
|
||||
cd /mnt
|
||||
btrfs subvolume create @
|
||||
btrfs subvolume create @home
|
||||
btrfs subvolume create @snapshots
|
||||
btrfs subvolume create @var
|
||||
btrfs subvolume create @var_log
|
||||
btrfs subvolume create @var_cache
|
||||
cd /
|
||||
umount /mnt
|
||||
|
||||
mount -o defaults,noatime,compress=zstd,ssd,space_cache=v2,autodefrag,subvol=@ /dev/mapper/cryptroot /mnt
|
||||
mkdir -p /mnt/{home,var,tmp,boot,snapshots}
|
||||
mount -o defaults,noatime,compress=zstd,ssd,space_cache=v2,autodefrag,subvol=@home /dev/mapper/cryptroot /mnt/home
|
||||
mount -o defaults,noatime,compress=zstd,space_cache=v2,subvol=@snapshots /dev/mapper/cryptroot /mnt/snapshots
|
||||
mount -o defaults,noatime,space_cache=v2,subvol=@var /dev/mapper/cryptroot /mnt/var
|
||||
mkdir -p /mnt/var/{log,cache}
|
||||
mount -o defaults,noatime,space_cache=v2,nodatacow,subvol=@var_log /dev/mapper/cryptroot /mnt/var/log
|
||||
mount -o defaults,noatime,space_cache=v2,nodatacow,subvol=@var_cache /dev/mapper/cryptroot /mnt/var/cache
|
||||
mount -o fmask=0077,dmask=0077 /dev/${_SYS_DEV}1 /mnt/boot
|
||||
|
||||
mkswap /dev/${_SYS_DEV}2
|
||||
swapon /dev/${_SYS_DEV}2
|
||||
41
3.install.sh
41
3.install.sh
@@ -2,10 +2,16 @@
|
||||
|
||||
source .env
|
||||
|
||||
echo $_LUKS_UUID
|
||||
#_LUKS_UUID=$(cryptsetup luksUUID --header /dev/sdb1 /dev/sda3)
|
||||
_DATA_PARTUUID=$(blkid -s PARTUUID -o value /dev/sda3)
|
||||
_HEADER_PARTUUID=$(blkid -s PARTUUID -o value /dev/sdb1)
|
||||
|
||||
pacstrap -K /mnt base base-devel linux linux-firmware btrfs-progs mdadm nano sof-firmware intel-ucode nvidia-utils iwd dhcpcd vim cryptsetup networkmanager openssh efibootmgr
|
||||
|
||||
genfstab -U /mnt >> /mnt/etc/fstab
|
||||
arch-chroot /mnt
|
||||
arch-chroot /mnt /bin/bash <<EOF
|
||||
|
||||
sed -i '/en_US.UTF-8 UTF-8/s/^#//' /etc/locale.gen && sed -i '/ru_RU.UTF-8 UTF-8/s/^#//' /etc/locale.gen && grep -v '^#' /etc/locale.gen
|
||||
locale-gen
|
||||
echo "LANG=ru_RU.UTF-8" > /etc/locale.conf
|
||||
@@ -13,7 +19,36 @@ printf "KEYMAP=ru\nFONT=cyr-sun16" > /etc/vconsole.conf
|
||||
echo "$_HOSTNAME" > /etc/hostname
|
||||
|
||||
bootctl --path=/boot install
|
||||
printf "title Arch Linux\nlinux /vmlinuz-linux\ninitrd /intel-ucode.img\ninitrd /initramfs-linux.img\n" > /boot/loader/entries/arch.conf
|
||||
|
||||
#options rd.luks.name=PARTUUID=bdb153db-4a79-40f3-8507-759e15013526=cryptroot rd.luks.header=/dev/disk/by-id/usb-VBOX_HARDDISK-0:0 rd.luks.options=discard root=/dev/mapper/cryptroot rw rootflags=subvol=@
|
||||
#Создаем пункт загрузки
|
||||
printf "title Arch Linux\nlinux /vmlinuz-linux\ninitrd /intel-ucode.img\ninitrd /initramfs-linux.img\noptions rd.luks.name=${_LUKS_UUID}=cryptroot rd.luks.data=PARTUUID=${_DATA_PARTUUID} rd.luks.options=${_LUKS_UUID}=header=PARTUUID=${_HEADER_PARTUUID} root=/dev/mapper/cryptroot rw rootflags=subvol=@" > /boot/loader/entries/arch.conf
|
||||
|
||||
# Правим хуки
|
||||
sed -i 's/^HOOKS=(.*/HOOKS=(base systemd autodetect microcode modconf kms keyboard keymap sd-vconsole block sd-encrypt filesystems fsck)/' /etc/mkinitcpio.conf
|
||||
|
||||
mkinitcpio -P
|
||||
|
||||
# Финальнве шаги
|
||||
useradd -m -G wheel -s /bin/bash astraleuro
|
||||
sed -i '/%wheel ALL=(ALL:ALL) ALL/s/^# *//' /etc/sudoers
|
||||
systemctl enable NetworkManager
|
||||
systemctl enable sshd
|
||||
|
||||
EOF
|
||||
|
||||
umount -R /mnt
|
||||
cryptsetup close cryptroot
|
||||
mdadm --stop /dev/md0
|
||||
#reboot
|
||||
|
||||
#rd.luks.name=${$_LUKS_UUID}=cryptroot
|
||||
#rd.luks.options=<LUKS_UUID>=header=/dev/disk/by-id/<USB_HEADER_ID>
|
||||
##rd.luks.data=<LUKS_UUID>=/dev/disk/by-id/<SYSTEM_DISK_PART3_ID>
|
||||
#root=/dev/mapper/cryptroot
|
||||
#rootflags=subvol=@
|
||||
#rw
|
||||
|
||||
|
||||
|
||||
#options #rd.luks.name=PARTUUID=bdb153db-4a79-40f3-8507-759e15013526=cryptroot #rd.luks.header=/dev/disk/by-id/usb-VBOX_HARDDISK-0:0 #rd.luks.options=discard root=/dev/mapper/cryptroot rw rootflags=subvol=@
|
||||
#HOOKS=(base systemd autodetect microcode modconf kms keyboard keymap sd-vconsole block sd-encrypt filesystems fsck)
|
||||
|
||||
Reference in New Issue
Block a user