SpecialistOff.NET / Вопросы / Статьи / Фрагменты кода / Резюме / Метки / Помощь / Файлы
НазадМетки: [fedora];
--- install.sh
#!/bin/sh
set -e
drive=/dev/sda
sgdisk --zap-all ${drive}
sgdisk -o ${drive}
sgdisk -a 4096 -n 1:0:+512M --typecode=1:ef00 ${drive}
sgdisk -a 4096 --largest-new=2 --typecode=2:8300 ${drive}
mkfs.vfat ${drive}1
mkfs.xfs -f ${drive}2
mount ${drive}2 /mnt
mkdir /mnt/{boot,dev,sys,proc}
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
dnf -y --installroot=/mnt --releasever=40 group install standard core \
hardware-support development-libs development-tools
dnf -y --installroot=/mnt --releasever=40 install gpart gdisk rsync nano tcpdump \
tcsh net-tools bind-utils sysstat xfsprogs atop chrony ntpstat \
tree git wpa_supplicant glibc-langpack-ru
dnf -y --installroot=/mnt --releasever=40 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}2 | grep ^UUID= | xargs -I '{}' echo {} / xfs defaults 0 1 > /mnt/etc/fstab
# blkid --output export ${drive}2 | grep ^UUID= | xargs -I '{}' echo {} swap swap defaults 0 0 >> /mnt/etc/fstab
blkid --output export ${drive}1 | 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/dev
umount /mnt/sys
umount /mnt/proc
umount /mnt/boot/efi
umount /mnt