Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh -e
- ################################################################################
- BASE='alsa-utils base base-devel ccache efibootmgr linux-zen linux-firmware ntp'
- ################################################################################
- DRIVERS='intel-ucode intel-media-driver libva-vdpau-driver vulkan-icd-loader vulkan-intel gstreamer-vaapi'
- ################################################################################
- GNOME='file-roller gnome-calculator gdm gedit gnome-control-center gnome-keyring gnome-screenshot gnome-shell gnome-system-monitor gnome-terminal gnome-weather nautilus networkmanager xdg-user-dirs-gtk gnome-tweaks totem gst-plugins-ugly gst-libav gvfs-mtp eog'
- ################################################################################
- APPS='firefox firefox-ublock-origin telegram-desktop qt5-wayland'
- ################################################################################
- TOOLS='asp git nano neofetch pacman-contrib youtube-dl wget'
- ################################################################################
- FONTS='ttf-liberation noto-fonts noto-fonts-cjk noto-fonts-emoji noto-fonts-extra ttf-opensans'
- ################################################################################
- ### Connect to the internet ###
- #need autoconnect+test, rewrite
- #wifi-menu
- #sleep 3
- #if ping -q -c 1 -W 1 8.8.8.8 >/dev/null; then
- # echo "IPv4 is up"
- #else
- # echo "IPv4 is down"
- #fi
- ### Update the system clock ###
- timedatectl set-ntp true
- ### Configuring and mounting drives ###
- parted --script --align optimal /dev/sda 'mklabel gpt' 'mkpart primary 0% 128MB' 'mkpart primary 128MB 126GB' 'mkpart primary 126GB 100%' 'set 1 esp on'
- mkfs.vfat -F32 /dev/sda1
- mkfs.ext4 -F /dev/sda2
- mkswap /dev/sda3
- swapon /dev/sda3
- mount -o noatime,discard /dev/sda2 /mnt
- mkdir /mnt/boot
- mount /dev/sda1 /mnt/boot
- ### Select the mirrors ###
- pacman -Sy --quiet --noconfirm --noprogressbar reflector
- reflector --protocol https --sort rate --save /etc/pacman.d/mirrorlist
- ### Install the packages ###
- pacstrap /mnt $BASE $DRIVERS $GNOME $APPS $TOOLS $FONTS
- ### Fstab Setup ###
- genfstab -U /mnt >> /mnt/etc/fstab
- sed -i "s/0 2/0 0/" /mnt/etc/fstab
- sed -i "s/0 1/0 0/" /mnt/etc/fstab
- mkdir /mnt/install
- cat > /mnt/install/setup.sh << "EOF1"
- #!/bin/sh -e
- ### Time zone ###
- ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime
- hwclock --systohc
- ### Localization ###
- sed -i "s/#en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/" /etc/locale.gen
- sed -i "s/#ko_KR.UTF-8 UTF-8/ko_KR.UTF-8 UTF-8/" /etc/locale.gen
- sed -i "s/#ru_RU.UTF-8 UTF-8/ru_RU.UTF-8 UTF-8/" /etc/locale.gen
- locale-gen
- echo "LANG=en_US.UTF-8" > /etc/locale.conf
- ### Network configuration ###
- echo localhost > /etc/hostname
- echo -e "127.0.0.1\tlocalhost\n::1\tlocalhost\n127.0.1.1\tlocalhost.localdomain localhost" > /etc/hosts
- ### Root password ###
- echo -e "$PASSWORD\n$PASSWORD\n" | passwd
- ### Creating boot entry ###
- efibootmgr --disk /dev/sda --part 1 --create --label "Arch Linux" --loader /vmlinuz-linux-zen --unicode "root=PARTUUID=$(blkid -s PARTUUID -o value /dev/sda2) rw initrd=intel-ucode.img initrd=initramfs-linux-zen.img quiet udev.log_priority=3 i915.fastboot=1 i915.enable_fbc=1 i915.enable_guc=2 mitigations=off"
- ### Create a user account ###
- useradd --create-home --gid users --groups wheel,lp,storage,video,network,power --shell /bin/bash user_name
- echo -e "$PASSWORD\n$PASSWORD\n" | passwd user_name
- ### Enabling late microcode updates ###
- #
- # Use api, rewrite
- #
- curl --output /install/microcode.tar.gz -L https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files/archive/microcode-20191115.tar.gz
- tar -xf /install/microcode.tar.gz --directory /install
- mv /install/Intel-Linux-Processor-Microcode-Data-Files-microcode-20191115/intel-ucode /usr/lib/firmware
- # curl -s https://api.github.com/repos/intel/Intel-Linux-Processor-Microcode-Data-Files/releases/latest \
- # grep "tarball_url" \
- # cut -d : -f 2,3 \
- # tr -d \" \
- # wget -qi -
- ### Creating pacman hook for "Reflector" ###
- mkdir /etc/pacman.d/hooks
- cat > /etc/pacman.d/hooks/mirrorupgrade.hook << "EOF2"
- [Trigger]
- Operation = Upgrade
- Type = Package
- Target = pacman-mirrorlist
- [Action]
- Description = Updating pacman-mirrorlist with reflector and removing pacnew...
- When = PostTransaction
- Depends = reflector
- Exec = /bin/sh -c "reflector --protocol https --sort rate --save /etc/pacman.d/mirrorlist; rm -f /etc/pacman.d/mirrorlist.pacnew"
- EOF2
- ### 'mkinitcpio' Setup ###
- sed -i "s/MODULES=()/MODULES=(ext4 i915)/" /etc/mkinitcpio.conf
- sed -i "s/(base udev autodetect modconf block filesystems keyboard fsck)/(base udev autodetect modconf block)/" /etc/mkinitcpio.conf
- mkinitcpio -p linux-zen
- ### Sound setting ###
- amixer sset Master on
- amixer sset Master 0.00dB
- amixer sset Master 18.75dB-
- amixer sset Capture cap
- amixer sset Capture 12.75dB
- #For soundcard
- #sed -i "s/; high-priority = yes/high-priority = yes/" /etc/pulse/daemon.conf
- #sed -i "s/; resample-method = speex-float-1/resample-method = copy/" /etc/pulse/daemon.conf
- #sed -i "s/; default-sample-format = s16le/default-sample-format = s24le/" /etc/pulse/daemon.conf
- #sed -i "s/; default-sample-rate = 44100/default-sample-rate = 96000/" /etc/pulse/daemon.conf
- #sed -i "s/; alternate-sample-rate = 48000/alternate-sample-rate = 44100/" /etc/pulse/daemon.conf
- #sed -i "s/; default-sample-channels = 2/default-sample-channels = 2/" /etc/pulse/daemon.conf
- ### "Makepkg" Setup ###
- sed -i "s/-march=x86-64 -mtune=generic/-march=native/" /etc/makepkg.conf
- sed -i 's/#MAKEFLAGS="-j2"/MAKEFLAGS="-j4"/' /etc/makepkg.conf
- sed -i 's/(!distcc color !ccache check !sign)/(!distcc color ccache check !sign)/' /etc/makepkg.conf
- sed -i "s/PKGEXT='.pkg.tar.xz'/PKGEXT='.pkg.tar'/" /etc/makepkg.conf
- ### Work with SystemD services ###
- systemctl enable NetworkManager.service
- systemctl enable bluetooth.service
- systemctl enable gdm.service
- systemctl mask lvm2-monitor.service
- systemctl mask lvm2-lvmpolld.socket
- systemctl mask lvm2-lvmetad.socket
- systemctl mask cryptsetup.target
- ### Setting environment variables ###
- echo "QT_QPA_PLATFORM=wayland-egl" >> /etc/environment
- echo "LIBVA_DRIVER_NAME=iHD" >> /etc/environment
- echo "MOZ_ENABLE_WAYLAND=1" >> /etc/environment
- echo "VDPAU_DRIVER=va_gl" >> /etc/environment
- ### Setup "sudoers" ###
- sed -i 's/# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/' /etc/sudoers
- echo -e "\n##Sudo will provide visual feedback when the user presses a key" >> /etc/sudoers
- echo "Defaults pwfeedback" >> /etc/sudoers
- ### Remove .desktop files ###
- rm /usr/share/applications/avahi-discover.desktop
- rm /usr/share/applications/qvidcap.desktop
- rm /usr/share/applications/qv4l2.desktop
- rm /usr/share/applications/bssh.desktop
- rm /usr/share/applications/bvnc.desktop
- ### Other commands ###
- sed -i "s/#SystemMaxUse=/SystemMaxUse=12M/" /etc/systemd/journald.conf
- sed -i "s/#Storage=external/Storage=none/" /etc/systemd/coredump.conf
- exit
- EOF1
- chmod +x /mnt/install/setup.sh
- export PASSWORD=$(echo $1)
- arch-chroot /mnt /install/setup.sh
- rm -r /mnt/install
- umount -R /mnt
- echo -e "\n\n\n\n\n\n\n\n\n\n\n\n -@\n .##@\n .####@\n @#####@ Installation completed.\n . *######@\n .##@o@#####@\n /############@\n /##############@\n @######@**%######@\n @######\` %#####o Restart the computer, do not forget to remove the USB-drive ...\n @######@ ######%\n -@#######h ######@.\`\n /#####h**\`\` \`**%@####@\n @H@*\` \`*%#@\n *\` \`*\n\n\n\n\n\n\n\n\n\n\n\n"
- ####################
- ########################################
- ############################################################
- ################################################################################
- ### Essential packages from AUR ###
- # gnome-shell-extension-remove-dropdown-arrows 9-1
- # arch-firefox-search 0.8.2-8 - not installing
- # aurutils 2.3.3-1 - not installing
- ### Other commands ###
- # gsettings set org.gnome.desktop.peripherals.touchpad tap-to-click 'true'
- # echo "options bluetooth disable_ertm=1" >> /etc/modprobe.d/xbox_bt.conf
- # xsetwacom set 14 Area 5700 4157 15200 9500
- ################################################################################
- ############################################################
- ########################################
- ####################
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement