Advertisement
Guest User

Parabola

a guest
Aug 20th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.20 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # project : https://github.com/asafemode/arch_install
  4. # download : wget https://raw.githubusercontent.com/asafemode/arch_install/master/archfi
  5.  
  6. #########################
  7. #### Dialog function ####
  8. #########################
  9. boot_dialog() {
  10. DIALOG_RESULT=$(whiptail --clear --backtitle " Arch Linux / Parabola Fast Install (GRUB SYSTEMD-BOOT)" "$@" 3>&1 1>&2 2>&3)
  11. DIALOG_CODE=$?
  12. }
  13.  
  14. #################
  15. #### Welcome ####
  16. #################
  17. clear
  18. boot_dialog --title "Welcome" --msgbox "\nChoosing between GPT and MBR partition table." 10 60
  19.  
  20. ##############################
  21. #### UEFI / BIOS detection ####
  22. ##############################
  23. efivar -l >/dev/null 2>&1
  24.  
  25. if [[ $? -eq 0 ]]; then
  26. UEFI_BIOS_text="UEFI detected."
  27. UEFI_radio="on"
  28. BIOS_radio="off"
  29. else
  30. UEFI_BIOS_text="BIOS detected."
  31. UEFI_radio="off"
  32. BIOS_radio="on"
  33. fi
  34.  
  35. boot_dialog --title "UEFI or BIOS" --radiolist "${UEFI_BIOS_text}\nPress <Enter> to accept." 10 60 2 1 GPT "$UEFI_radio" 2 MBR "$BIOS_radio"
  36. [[ $DIALOG_RESULT -eq 1 ]] && GPT=1 || GPT=0
  37. if [[ $GPT -eq 1 ]]; then
  38. boot_dialog --title "UEFI boot loaders" --menu "" 10 60 2 "1" "GRUB" "2" "SYSTEMD-BOOT"
  39. bl="$DIALOG_RESULT"
  40. fi
  41.  
  42. ############################
  43. #### Linux distribution ####
  44. ############################
  45. boot_dialog --title "Linux distribution" --menu "" 10 60 2 "1" "ARCHLINUX" "2" "PARABOLA"
  46. os="$DIALOG_RESULT"
  47.  
  48. ###################
  49. #### Localtime ####
  50. ###################
  51. items=$(ls -l /usr/share/zoneinfo/ | grep '^d' | gawk -F':[0-9]* ' '/:/{print $2}')
  52. options=()
  53. for item in $items; do
  54. options+=("$item" "")
  55. done
  56. boot_dialog --title "Timezone" --menu "" 16 60 7 "${options[@]}"
  57. region="$DIALOG_RESULT"
  58.  
  59. items=$(ls /usr/share/zoneinfo/$region/)
  60. options=()
  61. for item in $items; do
  62. options+=("$item" "")
  63. done
  64. boot_dialog --title "Timezone" --menu "" 16 60 7 "${options[@]}"
  65. city="$DIALOG_RESULT"
  66.  
  67. ################
  68. #### Locale ####
  69. ################
  70. items=$(ls /usr/share/i18n/locales)
  71. options=()
  72. for item in $items; do
  73. options+=("$item" "")
  74. done
  75. boot_dialog --title "Locale" --menu "" 16 60 7 "${options[@]}"
  76. locale="$DIALOG_RESULT"
  77.  
  78. ################
  79. #### Keymap ####
  80. ################
  81. items=$(find /usr/share/kbd/keymaps/ -type f -printf "%f\n" | sort -V | awk -F'.map' '{print $1}')
  82. options=()
  83. for item in $items; do
  84. options+=("$item" "")
  85. done
  86. boot_dialog --title "Keymap" --menu "" 16 60 7 "${options[@]}"
  87. keymap="$DIALOG_RESULT"
  88.  
  89. ##############
  90. #### Font ####
  91. ##############
  92. items=$(find /usr/share/kbd/consolefonts/*.psfu.gz -printf "%f\n" | cut -f1 -d.)
  93. options=()
  94. for item in $items; do
  95. options+=("$item" "")
  96. done
  97. boot_dialog --title "Font" --menu "" 16 60 7 "${options[@]}"
  98. font="$DIALOG_RESULT"
  99.  
  100. ############################
  101. #### Display drivers ####
  102. ############################
  103. boot_dialog --title "Display drivers" --menu "" 16 60 6 "1" "VIRTUALBOX" "2" "VMware" "3" "INTEL" "4" "ATI" "5" "AMD" "6" "NVIDIA"
  104. dd="$DIALOG_RESULT"
  105.  
  106. #############################
  107. #### Desktop environment ####
  108. #############################
  109. boot_dialog --title "Desktop environment" --menu "" 10 60 4 "1" "XFCE" "2" "MATE" "3" "KDE" "4" "WITHOUT DE"
  110. de="$DIALOG_RESULT"
  111.  
  112. ######################
  113. #### File systems ####
  114. ######################
  115. boot_dialog --title "File systems" --menu "" 10 60 2 "1" "EXT4" "2" "BTRFS"
  116. fs="$DIALOG_RESULT"
  117.  
  118. ###########################
  119. #### Hostname Username ####
  120. ###########################
  121. boot_dialog --title "Hostname" --inputbox "\nPlease enter a name for this host.\n" 10 60
  122. hostname="$DIALOG_RESULT"
  123.  
  124. boot_dialog --title "User name" --inputbox "Please enter a name for this user.\n" 10 60
  125. username="$DIALOG_RESULT"
  126.  
  127. ##########################
  128. #### Password prompts ####
  129. ##########################
  130. boot_dialog --title "Root password" --passwordbox "Please enter a strong password for the root user.\n" 10 60
  131. root_password="$DIALOG_RESULT"
  132.  
  133. boot_dialog --title "User password" --passwordbox "Please enter a strong password for the user.\n" 10 60
  134. user_password="$DIALOG_RESULT"
  135.  
  136. boot_dialog --title "Disk encryption" --passwordbox "\nEnter a strong passphrase for the disk encryption.\nLeave blank if you don't want encryption.\n" 10 60
  137. encryption_passphrase="$DIALOG_RESULT"
  138.  
  139. #################
  140. #### Warning ####
  141. #################
  142. boot_dialog --title "WARNING" --yesno "\nYou have chosen to remove all partition(ALL DATA) on the following drives:/dev/sda.\nPress <Yes> to continue or <No> to cancel.\n" 10 60
  143. clear
  144. if [[ $DIALOG_CODE -eq 1 ]]; then
  145. boot_dialog --title "Cancelled" --msgbox "\nScript was cancelled at your request." 10 60
  146. exit 0
  147. fi
  148.  
  149. ##########################
  150. #### Reset the screen ####
  151. ##########################
  152. reset
  153. timedatectl set-ntp true
  154. ##################
  155. #### Packages ####
  156. ##################
  157. core_packages=''
  158. is_intel_cpu=$(lscpu | grep 'Intel' &> /dev/null && echo 'yes' || echo '')
  159. # Xserver
  160. core_packages+=' xorg-server xorg-apps xorg-xinit xorg-twm xterm'
  161. if [[ "$os" = "1" ]]; then
  162. # linux-headers
  163. core_packages+=' linux-headers'
  164. else
  165. # linux-libre-headers
  166. core_packages+=' linux-libre-headers'
  167. fi
  168. if [[ "$os" = "1" && -n "$is_intel_cpu" ]]; then
  169. # https://wiki.archlinux.org/index.php/microcode
  170. core_packages+=' intel-ucode'
  171. fi
  172. if [[ "$dd" = "1" && "$os" = "1" ]]; then
  173. # Virtualbox
  174. core_packages+=' virtualbox-guest-utils'
  175. fi
  176. if [[ "$dd" = "2" ]]; then
  177. # Vmware
  178. core_packages+=' xf86-video-vmware xf86-input-vmmouse'
  179. fi
  180. if [[ "$dd" = "3" ]]; then
  181. # Intel
  182. core_packages+=' xf86-video-intel'
  183. fi
  184. if [[ "$dd" = "4" ]]; then
  185. # Ati for older cards
  186. core_packages+=' xf86-video-ati'
  187. fi
  188. if [[ "$dd" = "5" ]]; then
  189. # Amdgpu for newer cards
  190. core_packages+=' xf86-video-amdgpu'
  191. fi
  192. if [[ "$dd" = "6" ]]; then
  193. # Nvidia
  194. core_packages+=' xf86-video-nouveau'
  195. fi
  196. if [[ "$de" = "1" ]]; then
  197. # Desktop environment
  198. core_packages+=' xfce4 xfce4-goodies'
  199. # Display manager
  200. core_packages+=' lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings'
  201. fi
  202. if [[ "$de" = "2" ]]; then
  203. # Desktop environment
  204. core_packages+=' mate mate-extra'
  205. # Display manager
  206. core_packages+=' lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings'
  207. fi
  208. if [[ "$de" = "3" && "$os" = "1" ]]; then
  209. # Desktop environment,localization for applications - kde-l10n-lt,kde-l10n-de ...
  210. core_packages+=' plasma-meta'
  211. # Display manager
  212. core_packages+=' sddm'
  213. fi
  214. if [[ "$de" = "3" && "$os" = "2" ]]; then
  215. # Desktop environment,Parabola KDE pakages-https://www.parabola.nu/packages/?sort=&q=kde&maintainer=&flagged= ,localization for applications - kde-l10n-lt,kde-l10n-de ...
  216. core_packages+=' plasma kdebase-meta kdemultimedia-meta'
  217. # Display manager
  218. core_packages+=' sddm'
  219. fi
  220. # Fonts
  221. core_packages+=' ttf-dejavu ttf-liberation ttf-freefont noto-fonts'
  222. # Audio
  223. core_packages+=' pulseaudio pulseaudio-alsa pavucontrol'
  224. # General utilities/libraries
  225. core_packages+=' mesa lib32-mesa xf86-input-libinput xdg-user-dirs networkmanager network-manager-applet ppp dialog wpa_supplicant'
  226. packages=''
  227. if [[ "$os" = "1" ]]; then
  228. # Browser
  229. packages+=' chromium'
  230. # General utilities/libraries
  231. packages+=' unace unrar'
  232. else
  233. # Browser ,language iceweasel-l10n-lt iceweasel-l10n-de iceweasel-l10n-ru
  234. packages+=' iceweasel iceweasel-noscript iceweasel-ublock-origin'
  235. fi
  236. # Image viewer
  237. packages+=' feh imagemagick'
  238. # Video
  239. packages+=' ffmpeg ffmpegthumbnailer mpv'
  240. # General utilities/libraries
  241. packages+=' neofetch git wget curl openssh file-roller p7zip unzip w3m mc htop ntfs-3g os-prober'
  242.  
  243. if [[ "$de" = "1" ]]; then
  244. display_manager=" lightdm.service"
  245. fi
  246. if [[ "$de" = "2" ]]; then
  247. display_manager=" lightdm.service"
  248. fi
  249. if [[ "$de" = "3" ]]; then
  250. display_manager=" sddm.service"
  251. fi
  252.  
  253. ##################
  254. #### Parabola ####
  255. ##################
  256. #############################################################################################################################################
  257. #### Install the keyring and mirror list for free repositories.If this doesn't work,see you https://wiki.parabola.nu/Migration_from_Arch ####
  258. #############################################################################################################################################
  259. migration_to_parabola(){
  260. sed -i 's/^#RemoteFileSigLevel = Required/RemoteFileSigLevel = Never/' /etc/pacman.conf
  261. #pacman -U --noconfirm --force https://www.parabola.nu/packages/libre/any/parabola-keyring/download
  262. #pacman -U --noconfirm --force https://www.parabola.nu/packages/libre/any/pacman-mirrorlist/download
  263. pacman -U --noconfirm --force https://repo.parabola.nu/pool/parabola/parabola-keyring-20180802-1-any.pkg.tar.xz
  264. pacman -U --noconfirm --force https://repo.parabola.nu/pool/parabola/pacman-mirrorlist-20180712-1.parabola1-any.pkg.tar.xz
  265. sed -i 's/^RemoteFileSigLevel = Never/#RemoteFileSigLevel = Required/' /etc/pacman.conf
  266. cp -vr /etc/pacman.d/mirrorlist.pacnew /etc/pacman.d/mirrorlist
  267. cat << PACMAN > /etc/pacman.conf
  268. #
  269. # /etc/pacman.conf
  270. #
  271. # See the pacman.conf(5) manpage for option and repository directives
  272. #
  273. # GENERAL OPTIONS
  274. #
  275. [options]
  276. # The following paths are commented out with their default values listed.
  277. # If you wish to use different paths, uncomment and update the paths.
  278. #RootDir = /
  279. #DBPath = /var/lib/pacman/
  280. #CacheDir = /var/cache/pacman/pkg/
  281. #LogFile = /var/log/pacman.log
  282. #GPGDir = /etc/pacman.d/gnupg/
  283. #HookDir = /etc/pacman.d/hooks/
  284. HoldPkg = pacman glibc
  285. #XferCommand = /usr/bin/curl -C - -f %u > %o
  286. #XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
  287. #CleanMethod = KeepInstalled
  288. #UseDelta = 0.7
  289. Architecture = auto
  290. #IgnorePkg =
  291. #IgnorePkg =
  292. #IgnoreGroup =
  293. #NoUpgrade =
  294. #NoExtract =
  295. # Misc options
  296. #UseSyslog
  297. #Color
  298. #TotalDownload
  299. CheckSpace
  300. #VerbosePkgLists
  301.  
  302. # By default, pacman accepts packages signed by keys that its local keyring
  303. # trusts (see pacman-key and its man page), as well as unsigned packages.
  304. SigLevel = Required DatabaseOptional
  305. LocalFileSigLevel = Optional
  306. #RemoteFileSigLevel = Required
  307. # NOTE: You must run `pacman-key --init` before first using pacman; the local
  308. # keyring can then be populated with the keys of all official Arch Linux
  309. # packagers with `pacman-key --populate archlinux`.
  310. #
  311. # REPOSITORIES
  312. # - can be defined here or included from another file
  313. # - pacman will search repositories in the order defined here
  314. # - local/custom mirrors can be added here or in separate files
  315. # - repositories listed first will take precedence when packages
  316. # have identical names, regardless of version number
  317. # - URLs will have $repo replaced by the name of the current repo
  318. # - URLs will have $arch replaced by the name of the architecture
  319. #
  320. # Repository entries are of the format:
  321. # [repo-name]
  322. # Server = ServerName
  323. # Include = IncludePath
  324. #
  325. # The header [repo-name] is crucial - it must be present and
  326. # uncommented to enable the repo.
  327. #
  328. # The testing repositories are disabled by default. To enable, uncomment the
  329. # repo name header and Include lines. You can add preferred servers immediately
  330. # after the header, and they will be used before the default mirrors.
  331. #[testing]
  332. #Include = /etc/pacman.d/mirrorlist
  333. #[pcr]
  334. #Include = /etc/pacman.d/mirrorlist
  335. [kernels]
  336. Include = /etc/pacman.d/mirrorlist
  337. [nonprism]
  338. Include = /etc/pacman.d/mirrorlist
  339. [libre]
  340. Include = /etc/pacman.d/mirrorlist
  341. [core]
  342. Include = /etc/pacman.d/mirrorlist
  343. [extra]
  344. Include = /etc/pacman.d/mirrorlist
  345. #[community-testing]
  346. #Include = /etc/pacman.d/mirrorlist
  347. [community]
  348. Include = /etc/pacman.d/mirrorlist
  349. # If you want to run 32 bit applications on your x86_64 system,
  350. # enable the multilib repositories as required here.
  351. #[multilib-testing]
  352. #Include = /etc/pacman.d/mirrorlist
  353. #[multilib]
  354. #Include = /etc/pacman.d/mirrorlist
  355. # An example of a custom package repository. See the pacman manpage for
  356. # tips on creating your own repositories.
  357. #[custom]
  358. #SigLevel = Optional TrustAll
  359. #Server = file:///home/custompkgs
  360. PACMAN
  361. pacman -Scc --noconfirm
  362. pacman -Syy --noconfirm
  363. pacman-key --refresh
  364. pacman -Suu pacman --noconfirm
  365. pacman -Sy archlinux-keyring parabola-keyring --noconfirm
  366. pacman-key --populate archlinux parabola
  367. #pacman-key --refresh-keys
  368. }
  369.  
  370. ############################################
  371. #### Set up disk partitions and install ####
  372. ############################################
  373.  
  374. if [[ $GPT -eq 1 ]]; then
  375. echo "UEFI disk partitions"
  376. if [[ "$bl" = "1" ]]; then
  377. efi_bootmgr=" grub efibootmgr"
  378. else
  379. efi_bootmgr=" dosfstools gptfdisk"
  380. fi
  381. else
  382. echo "BIOS disk partitions"
  383. mbr_grub=" grub"
  384. fi
  385. if [[ $GPT -eq 1 ]]; then
  386. mkfs.vfat -F32 -n EFI /dev/sda2
  387. else
  388. mkfs.ext2 -L boot /dev/sda2
  389. fi
  390. mkswap -L swap /dev/sda6
  391. swapon /dev/sda6
  392. if [[ ! -z $encryption_passphrase ]]; then
  393. echo "Setting up encryption"
  394. printf "%s" "$encryption_passphrase" | cryptsetup luksFormat /dev/sda7
  395. printf "%s" "$encryption_passphrase" | cryptsetup open /dev/sda3 cryptroot
  396. physical_volume="/dev/mapper/cryptroot"
  397. encrypt_mkinitcpio_hook=" encrypt"
  398. sd_encrypt_mkinitcpio_hook=" sd-encrypt"
  399. crypt_uuid=$(blkid -s UUID -o value /dev/sda7)
  400. cryptdevice_grub="cryptdevice=UUID=${crypt_uuid}:cryptroot"
  401. cryptdevice_systemd="rd.luks.name=${crypt_uuid}=cryptroot"
  402. else
  403. physical_volume="/dev/sda7"
  404. resume_mkinitcpio_hook=" resume"
  405. resume_grub_systemd=" resume=UUID=$(blkid -s UUID -o value /dev/sda6)"
  406. fi
  407. if [[ "$fs" = "1" ]]; then
  408. mkfs.ext4 -L root $physical_volume
  409. mount $physical_volume /mnt
  410. mkdir /mnt/boot
  411. mount /dev/sda2 /mnt/boot
  412. fsck_mkinitcpio_hook=" fsck"
  413. root_systemd=" root=UUID=$(blkid -s UUID -o value ${physical_volume})"
  414. else
  415. mkfs.btrfs -L root $physical_volume
  416. mount $physical_volume /mnt
  417. btrfs subvolume create /mnt/@
  418. btrfs subvolume create /mnt/@home
  419. btrfs subvolume create /mnt/@snapshots
  420. btrfs sub set-default /mnt
  421. umount /mnt
  422. mount -o compress=lzo,subvol=@ $physical_volume /mnt
  423. mkdir /mnt/boot
  424. mount /dev/sda2 /mnt/boot
  425. mkdir /mnt/home
  426. mount -o compress=lzo,subvol=@home $physical_volume /mnt/home
  427. mkdir /mnt/snapshots
  428. mount -o compress=lzo,subvol=@snapshots $physical_volume /mnt/snapshots
  429. btrfs_progs=" btrfs-progs"
  430. root_systemd=" root=UUID=$(blkid -s UUID -o value ${physical_volume}) rootflags=subvol=@"
  431. fi
  432. if [[ "$bl" = "2" && ! -z $encryption_passphrase ]]; then
  433. root_uuid=${cryptdevice_systemd}${root_systemd}
  434. else
  435. root_uuid=${root_systemd}
  436. fi
  437. if [[ "$os" = "2" ]]; then
  438. migration_to_parabola
  439. fi
  440. echo "pacstrap /mnt base base-devel bash-completion${btrfs_progs}${efi_bootmgr}${mbr_grub}"
  441. pacstrap /mnt base base-devel bash-completion$btrfs_progs$efi_bootmgr$mbr_grub
  442. genfstab -U -p /mnt >> /mnt/etc/fstab
  443. arch-chroot /mnt /bin/bash <<EOF
  444. echo $hostname > /etc/hostname
  445. ln -svf /usr/share/zoneinfo/$region/$city /etc/localtime
  446. hwclock --systohc
  447. echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
  448. echo $locale".UTF-8 UTF-8" >> /etc/locale.gen
  449. echo 'LANG="'$locale'.UTF-8"' > /etc/locale.conf
  450. echo 'KEYMAP='$keymap'' >> /etc/vconsole.conf
  451. echo 'FONT='$font'' >> /etc/vconsole.conf
  452. locale-gen
  453. echo "root:$root_password" | chpasswd
  454. useradd -m -g users -G wheel -s /bin/bash $username
  455. echo "$username:$user_password" | chpasswd
  456. sed -i 's/^# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/g' /etc/sudoers
  457. sed -i 's/^HOOKS=.*/HOOKS=(base udev autodetect keyboard keymap consolefont modconf block${encrypt_mkinitcpio_hook}${resume_mkinitcpio_hook} filesystems${fsck_mkinitcpio_hook})/g' /etc/mkinitcpio.conf
  458. EOF
  459. if [[ "$fs" = "2" ]]; then
  460. arch-chroot /mnt /bin/bash <<EOF
  461. sed -i 's/^BINARIES=.*/BINARIES=(\/usr\/bin\/btrfs)/g' /etc/mkinitcpio.conf
  462. EOF
  463. fi
  464. if [[ "$bl" = "2" ]]; then
  465. arch-chroot /mnt /bin/bash <<EOF
  466. sed -i 's/^HOOKS=.*/HOOKS=(base systemd autodetect keyboard sd-vconsole modconf block${sd_encrypt_mkinitcpio_hook} filesystems${fsck_mkinitcpio_hook})/g' /etc/mkinitcpio.conf
  467. EOF
  468. fi
  469. if [[ "$os" = "1" ]]; then
  470. arch-chroot /mnt /bin/bash <<EOF
  471. mkinitcpio -p linux
  472. EOF
  473. else
  474. arch-chroot /mnt /bin/bash <<EOF
  475. mkinitcpio -p linux-libre
  476. EOF
  477. fi
  478. if [[ "$bl" = "2" ]]; then
  479. arch-chroot /mnt /bin/bash <<EOF
  480. bootctl install
  481. cat << LINUX > /boot/loader/entries/arch.conf
  482. title Arch Linux
  483. linux /vmlinuz-linux
  484. initrd /initramfs-linux.img
  485. options ${root_uuid}${resume_grub_systemd} rw quiet splash
  486. LINUX
  487. cat << LINUXFL > /boot/loader/entries/arch-fallback.conf
  488. title Arch Linux Fallback
  489. linux /vmlinuz-linux
  490. initrd /initramfs-linux-fallback.img
  491. options ${root_uuid}${resume_grub_systemd} rw quiet splash
  492. LINUXFL
  493. cat << GRUB > /boot/loader/loader.conf
  494. default arch
  495. timeout 3
  496. editor 0
  497. GRUB
  498. cat /boot/loader/entries/arch.conf
  499. cat /boot/loader/entries/arch-fallback.conf
  500. cat /boot/loader/loader.conf
  501. EOF
  502. else
  503. arch-chroot /mnt /bin/bash <<EOF
  504. sed -i "s/^GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT=\"quiet splash${resume_grub_systemd}\"/g" /etc/default/grub
  505. sed -i "s/^GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"${cryptdevice_grub}\"/g" /etc/default/grub
  506. EOF
  507. fi
  508. if [[ "$os" = "1" &&"$bl" = "2" && -n "$is_intel_cpu" ]]; then
  509. arch-chroot /mnt /bin/bash <<EOF
  510. sed -i "s/^initrd.*/initrd \/intel-ucode.img\\ninitrd \/initramfs-linux.img/g" /boot/loader/entries/arch.conf
  511. sed -i "s/^initrd.*/initrd \/intel-ucode.img\\ninitrd \/initrd \/initramfs-linux-fallback.img/g" /boot/loader/entries/arch-fallback.conf
  512. EOF
  513. fi
  514. if [[ "$bl" = "2" && "$os" = "2" ]]; then
  515. arch-chroot /mnt /bin/bash <<EOF
  516. sed -i 's/Arch Linux/Parabola/g' /boot/loader/entries/arch.conf
  517. sed -i 's/vmlinuz-linux/vmlinuz-linux-libre/g' /boot/loader/entries/arch.conf
  518. sed -i 's/initramfs-linux.img/initramfs-linux-libre.img/g' /boot/loader/entries/arch.conf
  519. sed -i 's/Arch Linux/Parabola/g' /boot/loader/entries/arch-fallback.conf
  520. sed -i 's/vmlinuz-linux/vmlinuz-linux-libre/g' /boot/loader/entries/arch-fallback.conf
  521. sed -i 's/initramfs-linux-fallback.img/initramfs-linux-libre-fallback.img/g' /boot/loader/entries/arch-fallback.conf
  522. EOF
  523. fi
  524. if [[ "$os" = "2" ]]; then
  525. arch-chroot /mnt /bin/bash <<EOF
  526. sed -i '/^#\[nonprism\]/{n;s/^#Include.*/Include = \/etc\/pacman.d\/mirrorlist/g}' /etc/pacman.conf
  527. sed -i 's/^#\[nonprism\]/\[nonprism\]/g' /etc/pacman.conf
  528. EOF
  529. fi
  530. arch-chroot /mnt /bin/bash <<EOF
  531. sed -i "s/^#VerbosePkgLists/ILoveCandy\\n#VerbosePkgLists/g" /etc/pacman.conf
  532. sed -i '/^#\[multilib\]/{n;s/^#Include.*/Include = \/etc\/pacman.d\/mirrorlist/g}' /etc/pacman.conf
  533. sed -i 's/^#\[multilib\]/\[multilib\]/g' /etc/pacman.conf
  534. pacman -Syy --noconfirm --needed $core_packages
  535. EOF
  536. if [[ "$bl" = "1" ]]; then
  537. arch-chroot /mnt /bin/bash <<EOF
  538. grub-install --target=x86_64-efi --efi-directory=/boot
  539. grub-mkconfig -o /boot/grub/grub.cfg
  540. EOF
  541. fi
  542. if [[ $GPT -eq 0 ]]; then
  543. arch-chroot /mnt /bin/bash <<EOF
  544. grub-install --target=i386-pc --recheck /dev/sda
  545. grub-mkconfig -o /boot/grub/grub.cfg
  546. EOF
  547. fi
  548. if [[ $GPT -eq 1 && "$bl" = "1" && "$dd" = "1" ]]; then
  549. arch-chroot /mnt /bin/bash <<EOF
  550. mkdir /boot/EFI/boot
  551. cp /boot/EFI/arch/grubx64.efi /boot/EFI/boot/bootx64.efi
  552. EOF
  553. fi
  554. arch-chroot /mnt /bin/bash <<EOF
  555. xdg-user-dirs-update
  556. systemctl enable$display_manager NetworkManager
  557. pacman -S --noconfirm --needed $packages
  558. EOF
  559.  
  560. #################
  561. #### The end ####
  562. #################
  563. printf "The script has completed boot Arch Linux or Parabola.\nIf it looks good you >> umount -R /mnt and shutdown now or reboot.\n"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement