From patchwork Thu Apr 8 02:02:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quirin Gylstorff X-Patchwork-Id: 407 Return-Path: Delivered-To: ilbers.mnt@gmail.com Received: by 2002:a4a:378f:0:0:0:0:0 with SMTP id r137csp418577oor; Thu, 8 Apr 2021 03:13:41 -0700 (PDT) X-Received: by 2002:ac2:5f42:: with SMTP id 2mr2270647lfz.259.1617876821068; Thu, 08 Apr 2021 03:13:41 -0700 (PDT) ARC-Seal: i=3; a=rsa-sha256; t=1617876821; cv=pass; d=google.com; s=arc-20160816; b=WLpm2u2oupkidOa705URji/OGYCgTM5bayaKzv0S0i9gp61ae98AKxpp09WDjUFo9Z hnl7DdCXMt2Fmtm/ap8gQ3VuS23yAkxzXIJW2N5XLLQqf+4D09J0HInGncqgsnRaYiaW yQUrVQ86AA0hVwqYhP5XqJn4RnkoLyjFdoScounRDeMEvlwoLXcFHR3/hRFn04hfIYnE rprCtrd1Tgr0ZKTRNxa3ap0THeIUcZnetTG/LC2l1LkD3+mheUwl9PLnSSqL3EcZBmpP 5NAXxjdWIGlrN0w8AK8O5zZa3Q03zjFgnT3FrOZ5G2oT0HcR6RYTIPCKmDrfW2tSTa3y ny9Q== ARC-Message-Signature: i=3; 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=+ivmvpZumKWNwsuXzI7l9fNwKyGWw0WQ/+RP5/xJpSo=; b=EKqzSfFAX6oCZ4pZNKwt3rqdCQtujOThYdWGpsC85Sa9rGcn1VejYoCWNGKysKTezH eTu6QWvHKO2KY2iT1Xg3gM3qym5jESHS7DCmiQ5h8CQZETY3rMlf+w9WavFu/lXoN1wJ WOMHVHuyDSI/Dl1pdys7zVbxGgJGPiKfUEx+uYF6fkJJOFCVGOa2XAd8LpecBQ0fMSq6 u5gvg/Od5/tQrsUwvI1NUiEGhNP68NwALTff+Iju5zro+8nzaO6fu7Kjbx2dfZNSqa7C ixXSu3HlnMEczAtzqyjErg3jF1MokHrel7SloAxbZ0zy9Nlca935p41hpeqZpPO3o7ad TT4A== ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@googlegroups.com header.s=20161025 header.b=jM8bJ76z; arc=pass (i=2 spf=pass spfdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of isar-users+bncbctzztvx2qcrbvfoxobqmgqegjd6rci@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCTZZTVX2QCRBVFOXOBQMGQEGJD6RCI@googlegroups.com; dmarc=fail (p=NONE sp=NONE dis=NONE arc=pass) header.from=siemens.com Received: from mail-sor-f55.google.com (mail-sor-f55.google.com. [209.85.220.55]) by mx.google.com with SMTPS id m8sor10358389lji.41.2021.04.08.03.13.40 (Google Transport Security); Thu, 08 Apr 2021 03:13:41 -0700 (PDT) Received-SPF: pass (google.com: domain of isar-users+bncbctzztvx2qcrbvfoxobqmgqegjd6rci@googlegroups.com designates 209.85.220.55 as permitted sender) client-ip=209.85.220.55; Authentication-Results: mx.google.com; dkim=pass header.i=@googlegroups.com header.s=20161025 header.b=jM8bJ76z; arc=pass (i=2 spf=pass spfdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of isar-users+bncbctzztvx2qcrbvfoxobqmgqegjd6rci@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCTZZTVX2QCRBVFOXOBQMGQEGJD6RCI@googlegroups.com; dmarc=fail (p=NONE sp=NONE dis=NONE arc=pass) header.from=siemens.com ARC-Seal: i=2; a=rsa-sha256; t=1617876820; cv=pass; d=google.com; s=arc-20160816; b=O20HhXw526qz/FY8PhRLlEREMGakRcM8HBWrqom9L5XN6KSy5RGCN8TSfYQ+IxKz1Z 27taCyCWZFn5CCrpFTj6NnpMN0iw3C9dRsPLOwzDFtH8EG6QyMBesZzin28vXyuKknnl lU6344p3GhERwbuaaqjJmsxZufSrRRhRlEWOmcsRgpDG1uqG5zCK7dMUAnAiUwyAuEdf TwEOC4AvHlAC7mZPZBUvhMVY/GrGDUsU0h1fUHxpUWovhb3xvazdEMJZEmza/2LnQvTO np3M5vbbYGy1se/HBeQgH7doL4FaptKTJzcXqBzagy2j4ORo6mpSPz1g0/+eMCv+5ur/ OCBQ== 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=+ivmvpZumKWNwsuXzI7l9fNwKyGWw0WQ/+RP5/xJpSo=; b=mJeKbDc24NZo+pApSXIjJhLoE3oVT0tpNDdYTF/6LsiemZb59KD/1+L7XKw4wYZeZu GGLhYAChJ/+nW9YSsbuGMMw0QKM8hcodSj23RQYV50IT0mZovP2VL7LiTkE51XJyiACi HLYVrfIcrv+Kh78qLqIjEVeyCi4TmJ9Rb6CRn0JdnYJOeVUqNR2cQgEU12DCq/IrzmzV ao/E3tlUX9j4b4nsH8ivqzyPcWDLKT/lkk/fWyWD5Dd3AmitkBAWXmmiUHfhiuYejvL8 DE7ojC8eAr04tRvKN9It77ndKGBJb61wERMOZQgfSesJbhDJm4uI46UA3Vb2Dl4aiquJ jT7w== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of quirin.gylstorff@siemens.com designates 194.138.37.39 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=20161025; 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=+ivmvpZumKWNwsuXzI7l9fNwKyGWw0WQ/+RP5/xJpSo=; b=jM8bJ76zwRIQaruLxdTO7tm7x487xYz/2QsYlklotvValyU5kpVlZOlgRT5f7KOYBY zdOZQQwE4yo7tFzCxFYuEAirdfTaaEHBTwPy4ezd0en2HaJu+cZCLfKrfr52zV1R1nK1 Tvv3DnZHAqx7tVcr4zA9Zqll9Gp0M9vlSrFan623z/WHLDLQIw7FrSK+UKE07DsKpgxe j7G1F+HwS4cIf6TzVGZhEsft/1tRtHbsIAWiMNkQSEHZTjmgeqda87EHCWoCrIS18eW/ stpZWP7+b8WVCNofd3tKnF/bVbmyEgJVB8dD+1SvPIlvYuHstJl4Mp9s/fodd8iq+lvZ ORJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; 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=+ivmvpZumKWNwsuXzI7l9fNwKyGWw0WQ/+RP5/xJpSo=; b=hotje94ZIFIM5hBaA4lIT+iLXYlB+zK3ZgnDlP935gOkN78zMOW5UZrqqYcfeUnFr1 BqVDy2C0MyQtWH3AP8U69BK30dozNM/wvCgBF6i08ui6V63FeKhYZptXSV1M0S/YGoMb FTT+U+zurk98neZX5jWBqXtq6+pXw862qfiFL+1MwVTQv2s4PGp7hHk7jnzUuXkZaBQH SheFoVCgEltqt8uWmlt8d72DqhUaoy9nHe3AZw4H5EWpHzX8Nrig17TupABktMWLxd37 oADkQd0vB23vPrSfIfwgYi340zbwqbrB4fzeppNrInm+DpDz+nCfYdXsbOVtH1h6gisS HMqw== Sender: isar-users@googlegroups.com X-Gm-Message-State: AOAM5337zTK7Hy/NvlhrUEbLxgiDr+7okaaKSdv8poXf/UxTQ7JGJtgh uNaLEjyyxNoSwY+sfi3214A= X-Google-Smtp-Source: ABdhPJyb5rUAOA9JHhhUtI44xKzD+3/V/hlr+3q+Joun3P9AWVHIoCJ8OiqCTXLJOrjdv/xp9cjh/A== X-Received: by 2002:a2e:8e28:: with SMTP id r8mr5277093ljk.156.1617876820508; Thu, 08 Apr 2021 03:13:40 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6512:3d16:: with SMTP id d22ls4459907lfv.1.gmail; Thu, 08 Apr 2021 03:13:39 -0700 (PDT) X-Received: by 2002:ac2:46d5:: with SMTP id p21mr6042274lfo.295.1617876819543; Thu, 08 Apr 2021 03:13:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617876819; cv=none; d=google.com; s=arc-20160816; b=lvuECuTgmScr+jJLhAnJmGdzHVgBgrHYMI5Oxyc8e9POfxGMrTz4A9Inf8Vt/Sw2d4 lFWCHAumKo0bf4ZXzjlmRCbSxqICEkhSVca5LpBz4wD3xlXtMY9FVKrjXU8PCq6DmevI /m11sOwOFEbq65lqAZ1uSzIrixDVjBbBvPpkZN9DxNVsM+vEn3KEXAwEsv61Jyi95hS6 lRMXBxYZWaUAfLv/+JR2EgJy1htTFsJnYV2CgZekWi0jGQpHO1ugfC0KDUIwYQNGbcFz 4TvQsDvV8ZrxVrGvf25PmTHsjwbELf2cAn1olIlAS1WFD/y6FkidKpXcYlYTATHZpHYj pGdg== 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=n/qvHJCa7Mwi2MhtXdK0cpX4zP//Eh6pnYSmtMef1QA=; b=GgeMlMYArwHuPT7g+V+BfC5+MFWrwdMspE98gQzpt/5fmqncvwzuukGoa+voQw+KoC nqSXD8EtfLr+7Cj8kcOO0TMfaueITySl3Q/QYfNe826q6Bl9rMleOVSIsswNJ4TCiQGm cRqgdwgsUk8YGomfWcJhIyqIzVwGA0mlmmh/UY4KDpYVH51TTtRoMq7guCykM/kVr5tc WKsf0acGWj1SeyHEAQvJIgw7VFFbhgZ/j7j/6s9HO94VJeCAAafTFC0jxyZVcwdV5EiC hvjtpfoKoMdVCtVRfGy/OfP5NprC6BrwJowKwvrFUJhTrpZvh/w2pHMGzYMXwrsYES+I 0b/Q== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of quirin.gylstorff@siemens.com designates 194.138.37.39 as permitted sender) smtp.mailfrom=Quirin.Gylstorff@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from lizzard.sbs.de (lizzard.sbs.de. [194.138.37.39]) by gmr-mx.google.com with ESMTPS id l11si1898630lfg.13.2021.04.08.03.13.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Apr 2021 03:13:39 -0700 (PDT) Received-SPF: pass (google.com: domain of quirin.gylstorff@siemens.com designates 194.138.37.39 as permitted sender) client-ip=194.138.37.39; Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by lizzard.sbs.de (8.15.2/8.15.2) with ESMTPS id 138ADc9n009478 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 8 Apr 2021 12:13:38 +0200 Received: from md2dvrtc.fritz.box ([139.22.117.121]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 138A2faG007277; Thu, 8 Apr 2021 12:02:42 +0200 From: "Q. Gylstorff" To: isar-users@googlegroups.com Cc: Quirin Gylstorff Subject: [PATCH] wic/rootfs-u-boot: Allow to set root with source_params Date: Thu, 8 Apr 2021 12:02:41 +0200 Message-Id: <20210408100241.18186-1-Quirin.Gylstorff@siemens.com> X-Mailer: git-send-email 2.20.1 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.39 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 X-GMAIL-THRID: =?utf-8?q?1696466805819106417?= X-GMAIL-MSGID: =?utf-8?q?1696466805819106417?= 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 --- .../lib/wic/plugins/source/rootfs-u-boot.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) 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 3ac0aa0..1e10648 100644 --- a/meta/scripts/lib/wic/plugins/source/rootfs-u-boot.py +++ b/meta/scripts/lib/wic/plugins/source/rootfs-u-boot.py @@ -37,7 +37,7 @@ class RootfsUBootPlugin(RootfsPlugin): # Prologue from RootfsPlugin.do_prepare_partition, retrieves the # rootfs directory if part.rootfs_dir is None: - if not 'ROOTFS_DIR' in krootfs_dir: + if 'ROOTFS_DIR' not in krootfs_dir: raise WicError("Couldn't find --rootfs-dir, exiting") rootfs_dir = krootfs_dir['ROOTFS_DIR'] @@ -48,7 +48,8 @@ class RootfsUBootPlugin(RootfsPlugin): rootfs_dir = part.rootfs_dir else: raise WicError("Couldn't find --rootfs-dir=%s connection or " - "it is not a valid path, exiting" % part.rootfs_dir) + "it is not a valid path, exiting" % + part.rootfs_dir) if os.path.isdir(rootfs_dir): real_rootfs_dir = rootfs_dir else: @@ -59,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): @@ -68,8 +76,8 @@ class RootfsUBootPlugin(RootfsPlugin): with open(u_boot_script, 'w') as cfg: 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 "")) + cfg.write('KERNEL_ARGS="root=%s %s"\n' % + (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 ''