Skip to content

Commit

Permalink
Upgrade firecracker to 1.3.1
Browse files Browse the repository at this point in the history
Fix a build issue by specifying release branch for tools from
firecracker repo

Signed-off-by: Tony Fang <nhfang@amazon.com>
  • Loading branch information
fangn2 committed Mar 16, 2023
1 parent dc8f6de commit e840cf2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ JAILER_BIN=$(FC_TEST_DATA_PATH)/jailer-main
UID = $(shell id -u)
GID = $(shell id -g)

firecracker_version=v1.0.0
# Version has to be in format of vx.x.x
firecracker_version=v1.3.1

# The below files are needed and can be downloaded from the internet
release_url=https://github.com/firecracker-microvm/firecracker/releases/download/$(firecracker_version)/firecracker-$(firecracker_version)-$(arch).tgz
Expand Down Expand Up @@ -107,10 +108,11 @@ $(FC_TEST_DATA_PATH)/root-drive.img:

$(FC_TEST_DATA_PATH)/root-drive-ssh-key $(FC_TEST_DATA_PATH)/root-drive-with-ssh.img:
# Need root to move ssh key to testdata location
# Need to change the jammy.rootfs.ext4 if firecracker uses another Debian distro
ifeq ($(GID), 0)
$(MAKE) $(FIRECRACKER_DIR)
$(FIRECRACKER_DIR)/tools/devtool build_rootfs -m $(FC_TEST_DATA_PATH)/mnt
cp $(FIRECRACKER_DIR)/build/rootfs/bionic.rootfs.ext4 $(FC_TEST_DATA_PATH)/root-drive-with-ssh.img
cp $(FIRECRACKER_DIR)/build/rootfs/jammy.rootfs.ext4 $(FC_TEST_DATA_PATH)/root-drive-with-ssh.img
cp $(FIRECRACKER_DIR)/build/rootfs/ssh/id_rsa $(FC_TEST_DATA_PATH)/root-drive-ssh-key
rm -rf $(FIRECRACKER_DIR)
else
Expand All @@ -132,8 +134,10 @@ $(FC_TEST_BIN_PATH)/tc-redirect-tap:
$(FC_TEST_DATA_PATH)/ltag:
$(call install_go,github.com/kunalkushwaha/ltag,v0.2.3)

# Clone firecracker repo
# Checkout the matching release branch to make sure tools used match the firecracker version
$(FIRECRACKER_DIR):
- git clone https://github.com/firecracker-microvm/firecracker.git $(FIRECRACKER_DIR)
- git clone --branch firecracker-${firecracker_version%.*} https://github.com/firecracker-microvm/firecracker.git $(FIRECRACKER_DIR)

.PHONY: test-images
test-images: $(FIRECRACKER_BIN) $(JAILER_BIN)
Expand Down
2 changes: 1 addition & 1 deletion examples/cmd/snapshotting/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ root-drive-with-ssh.img root-drive-ssh-key:
- mkdir temp
- git clone https://github.com/firecracker-microvm/firecracker temp
temp/tools/devtool build_rootfs
cp temp/build/rootfs/bionic.rootfs.ext4 root-drive-with-ssh.img
cp temp/build/rootfs/jammy.rootfs.ext4 root-drive-with-ssh.img
cp temp/build/rootfs/ssh/id_rsa root-drive-ssh-key
rm -rf temp

Expand Down

0 comments on commit e840cf2

Please sign in to comment.