From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6992158526920458240 X-Received: by 2002:a2e:8813:: with SMTP id x19mr14205336ljh.272.1627988770756; Tue, 03 Aug 2021 04:06:10 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a2e:b171:: with SMTP id a17ls2043776ljm.4.gmail; Tue, 03 Aug 2021 04:06:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgAzKMm+bsCSD7tocNafyy9+0QgUDW2UlnCHQ1f343DHj5HoHdpnbFLuoyTrd2PPWSf2fL X-Received: by 2002:a2e:a793:: with SMTP id c19mr14345739ljf.426.1627988769616; Tue, 03 Aug 2021 04:06:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627988769; cv=none; d=google.com; s=arc-20160816; b=RNItiiqos4eMgXjcf/93O1cGGErnwg3iu+KTmVtu6EofH2HoH2L5LLfpDVN6ZO6NFy O7khnHrAXxivtxHvAjUKejOsp7IOh6b6a7zzSNOXM0zjaDlIQh0lQMvGgqAmu9Mn3RMT 0b+4nZVICR1OZdd5b/egoR0wTQ83aTvKW0/93apBmFDDxpEaHaBUXPSCK+Y33f/OR/U6 8mxqB8wCjujqbYqSKe0mPxpRFD5gZPpggaRoyTzvJ/WOJo9R/KmZZn1JHEUR3w5Yf32L 2agqEvGEaxyyuLC2mJUExTXWTYQPNWzBBiO0nkxwRWGRarJsUC1hzmq82+MohWsPJeAL sYUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from; bh=3ww5UldXFFR60F9cuaytw1vczXfU5rnK20AhvUjmUt0=; b=y8Nv0+8n+c2tLDNGDu6eTwQLUY0GldmZNF8UFy2j4YEfMx86QdP1b0CAiWGG5X1IW0 ctVV5vc4SLNLOMOTsFd55DVlURmCmr3PKsgB0ZB9yg+xN5bhrxuo/xPNaGIoLmz0nArI CLPFGzeLK9lBUqu52TCbhisigJIauvU+PSttM3IAfWSoFw6qV9IfgoAtzI4uMaiVfu3r x8tZsUPdMtIYzrWn2qMfQC3EJHaqEZaeMoh++YmzRV3iGKFA3ecVC5XaADcCxO04n7Ae pzzLPpmH5v7YRtlqJ4YXnYa+Fx6289jjWe15vlspxGPxHjvF8PgBhIqh/ZZnji7F9cnp Minw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of quirin.gylstorff@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=Quirin.Gylstorff@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from goliath.siemens.de (goliath.siemens.de. [192.35.17.28]) by gmr-mx.google.com with ESMTPS id v15si673098lfa.6.2021.08.03.04.06.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Aug 2021 04:06:09 -0700 (PDT) Received-SPF: pass (google.com: domain of quirin.gylstorff@siemens.com designates 192.35.17.28 as permitted sender) client-ip=192.35.17.28; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of quirin.gylstorff@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=Quirin.Gylstorff@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id 173B68EW021635 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 3 Aug 2021 13:06:08 +0200 Received: from md2dvrtc.fritz.box ([167.87.79.224]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id 173B68Ys019242; Tue, 3 Aug 2021 13:06:08 +0200 From: "Q. Gylstorff" To: isar-users@googlegroups.com Cc: Quirin Gylstorff Subject: [PATCH v2] wic/rootfs-u-boot: Allow to set root with source_params Date: Tue, 3 Aug 2021 13:06:08 +0200 Message-Id: <20210803110608.29342-1-Quirin.Gylstorff@siemens.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUID: UBjzfVg3/mMA From: Quirin Gylstorff If the root device needs to be modified during boot it needs to be set as source parameter in the wic file similar to efi boot. Signed-off-by: Quirin Gylstorff --- Changes V2: - remove autoformatted code meta/scripts/lib/wic/plugins/source/rootfs-u-boot.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/meta/scripts/lib/wic/plugins/source/rootfs-u-boot.py b/meta/scripts/lib/wic/plugins/source/rootfs-u-boot.py index 15acb57..0b4f9ee 100644 --- a/meta/scripts/lib/wic/plugins/source/rootfs-u-boot.py +++ b/meta/scripts/lib/wic/plugins/source/rootfs-u-boot.py @@ -60,6 +60,13 @@ class RootfsUBootPlugin(RootfsPlugin): (rootfs_dir, image_rootfs_dir)) real_rootfs_dir = image_rootfs_dir + root_dev = cr.rootdev + if not root_dev: + root_dev = source_params.get("root", None) + if not root_dev: + raise WicError("root not defined, exiting.") + root_dev = root_dev.replace(":", "=") + u_boot_script = os.path.join(real_rootfs_dir, "etc/default/u-boot-script") if not os.path.exists(u_boot_script): @@ -70,7 +77,7 @@ class RootfsUBootPlugin(RootfsPlugin): cfg.write('# Generated by wic, rootfs-u-boot plugin\n') cfg.write('ROOT_PARTITION="%d"\n' % part.realnum) cfg.write('KERNEL_ARGS="root=%s %s"\n' % \ - (cr.rootdev, cr.ks.bootloader.append or "")) + (root_dev, cr.ks.bootloader.append or "")) no_initrd = source_params.get('no_initrd') or '' cfg.write('NO_INITRD="%s"\n' % no_initrd) overlays = source_params.get('overlays') or '' -- 2.20.1