Guest User

Untitled

a guest
Mar 14th, 2020
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.21 KB | None | 0 0
  1. #!/bin/sh
  2. ## Pre-installation
  3. # Format the partitions
  4. lsblk -f
  5. mkfs.f2fs -f -w 4096 -l Linux /dev/sdc6
  6. cryptsetup -v --cipher aes-xts-plain64 --key-size 512 --hash sha512 --use-random --verify-passphrase --type luks2 --integrity hmac-sha512 --sector-size 4096 --label Home --pbkdf argon2id --pbkdf-force-iterations 16 --pbkdf-memory 1048576 --pbkdf-parallel 1 --timeout 60 luksFormat /dev/sdc7
  7. cryptsetup open --type luks2 /dev/sdc7 arch
  8.  
  9. sudo mount -t f2fs -o rw,noatime,lazytime,relatime,background_gc=on,data_flush,no_heap,inline_xattr,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6 /dev/sdc6 /mnt
  10. sudo mkdir /mnt/{boot,home,root,var}
  11. sudo mount -t vfat -o rw,noatime,lazytime,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro /dev/sdc2 /mnt/boot
  12.  
  13. sudo mkfs.brfs -f -L Home -n 16k /dev/mapper/arch /tmp/arch
  14. mkdir /tmp/arch
  15. sudo mount -t btrfs -o autodefrag,noatime,lazytime,relatime,space_cache=v2,datasum,ssd_spread,subvol=home /dev/mapper/arch /tmp/arch
  16.  
  17. # BTRFS subvolumes
  18. sudo btrfs subvolume create /tmp/arch/root
  19. sudo btrfs subvolume create /tmp/arch/home
  20. sudo btrfs subvolume create /tmp/arch/var
  21. sudo btrfs subvolume list /tmp/arch
  22.  
  23. sudo umount /tmp/arch
  24.  
  25. # Mount the file systems
  26. sudo mount -t btrfs -o autodefrag,relatime,noatime,lazytime,relatime,space_cache=v2,datasum,ssd_spread,subvol=root /dev/mapper/arch /tmp/root
  27. sudo mount -t btrfs -o autodefrag,relatime,noatime,lazytime,relatime,space_cache=v2,datasum,ssd_spread,subvol=home /dev/mapper/arch /tmp/home
  28. sudo mount -t btrfs -o autodefrag,relatime,noatime,lazytime,relatime,space_cache=v2,datasum,ssd_spread,subvol=var /dev/mapper/arch /tmp/var
  29.  
  30. # Update the system clock
  31. timedatectl set-local-rtc false
  32. timedatectl set-ntp true
  33. timedatectl set-timezone Europe/Brussels
  34.  
  35. # Swap
  36. dd if=/dev/zero of=/mnt/swapfile bs=8M count=1024
  37. chmod 600 /mnt/swapfile
  38. mkswap /mnt/swapfile
  39. swapon /mnt/swapfile
  40.  
  41. ## Installation
  42. # Select the mirrors
  43. sed -i -e "s/^#Server = http:\/\/archlinux.cu.be\/\$repo\/os\/\$arch/Server = http:\/\/archlinux.cu.be\/\$repo\/os\/\$arch/" /etc/pacman.d/mirrorlist
  44.  
  45. # Install the base packages
  46. pacstrap /mnt base base-devel bash-completion btrfs-progs dnscrypt-proxy etckeeper efivar efibootmgr elinks f2fs-tools intel-ucode mc ntfs-3g rsync sudo zsh zsh-completions |& tee -a /tmp/pacstrap.log
  47.  
  48. :: There are 2 providers available for resolvconf:
  49. :: Repository core
  50. 1) openresolv 2) systemd-resolvconf
  51.  
  52. Enter a number (default=1):
  53.  
  54. warning: directory permissions differ on /mnt/root/
  55. filesystem: 755 package: 750
  56.  
  57. Optional dependencies for bash
  58. bash-completion: for tab completion
  59.  
  60. Optional dependencies for util-linux
  61. python: python bindings to libmount
  62.  
  63. Initializing machine ID from random generator.
  64. :: Append 'init=/usr/lib/systemd/systemd' to your kernel command line in your
  65. bootloader to replace sysvinit with systemd, or install systemd-sysvcompat
  66.  
  67. Optional dependencies for systemd
  68. libmicrohttpd: remote journald capabilities
  69. quota-tools: kernel-level quota management
  70. systemd-sysvcompat: symlink package to provide sysvinit binaries [pending]
  71. polkit: allow administration as unprivileged user
  72. curl: machinectl pull-tar and pull-raw [pending]
  73.  
  74. Optional dependencies for glib2
  75. python: gdbus-codegen, glib-genmarshal, glib-mkenums, gtester-report
  76. libelf: gresource inspection tool [installed]
  77.  
  78. Optional dependencies for gettext
  79. git: for autopoint infrastructure updates
  80.  
  81. Optional dependencies for iproute2
  82. linux-atm: ATM support
  83.  
  84. Optional dependencies for iputils
  85. xinetd: for tftpd
  86.  
  87. Optional dependencies for mkinitcpio
  88. xz: Use lzma or xz compression for the initramfs image [installed]
  89. bzip2: Use bzip2 compression for the initramfs image [installed]
  90. lzop: Use lzo compression for the initramfs image
  91. lz4: Use lz4 compression for the initramfs image [installed]
  92. mkinitcpio-nfs-utils: Support for root filesystem on NFS
  93.  
  94. Optional dependencies for linux
  95. crda: to set the correct wireless channels of your country
  96.  
  97. Optional dependencies for groff
  98. netpbm: for use together with man -H command interaction in browsers
  99. psutils: for use together with man -H command interaction in browsers
  100. libxaw: for gxditview
  101.  
  102. Optional dependencies for man-db
  103. gzip [installed]
  104.  
  105. Optional dependencies for netctl
  106. dialog: for the menu based wifi assistant
  107. dhclient: for DHCP support (or dhcpcd)
  108. dhcpcd: for DHCP support (or dhclient) [installed]
  109. wpa_supplicant: for wireless networking support
  110. ifplugd: for automatic wired connections through netctl-ifplugd
  111. wpa_actiond: for automatic wireless connections through netctl-auto
  112. ppp: for PPP connections
  113. openvswitch: for Open vSwitch connections
  114.  
  115. Optional dependencies for libsecret
  116. gnome-keyring: key storage service (or use any other service implementing org.freedesktop.secrets)
  117.  
  118. Optional dependencies for pinentry
  119. gtk2: gtk2 backend
  120. qt5-base: qt backend
  121. gcr: gnome3 backend
  122.  
  123. Optional dependencies for gnutls
  124. guile: for use with Guile bindings
  125.  
  126. Optional dependencies for gnupg
  127. libldap: gpg2keys_ldap [installed]
  128. libusb-compat: scdaemon
  129. pcsclite: scdaemon
  130. Optional dependencies for pacman
  131. perl-locale-gettext: translation support in makepkg-template
  132.  
  133. Optional dependencies for s-nail
  134. smtp-forwarder: for sending mail
  135.  
  136. Optional dependencies for usbutils
  137. python: for lsusb.py usage
  138. coreutils: for lsusb.py usage [installed]
  139.  
  140. Optional dependencies for vi
  141. s-nail: used by the preserve command for notification [installed]
  142.  
  143. perl: warning: Setting locale failed.
  144. perl: warning: Please check that your locale settings:
  145. LANGUAGE = (unset),
  146. LC_ALL = (unset),
  147. LANG = "en_US.UTF-8"
  148. are supported and installed on your system.
  149. perl: warning: Falling back to the standard locale ("C").
  150.  
  151. Optional dependencies for gcc
  152. lib32-gcc-libs: for generating code for 32-bit ABI
  153.  
  154. Optional dependencies for patch
  155. ed: for patch -e functionality
  156.  
  157. Optional dependencies for git
  158. tk: gitk and git gui
  159. perl-libwww: git svn
  160. perl-term-readkey: git svn
  161. perl-mime-tools: git send-email
  162. perl-net-smtp-ssl: git send-email TLS support
  163. perl-authen-sasl: git send-email TLS support
  164. perl-mediawiki-api: git mediawiki support
  165. perl-datetime-format-iso8601: git mediawiki support
  166. perl-lwp-protocol-https: git mediawiki https support
  167. perl-cgi: gitweb (web interface) support
  168. python2: various helper scripts
  169. subversion: git svn
  170. gnome-keyring: GNOME keyring credential helper
  171.  
  172. Optional dependencies for etckeeper
  173. mercurial: use mercurial for version control
  174. bzr: use bazaar for version control
  175.  
  176. Optional dependencies for mc
  177. aspell: spelling corrections
  178. cabextract: ucab extfs
  179. cdparanoia: audio extfs
  180. cdrkit: iso9660 extfs
  181. cvs: CVS support
  182. gawk: hp48+ extfs [installed]
  183. mtools: a+ extfs
  184. p7zip: support for 7zip archives
  185. perl: needed by several extfs scripts [installed]
  186. python2-boto: s3+ extfs
  187. python2-pytz: s3+ extfs
  188. samba: VFS support
  189. unace: uace extfs
  190. unarj: uarj extfs
  191. unrar: urar extfs
  192. zip: uzip extfs
  193.  
  194. ## Configure the system
  195. # Fstab
  196. sudo genfstab -U /mnt >> /mnt/etc/fstab
  197.  
  198. read -p "Press key to continue.. " -n1 -s
  199.  
  200. # Chroot
  201. sudo arch-chroot /mnt
  202.  
  203. bootctl --path=/boot install
  204. efibootmgr -a -b 0001
  205.  
  206. # Time zone
  207. hwclock --systohc
  208. timedatectl set-local-rtc false
  209. timedatectl set-timezone Europe/Brussels
  210. timedatectl set-ntp true
  211. sed -i -e "s/^#Server = http:\/\/archlinux.cu.be\/\$repo\/os\/\$arch/Server = http:\/\/archlinux.cu.be\/\$repo\/os\/\$arch/" /etc/pacman.d/mirrorlist
  212. sed -i -e "s/^#NTP=/NTP=ntp.belbone.be/" "s/^#FallbackNTP=0.arch.pool.ntp.org 1.arch.pool.ntp.org 2.arch.pool.ntp.org 3.arch.pool.ntp.org/FallbackNTP=be.pool.ntp.org,europe.pool.ntp.org/" /etc/systemd/timesyncd.conf
  213.  
  214. # Localization
  215. sed -i -e "s/^#en_us.UTF-8/en_us.UTF-8/" "s/^#nl_BE.UTF-8/nl_BE.UTF-8/" "s/^#ru_RU.UTF-8/ru_RU.UTF-8/" /etc/locale.gen
  216. locale-gen
  217. localectl set-locale LANG=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
  218.  
  219. cat > /etc/vconsole.conf << EOF
  220. FONT=Lat2-Terminus16
  221. EOF
  222.  
  223. # Network configuration
  224. hostnamectl set-hostname inode
  225.  
  226. cat > /etc/hosts << EOF
  227. # <header>
  228.  
  229. 127.0.0.1 localhost
  230. 127.0.1.1 inode.localdomain inode
  231. ::1 localhost
  232.  
  233. # </header>
  234. EOF
  235.  
  236. systemctl enable --now systemd-networkd dnscrypt-proxy
  237. # Configure dnscrypt-proxy
  238. read -p "Press key to continue.. " -n1 -s
  239.  
  240. # Initramfs
  241. sed -i -e "s/^HOOKS=(.*)$/HOOKS=(base systemd autodetect modconf block filesystems keyboard sd-vconsole fsck)/" mkinitcpio.conf
  242. mkinitcpio -p linux
  243.  
  244. # Root password
  245. passwd
  246. usermod -s /bin/zsh
  247.  
  248. # User management
  249. useradd -m -g users -G wheel -s /bin/zsh blitz
  250. passwd blitz
  251. visudo
  252.  
  253. zsh <(curl meta.sh/aur) -Ccsir yay
  254. # Configure yay config
  255. read -p "Press key to continue.. " -n1 -s
  256.  
  257. yay -Syu xorg-init xorg-server xterm xorg-twm |& tee -a /tmp/pacstrap.log
  258. yay -Syu xf86-video-intel libva-intel-driver libva-mesa-driver |& tee -a /tmp/pacstrap.log
  259. yay -Syu gtk3 cinnamon |& tee -a /tmp/pacstrap.log
  260. yay -Syu cairo-infinality-ultimate fontconfig-infinality-ultimate freetype2-infinality |& tee -a /tmp/pacstrap.log
Advertisement
Add Comment
Please, Sign In to add comment