Commits

abudden committed 39d0139

Include sudo as standard and set up main user.

  • Participants
  • Parent commits 3b1c604

Comments (0)

Files changed (1)

File arch_install.sh

 genfstab -p /mnt >> /mnt/etc/fstab
 # Install the bare minimum of essential applications:
 pacstrap /mnt \
+	sudo \
 	python \
     python2 \
     mercurial \
 	vim
+echo "%sudo ALL=(ALL) ALL" > /mnt/etc/sudoers.d/sudo_group
 # Prepare a script for a chroot session.
 cat > ./arch_install_chroot.sh <<EOF
 #!/bin/bash
 mkdir -p /boot/grub/locale
 cp /usr/share/locale/en\@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo
 grub-mkconfig -o /boot/grub/grub.cfg
+
+groupadd sudo
 EOF
 # Make the script executable and use it
 mv ./arch_install_chroot.sh /mnt
 arch-chroot /mnt /arch_install_chroot.sh
 rm /mnt/arch_install_chroot.sh
 
-echo "Done: use passwd to set the root password, then"
-echo "power off, remove the CD and reboot."
+cat > ./finish.sh <<EOF
+echo "Root password:"
+passwd --root /mnt
+echo ""
+read -p "User name:" username
+useradd --root /mnt -m -s /bin/bash -g users -G sudo \${username}
+echo ""
+echo "User password:"
+passwd --root /mnt \${username}
+umount /mnt/{home,boot,}
+echo ""
+echo "Done: power off, remove the CD and reboot."
+EOF
+chmod +x ./finish.sh
+
+echo "Done: now run './finish.sh'"