From patchwork Fri Sep 24 03:40:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quirin Gylstorff X-Patchwork-Id: 838 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3) with LMTPA; Fri, 24 Sep 2021 13:41:08 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-wr1-f57.google.com (mail-wr1-f57.google.com [209.85.221.57]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8) with ESMTPS id 18OBf5Jl023479 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 24 Sep 2021 13:41:05 +0200 Received: by mail-wr1-f57.google.com with SMTP id s13-20020a5d69cd000000b00159d49442cbsf7805955wrw.13 for ; Fri, 24 Sep 2021 04:41:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1632483660; cv=pass; d=google.com; s=arc-20160816; b=QgZYL9e1ODIDsfZutp9A6R7yv7aNtKhniOZ2RMbl/GRhiRIkbHUu8Bu3uljDLaGuWH t3eSZePSlQlOXdscjqF1v04P1d9h1Q8JZzJTbYq47pne8AApwdhhVYyEYCqSjKzLd5ko mpTNx45q6XV8W9v+ERSvuB5a9uuWNUhtet/PwGtIGIn8oJUCm7nwtkvAZW37HcQdlG5P 1r2UGOKEqvVFRsjDWqgKaY5jNpsPyK2p/TrWAE4uqPwiDjz2M2aE2MBugaoH+SRASk4I yHJ7ZU9Tew08zdxfrrytUK7Hh1qdlU0JjAdzuUeNLYrfZubtX6XBvOUI8dZ0X2oCEkeT qKFw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:message-id:date :subject:cc:to:from:sender:dkim-signature; bh=XgQvk5dxAWdUzSZHfhiKZXAnQ2Yu4GsR5QkRMpLxglQ=; b=U7u4LJ+O7JvFRaPvb+qW14MQIT8B7qcDLfe/Nfj8pxD4TQtKJ8JqUje5B1OwPj17OL B21Q/Z7i1mb8nHbOOk2/YcswlstEMH00bM5REWLipk98L7ixT4mqnZ69RYvGIvRHS2eu 8ZgPhtw+pRCjSu58gDhtwpaJplC4YFNhX2icjR9t1YKnuVy1nAIEFm1djAFbRLWZhDtg ydLBfjP1tbDYyl4nAAUP0+mZt6Yslo+c7ADaCyLggqaHZIj8jqBBIlrA11EZT0b0AoTa xvh73tb/vssiAjgplZYNx8mQdpWn8jLVZVrCVnPhf36HU+EnwyCRDlkLPjsONMDExqOX kF1Q== ARC-Authentication-Results: i=2; 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:mime-version :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=XgQvk5dxAWdUzSZHfhiKZXAnQ2Yu4GsR5QkRMpLxglQ=; b=XA07CYvmR1U3TiHqlqPCZP/DZ7MQWJmJfeBTV+tFGexR2LKzw1XrNHiv/hmon4tW8L gUS6D3joO8L536G0JwBrOvMV7GiTgQ8mGZRXAeP50WdDBj4fiSHYTyXUUC9/Qps77AvW /U/9agllDzJqvB/iuaMTA/gM3fymwdau7TZO/ktsXyZcsBGx7yEK7eT6SXqJ+tK+pFUV k9Z+ol3Ftf3oMjCVO/YKbdloyGhVvmrMioaWwOAmbSTn3Eup61egygYaoMqrN9RzjWqy hpGYNwEoGDqyjPnsod9eyrf4Pc9PHZcg8wZHrspAfVemMGrcO05kJR4bcslvRlJV+Vkr lacQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=XgQvk5dxAWdUzSZHfhiKZXAnQ2Yu4GsR5QkRMpLxglQ=; b=UyFNpDRj75tpgUO+VxxfQbXWmbyUJNxM0FdY10ngMkr3jJ5HPFTQf5dq0RmA0sJOjz Q/pUTrRtuUg36lcuXPDtwVAWQPCzd+7JsvQuumKQ1IeW2oj4qsaT0883vrrIdc0bfwTF VJXPTDSOH079FnHqmLJEX9CSq4Axoi/7GmW3AYqQ/WZyG4wLO9PCmvNDHJ9VkV1lnNMK gmxaxLsHR+ztlQ7LkhKFJsQPP9UHj/jXzFuTvUFQFem2qNdgLb91njrG3ta/VRa8W8u9 RXCJYNy040DAGcX60VtQG44elPvUzEuBw3Vq4k0lB3skG4Kbrr449neaX7s2M2jv3h8/ VmIg== Sender: isar-users@googlegroups.com X-Gm-Message-State: AOAM533DgVp9wd09iyVxQMATrdc2BhWdgLIrkTKRQ1uSIe3n+xqa26xS DfVq1Y4TeXbJVumU8buy0RQ= X-Google-Smtp-Source: ABdhPJwijCPBDNoCjL/xYhKXD9M2w0Og8KdIYl3sMRsh8Qfuaa7Dds29knpecNnoaIfXEzNW/NRCuw== X-Received: by 2002:a1c:234a:: with SMTP id j71mr1607814wmj.11.1632483660511; 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-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 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; 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 X-Original-Sender: quirin.gylstorff@siemens.com X-Original-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 Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-getmail-retrieved-from-mailbox: INBOX 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 ''