-
Notifications
You must be signed in to change notification settings - Fork 0
/
1_get_kernel_rootfs.sh
34 lines (24 loc) · 1.02 KB
/
1_get_kernel_rootfs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!bin/bash
# Get an uncompressed Linux kernel binary to use as the guest kernel and
# An ext4 file system (fourth extended filesystem) image to use as the root filesystem
# Get the architecture of the system
arch=`uname -m`
image_bucket_url="https://s3.amazonaws.com/spec.ccfc.min/img/quickstart_guide/$arch"
echo "Using $2 in getting the guest kernel and rootfs."
dest_kernel="resources/$2-vmlinux.bin"
dest_rootfs="resources/$2-rootfs.ext4"
if [ ${arch}="x86_64" ]; then
kernel="${image_bucket_url}/kernels/vmlinux.bin"
rootfs="${image_bucket_url}/rootfs/bionic.rootfs.ext4"
elif [ ${arch}="aarch64" ]; then
kernel="${image_bucket_url}/kernels/vmlinux.bin"
rootfs="${image_bucket_url}/rootfs/bionic.rootfs.ext4"
else
echo "Cannot run firecracker on $arch architecture!"
exit 1
fi
echo "Downloading the guest kernel: $kernel..."
curl -fsSL -o $dest_kernel $kernel
echo "Downloading the root filesystem: $rootfs..."
curl -fsSL -o $dest_rootfs $rootfs
echo "Saved the kernel file to $dest_kernel and root block."