From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6948728032777469952 X-Received: by 2002:a05:6000:1acb:: with SMTP id i11mr10456608wry.68.1617879233863; Thu, 08 Apr 2021 03:53:53 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:adf:d1c8:: with SMTP id b8ls2924450wrd.3.gmail; Thu, 08 Apr 2021 03:53:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7eiYk2niJ9ATDR2jsqPLtfYrw8Wmoadz9c9pdKB1och7Z1cRNIrqEks0np8IvykXQ5T8w X-Received: by 2002:adf:e7d2:: with SMTP id e18mr10700165wrn.396.1617879233031; Thu, 08 Apr 2021 03:53:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617879233; cv=none; d=google.com; s=arc-20160816; b=utmfV5OYbVoXdPYCoowV1DgCgXBgQmn/3MKGhP1RZ35DqOYZMjuLnHzt0m67BZm0+J bnGu5y6LJ7f0bQynbxZx/cgsspjTjyT7V2syeZ7AGQBKmIl6QqFoQMLbpTdENEI2POcR t4KZYh3U92dDzfffULMXN6/XoWdQpIDWF1rFnUD6BTp64psNDRf6Vx4L6Dzx3+tLbTEP TiEX7ywUAv3e9XXzUiDm5izRNmF7lnL/qAUI0iuHpHef1/qn3FZTB14SeRXhXjg0wbGa i5+M+VxuXVk8Od7iuv/TBROnJdNrhJg2nDWyzv8t1aIlZ6WzENwhUHkTN7IlgosPNWq0 MYlw== 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=7dqThAa9Vg5TNmHCaOXsIZQkub/nPFIK50jqcrSbKP4=; b=KXEE+m7FW8vkmxXwPl4wCsowDT4xcdY3imMROnacXCpm8wTWyYFkqAnSAEHyUYWTHH 0hxLI/SR5FyFspxz0ouHTl3Mx9KNTBgBjCociSyyzuOePSAuPVL5TAYLpdiKdaJY74fa viOrUhKjwKQaeVrepLgy5NcPXAqzEK47i+8qh7VF40pf4J2jSNIv9JoCILrts1slYd/g q6DDOuO3ihmDsZcJxGSWLHZqF6hUov4G3Kv1q6Zh1fY19m+wzblOjrDeviH0ZARvx+7l 3b2Gwmq6fix+5nA3IM0N5rHHlj3bSSzViyp1Dc0r/VfYonP9E5hhpcuscoGp0/LFF9f9 tneA== 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 l8si2125160wrz.4.2021.04.08.03.53.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Apr 2021 03:53:53 -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 mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by gecko.sbs.de (8.15.2/8.15.2) with ESMTPS id 138Arqur027616 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 8 Apr 2021 12:53:52 +0200 Received: from md1za8fc.ad001.siemens.net ([167.87.8.3]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id 138Arqr9017571; Thu, 8 Apr 2021 12:53:52 +0200 Date: Thu, 8 Apr 2021 12:53:51 +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: <20210408125351.7e9813a2@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: 7ogQDQ2mfXP+ Sorry, that is already a plugin of our own. Forget that other mail. 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 ''