Add 02x scripts

This commit is contained in:
Donovan Glover 2018-08-31 15:35:09 -04:00
parent bfcd75107e
commit 1610ac144c
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
6 changed files with 77 additions and 0 deletions

9
sh/021-sudo Normal file
View File

@ -0,0 +1,9 @@
#!/bin/sh
#
# Give the wheel group permission to use the sudo and su commands.
#
# https://wiki.archlinux.org/index.php/Sudo
set -xe
echo "%wheel ALL=(ALL) ALL" >> /mnt/etc/sudoers

12
sh/022-grub Normal file
View File

@ -0,0 +1,12 @@
#!/bin/sh
#
# Install grub to the primary partition. Then, make the
# configuration file for grub.
#
# https://wiki.archlinux.org/index.php/Grub
set -xe
arch-chroot /mnt grub-install /dev/sda
arch-chroot /mnt grub-mkconfig -o /boot/grub/grub.cfg

11
sh/023-mkinitcpio Normal file
View File

@ -0,0 +1,11 @@
#!/bin/sh
#
# Save our hardware information with mkinitcpio. This creates
# an initial ramdisk environment that allows us to boot the
# Linux kernel.
#
# https://wiki.archlinux.org/index.php/Installation_guide
set -xe
arch-chroot /mnt mkinitcpio -p linux

7
sh/024-chsh Normal file
View File

@ -0,0 +1,7 @@
#!/bin/sh
#
# Change the shell of the root account to fish.
#
# https://wiki.archlinux.org/index.php/Command-line_shell
arch-chroot /mnt chsh -s /usr/bin/fish

23
sh/025-user Normal file
View File

@ -0,0 +1,23 @@
#!/bin/sh
#
# Create a new user account with sudo privileges and the fish shell.
# Then, and add a password to it.
#
# Note that the default password will be the same as your username.
#
# To change the root password, use passwd.
# To change the new user's password, use passwd <username>.
#
# https://wiki.archlinux.org/index.php/Password
set -xe
$USERNAME = "hello"
arch-chroot /mnt useradd -m -g users -G wheel -s /usr/bin/fish $USERNAME
# This is a workaround to the problem of using pipes with arch-chroot
echo "echo $USERNAME:$USERNAME | chpasswd" > /mnt/root/chpasswd.sh
chmod +x /mnt/root/chpasswd.sh
arch-chroot /mnt /root/chpasswd.sh
rm /mnt/root/chpasswd.sh

15
sh/026-cleanup Normal file
View File

@ -0,0 +1,15 @@
#!/bin/sh
#
# The installation process is done. Unmount the filesystem and
# restart the computer in order to boot into the new system.
#
# Alternatively, you can perform more operations with chroot
# before you unmount and reboot.
#
# https://wiki.archlinux.org/index.php/Installation_guide
set -xe
umount /mnt
reboot