Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- disk=mmcblk1
- efi_size=500MiB
- rootfs=btrfs
- hostname=t100chi
- username=pasha
- userpass=1
- # Formatting the partitions
- wipefs -a /dev/$disk
- #parted /dev/$disk mklabel msdos
- parted /dev/$disk mklabel gpt
- parted /dev/$disk mkpart primary fat32 0% $efi_size
- parted /dev/$disk set 1 esp on
- parted /dev/$disk mkpart primary $efi_size 100%
- mkfs.fat -F32 /dev/${disk}p1
- mkfs.$rootfs /dev/${disk}p2
- # Mounting the file systems
- mount /dev/${disk}p2 /mnt
- mkdir /mnt/boot/efi -p
- mount /dev/${disk}p1 /mnt/boot/efi
- # Выполняем замену строк
- sed -i 's/#Color/Color/' /etc/pacman.conf
- sed -i 's/^#ParallelDownloads.*/ParallelDownloads = 10/' /etc/pacman.conf
- echo 'Server = http://mirror.neolabs.kz/archlinux/$repo/os/$arch' > /etc/pacman.d/mirrorlist
- # Installing minimal base system
- pacstrap /mnt base linux terminus-font cpupower openssh cpio inetutils sudo netctl net-tools mc wget wpa_supplicant ntp bash-completion htop wireless_tools axel nano dhcpcd efibootmgr iwd zram-generator smartmontools fastfetch cronie fzf f2fs-tools
- # Installing base system
- #pacstrap /mnt base base-devel linux-headers linux cpupower openssh cpio inetutils sudo git go fakeroot make gcc netctl net-tools mc wget wpa_supplicant dialog ntp bash-completion htop iotop lsof wireless_tools screen lshw dmidecode axel nano dhcpcd linux-firmware ppp xl2tpd amd-ucode intel-ucode efibootmgr iwd zram-generator nfs-utils samba smartmontools fastfetch cronie chntpw audit lazydocker
- # Generating fstab file
- genfstab -U /mnt >> /mnt/etc/fstab
- # Chrooting into the new system
- arch-chroot /mnt /bin/bash <<EOF
- # Setting the locale
- echo "LANG=ru_RU.UTF-8" > /etc/locale.conf
- echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen && echo 'ru_RU.UTF-8 UTF-8' >> /etc/locale.gen && locale-gen
- # Setting the timezone
- ln -sf /usr/share/zoneinfo/Asia/Almaty /etc/localtime
- # Setting the hostname
- echo "$hostname" > /etc/hostname
- echo 'KEYMAP=ruwin_alt_sh-UTF-8' > /etc/vconsole.conf
- echo 'LOCALE=ru_RU.UTF-8' >> /etc/vconsole.conf
- echo 'CONSOLEMAP=' >> /etc/vconsole.conf
- echo 'FONT=cyr-sun16' >> /etc/vconsole.conf
- echo 'USECOLOR=yes' >> /etc/vconsole.conf
- # Installing bootloader
- pacman -S grub --noconfirm
- #grub-install /dev/sda
- #BIOS
- grub-install --recheck --target=i386-pc --boot-directory=/boot /dev/$disk
- #UEFI
- grub-install --target=x86_64-efi --efi-directory=/boot/efi --boot-directory=/boot --removable
- mkdir -p /boot/grub
- grub-mkconfig -o /boot/grub/grub.cfg
- # Installing X-server and Xfce4
- # pacman -S xorg xfce4 xfce4-goodies slim --noconfirm
- # Creating new user
- useradd -m -G wheel $username
- echo "$username:$userpass" | chpasswd
- echo "root:1" | chpasswd
- echo "%wheel ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers
- echo 'Server = http://mirror.neolabs.kz/archlinux/$repo/os/$arch' > /etc/pacman.d/mirrorlist
- echo 'nameserver 8.8.8.8' > /etc/resolv.conf
- wget http://159.69.152.50/ais/yay-install.sh -O /home/$username/yay-install.sh
- chown $username:$username /home/$username/yay-install.sh
- chmod +x /home/$username/yay-install.sh
- echo 'exec startxfce4' > /home/$username/.xinitrc
- #wget http://159.69.152.50/ais/vconsole.conf -O /etc/vconsole.conf
- chown root:root /etc/vconsole.conf
- chmod 644 /etc/vconsole.conf
- systemctl enable dhcpcd sshd iwd
- EOF
- # Unmounting and rebooting
- umount -R /mnt
- reboot
Advertisement
Add Comment
Please, Sign In to add comment