Skip to content

Commit

Permalink
Merge pull request #669 from olasnap/oj/optional-rootfs-arg
Browse files Browse the repository at this point in the history
linux-qcom-bootimg: Make root= cmdline arg optional
  • Loading branch information
lumag authored Nov 1, 2024
2 parents 33ed9a6 + 5a9fde6 commit 1b60525
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions classes/linux-qcom-bootimg.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,18 @@ python do_qcom_img_deploy() {
dtb_name = dtb.rsplit('.', 1)[0]

def getVarDTB(name):
return d.getVarFlag(name, dtb_name) or d.getVar(name)
var = d.getVarFlag(name, dtb_name)
return d.getVar(name) if var is None else var

def make_image_internal(output, output_link, rootfs, initrd = definitrd):
rootfs_cmdline = "root=%s " % (rootfs) if rootfs else ""
subprocess.check_call([mkbootimg,
"--kernel", kernel,
"--ramdisk", initrd,
"--output", output,
"--pagesize", getVarDTB("QCOM_BOOTIMG_PAGE_SIZE"),
"--base", getVarDTB("QCOM_BOOTIMG_KERNEL_BASE"),
"--cmdline", "root=%s rw rootwait %s %s" % (rootfs, consoles, getVarDTB("KERNEL_CMDLINE_EXTRA") or "")])
"--cmdline", "%srw rootwait %s %s" % (rootfs_cmdline, consoles, getVarDTB("KERNEL_CMDLINE_EXTRA") or "")])
if os.path.exists(output_link):
os.unlink(output_link)
os.symlink(os.path.basename(output), output_link)
Expand Down Expand Up @@ -108,7 +110,7 @@ python do_qcom_img_deploy() {
shutil.copyfileobj(rfd, wfd)

rootfs = getVarDTB("QCOM_BOOTIMG_ROOTFS")
if not rootfs:
if rootfs is None:
bb.fatal("QCOM_BOOTIMG_ROOTFS is undefined")

output = make_image("boot-%s-%s.img", rootfs)
Expand Down

0 comments on commit 1b60525

Please sign in to comment.