Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4167389ybl; Mon, 26 Aug 2019 06:32:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqx9DEztiplA5U0Xdgywyk6WvKQji+2GitlyYcZz/yAANiaTL+csX8I/RghxMBPe32ji0ucZ X-Received: by 2002:aa7:9483:: with SMTP id z3mr20281245pfk.104.1566826356084; Mon, 26 Aug 2019 06:32:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566826356; cv=none; d=google.com; s=arc-20160816; b=msvjiwjErXDYTg6mDs0w6eQpLcUDgq3QohE5SgFnggvc+1YDJkRKGQND+7ytAaVZdX jGVgOhsGXvCTkMPC5rUnOjDJ2irvkl7GOED4l1TcrvG6M7QktsGXAhkSkG5CMnPlE4l4 1FV2+jhcazYmuXiG2xjDBev1QRuH/+s+CyBBQVOoyLbhRNuftaJREexzThDpnruhsSVb ymm7GYxJRIpnWYDE6WeSB0f/2IHVaxTrtFhXbS2hzL86ek3XqsSi9VRrr0IfH/qPT7Ri G3+tMZXCAf8v4fIGhx8uz+9dvJFRj9Wuk4sXRPniXXi/v1/+cCM480P77gkpJuLx4bZh U7yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=IS/qMGBFamNKdcLJvDx8CQST40wIN4oUS5DvobHPPLE=; b=DUjrj/ZVhty4GmvHB78hMmbi5E+M8U4M9odMH8dU8fYuLLjcVtvsiWrQRDO8MM8bLS 27SvUM3AAwJkNBDRAF2Z8BYEJyW7YytaRnw9DGyrggQl7b3AxMLZxQdjEVc2o38iu5Gl dtR0gu3w9AdS+Fn0dzXNegjHlP2b6fkPzPf0hdc5QupV0m5thTQdDocmfm2aoXW5/KgL ixWZSBBd1AIQ1O+8OmM+K1nDr9a9BquQlOSl60WWGPi2/IG11tecvP8cG1uPyjBCphs0 5iupb4KniS5lRjDHYIj04WK2FymGQH/fyxSWJD3GHtr5MPSKiypVpN4Lu+esQk0tnkTT LAFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eAitVO3Y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k8si10479809pfp.255.2019.08.26.06.32.20; Mon, 26 Aug 2019 06:32:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=eAitVO3Y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731138AbfHZN2C (ORCPT + 99 others); Mon, 26 Aug 2019 09:28:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:59592 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729937AbfHZN2C (ORCPT ); Mon, 26 Aug 2019 09:28:02 -0400 Received: from mail-qt1-f171.google.com (mail-qt1-f171.google.com [209.85.160.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F203121872; Mon, 26 Aug 2019 13:28:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566826081; bh=VjxUxDnVuRk1DSTLUCljhelqYMjetMiX0Jgtit+/pPg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=eAitVO3YoyuYVrg7Km4FZM80GaTZmMfF8XtM3rxdRoM6HhgSMSp2F9PG0ox13+4Cy 3fjRHYFpb+2S9sIgjempVLcUAjTm/MvWf1sYpH72WDCqbDiRgxekXMPhys7WQGW4Ln XZUZxUL3UphvQDnUcW5hAb9oFOzsOY2T2DRowQ2Q= Received: by mail-qt1-f171.google.com with SMTP id y26so17842245qto.4; Mon, 26 Aug 2019 06:28:00 -0700 (PDT) X-Gm-Message-State: APjAAAUrgrlGqxFau6Fykf+oqttbW9HsDb+GPMxsLjdi9MP4BrloV/Wg gi2+fB35edzSPmXhNP0pyLW23d+8QuGaLN1yUw== X-Received: by 2002:aed:24f4:: with SMTP id u49mr17690228qtc.110.1566826080079; Mon, 26 Aug 2019 06:28:00 -0700 (PDT) MIME-Version: 1.0 References: <156678933823.21459.4100380582025186209.stgit@devnote2> <156678934990.21459.10847677747264952252.stgit@devnote2> In-Reply-To: <156678934990.21459.10847677747264952252.stgit@devnote2> From: Rob Herring Date: Mon, 26 Aug 2019 08:27:48 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH v3 01/19] skc: Add supplemental kernel cmdline support To: Masami Hiramatsu Cc: Steven Rostedt , Frank Rowand , Ingo Molnar , Namhyung Kim , Tim Bird , Jiri Olsa , Arnaldo Carvalho de Melo , Tom Zanussi , Andrew Morton , Thomas Gleixner , Greg Kroah-Hartman , Alexey Dobriyan , Jonathan Corbet , Linus Torvalds , Linux Doc Mailing List , linux-fsdevel@vger.kernel.org, "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Aug 25, 2019 at 10:15 PM Masami Hiramatsu wrote: > > Supplemental kernel command line (SKC) allows admin to pass a > tree-structured supplemental kernel commandline file (SKC file) > when boot up kernel. This expands the kernel command line in > efficient way. > > SKC file will contain some key-value commands, e.g. > > key.word = value1; > another.key.word = value2; > > It can fold same keys with braces, also you can write array > data. For example, > > key { > word1 { > setting1 = data; > setting2; > } > word2.array = "val1", "val2"; > } Why invent a custom file format? You could use YAML (or JSON): key: word1: setting1: data setting2: true word2: - val1 - val2 That would allow you to define a schema for defined options and can easily be manipulated with python (or any language with dictionaries and lists). That does imply adding a YAML parser to the kernel which I'm not sure is a great idea. There is a C parser lib, but working with YAML in C is not that great compared to python. Another option would be using the DTS format, but as a separate file. That's not unprecedented as u-boot FIT image is a DTB. Then the kernel already has the parser. And you could still have schema now. A new interface will take a lot of bootloader work to make it easy to use given the user has to manually load some file in the bootloader and know a good address to load it to. Between that and rebuilding the kernel with the configuration, I'd pick rebuilding the kernel. Perhaps this version will highlight that the original proposal was not so bad. Another thought, maybe you could process the configuration file that's in a readable/editable format into a flat representation that could simply be added to the kernel command line: key.word1.setting1=data key.word1.setting2 key.word2=val1,val2 That would then use an existing interface and probably simplify the kernel parsing. Rob