2022-07-28 00:27:16 +00:00
|
|
|
DEBUG := false
|
2022-06-24 09:02:51 +00:00
|
|
|
OUT_DIR := out
|
|
|
|
KEY_DIR := keys
|
2022-07-28 00:27:16 +00:00
|
|
|
SRC_DIR := src
|
2022-09-13 23:01:10 +00:00
|
|
|
TARGET := generic
|
2022-06-24 09:02:51 +00:00
|
|
|
CACHE_DIR := cache
|
2022-07-29 19:32:45 +00:00
|
|
|
CONFIG_DIR := config
|
|
|
|
SRC_DIR := src
|
2022-07-24 12:30:55 +00:00
|
|
|
USER := $(shell id -g):$(shell id -g)
|
2022-06-24 09:02:51 +00:00
|
|
|
CPUS := $(shell nproc)
|
2022-07-09 00:37:00 +00:00
|
|
|
ARCH := x86_64
|
2022-09-13 23:01:10 +00:00
|
|
|
TARGET_NAME := bzImage
|
2022-09-26 23:07:37 +00:00
|
|
|
, := ,
|
2022-06-24 09:02:51 +00:00
|
|
|
|
2022-07-29 19:32:45 +00:00
|
|
|
include $(PWD)/config/global.env
|
2022-06-24 09:02:51 +00:00
|
|
|
|
2022-09-13 23:01:10 +00:00
|
|
|
ifeq ($(TARGET), aws)
|
|
|
|
TARGET_NAME := nitro.eif
|
|
|
|
endif
|
|
|
|
|
2022-06-24 09:02:51 +00:00
|
|
|
.DEFAULT_GOAL := default
|
2022-07-09 07:52:32 +00:00
|
|
|
.PHONY: default
|
2022-09-13 23:01:10 +00:00
|
|
|
default: \
|
|
|
|
fetch \
|
|
|
|
$(OUT_DIR)/$(TARGET)/$(TARGET_NAME)
|
2022-07-09 07:52:32 +00:00
|
|
|
|
|
|
|
# Clean repo back to initial clone state
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
rm -rf cache out
|
|
|
|
docker image rm -f local/$(NAME)-build
|
|
|
|
|
2022-07-24 12:30:55 +00:00
|
|
|
# Launch a shell inside the toolchain container
|
|
|
|
.PHONY: toolchain-shell
|
|
|
|
toolchain-shell: $(OUT_DIR)/toolchain.tar
|
|
|
|
$(call toolchain,root,bash)
|
|
|
|
|
|
|
|
# Pin all packages in toolchain container to latest versions
|
|
|
|
.PHONY: toolchain-update
|
|
|
|
toolchain-update:
|
2022-09-13 23:01:10 +00:00
|
|
|
docker run \
|
|
|
|
--rm \
|
|
|
|
--env LOCAL_USER=$(USER) \
|
|
|
|
--platform=linux/$(ARCH) \
|
|
|
|
--volume $(PWD)/$(CONFIG_DIR):/config \
|
|
|
|
--volume $(PWD)/$(SRC_DIR)/toolchain/scripts:/usr/local/bin \
|
|
|
|
--env GNUPGHOME=/cache/.gnupg \
|
|
|
|
--env ARCH=$(ARCH) \
|
|
|
|
--interactive \
|
|
|
|
--tty \
|
|
|
|
debian@sha256:$(DEBIAN_HASH) \
|
|
|
|
bash -c /usr/local/bin/packages-update
|
2022-07-24 12:30:55 +00:00
|
|
|
|
2022-07-09 07:52:32 +00:00
|
|
|
# Source anything required from the internet to build
|
|
|
|
.PHONY: fetch
|
|
|
|
fetch: \
|
|
|
|
keys \
|
2022-09-13 23:01:10 +00:00
|
|
|
$(OUT_DIR)/$(TARGET) \
|
2022-07-24 12:30:55 +00:00
|
|
|
$(OUT_DIR)/toolchain.tar \
|
2022-07-09 07:52:32 +00:00
|
|
|
$(CACHE_DIR) \
|
|
|
|
$(CACHE_DIR)/linux-$(LINUX_VERSION).tar.xz \
|
|
|
|
$(CACHE_DIR)/linux-$(LINUX_VERSION).tar.sign \
|
|
|
|
$(CACHE_DIR)/busybox-$(BUSYBOX_VERSION).tar.bz2 \
|
2022-09-01 21:16:48 +00:00
|
|
|
$(CACHE_DIR)/busybox-$(BUSYBOX_VERSION).tar.bz2.sig \
|
|
|
|
$(CACHE_DIR)/aws-nitro-enclaves-image-format/.git/HEAD
|
2022-07-09 07:52:32 +00:00
|
|
|
|
|
|
|
# Build latest image and run in terminal via Qemu
|
|
|
|
.PHONY: run
|
|
|
|
run: default
|
|
|
|
qemu-system-x86_64 \
|
|
|
|
-m 512M \
|
|
|
|
-nographic \
|
|
|
|
-kernel $(OUT_DIR)/bzImage
|
|
|
|
|
|
|
|
# Run ncurses busybox config menu and save output
|
|
|
|
.PHONY: busybox-config
|
|
|
|
busybox-config:
|
2022-07-29 20:32:04 +00:00
|
|
|
rm $(CONFIG_DIR)/debug/busybox.config
|
|
|
|
make $(CONFIG_DIR)/debug/busybox.config
|
2022-07-09 07:52:32 +00:00
|
|
|
|
|
|
|
# Run linux config menu and save output
|
|
|
|
.PHONY: linux-config
|
|
|
|
linux-config:
|
2022-07-29 19:32:45 +00:00
|
|
|
rm $(CONFIG_DIR)/$(TARGET)/linux.config
|
|
|
|
make $(CONFIG_DIR)/$(TARGET)/linux.config
|
2022-07-09 07:52:32 +00:00
|
|
|
|
2022-07-29 20:32:04 +00:00
|
|
|
.PHONY: keys
|
|
|
|
keys: \
|
|
|
|
$(KEY_DIR)/$(LINUX_KEY).asc \
|
|
|
|
$(KEY_DIR)/$(BUSYBOX_KEY).asc
|
|
|
|
|
|
|
|
$(KEY_DIR)/$(LINUX_KEY).asc:
|
|
|
|
$(call fetch_pgp_key,$(LINUX_KEY))
|
|
|
|
|
|
|
|
$(KEY_DIR)/$(BUSYBOX_KEY).asc:
|
|
|
|
$(call fetch_pgp_key,,$(BUSYBOX_KEY))
|
|
|
|
|
|
|
|
define fetch_pgp_key
|
|
|
|
mkdir -p $(KEY_DIR) && \
|
2022-09-01 21:16:48 +00:00
|
|
|
$(call toolchain,$(USER), " \
|
2022-07-29 20:32:04 +00:00
|
|
|
for server in \
|
|
|
|
ha.pool.sks-keyservers.net \
|
|
|
|
hkp://keyserver.ubuntu.com:80 \
|
|
|
|
hkp://p80.pool.sks-keyservers.net:80 \
|
|
|
|
pgp.mit.edu \
|
|
|
|
; do \
|
|
|
|
echo "Trying: $${server}"; \
|
|
|
|
gpg \
|
|
|
|
--recv-key \
|
|
|
|
--keyserver "$${server}" \
|
|
|
|
--keyserver-options timeout=10 \
|
|
|
|
--recv-keys "$(1)" \
|
|
|
|
&& break; \
|
|
|
|
done; \
|
|
|
|
gpg --export -a $(1) > $(KEY_DIR)/$(1).asc; \
|
2022-09-01 21:16:48 +00:00
|
|
|
")
|
2022-07-29 20:32:04 +00:00
|
|
|
endef
|
|
|
|
|
2022-09-13 23:01:10 +00:00
|
|
|
$(OUT_DIR)/$(TARGET):
|
|
|
|
mkdir -p $(OUT_DIR)/$(TARGET)
|
2022-07-29 20:32:04 +00:00
|
|
|
|
|
|
|
$(CACHE_DIR):
|
|
|
|
mkdir -p $(CACHE_DIR)
|
|
|
|
|
2022-10-04 17:55:30 +00:00
|
|
|
|
|
|
|
$(CACHE_DIR)/aws-nitro-enclaves-sdk-bootstrap/.git/HEAD:
|
|
|
|
$(call toolchain,$(USER), " \
|
|
|
|
cd /cache; \
|
|
|
|
git clone $(AWS_NITRO_DRIVER_REPO); \
|
|
|
|
cd aws-nitro-enclaves-sdk-bootstrap; \
|
|
|
|
git checkout $(AWS_NITRO_DRIVER_REF); \
|
|
|
|
git rev-parse --verify HEAD | grep -q $(AWS_NITRO_DRIVER_REF) || { \
|
|
|
|
echo 'Error: Git ref/branch collision.'; exit 1; \
|
|
|
|
}; \
|
|
|
|
")
|
|
|
|
|
2022-09-01 21:16:48 +00:00
|
|
|
$(CACHE_DIR)/aws-nitro-enclaves-image-format/.git/HEAD:
|
|
|
|
$(call toolchain,$(USER), " \
|
|
|
|
cd /cache; \
|
|
|
|
git clone https://github.com/aws/aws-nitro-enclaves-image-format.git; \
|
|
|
|
cd aws-nitro-enclaves-image-format; \
|
|
|
|
git checkout $(AWS_EIF_REF); \
|
|
|
|
git rev-parse --verify HEAD | grep -q $(AWS_EIF_REF) || { \
|
|
|
|
echo 'Error: Git ref/branch collision.'; exit 1; \
|
|
|
|
}; \
|
|
|
|
")
|
|
|
|
|
2022-07-29 20:32:04 +00:00
|
|
|
$(CACHE_DIR)/busybox-$(BUSYBOX_VERSION).tar.bz2.sig:
|
|
|
|
curl \
|
|
|
|
--url $(BUSYBOX_SERVER)/busybox-$(BUSYBOX_VERSION).tar.bz2.sig \
|
|
|
|
--output $(CACHE_DIR)/busybox-$(BUSYBOX_VERSION).tar.bz2.sig
|
|
|
|
|
|
|
|
$(CACHE_DIR)/busybox-$(BUSYBOX_VERSION).tar.bz2:
|
|
|
|
curl \
|
|
|
|
--url $(BUSYBOX_SERVER)/busybox-$(BUSYBOX_VERSION).tar.bz2 \
|
|
|
|
--output $(CACHE_DIR)/busybox-$(BUSYBOX_VERSION).tar.bz2
|
|
|
|
|
|
|
|
$(CACHE_DIR)/linux-$(LINUX_VERSION).tar.sign:
|
|
|
|
curl \
|
|
|
|
--url $(LINUX_SERVER)/linux-$(LINUX_VERSION).tar.sign \
|
|
|
|
--output $(CACHE_DIR)/linux-$(LINUX_VERSION).tar.sign
|
|
|
|
|
|
|
|
$(CACHE_DIR)/linux-$(LINUX_VERSION).tar.xz:
|
|
|
|
curl \
|
|
|
|
--url $(LINUX_SERVER)/linux-$(LINUX_VERSION).tar.xz \
|
|
|
|
--output $(CACHE_DIR)/linux-$(LINUX_VERSION).tar.xz
|
|
|
|
|
|
|
|
$(CACHE_DIR)/linux-$(LINUX_VERSION).tar:
|
|
|
|
xz -d $(CACHE_DIR)/linux-$(LINUX_VERSION).tar.xz
|
|
|
|
|
|
|
|
$(CACHE_DIR)/linux-$(LINUX_VERSION): $(CACHE_DIR)/linux-$(LINUX_VERSION).tar
|
|
|
|
$(call toolchain,$(USER), " \
|
|
|
|
cd /cache && \
|
|
|
|
gpg --import /keys/$(LINUX_KEY).asc && \
|
|
|
|
gpg --verify linux-$(LINUX_VERSION).tar.sign && \
|
|
|
|
tar xf linux-$(LINUX_VERSION).tar; \
|
|
|
|
")
|
|
|
|
|
|
|
|
$(CACHE_DIR)/busybox-$(BUSYBOX_VERSION):
|
|
|
|
$(call toolchain,$(USER), " \
|
|
|
|
cd /cache && \
|
|
|
|
gpg --import /keys/$(BUSYBOX_KEY).asc && \
|
|
|
|
gpg --verify busybox-$(BUSYBOX_VERSION).tar.bz2.sig && \
|
|
|
|
tar -xf busybox-$(BUSYBOX_VERSION).tar.bz2 \
|
|
|
|
")
|
|
|
|
|
2022-07-24 12:30:55 +00:00
|
|
|
$(OUT_DIR)/toolchain.tar:
|
2022-09-01 21:16:48 +00:00
|
|
|
DOCKER_BUILDKIT=1 \
|
|
|
|
docker build \
|
|
|
|
--tag local/$(NAME)-build \
|
|
|
|
--build-arg DEBIAN_HASH=$(DEBIAN_HASH) \
|
|
|
|
--build-arg RUST_REF=$(RUST_REF) \
|
|
|
|
--build-arg CARGO_REF=$(CARGO_REF) \
|
|
|
|
--build-arg CONFIG_DIR=$(CONFIG_DIR) \
|
|
|
|
--build-arg SCRIPTS_DIR=$(SRC_DIR)/toolchain/scripts \
|
|
|
|
-f $(SRC_DIR)/toolchain/Dockerfile \
|
|
|
|
.
|
|
|
|
docker save "local/$(NAME)-build" -o "$@"
|
|
|
|
|
|
|
|
define toolchain
|
|
|
|
docker load -i $(OUT_DIR)/toolchain.tar
|
|
|
|
docker run \
|
|
|
|
--rm \
|
|
|
|
--tty \
|
|
|
|
--interactive \
|
|
|
|
--user=$(1) \
|
|
|
|
--platform=linux/$(ARCH) \
|
|
|
|
--volume $(PWD)/$(CONFIG_DIR):/config \
|
|
|
|
--volume $(PWD)/$(CACHE_DIR):/cache \
|
|
|
|
--volume $(PWD)/$(KEY_DIR):/keys \
|
|
|
|
--volume $(PWD)/$(OUT_DIR):/out \
|
|
|
|
--volume $(PWD)/$(SRC_DIR):/src \
|
|
|
|
--env GNUPGHOME=/cache/.gnupg \
|
|
|
|
--env ARCH=$(ARCH) \
|
|
|
|
--env KBUILD_BUILD_USER=$(KBUILD_BUILD_USER) \
|
|
|
|
--env KBUILD_BUILD_HOST=$(KBUILD_BUILD_HOST) \
|
|
|
|
--env KBUILD_BUILD_VERSION=$(KBUILD_BUILD_VERSION) \
|
|
|
|
--env KBUILD_BUILD_TIMESTAMP=$(KBUILD_BUILD_TIMESTAMP) \
|
|
|
|
--env KCONFIG_NOTIMESTAMP=$(KCONFIG_NOTIMESTAMP) \
|
|
|
|
--env SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) \
|
|
|
|
local/$(NAME)-build \
|
|
|
|
bash -c $(2)
|
|
|
|
endef
|
|
|
|
|
2022-07-24 12:30:55 +00:00
|
|
|
|
2022-07-29 20:32:04 +00:00
|
|
|
$(CONFIG_DIR)/debug/busybox.config:
|
2022-07-24 12:30:55 +00:00
|
|
|
$(call toolchain,$(USER), " \
|
2022-06-24 09:02:51 +00:00
|
|
|
cd /cache/busybox-$(BUSYBOX_VERSION) && \
|
2022-07-09 00:37:00 +00:00
|
|
|
KCONFIG_NOTIMESTAMP=1 make menuconfig && \
|
2022-07-29 20:32:04 +00:00
|
|
|
cp .config /config/debug/busybox.config; \
|
2022-07-24 12:30:55 +00:00
|
|
|
")
|
2022-06-24 09:02:51 +00:00
|
|
|
|
2022-07-29 19:32:45 +00:00
|
|
|
$(CONFIG_DIR)/$(TARGET)/linux.config:
|
2022-07-24 12:30:55 +00:00
|
|
|
$(call toolchain,$(USER)," \
|
2022-06-24 09:02:51 +00:00
|
|
|
cd /cache/linux-$(LINUX_VERSION) && \
|
|
|
|
make menuconfig && \
|
2022-07-29 19:32:45 +00:00
|
|
|
cp .config /config/$(TARGET)/linux.config; \
|
2022-07-24 12:30:55 +00:00
|
|
|
")
|
2022-07-09 00:37:00 +00:00
|
|
|
|
2022-07-09 07:52:32 +00:00
|
|
|
$(OUT_DIR)/busybox: \
|
|
|
|
$(CACHE_DIR)/busybox-$(BUSYBOX_VERSION) \
|
|
|
|
$(CACHE_DIR)/busybox-$(BUSYBOX_VERSION).tar.bz2 \
|
|
|
|
$(CACHE_DIR)/busybox-$(BUSYBOX_VERSION).tar.bz2.sig
|
2022-07-24 12:30:55 +00:00
|
|
|
$(call toolchain,$(USER)," \
|
2022-06-24 09:02:51 +00:00
|
|
|
cd /cache/busybox-$(BUSYBOX_VERSION) && \
|
2022-07-29 20:32:04 +00:00
|
|
|
cp /config/debug/busybox.config .config && \
|
2022-06-24 09:02:51 +00:00
|
|
|
make -j$(CPUS) busybox && \
|
|
|
|
cp busybox /out/; \
|
2022-07-24 12:30:55 +00:00
|
|
|
")
|
2022-06-24 09:02:51 +00:00
|
|
|
|
2022-07-29 20:32:04 +00:00
|
|
|
$(OUT_DIR)/init:
|
2022-07-28 00:27:16 +00:00
|
|
|
$(call toolchain,$(USER)," \
|
|
|
|
gcc \
|
|
|
|
-static \
|
2022-09-01 21:16:48 +00:00
|
|
|
-static-libgcc /src/init/init.c \
|
2022-07-29 20:32:04 +00:00
|
|
|
-o /out/init; \
|
2022-07-28 00:27:16 +00:00
|
|
|
")
|
|
|
|
|
2022-07-12 11:42:03 +00:00
|
|
|
$(CACHE_DIR)/linux-$(LINUX_VERSION)/usr/gen_init_cpio: \
|
2022-07-12 12:15:15 +00:00
|
|
|
$(CACHE_DIR)/linux-$(LINUX_VERSION) \
|
|
|
|
$(CACHE_DIR)/linux-$(LINUX_VERSION) \
|
|
|
|
$(CACHE_DIR)/linux-$(LINUX_VERSION).tar.xz \
|
|
|
|
$(CACHE_DIR)/linux-$(LINUX_VERSION).tar.sign
|
2022-07-24 12:30:55 +00:00
|
|
|
$(call toolchain,$(USER)," \
|
2022-07-12 11:42:03 +00:00
|
|
|
cd /cache/linux-$(LINUX_VERSION) && \
|
|
|
|
gcc usr/gen_init_cpio.c -o usr/gen_init_cpio \
|
2022-07-24 12:30:55 +00:00
|
|
|
")
|
2022-07-12 11:42:03 +00:00
|
|
|
|
2022-10-04 17:55:30 +00:00
|
|
|
$(OUT_DIR)/$(TARGET)/rootfs.cpio: \
|
2022-07-12 11:42:03 +00:00
|
|
|
$(OUT_DIR)/busybox \
|
2022-07-29 20:32:04 +00:00
|
|
|
$(OUT_DIR)/init \
|
2022-07-12 11:42:03 +00:00
|
|
|
$(CACHE_DIR)/linux-$(LINUX_VERSION)/usr/gen_init_cpio
|
2022-09-01 21:16:48 +00:00
|
|
|
mkdir -p $(CACHE_DIR)/$(TARGET)/rootfs/bin
|
2022-09-13 23:01:10 +00:00
|
|
|
cp $(CONFIG_DIR)/generic/rootfs.list $(CACHE_DIR)/$(TARGET)/rootfs.list
|
2022-07-28 00:27:16 +00:00
|
|
|
ifeq ($(DEBUG), true)
|
2022-09-01 21:16:48 +00:00
|
|
|
cp $(OUT_DIR)/init $(CACHE_DIR)/$(TARGET)/rootfs/real_init
|
|
|
|
cp $(SRC_DIR)/scripts/busybox_init $(CACHE_DIR)/$(TARGET)/rootfs/init
|
|
|
|
cp $(OUT_DIR)/busybox $(CACHE_DIR)/$(TARGET)/rootfs/bin/
|
|
|
|
echo "file /bin/busybox /cache/rootfs/bin/busybox 0755 0 0" \
|
2022-10-04 17:55:30 +00:00
|
|
|
>> $(CACHE_DIR)/$(TARGET)/rootfs.list
|
2022-07-28 00:27:16 +00:00
|
|
|
else
|
2022-09-01 21:16:48 +00:00
|
|
|
cp $(OUT_DIR)/init $(CACHE_DIR)/$(TARGET)/rootfs/init
|
2022-10-04 17:55:30 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(TARGET), aws)
|
|
|
|
echo "file /nsm.ko /out/aws/nsm.ko 0755 0 0" \
|
|
|
|
>> $(CACHE_DIR)/$(TARGET)/rootfs.list
|
2022-07-28 00:27:16 +00:00
|
|
|
endif
|
2022-07-24 12:30:55 +00:00
|
|
|
$(call toolchain,$(USER)," \
|
2022-09-01 21:16:48 +00:00
|
|
|
cd /cache/$(TARGET)/rootfs && \
|
2022-07-12 12:15:15 +00:00
|
|
|
find . -mindepth 1 -execdir touch -hcd "@0" "{}" + && \
|
|
|
|
find . -mindepth 1 -printf '%P\0' && \
|
|
|
|
cd /cache/linux-$(LINUX_VERSION) && \
|
2022-07-29 19:32:45 +00:00
|
|
|
usr/gen_initramfs.sh \
|
2022-10-04 17:55:30 +00:00
|
|
|
-o /out/$(TARGET)/rootfs.cpio \
|
2022-09-01 21:16:48 +00:00
|
|
|
/cache/$(TARGET)/rootfs.list && \
|
2022-10-04 17:55:30 +00:00
|
|
|
cpio -itv < /out/$(TARGET)/rootfs.cpio && \
|
2022-07-12 12:15:15 +00:00
|
|
|
sha256sum /out/rootfs.cpio; \
|
2022-07-24 12:30:55 +00:00
|
|
|
")
|
2022-07-12 11:42:03 +00:00
|
|
|
|
2022-09-13 23:01:10 +00:00
|
|
|
$(OUT_DIR)/$(TARGET)/bzImage: \
|
2022-07-12 12:15:15 +00:00
|
|
|
$(OUT_DIR)/rootfs.cpio
|
2022-07-24 12:30:55 +00:00
|
|
|
$(call toolchain,$(USER)," \
|
2022-06-24 09:02:51 +00:00
|
|
|
cd /cache/linux-$(LINUX_VERSION) && \
|
2022-07-29 19:32:45 +00:00
|
|
|
cp /config/$(TARGET)/linux.config .config && \
|
2022-07-09 00:37:00 +00:00
|
|
|
make olddefconfig && \
|
2022-10-04 17:55:30 +00:00
|
|
|
make modules_prepare && \
|
2022-07-09 00:37:00 +00:00
|
|
|
make -j$(CPUS) ARCH=$(ARCH) bzImage && \
|
2022-09-13 23:01:10 +00:00
|
|
|
cp arch/x86_64/boot/bzImage /out/$(TARGET) && \
|
|
|
|
sha256sum /out/$(TARGET)/bzImage; \
|
|
|
|
")
|
|
|
|
|
2022-09-26 23:07:37 +00:00
|
|
|
$(OUT_DIR)/aws/eif_build:
|
2022-09-13 23:01:10 +00:00
|
|
|
ifeq ($(TARGET), aws)
|
|
|
|
$(call toolchain,$(USER)," \
|
|
|
|
cd /cache/aws-nitro-enclaves-image-format \
|
|
|
|
&& CARGO_HOME=/cache/cargo cargo build --example eif_build \
|
|
|
|
&& cp target/debug/examples/eif_build /out; \
|
2022-07-24 12:30:55 +00:00
|
|
|
")
|
2022-09-13 23:01:10 +00:00
|
|
|
endif
|
2022-09-01 21:16:48 +00:00
|
|
|
|
2022-10-04 17:55:30 +00:00
|
|
|
$(OUT_DIR)/aws/nsm.ko: \
|
|
|
|
$(CACHE_DIR)/aws-nitro-enclaves-sdk-bootstrap/.git/HEAD
|
|
|
|
ifeq ($(TARGET), aws)
|
|
|
|
$(call toolchain,$(USER)," \
|
|
|
|
cd /cache/aws-nitro-enclaves-sdk-bootstrap/ \
|
|
|
|
&& make -C /cache/linux-$(LINUX_VERSION) M=/cache/aws-nitro-enclaves-sdk-bootstrap/nsm-driver \
|
|
|
|
&& cp nsm-driver/nsm.ko /out/aws/nsm.ko; \
|
|
|
|
")
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
2022-09-26 23:07:37 +00:00
|
|
|
$(OUT_DIR)/aws/nitro.eif: \
|
|
|
|
$(OUT_DIR)/aws/eif_build \
|
2022-09-13 23:01:10 +00:00
|
|
|
$(OUT_DIR)/$(TARGET)/bzImage \
|
2022-09-01 21:16:48 +00:00
|
|
|
$(OUT_DIR)/rootfs.cpio
|
2022-09-13 23:01:10 +00:00
|
|
|
ifeq ($(TARGET), aws)
|
2022-09-01 21:16:48 +00:00
|
|
|
$(call toolchain,$(USER)," \
|
|
|
|
/out/eif_build \
|
2022-09-13 23:01:10 +00:00
|
|
|
--kernel /out/$(TARGET)/bzImage \
|
2022-09-01 21:16:48 +00:00
|
|
|
--kernel_config /config/$(TARGET)/linux.config \
|
2022-09-26 23:07:37 +00:00
|
|
|
--cmdline 'reboot=k initrd=0x2000000$(,)3228672 root=/dev/ram0 panic=1 pci=off nomodules console=ttyS0 i8042.noaux i8042.nomux i8042.nopnp i8042.dumbkbd' \
|
2022-09-01 21:16:48 +00:00
|
|
|
--ramdisk /out/rootfs.cpio \
|
2022-09-26 23:07:37 +00:00
|
|
|
--output /out/aws/nitro.eif; \
|
2022-09-01 21:16:48 +00:00
|
|
|
")
|
2022-09-13 23:01:10 +00:00
|
|
|
endif
|
2022-09-01 21:16:48 +00:00
|
|
|
|