# runs from inside the installation
# unlike the legacy bios grub script
-DISK=$(cat /root/instantARCH/config/disk)
mkdir /efi
-DISK1=$(fdisk -l | grep "^${DISK}" | grep -o '^[^ ]*' | head -1)
-
-mount "${DISK1}" /efi
+mount "$(cat /root/instantARCH/config/partefi)" /efi
sudo pacman -S efibootmgr grub --noconfirm
mkfs.fat -F32 "$DISK1"
mkfs.ext4 -F "$DISK2"
+ echo "$DISK1" >/root/instantARCH/config/partefi
+ echo "$DISK2" >/root/instantARCH/config/partroot
+
else
echo "legacy bios"
echo "label: dos
DISK1="$(fdisk -l | grep "^${DISK}" | grep -o '^[^ ]*' | head -1)"
mkfs.ext4 -F "$DISK1"
+ echo "$DISK1" >/root/instantARCH/config/partroot
fi
--- /dev/null
+#!/bin/bash
+
+# mounts all partitions to to the installation medium
+
+# mountpart partname mountpoint
+mountpart() {
+ if [ -e /root/instantARCH/config/part$1 ]; then
+ TMPPART="$(cat /root/instantARCH/config/part$1)"
+ echo "mounting $TMPPART to $2"
+ mount "$TMPPART" "$2"
+ else
+ echo "using default partition for $2"
+ fi
+}
+
+mountpart efi /efi
+mountpart root /mnt
+sleep 2
+
+if ! mount | grep -q '/mnt'; then
+ echo "mount failed"
+ exit 1
+fi
# scripts executed in installed environment
chrootscript() {
setinfo "${2:-info}"
- if ! mount | grep -q '/mnt.*ext4'; then
+ if ! mount | grep -q '/mnt'; then
echo "mount failed"
exit 1
fi
escript init/init "configuring time"
escript disk/disk "partitioning disk"
+escript disk/mount "mounting partitions"
escript pacstrap/pacstrap "installing base packages"
sleep 1
#!/bin/bash
-# mount all disks (TODO: make mounting its own module to allow manual partitioning)
# install base system to target root partition
-DISK=$(cat /root/instantARCH/config/disk)
-
-if efibootmgr; then
- DISK1=$(fdisk -l | grep "^${DISK}" | grep -o '^[^ ]*' | head -1)
- DISK2=$(fdisk -l | grep "^${DISK}" | grep -o '^[^ ]*' | tail -1)
-
- mount ${DISK2} /mnt
- mount ${DISK1} /efi
-else
- DISK1=$(fdisk -l | grep "^${DISK}" | grep -o '^[^ ]*' | head -1)
- mount ${DISK1} /mnt
-fi
-
-if ! mount | grep '/mnt.*ext4'; then
+if ! mount | grep '/mnt'; then
echo "mount failed"
exit 1
fi