arch-maride-flavour/steps/50-configure.step
2018-03-04 14:00:22 +01:00

46 lines
1.6 KiB
Bash
Executable File

#!/bin/sh
echo "~> generating fstab"
genfstab -U /mnt >> /mnt/etc/fstab
echo "~> Choosing 'Europe/Berlin' as timezone and syncing hardware clock"
arch-chroot /mnt ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
arch-chroot /mnt hwclock --systohc
echo "~> Overwriting locale.gen and generate en_US and de_DE"
echo -e 'en_US.UTF-8 UTF-8\nde_DE.UTF-8 UTF-8' > /mnt/etc/locale.gen
arch-chroot /mnt locale-gen
echo 'LANG=de_DE.UTF-8' > /mnt/etc/locale.conf
echo 'KEYMAP=de-latin1' > /mnt/etc/vconsole.conf
echo -e "~> Choose a hostname: "
read hostname
echo $hostname > /mnt/etc/hostname
echo "~> Configuring 'grub' for $bootloader"
if [ "$bootmethod" == "EFI" ]; then
arch-chroot /mnt grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=BOOT
# thanks to Virtualbox, this step is necessary
cp /mnt/boot/EFI/BOOT/{grubx64.efi,BOOTX64.EFI}
else
arch-chroot /mnt grub-install --target=i386-pc /dev/*da
fi
if [ "$cryptroot" -eq 1 ]; then
echo "GRUB_CMDLINE_LINUX='cryptdevice=UUID=`blkid -o value ${blockdevice}2 | head -n 1`:cryptroot'" > /mnt/etc/default/grub
fi
arch-chroot /mnt grub-mkconfig -o /boot/grub/grub.cfg
echo "~> Patching mkinitcpio.conf for encryption magic"
arch-chroot /mnt sed -i "s/^HOOKS/#HOOKS/g" /etc/mkinitcpio.conf
echo "HOOKS=\"base udev autodetect modconf block keyboard keymap encrypt filesystems fsck\"" >> /mnt/etc/mkinitcpio.conf
echo "~> ... and recompile the kernel"
arch-chroot /mnt mkinitcpio -p linux
echo "~> Patching pacman.conf for some pacman magic."
arch-chroot /mnt sed -i "s/\[options\]/\[options\]\nILoveCandy/g" /etc/pacman.conf
amf_return=0