cd $(dirname $(readlink -f "$BASH_SOURCE"))
-ROOTPW="$(cat /root/shadow/standard)"
-export ROOTPW
export hostname="$1"
mirror=$2
TPPASS="$(cat /root/shadow/traci-simple)"
-export TPPASS
-if [[ $hostname == tp ]]; then
- ROOTPW="$TPPASS"
-fi
(( $# >= 1 )) || { echo "$0: error: need 1 or 2 arguments"; exit 1; }
curl -s 'https://www.archlinux.org/mirrorlist/?country=US&protocol=https&ip_version=4&ip_version=6&use_mirror_status=on' |
sed -r 's/^[ #]*(Server *=)/\1/' >> /etc/pacman.d/mirrorlist
-# export class vars with CLASS_ in front to avoid name colissions.
-ifclass() {
- local var=${1/#/CLASS_}
- [[ $hostname == $1 || ${!var} ]]
-}
-export -f ifclass
-for x in $(bash 50-host-classes); do
- export CLASS_$x=true
-done
+. /a/bin/fai/fai-wrapper
export LUKS_DIR=/root/luks
export HOSTNAME=$hostname
export DISTRO=arch
-chmod +x partition.DEFAULT
+partition_script=/a/bin/fai/fai/config/hooks/partition.DEFAULT
+chmod +x $partition_script
export PARTITION_PROMPT=true
done
if ! $already_partitioned; then
- ./partition.DEFAULT
+ /a/bin/fai/fai/config/hooks/partition.DEFAULT
fi
. /tmp/fai/disk_var.sh
mount -o subvol=root_$DISTRO $ROOT_PARTITION /mnt
mkdir -p /mnt/{q,home,boot}
mount -o subvol=q $ROOT_PARTITION /mnt/q
- mount -o subvol=home_$DISTRO $ROOT_PARTITION /mnt/home
mount -o subvol=boot_$DISTRO $BOOT_PARTITION /mnt/boot
fi
fi
pacstrap /mnt base
cp /tmp/fai/{fstab,crypttab} /mnt/etc
-cp /root/encrypt /mnt/usr/lib/initcpio/hooks
+cp /a/bin/fai/encrypt /mnt/usr/lib/initcpio/hooks
# not needed anymore
#cp /usr/bin/devbyid /mnt/root
-cp -r .ssh /mnt/root
-cp -r /root/distro-install-common /mnt/root
+cp -r /root/.ssh /mnt/root
+
+bindmount() {
+ local mountpoint=$2
+ local source=$1
+ mkdir -p $mountpoint
+ mount -o bind $source $mountpoint
+}
+bindmount /a /mnt/a
+bindmount /root/shadow /mnt/q/root/shadow
+
mkdir -p /mnt/etc/ssh
-cp /etc/ssh/host_* /mnt/etc/ssh
+cp /etc/ssh/ssh_host_* /mnt/etc/ssh
-cp /root/arch-init-chroot /mnt/root
+cp /a/bin/fai/arch-init-chroot /mnt/root
# for manual commands, arch-chroot /mnt bash
arch-chroot /mnt /root/arch-init-chroot