echo "Running install script" #!/bin/bash # Partition the disk parted -s /dev/nvme0n1 mklabel gpt parted -s /dev/nvme0n1 mkpart primary ext4 1MiB 100% parted -s /dev/nvme0n1 set 1 boot on # Format the partition mkfs.ext4 /dev/nvme0n1p1 # Mount the partition mount /dev/nvme0n1p1 /mnt # Prepare the target system for installation apt update apt install -y debootstrap debootstrap bionic /mnt # Mount necessary filesystems for the chroot environment mount -t proc none /mnt/proc mount -t sysfs none /mnt/sys mount -o bind /dev /mnt/dev mount -t devpts none /mnt/dev/pts # Enter the chroot environment chroot /mnt /bin/bash < /etc/cloud/cloud.cfg.d/50-curtin-networking.cfg network: version: 2 renderer: networkd ethernets: enp94s0f10: dhcp4: false addresses: [66.85.158.18/29] gateway4: 66.85.158.17 nameservers: addresses: [8.8.8.8, 8.8.4.4] EOT # Set up DNS configuration cat < /etc/resolv.conf nameserver 8.8.8.8 nameserver 8.8.4.4 EOT # Update the system apt update apt upgrade -y # Install additional packages (adjust as needed) apt install -y openssh-server # Configure the bootloader apt install -y grub-pc grub-install /dev/nvme0n1 update-grub # Set the hostname echo "myserver" > /etc/hostname # Set the root password echo "root:myrootpassword" | chpasswd # For the Cloud Init configuration changes to take effect cloud-init clean -r # Complete KS installation wget -T 30 -O /dev/null 'http://192.168.200.2/automation/completeKickstartInstallation.php?kickstartInstallationId=72491&securityKey=ghubqkfmhptjqnajkhcuubaqmglhsnoz' # Exit the chroot environment exit EOF # Unmount the chroot environment umount /mnt/dev/pts umount /mnt/dev umount /mnt/sys umount /mnt/proc # Reboot the system reboot