From nobody Tue Apr 7 08:06:26 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7462A17B43F; Sat, 14 Mar 2026 10:10:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773483053; cv=none; b=HhwkSWrGmI9ULX2XylcFEKFExYJXY+4xAAkGUcws1z8L/LZXrXfKE8HMVRGN4Y6+9z9zbj48MsXTpLsvGZ1jb/H1bvN1hz9ZBvmvdp/Sl7Z1dM/tXhIQoMuNLV7Dj8gcQN3/2YkjhT2EBoIjUE2APH6heVDgwogJZIDVIgW7P70= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773483053; c=relaxed/simple; bh=XlS8bB5aiFrJgpMoA+5FmJrVMPtY9Id3Xq/yMyZD2zQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=EYCNcpJcOydsUHG5v9nVee2nCHL1SuNTEJwvgOThJ+23F0cDb/Y1QCqAf1rMi/2qSwSN+jCcFNcL/0UEzgOTHd9kTMiXKNbC2d95YQUS415EXf8VTDVF+YXHmbcbxklhHRR5pymXSQKuf2TMjnADQnTW9gRgAL7v/cV38JoaKFw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=V4sG7zQM; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="V4sG7zQM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EBE17C116C6; Sat, 14 Mar 2026 10:10:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773483053; bh=XlS8bB5aiFrJgpMoA+5FmJrVMPtY9Id3Xq/yMyZD2zQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V4sG7zQM4jtLKRV8b/7RGirFUqfhCVcoPU7qG4jc80IzpHXUtUrku7XewYICxU7wQ J0UcaRxKv147vhEu/RkC36QsjcadC3nW9YyEfMrp2/ugBz3pV91gqAIYDCdKR3pwGN BlhXtCAvkR4IIB2RRaLqOIWwo6AjR6MM9c+zjH0oPTYdPNeQeYLj+Y0v3NyWO8w8Qj im6BfMnJsLRIBgqJRpDAZJ63IuaabAygCS9F8+PkqOorV7t/u8t0OsKdEa5HY2sXTM c0H/CJ68gIehuTfxDoAwF86UG9MotO3Ko+wu6mFiUoV7MkMI05erqH1i6GP4C+dn3j B9zzJMgNBntMA== From: "Masami Hiramatsu (Google)" To: Masami Hiramatsu , Steven Rostedt Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: [PATCH v2 1/2] Documentation: bootconfig: Add EBNF definiton of bootconfig Date: Sat, 14 Mar 2026 19:10:49 +0900 Message-ID: <177348304960.463670.10025294494717117792.stgit@devnote2> X-Mailer: git-send-email 2.43.0 In-Reply-To: <177348304012.463670.8543295382997674229.stgit@devnote2> References: <177348304012.463670.8543295382997674229.stgit@devnote2> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Masami Hiramatsu (Google) Add the EBNF definition to Documentation/admin-guide/bootconfig.rst as an additional section to formally define the bootconfig syntax. Signed-off-by: Masami Hiramatsu (Google) --- Changes in v2: - Move EBNF as a separated section. --- Documentation/admin-guide/bootconfig.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Documentation/admin-guide/bootconfig.rst b/Documentation/admin= -guide/bootconfig.rst index f712758472d5..41bd1ee92395 100644 --- a/Documentation/admin-guide/bootconfig.rst +++ b/Documentation/admin-guide/bootconfig.rst @@ -152,6 +152,23 @@ Note that you can NOT put a comment or a newline betwe= en value and delimiter key =3D 1 # comment ,2 =20 +EBNF definition +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +The syntax is defined in EBNF as follows:: + + Config =3D { Statement } + Statement =3D [ Key [ Assignment | Block ] | Comment ] ( "\n" | ";" ) + Assignment =3D ( "=3D" | "+=3D" | ":=3D" ) ValueList + ValueList =3D [ Value { "," [ { ( Comment | "\n" ) } ] Value } ] + Block =3D "{" { Statement } "}" + Key =3D Word { "." Word } + Word =3D [a-zA-Z0-9_-]+ + Value =3D QuotedValue | UnquotedValue + QuotedValue =3D "\"" { any_character_except_double_quote } "\"" + | "'" { any_character_except_single_quote } "'" + UnquotedValue =3D { any_printable_character_except_delimiters } + Comment =3D "#" { any_character_except_newline } =20 /proc/bootconfig =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D From nobody Tue Apr 7 08:06:26 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5BF1017B43F; Sat, 14 Mar 2026 10:11:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773483062; cv=none; b=gIxgnQzqsCblQW8ohzKRcPe677XMKQINnTSq6Ava5J5/udKbLpfbOALKXE7EoFXGXXJzaf7D+xYzLjiMWkQXaQX7bb1Dv5z653uvtGwa85uNm+E1p5/A7EzhgarTDZ4zS40EujDFvbdwFkoBdTrh+3o+s6Py/Qr0q1NrCpX2KwM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773483062; c=relaxed/simple; bh=7VkJjXzeXYwJ7pfvTiOGUj5L+IBz/aF0RFlZKjCffZQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=VMMYarbhkb/t2F9GyI67z2Akn7VsSUS0hhLzJIAvMQ80NbEz9VvoDfmT2hxn7gGI+TvrCl/WdobruUM1TW9u3cWPcwJidgnW6HfXSjdzi9YcE7tiJMyWVLJLw4TJme89AwEJHs0/Uuc6pCjqmDNzeWA6H2CWAf73bNRU3JgpbwA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=keip+0P8; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="keip+0P8" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D80A0C116C6; Sat, 14 Mar 2026 10:11:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773483062; bh=7VkJjXzeXYwJ7pfvTiOGUj5L+IBz/aF0RFlZKjCffZQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=keip+0P8oM3D2KkOE3HVi84p084uf8xOHXwKzfP68AwGq6VPacZRcXHx9DBtGQOOe tJXT4yDv4iuR1JfbyB3Mhzs7QBmEnZX3dv6nyJJcPlnRfva66YQ75wU9ftJxMGN/Dr 61Rl56Hb4KZ9TyHoSweszEu2qlr54XwH2OWaSb7t8sWjf+drdJX3yBQ1BLYO0hEzsR usI6fX8xbnAbbxNaCxJjkkzDQH2oHqsFTogXCI2mgftKI0YWrWhr61Zih5UHcjhemb EYEQOujv8RucaPLa3Q1M7gC5ixSSYHmIvzNykrSTrnsGms8z/OwRooNd5Bp34bPqi/ ULsDSWzBaTp3A== From: "Masami Hiramatsu (Google)" To: Masami Hiramatsu , Steven Rostedt Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: [PATCH v2 2/2] bootconfig: Add more test samples Date: Sat, 14 Mar 2026 19:10:58 +0900 Message-ID: <177348305841.463670.259256758582249863.stgit@devnote2> X-Mailer: git-send-email 2.43.0 In-Reply-To: <177348304012.463670.8543295382997674229.stgit@devnote2> References: <177348304012.463670.8543295382997674229.stgit@devnote2> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Masami Hiramatsu (Google) Add more test samples for edge cases (empty block, quoted newline, various error cases) to tools/bootconfig/samples/. Signed-off-by: Masami Hiramatsu (Google) --- Changes in v2: - Make EBNF as a separated section. --- .../samples/bad-array-comment-delimiter.bconf | 2 ++ tools/bootconfig/samples/bad-dot-middle.bconf | 1 + .../bootconfig/samples/bad-invalid-operator.bconf | 1 + tools/bootconfig/samples/bad-key-dot-end.bconf | 1 + tools/bootconfig/samples/bad-unclosed-quote.bconf | 1 + .../samples/bad-unexpected-close-brace.bconf | 4 ++++ .../samples/exp-good-dot-with-block.bconf | 1 + .../bootconfig/samples/exp-good-empty-block.bconf | 1 + .../samples/exp-good-empty-value-sep.bconf | 3 +++ .../samples/exp-good-quoted-newline.bconf | 2 ++ tools/bootconfig/samples/good-dot-with-block.bconf | 3 +++ tools/bootconfig/samples/good-empty-block.bconf | 1 + .../bootconfig/samples/good-empty-value-sep.bconf | 3 +++ tools/bootconfig/samples/good-quoted-newline.bconf | 2 ++ 14 files changed, 26 insertions(+) create mode 100644 tools/bootconfig/samples/bad-array-comment-delimiter.bc= onf create mode 100644 tools/bootconfig/samples/bad-dot-middle.bconf create mode 100644 tools/bootconfig/samples/bad-invalid-operator.bconf create mode 100644 tools/bootconfig/samples/bad-key-dot-end.bconf create mode 100644 tools/bootconfig/samples/bad-unclosed-quote.bconf create mode 100644 tools/bootconfig/samples/bad-unexpected-close-brace.bco= nf create mode 100644 tools/bootconfig/samples/exp-good-dot-with-block.bconf create mode 100644 tools/bootconfig/samples/exp-good-empty-block.bconf create mode 100644 tools/bootconfig/samples/exp-good-empty-value-sep.bconf create mode 100644 tools/bootconfig/samples/exp-good-quoted-newline.bconf create mode 100644 tools/bootconfig/samples/good-dot-with-block.bconf create mode 100644 tools/bootconfig/samples/good-empty-block.bconf create mode 100644 tools/bootconfig/samples/good-empty-value-sep.bconf create mode 100644 tools/bootconfig/samples/good-quoted-newline.bconf diff --git a/tools/bootconfig/samples/bad-array-comment-delimiter.bconf b/t= ools/bootconfig/samples/bad-array-comment-delimiter.bconf new file mode 100644 index 000000000000..5300cef82aa3 --- /dev/null +++ b/tools/bootconfig/samples/bad-array-comment-delimiter.bconf @@ -0,0 +1,2 @@ +key =3D 1 # comment + , 2 # Error: comment between value and its comma delimiter diff --git a/tools/bootconfig/samples/bad-dot-middle.bconf b/tools/bootconf= ig/samples/bad-dot-middle.bconf new file mode 100644 index 000000000000..b3bd19e3c991 --- /dev/null +++ b/tools/bootconfig/samples/bad-dot-middle.bconf @@ -0,0 +1 @@ +key..word =3D value # Double dots are not allowed diff --git a/tools/bootconfig/samples/bad-invalid-operator.bconf b/tools/bo= otconfig/samples/bad-invalid-operator.bconf new file mode 100644 index 000000000000..ca19895bee8a --- /dev/null +++ b/tools/bootconfig/samples/bad-invalid-operator.bconf @@ -0,0 +1 @@ +key ?=3D value # Unsupported operator diff --git a/tools/bootconfig/samples/bad-key-dot-end.bconf b/tools/bootcon= fig/samples/bad-key-dot-end.bconf new file mode 100644 index 000000000000..57ae39d36e95 --- /dev/null +++ b/tools/bootconfig/samples/bad-key-dot-end.bconf @@ -0,0 +1 @@ +key. =3D value # Key cannot end with a dot diff --git a/tools/bootconfig/samples/bad-unclosed-quote.bconf b/tools/boot= config/samples/bad-unclosed-quote.bconf new file mode 100644 index 000000000000..9384e68d17f6 --- /dev/null +++ b/tools/bootconfig/samples/bad-unclosed-quote.bconf @@ -0,0 +1 @@ +key =3D "unclosed quote diff --git a/tools/bootconfig/samples/bad-unexpected-close-brace.bconf b/to= ols/bootconfig/samples/bad-unexpected-close-brace.bconf new file mode 100644 index 000000000000..a372be395200 --- /dev/null +++ b/tools/bootconfig/samples/bad-unexpected-close-brace.bconf @@ -0,0 +1,4 @@ +key { + subkey =3D value +} +} # Extra closing brace diff --git a/tools/bootconfig/samples/exp-good-dot-with-block.bconf b/tools= /bootconfig/samples/exp-good-dot-with-block.bconf new file mode 100644 index 000000000000..ff563ceec024 --- /dev/null +++ b/tools/bootconfig/samples/exp-good-dot-with-block.bconf @@ -0,0 +1 @@ +key.subkey.subsubkey =3D "value"; diff --git a/tools/bootconfig/samples/exp-good-empty-block.bconf b/tools/bo= otconfig/samples/exp-good-empty-block.bconf new file mode 100644 index 000000000000..fe460e8e675c --- /dev/null +++ b/tools/bootconfig/samples/exp-good-empty-block.bconf @@ -0,0 +1 @@ +key; diff --git a/tools/bootconfig/samples/exp-good-empty-value-sep.bconf b/tool= s/bootconfig/samples/exp-good-empty-value-sep.bconf new file mode 100644 index 000000000000..266851aae8f2 --- /dev/null +++ b/tools/bootconfig/samples/exp-good-empty-value-sep.bconf @@ -0,0 +1,3 @@ +key1 =3D ""; +key2 =3D ""; +key3 =3D ""; diff --git a/tools/bootconfig/samples/exp-good-quoted-newline.bconf b/tools= /bootconfig/samples/exp-good-quoted-newline.bconf new file mode 100644 index 000000000000..2b5166541df6 --- /dev/null +++ b/tools/bootconfig/samples/exp-good-quoted-newline.bconf @@ -0,0 +1,2 @@ +key =3D "value +that spans multiple lines"; diff --git a/tools/bootconfig/samples/good-dot-with-block.bconf b/tools/boo= tconfig/samples/good-dot-with-block.bconf new file mode 100644 index 000000000000..3d9bef7daa2f --- /dev/null +++ b/tools/bootconfig/samples/good-dot-with-block.bconf @@ -0,0 +1,3 @@ +key.subkey { + subsubkey =3D value +} # Combination of dot-notation and block syntax diff --git a/tools/bootconfig/samples/good-empty-block.bconf b/tools/bootco= nfig/samples/good-empty-block.bconf new file mode 100644 index 000000000000..8c390f37b177 --- /dev/null +++ b/tools/bootconfig/samples/good-empty-block.bconf @@ -0,0 +1 @@ +key { } # Empty block should be allowed and ignored diff --git a/tools/bootconfig/samples/good-empty-value-sep.bconf b/tools/bo= otconfig/samples/good-empty-value-sep.bconf new file mode 100644 index 000000000000..fbfb9a17ff99 --- /dev/null +++ b/tools/bootconfig/samples/good-empty-value-sep.bconf @@ -0,0 +1,3 @@ +key1 =3D ; +key2 =3D=20 +key3 =3D # comment diff --git a/tools/bootconfig/samples/good-quoted-newline.bconf b/tools/boo= tconfig/samples/good-quoted-newline.bconf new file mode 100644 index 000000000000..8c9cd088579a --- /dev/null +++ b/tools/bootconfig/samples/good-quoted-newline.bconf @@ -0,0 +1,2 @@ +key =3D "value +that spans multiple lines" # Quoted values can contain newlines