diff --git a/docs/getting-started.md b/docs/getting-started.md index 6e2d9f0d616..485d223a8ab 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -115,23 +115,29 @@ latest_ubuntu_key=$(curl "http://spec.ccfc.min.s3.amazonaws.com/?prefix=firecrac | sort -V | tail -1) ubuntu_version=$(basename $latest_ubuntu_key .squashfs | grep -oE '[0-9]+\.[0-9]+') -# Download a rootfs +# Download a rootfs from Firecracker CI wget -O ubuntu-$ubuntu_version.squashfs.upstream "https://s3.amazonaws.com/spec.ccfc.min/$latest_ubuntu_key" -# Create an ssh key for the rootfs +# The rootfs in our CI doesn't contain SSH keys to connect to the VM +# For the purpose of this demo, let's create one and patch it in the rootfs unsquashfs ubuntu-$ubuntu_version.squashfs.upstream ssh-keygen -f id_rsa -N "" cp -v id_rsa.pub squashfs-root/root/.ssh/authorized_keys mv -v id_rsa ./ubuntu-$ubuntu_version.id_rsa # create ext4 filesystem image sudo chown -R root:root squashfs-root -truncate -s 400M ubuntu-$ubuntu_version.ext4 +truncate -s 1G ubuntu-$ubuntu_version.ext4 sudo mkfs.ext4 -d squashfs-root -F ubuntu-$ubuntu_version.ext4 # Verify everything was correctly set up and print versions -echo "Kernel: $(ls vmlinux-* | tail -1)" -echo "Rootfs: $(ls *.ext4 | tail -1)" -echo "SSH Key: $(ls *.id_rsa | tail -1)" +echo +echo "The following files were downloaded and set up:" +KERNEL=$(ls vmlinux-* | tail -1) +[ -f $KERNEL ] && echo "Kernel: $KERNEL" || echo "ERROR: Kernel $KERNEL does not exist" +ROOTFS=$(ls *.ext4 | tail -1) +e2fsck -fn $ROOTFS &>/dev/null && echo "Rootfs: $ROOTFS" || echo "ERROR: $ROOTFS is not a valid ext4 fs" +KEY_NAME=$(ls *.id_rsa | tail -1) +[ -f $KEY_NAME ] && echo "SSH Key: $KEY_NAME" || echo "ERROR: Key $KEY_NAME does not exist" ``` ### Getting a Firecracker Binary