kernel-config: Sync fixes from BLFS

This commit is contained in:
Xi Ruoyao 2023-12-06 01:32:48 +08:00
parent 981b9fa6a1
commit 31a9142d10
No known key found for this signature in database
GPG Key ID: ACAAD20E19E710E3
3 changed files with 10 additions and 3 deletions

View File

@ -19,5 +19,8 @@ s-kernel-version:
fi fi
touch s-kernel-version touch s-kernel-version
%.xml: %.toml kernel-config.py kernel_version.py kernel.version %.xml.tmp: %.toml kernel-config.py kernel_version.py kernel.version
./kernel-config.py $(KERNEL_TREE) $< > $@ ./kernel-config.py $(KERNEL_TREE) $< > $@
%.xml: %.xml.tmp
mv $< $@

View File

@ -5,4 +5,4 @@
DO NOT EDIT! --> DO NOT EDIT! -->
<screen role="nodump"><emphasis role='blue'>P</emphasis>rocessor type and features ---&gt; <screen role="nodump"><emphasis role='blue'>P</emphasis>rocessor type and features ---&gt;
H<emphasis role='blue'>i</emphasis>gh Memory Support ---&gt; H<emphasis role='blue'>i</emphasis>gh Memory Support ---&gt;
(X) <emphasis role='blue'>6</emphasis>4GB [HIGHMEM64G]</screen> (X) 64<emphasis role='blue'>G</emphasis>B [HIGHMEM64G]</screen>

View File

@ -185,6 +185,10 @@ def load_kconfig(file):
if_stack += [top] if_stack += [top]
elif line.startswith('endif'): elif line.startswith('endif'):
if_stack = if_stack[:-1] if_stack = if_stack[:-1]
if config_buf:
r += [parse_config(config_buf)]
return r return r
known_config = {} known_config = {}
@ -259,7 +263,7 @@ for i0, val, i1, title, arrow, key, menu, comment in r:
if len(title) > rem: if len(title) > rem:
title = title[:rem - 3] + '...' title = title[:rem - 3] + '...'
b = title.lstrip('YyMmNnHh') b = title.lstrip('YyMmNnHh.' + "".join(map(str, range(10))))
a = title[:len(title) - len(b)] a = title[:len(title) - len(b)]
b0 = "<emphasis role='blue'>" + escape(b[0]) + "</emphasis>" b0 = "<emphasis role='blue'>" + escape(b[0]) + "</emphasis>"
line += escape(a) + b0 + escape(b[1:]) + escape(arrow) line += escape(a) + b0 + escape(b[1:]) + escape(arrow)