From 3998a0095cacfdd044b7f1bae90450e96aa04af8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 28 Mar 2017 16:03:40 +0200 Subject: Add support for persistent state, SSH --- bootstrap | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'bootstrap') diff --git a/bootstrap b/bootstrap index 7eae918..c8707f6 100755 --- a/bootstrap +++ b/bootstrap @@ -149,6 +149,7 @@ if [ "$stage" -eq "1" ]; then pkgs+=",net-tools,iproute2,iptables,isc-dhcp-client" pkgs+=",ifupdown,bridge-utils,dnsmasq,ntp,postfix" pkgs+=",iputils-ping,wget,curl" + pkgs+=",openssh-client,openssh-server" pkgs+=",less" @@ -293,8 +294,8 @@ apt-get clean # Clean up /bootstrap. # -rm /usr/lib/systemd/system/default.target.wants/setup.service -rm /usr/lib/systemd/system/setup.service +rm /usr/lib/systemd/system/default.target.wants/buildos-setup.service +rm /usr/lib/systemd/system/buildos-setup.service rm -r /bootstrap # Shutdown the container from within. @@ -408,8 +409,12 @@ fi # Test. # -if [ ! -e /tmp/buildos-disk ]; then - qemu-img create -f raw /tmp/buildos-disk 100M +if [ ! -e /tmp/buildos-state ]; then + qemu-img create -f raw /tmp/buildos-state 20M +fi + +if [ ! -e /tmp/buildos-machines ]; then + qemu-img create -f raw /tmp/buildos-machines 100M fi # To test PXE boot, replace -kernel/-initrd/-append with '-boot n'. @@ -420,7 +425,9 @@ sudo kvm \ -netdev "tap,id=net0,script=./qemu-ifup" \ -device "virtio-scsi-pci,id=scsi" \ -device "scsi-hd,drive=disk1" \ - -drive "if=none,id=disk1,file=/tmp/buildos-disk,format=raw" \ + -drive "if=none,id=disk1,file=/tmp/buildos-state,format=raw" \ + -device "scsi-hd,drive=disk2" \ + -drive "if=none,id=disk2,file=/tmp/buildos-machines,format=raw" \ -boot n # -kernel buildos-image -initrd buildos-initrd \ -- cgit v1.1