From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6948728032777469952 X-Received: by 2002:ac2:4541:: with SMTP id j1mr1335574lfm.89.1617879551355; Thu, 08 Apr 2021 03:59:11 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a19:e86:: with SMTP id 128ls4583125lfo.0.gmail; Thu, 08 Apr 2021 03:59:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxB3VAL5wSOiIe6GBh30LH6lSaHuP0FldIZzh5qvh/k5pfum9GQxpeZYZwg5EPV/KKYnCtb X-Received: by 2002:ac2:5687:: with SMTP id 7mr6068389lfr.407.1617879550329; Thu, 08 Apr 2021 03:59:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617879550; cv=none; d=google.com; s=arc-20160816; b=0N3D/EBWxgTQNxDgQSdxqfLEkPDqKDna2g5fVv3HgujVVJmIWerL6kr+4ZKthlh+5v 7Z+3BajJqab7Vxto54PRx34E4OsE98Dz+mJ6cOEUIyvGwyqgNqRjAs3qgjQh1NSl6uL5 rBaPn45s61yptV83h650QY8f6k74/ZGxwCH/hUIWUE4gOZ/uaf3IrRBbz4jBD+gW/0Ci E7Nb616Z2DZVJpCtMEr4lzdQCeJwx3shvSjNIxVuVDAqa1GmYfO3zqoaxZAHkeLo1H8f HMNnfQiYfaNyutte277QOqPY9EEP/AORFZRpESHpY9KfLjWRYudLNRebjTl8zYNiA7ao 243w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date; bh=Q9D0yZvURwYH31fvsfRRs0pADC+O4ojCjHXwlA6y2K0=; b=uJQnIbKkqxwMV8H20VcRjlGQPEXsdSzhVEaTSssXLc3id5oqTHBWGNacspo3WRzSB7 a4hAKDxK+QXJ4YPiPiWg7LPVBJSBVyV7Gis0dUagltpKe7YrZ3ICK4Vff7Ds3FOinHGh x+QCOuYIARdQalxYGADnsdHu1YJSO08TAqdBvLbcdUl3EL2RljSblZEPqRT0JRcy2oGJ xA45TNbjddWhPJ1hHad3SLuK2yR24r1FV9Eo/NvkwYOSk3RGoiV7V44FECxcEPIHLxqB PcXZMRETdm/SO/QtRdmb83MLfMnW9ooVeKUQLHUmqaF4JYeM7qFaR04FiQHuE6SNKgN5 10Fg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=henning.schild@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 63si1927311lfd.1.2021.04.08.03.59.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Apr 2021 03:59:10 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@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 henning.schild@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=henning.schild@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 138Ax9Fp001593 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 8 Apr 2021 12:59:09 +0200 Received: from md1za8fc.ad001.siemens.net ([167.87.8.3]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 138Apr2m028820; Thu, 8 Apr 2021 12:51:54 +0200 Date: Thu, 8 Apr 2021 12:51:53 +0200 From: Henning Schild To: "[ext] Q. Gylstorff" Cc: isar-users@googlegroups.com Subject: Re: [PATCH] wic/rootfs-u-boot: Allow to set root with source_params Message-ID: <20210408125153.44370c55@md1za8fc.ad001.siemens.net> In-Reply-To: <20210408100241.18186-1-Quirin.Gylstorff@siemens.com> References: <20210408100241.18186-1-Quirin.Gylstorff@siemens.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: XJf4WkbZmeR1 This needs to be done in OE and will eventually arrive here. We can shorten the time with a cherry pick, but this really needs to go into OE first. Alternative would be a new forked plugin, but also not nice. Henning Am Thu, 8 Apr 2021 12:02:41 +0200 schrieb "[ext] Q. Gylstorff" : > 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 ''