From 65b78b0145538eb5edf54b3545e269887b57efc7 Mon Sep 17 00:00:00 2001 From: RemiZOffAlex Date: Tue, 21 May 2024 23:38:05 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20install.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 install.sh diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..f55b802 --- /dev/null +++ b/install.sh @@ -0,0 +1,56 @@ +#!/bin/sh + +set -e + +drive=/dev/nvme1n1 + +sgdisk --zap-all ${drive} +sgdisk -o ${drive} +sgdisk -a 4096 -n 1:0:+1G --typecode=1:ef00 ${drive} +sgdisk -a 4096 -n 2:0:+8G --typecode=2:8200 ${drive} +sgdisk -a 4096 --largest-new=3 --typecode=3:8300 ${drive} + +mkfs.vfat ${drive}p1 +mkswap --force ${drive}p2 +mkfs.xfs -f ${drive}3 + +mount ${drive}3 /mnt +mkdir /mnt/{boot,dev,sys,proc,run} +mkdir /mnt/boot/efi +mount ${drive}1 /mnt/boot/efi + +mount --bind /dev /mnt/dev +mount --bind /sys /mnt/sys +mount --bind /proc /mnt/proc +mount --bind /run /mnt/run + +dnf -y --installroot=/mnt --releasever=39 group install standard core \ +hardware-support development-libs development-tools + +dnf -y --installroot=/mnt --releasever=39 install gpart gdisk rsync nano tcpdump \ +tcsh net-tools bind-utils sysstat xfsprogs atop chrony ntpstat \ +tree git git-all mc wpa_supplicant glibc-langpack-ru + +dnf -y --installroot=/mnt --releasever=39 install kernel grub2-efi-x64 \ +grub2-efi-x64-modules grub2-tools-efi shim + +chroot /mnt grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg + +blkid --output export ${drive}p3 | grep ^UUID= | xargs -I '{}' echo {} / xfs defaults 0 1 > /mnt/etc/fstab +blkid --output export ${drive}p2 | grep ^UUID= | xargs -I '{}' echo {} none swap defaults 0 0 >> /mnt/etc/fstab +blkid --output export ${drive}p1 | grep ^UUID= | xargs -I '{}' echo {} /boot/efi vfat defaults 0 2 > /mnt/etc/fstab + +setenforce 0 +echo 'root:123' | chpasswd --root /mnt +#groupadd --root /mnt admin +#useradd --root /mnt -m -d /home/admin -s /bin/bash -g admin -m admin +#echo 'admin:admin' | chpasswd --root /mnt +# SElinux to mode Permissive +sed -i s/^SELINUX=.*$/SELINUX=permissive/ /mnt/etc/selinux/config + +umount /mnt/run +umount /mnt/dev +umount /mnt/sys +umount /mnt/proc +umount /mnt/boot/efi +umount /mnt