From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7011463933289562112 X-Received: by 2002:adf:ce84:: with SMTP id r4mr11047574wrn.107.1632483660554; Fri, 24 Sep 2021 04:41:00 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:600c:4f8e:: with SMTP id n14ls4599282wmq.1.gmail; Fri, 24 Sep 2021 04:40:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbWV5iywLgf0zh/QnXcOu1Z5fkMMqXhyiZab5ETXJQzxiEBwvWxGjSQbPSJ63m+Nwcvkxi X-Received: by 2002:a1c:1d10:: with SMTP id d16mr1622225wmd.109.1632483659656; Fri, 24 Sep 2021 04:40:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632483659; cv=none; d=google.com; s=arc-20160816; b=ZRwToHnPSWl5N3lmA61+yE3lr/wevQJXU0l3Se+oWXM1wx0kvU2cmxyprRtg7rnXtW xuhXffUYvmFh4yHsUszVbI1eK06y5efckbcFLBWJt71M2XVip4pWiq5RVug5A2Mx8LGY qevKkZWuju0HqnnelcDzGtMiqjBng6xW9epwDgowV2iBcZhg+G2YTazR5QIN362FrYMv sRRQSFUUTO2j0l6I3FATmhPW3RBwK31cSvrJsrmtPo2zH3cywfr6gXqbksZyge7QQw87 kiyv9FPgK+ZPqzPzg0kBQ1JTPJm5i8pT0rvahoNpayfbhgAl3MsIjR1pugPjVgUjqNAg fBTg== 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=Ne6uHATwrkcNpaS5exAEpY8xakblN4HmwF0JiS47zBQ=; b=cyRQK14Ye8ThyD1cFb8e2UvuOWYRa6VoUuDUyOCtGtTsOSfa1apgL4sLz74QV/RHeq KWh1qb7mO/BNOVOV8gWoZzjJmJ+paXRndA+90MALNAHXAMaw9HgLTBwyRFvSRhFmBmRl DWdra3oU+pVkGKiwMtkE8aXBEmi7g9IyqS2lmR/dd07eZjaizPuInQ9P/v1Mq4aOallL r77ujaz2KndAp1atxalA6YSODcwCaCWVlkUL3lRcvE4fb7okpSMvhUiP0YBfaBOXjfFr JbrvD8/v8efRjf5jA3nzFEYH7OFdVfi72umAXctg7b676lz8DmjpfLeAui5LXnXNTCK5 0aVA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of quirin.gylstorff@siemens.com designates 194.138.37.40 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 gecko.sbs.de (gecko.sbs.de. [194.138.37.40]) by gmr-mx.google.com with ESMTPS id g8si614007wrh.0.2021.09.24.04.40.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Sep 2021 04:40:59 -0700 (PDT) Received-SPF: pass (google.com: domain of quirin.gylstorff@siemens.com designates 194.138.37.40 as permitted sender) client-ip=194.138.37.40; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of quirin.gylstorff@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=Quirin.Gylstorff@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by gecko.sbs.de (8.15.2/8.15.2) with ESMTPS id 18OBexvf002878 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 24 Sep 2021 13:40:59 +0200 Received: from md2dvrtc.fritz.box ([139.22.34.89]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 18OBewfr002463; Fri, 24 Sep 2021 13:40:58 +0200 From: "Q. Gylstorff" To: isar-users@googlegroups.com Cc: Quirin Gylstorff Subject: [PATCH v3] wic/rootfs-u-boot: Allow to set root with source_params Date: Fri, 24 Sep 2021 13:40:58 +0200 Message-Id: <20210924114058.1056129-1-Quirin.Gylstorff@siemens.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUID: ZX90+nR671tc 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 Changes V3: - add example usage to bananapi.wks meta-isar/scripts/lib/wic/canned-wks/bananapi.wks | 2 +- meta/scripts/lib/wic/plugins/source/rootfs-u-boot.py | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/meta-isar/scripts/lib/wic/canned-wks/bananapi.wks b/meta-isar/scripts/lib/wic/canned-wks/bananapi.wks index 1ba71b9..e0badcd 100644 --- a/meta-isar/scripts/lib/wic/canned-wks/bananapi.wks +++ b/meta-isar/scripts/lib/wic/canned-wks/bananapi.wks @@ -1,5 +1,5 @@ part u-boot --source rawcopy --sourceparams "file=/usr/lib/u-boot/Bananapi/u-boot-sunxi-with-spl.bin" --no-table --align 8 -part / --source rootfs-u-boot --ondisk mmcblk0 --fstype ext4 --mkfs-extraopts "-T default" --label platform --align 1024 +part --source rootfs-u-boot --ondisk mmcblk0 --sourceparams="root=/dev/mmcblk0p1" --fstype ext4 --mkfs-extraopts "-T default" --label platform --align 1024 bootloader --append "rootwait" 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.30.2