Skip to content

Commit

Permalink
lk2nd: build: create a fake ramdisk
Browse files Browse the repository at this point in the history
Create a 1 byte large fake ramdisk that is just 1 zero.
  • Loading branch information
J0SH1X authored and TravMurav committed Feb 28, 2025
1 parent f43dd80 commit 2c81fe6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lk2nd/device/2nd/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,19 @@ $(OUTQCDT): $(QCDTBS)
$(NOECHO)lk2nd/scripts/dtbTool -o $@ $(QCDTBS)
endif

# Generate a 1-byte RAM disk containing a single zero
RAMDISK := $(BUILDDIR)/ramdisk.img
$(RAMDISK):
$(NOECHO)printf '\0' > $(RAMDISK)

# Android boot image
MKBOOTIMG_BASE ?= $(BASE_ADDR)

ifeq ($(ENABLE_UFS_SUPPORT), 1)
MKBOOTIMG_PAGESIZE ?= 4096
endif

$(OUTBOOTIMG): $(OUTBINDTB) $(OUTQCDT)
$(OUTBOOTIMG): $(OUTBINDTB) $(OUTQCDT) $(RAMDISK)
@echo generating Android boot image: $@
$(NOECHO)lk2nd/scripts/mkbootimg \
--kernel=$< \
Expand All @@ -61,7 +66,9 @@ $(OUTBOOTIMG): $(OUTBINDTB) $(OUTQCDT)
$(if $(OUTQCDT),--qcdt=$(OUTQCDT)) \
$(if $(MKBOOTIMG_BASE),--base=$(MKBOOTIMG_BASE)) \
$(if $(MKBOOTIMG_PAGESIZE),--pagesize=$(MKBOOTIMG_PAGESIZE)) \
--ramdisk=$(RAMDISK) \
$(MKBOOTIMG_ARGS)

ifeq ($(SIGN_BOOTIMG), 1)
$(NOECHO)lk2nd/scripts/bootsignature.py \
-s \
Expand Down

0 comments on commit 2c81fe6

Please sign in to comment.