feat: better driver support, grub
This commit is contained in:
parent
2724a43e07
commit
788571364e
@ -9,18 +9,18 @@ GREEN='\e[32m'
|
|||||||
PACMAN='pacman --needed -Syu'
|
PACMAN='pacman --needed -Syu'
|
||||||
|
|
||||||
# System config
|
# System config
|
||||||
|
cp -rf rootfs/ /
|
||||||
ln -sf "/usr/share/zoneinfo/$tz" /etc/localtime
|
ln -sf "/usr/share/zoneinfo/$tz" /etc/localtime
|
||||||
hwclock --systohc
|
hwclock --systohc
|
||||||
timedatectl set-ntp true
|
timedatectl set-ntp true # TODO after system reboot?
|
||||||
for l in "${locales[@]}"; do
|
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
|
done
|
||||||
locale-gen
|
locale-gen
|
||||||
echo "LANG=$lang" > /etc/locale.conf
|
echo "LANG=$lang.UTF-8" > /etc/locale.conf
|
||||||
echo "$hostname" > /etc/hostname
|
echo "$hostname" > /etc/hostname
|
||||||
|
|
||||||
# Packages
|
# Packages
|
||||||
cp -rf rootfs/ /
|
|
||||||
$PACMAN "${pkg[@]}"
|
$PACMAN "${pkg[@]}"
|
||||||
systemctl enable NetworkManager
|
systemctl enable NetworkManager
|
||||||
systemctl enable reflector.timer
|
systemctl enable reflector.timer
|
||||||
@ -35,9 +35,13 @@ echo "root:$root_passwd" | chpasswd
|
|||||||
useradd -mG wheel "$username"
|
useradd -mG wheel "$username"
|
||||||
echo "$username:$user_passwd" | chpasswd
|
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
|
case "$(lscpu | grep Vendor)" in
|
||||||
*AuthenticAMD*)
|
*AuthenticAMD*)
|
||||||
$PACMAN amd-ucode
|
$PACMAN amd-ucode
|
||||||
@ -46,10 +50,16 @@ case "$(lscpu | grep Vendor)" in
|
|||||||
$PACMAN intel-ucode
|
$PACMAN intel-ucode
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
./gpu.sh
|
||||||
|
|
||||||
bootctl install
|
# Bootloader
|
||||||
cp loader/ /boot/loader # TODO
|
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}"
|
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'
|
tz='Europe/Paris'
|
||||||
locales=(
|
locales=(
|
||||||
'en_US.UTF-8'
|
'en_US'
|
||||||
)
|
)
|
||||||
lang="${locales[0]}"
|
lang="${locales[0]}"
|
||||||
|
|
||||||
esp="$(lsblk -f | grep vfat | grep -o '/boot.\+')"
|
esp="$(lsblk -f | grep vfat | grep -o '/boot.*')"
|
||||||
|
grub_timeout=1
|
||||||
|
|
||||||
pkg=(
|
pkg=(
|
||||||
base-devel
|
base-devel
|
||||||
docker{,-compose}
|
docker{,-compose}
|
||||||
efibootmgr
|
|
||||||
fuse
|
fuse
|
||||||
git
|
git
|
||||||
|
grub efibootmgr os-prober
|
||||||
htop
|
htop
|
||||||
man-{db,pages}
|
man-{db,pages}
|
||||||
mpv
|
mpv
|
||||||
|
4
gpu.sh
4
gpu.sh
@ -29,4 +29,6 @@ esac
|
|||||||
|
|
||||||
sed -i "s/^MODULES=(/MODULES=($modules/" /etc/mkinitcpio.conf
|
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
|
Operation=Remove
|
||||||
Type=Package
|
Type=Package
|
||||||
Target=nvidia
|
Target=nvidia
|
||||||
Target=linux
|
Target=linux*
|
||||||
# Change the linux part above and in the Exec line if a different kernel is used
|
|
||||||
|
|
||||||
[Action]
|
[Action]
|
||||||
Description=Update NVIDIA module in initcpio
|
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…
Reference in New Issue
Block a user