From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6948728032777469952 X-Received: by 2002:a2e:140b:: with SMTP id u11mr5134170ljd.125.1617876820568; 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-Google-Smtp-Source: ABdhPJzPvVtuowLqqapAPVvPtrgXM5IoSUJgnehusSU0odcZC+dX3S5LQ/yV+sdoFkiH+fHWAXWl 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 Return-Path: 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; 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 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 Content-Transfer-Encoding: 8bit X-TUID: 2S4wU66TUETb 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 '' -- 2.20.1