abudden avatar abudden committed 0cc2287

Another attempt at passwords and partitioning.

Comments (0)

Files changed (1)

 # Make the keyboard work
 loadkeys uk
+read -s -p "Enter root password: " password1
+echo ""
+read -s -p "Re-enter password: " password2
+echo ""
+if [ x$password1 != x$password2 ]
+	echo "Passwords do not match"
+	exit
 # Partitioning - use parted to create:
 # /boot: 512 MB (with 1 MB free at the start for grub)
 # swap: 1024 MB
 # /home: all of second hard drive
 parted --script --align optimal -- /dev/sda \
 	mklabel gpt \
+	mkpart primary ext2 0 1 \
 	mkpart primary ext2 1 512 \
 	mkpart primary linux-swap 512 1536 \
 	mkpart primary ext2 1536 -1 \
-	set 1 boot on
+	set 1 bios_grub on \
+	set 2 boot on
 parted --script --align optimal -- /dev/sdb \
 	mklabel gpt \
 	mkpart primary ext2 1 -1
 # Formatting - /boot is ext2, others are ext4
-mkfs.ext2 /dev/sda1
-mkswap /dev/sda2
-mkfs.ext4 /dev/sda3
+mkfs.ext2 /dev/sda2
+mkswap /dev/sda3
+mkfs.ext4 /dev/sda4
 mkfs.ext4 /dev/sdb1
 # Check for /mnt mount point, then mount everything
 	mkdir /mnt
-mount /dev/sda3 /mnt
+mount /dev/sda4 /mnt
 mkdir /mnt/boot
 mkdir /mnt/home
-mount /dev/sda1 /mnt/boot
+mount /dev/sda2 /mnt/boot
 mount /dev/sdb1 /mnt/home
 # Assume we've got an internet connection
 arch-chroot /mnt /arch_install_chroot.sh
 rm /mnt/arch_install_chroot.sh
-passwd --root /mnt
+echo "root:${password1}" | chpasswd --root /mnt
-# Unmount everything: ready to reboot and get going
 umount /mnt/{boot,home,}
 echo "Done: power off and remove the CD before rebooting."
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.