feat: better driver support, grub
This commit is contained in:
		
							parent
							
								
									2724a43e07
								
							
						
					
					
						commit
						788571364e
					
				
					 6 changed files with 37 additions and 24 deletions
				
			
		|  | @ -9,18 +9,18 @@ GREEN='\e[32m' | |||
| PACMAN='pacman --needed -Syu' | ||||
| 
 | ||||
| # System config | ||||
| cp -rf rootfs/ / | ||||
| ln -sf "/usr/share/zoneinfo/$tz" /etc/localtime | ||||
| hwclock --systohc | ||||
| timedatectl set-ntp true | ||||
| timedatectl set-ntp true # TODO after system reboot? | ||||
| for l in "${locales[@]}"; do | ||||
|     sed -i "/#\s*$l/s/^#\s*//" /etc/locale.gen # todo test | ||||
|     sed -i "/#\s*$l/s/^#\s*//" /etc/locale.gen | ||||
| done | ||||
| locale-gen | ||||
| echo "LANG=$lang" > /etc/locale.conf | ||||
| echo "LANG=$lang.UTF-8" > /etc/locale.conf | ||||
| echo "$hostname" > /etc/hostname | ||||
| 
 | ||||
| # Packages | ||||
| cp -rf rootfs/ / | ||||
| $PACMAN "${pkg[@]}" | ||||
| systemctl enable NetworkManager | ||||
| systemctl enable reflector.timer | ||||
|  | @ -35,9 +35,13 @@ echo "root:$root_passwd" | chpasswd | |||
| useradd -mG wheel "$username" | ||||
| echo "$username:$user_passwd" | chpasswd | ||||
| 
 | ||||
| sed -i '/%wheel\s\+ALL=(ALL)\s\+ALL/s/^#\s*//' /etc/sudoers | ||||
| sed -i '/^# %wheel\s\+ALL=(ALL:ALL)\s\+ALL/s/^#\s*//' /etc/sudoers | ||||
| 
 | ||||
| # drivers | ||||
| if blkid | grep -q LUKS; then | ||||
|     sed -i '/^HOOKS=(/s/filesystems/encrypt filesystems/' /etc/mkinitcpio.conf | ||||
| fi | ||||
| 
 | ||||
| # Bootloader | ||||
| case "$(lscpu | grep Vendor)" in | ||||
|     *AuthenticAMD*) | ||||
|         $PACMAN amd-ucode | ||||
|  | @ -46,10 +50,16 @@ case "$(lscpu | grep Vendor)" in | |||
|         $PACMAN intel-ucode | ||||
|         ;; | ||||
| esac | ||||
| ./gpu.sh | ||||
| 
 | ||||
| bootctl install | ||||
| cp loader/ /boot/loader # TODO | ||||
| # Bootloader | ||||
| sed -i '/GRUB_DISABLE_OS_PROBER=/s/.*/GRUB_DISABLE_OS_PROBER=true/' /etc/default/grub | ||||
| 
 | ||||
| mkinitcpio -P | ||||
| if [ -n "$grub_timeout" ]; then | ||||
|     sed -i "/GRUB_TIMEOUT=/s/.*/GRUB_TIMEOUT=$grub_timeout/" /etc/default/grub | ||||
| fi | ||||
| 
 | ||||
| grub-install --target=x86_64-efi --efi-directory="$esp" --bootloader-id=GRUB | ||||
| grub-mkconfig -o /boot/grub/grub.cfg | ||||
| 
 | ||||
| echo -e "${BOLD}${GREEN}DONE. Ctrl+D, umount -R /mnt and reboot${NORMAL}" | ||||
|  |  | |||
							
								
								
									
										7
									
								
								config
									
										
									
									
									
								
							
							
						
						
									
										7
									
								
								config
									
										
									
									
									
								
							|  | @ -9,18 +9,19 @@ hostname="$username-pc" | |||
| 
 | ||||
| tz='Europe/Paris' | ||||
| locales=( | ||||
|     'en_US.UTF-8' | ||||
|     'en_US' | ||||
| ) | ||||
| lang="${locales[0]}" | ||||
| 
 | ||||
| esp="$(lsblk -f | grep vfat | grep -o '/boot.\+')" | ||||
| esp="$(lsblk -f | grep vfat | grep -o '/boot.*')" | ||||
| grub_timeout=1 | ||||
| 
 | ||||
| pkg=( | ||||
|     base-devel | ||||
|     docker{,-compose} | ||||
|     efibootmgr | ||||
|     fuse | ||||
|     git | ||||
|     grub efibootmgr os-prober | ||||
|     htop | ||||
|     man-{db,pages} | ||||
|     mpv | ||||
|  |  | |||
							
								
								
									
										4
									
								
								gpu.sh
									
										
									
									
									
								
							
							
						
						
									
										4
									
								
								gpu.sh
									
										
									
									
									
								
							|  | @ -29,4 +29,6 @@ esac | |||
| 
 | ||||
| sed -i "s/^MODULES=(/MODULES=($modules/" /etc/mkinitcpio.conf | ||||
| 
 | ||||
| echo -e "${BOLD}${GREEN}DONE. You can reboot.${NORMAL}" | ||||
| mkinitcpio -P | ||||
| 
 | ||||
| echo -e "${BOLD}${GREEN}GPU drivers install finished.${NORMAL}" | ||||
|  |  | |||
|  | @ -4,8 +4,7 @@ Operation=Upgrade | |||
| Operation=Remove | ||||
| Type=Package | ||||
| Target=nvidia | ||||
| Target=linux | ||||
| # Change the linux part above and in the Exec line if a different kernel is used | ||||
| Target=linux* | ||||
| 
 | ||||
| [Action] | ||||
| Description=Update NVIDIA module in initcpio | ||||
|  |  | |||
							
								
								
									
										10
									
								
								rootfs/etc/pacman.d/hooks/95-grub.hook
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								rootfs/etc/pacman.d/hooks/95-grub.hook
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,10 @@ | |||
| [Trigger] | ||||
| Type = Package | ||||
| Operation = Install | ||||
| Operation = Upgrade | ||||
| Target = linux* | ||||
| 
 | ||||
| [Action] | ||||
| Description = Update grub config | ||||
| When = PostTransaction | ||||
| Exec = /usr/bin/grub-mkconfig -o /boot/grub/grub.cfg | ||||
|  | @ -1,9 +0,0 @@ | |||
| [Trigger] | ||||
| Type = Package | ||||
| Operation = Upgrade | ||||
| Target = systemd | ||||
| 
 | ||||
| [Action] | ||||
| Description = Gracefully upgrading systemd-boot... | ||||
| When = PostTransaction | ||||
| Exec = /usr/bin/systemctl restart systemd-boot-update.service | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue