Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B354C07E95 for ; Sat, 10 Jul 2021 14:39:38 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3D7D761260 for ; Sat, 10 Jul 2021 14:39:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3D7D761260 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=dalco.ch Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C6EE9832A1; Sat, 10 Jul 2021 16:39:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=dalco.ch Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id CB71E83288; Sat, 10 Jul 2021 11:48:59 +0200 (CEST) Received: from mail.dalco.ch (mail.dalco.ch [195.242.140.30]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4D30382C44 for ; Sat, 10 Jul 2021 11:48:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=dalco.ch Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=Matteo.Guglielmi@dalco.ch From: Matteo Guglielmi To: "u-boot@lists.denx.de" Subject: Read Kernel Command Line Options From a Text File Thread-Topic: Read Kernel Command Line Options From a Text File Thread-Index: AQHXdW6uzGkXRZ8uoUikBStJX4sEhg== Date: Sat, 10 Jul 2021 09:48:56 +0000 Message-ID: <857c3af24b2744919684cbd72992044d@dalco.ch> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.16.16.200] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailman-Approved-At: Sat, 10 Jul 2021 16:39:33 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Dear All, I would need to read additional kernel options from a text file. So far I've managed to read a text file from a tftp server into memory as follow: # define and reads text file into memory (file name is based on # the onboard nic's mac address e.g.: 01-e4-5f-01-0f-0a-d8) setexpr params_filename gsub '\\(..\\):' '\\\\1-' 01-$ethaddr setenv tftp_prefix nodes/ echo "Downloading options..." tftpboot ${ramdisk_addr_r} ${tftp_prefix}${params_filename} Now, how do I get the whole memory content into a u-boot variable? I've tried this command but it picks up only name=3Dvalue pairs: env import -t -r ${ramdisk_addr_r} ${filesize} but I need the whole thing inside a single u-boot variable since it may look like something this: opt1 opt2 opt3_with_options=3Dpar1,par2 opt4 In other words, what I'd need is something like this: setenv more_options opt1 opt2 opt3_with_options=3Dpar1,par2 opt4 by pulling out the data from ${ramdisk_addr_r} ${filesize}. Any help is really appreciated.