From 57499d5909d515e8e4d9bfab91c90350816e148c Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Tue, 1 Aug 2023 09:17:05 +0800 Subject: [PATCH] kernel: Separate toplevel menus in rendering --- chapter10/kernel/kernel-config.py | 7 ++++++- chapter10/kernel/systemd.xml | 5 +++++ chapter10/kernel/sysv.xml | 3 +++ chapter10/kernel/x2apic.xml | 1 + 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/chapter10/kernel/kernel-config.py b/chapter10/kernel/kernel-config.py index 93b203a46..fc9bcc0d2 100755 --- a/chapter10/kernel/kernel-config.py +++ b/chapter10/kernel/kernel-config.py @@ -243,6 +243,8 @@ for i in known_config: if i not in done: raise Exception("%s seems not exist" % i) +sep = known_config.get('separate_toplevel_menu') + for i0, val, i1, title, arrow, key, menu, comment in r: rem = max_line @@ -275,7 +277,10 @@ for i0, val, i1, title, arrow, key, menu, comment in r: comment = [comment] if comment: comment = '\n'.join([' ' * i0 + '# ' + line for line in comment]) - line = escape(comment) + ':\n' + line + buf += escape(comment) + ':' + + if not menu and buf: + buf += [''] buf += [line.rstrip()] diff --git a/chapter10/kernel/systemd.xml b/chapter10/kernel/systemd.xml index 0bbe1d42a..4c57776c2 100644 --- a/chapter10/kernel/systemd.xml +++ b/chapter10/kernel/systemd.xml @@ -14,16 +14,20 @@ [*] Control Group support ---> [CGROUPS] [*] Memory controller [MEMCG] [ ] Configure standard kernel features (expert users) ---> [EXPERT] + Processor type and features ---> [*] Build a relocatable kernel [RELOCATABLE] [*] Randomize the address of the kernel image (KASLR) [RANDOMIZE_BASE] + General architecture-dependent options ---> [*] Stack Protector buffer overflow detection [STACKPROTECTOR] [*] Strong Stack Protector [STACKPROTECTOR_STRONG] + [*] Networking support ---> [NET] Networking options ---> [*] TCP/IP networking [INET] <*> The IPv6 protocol ---> [IPV6] + Device Drivers ---> Generic Driver Options ---> [ ] Support for uevent helper [UEVENT_HELPER] @@ -41,6 +45,7 @@ <*> Support for frame buffer devices ---> [FB] Console display driver support ---> [*] Framebuffer Console support [FRAMEBUFFER_CONSOLE] + File systems ---> [*] Inotify support for userspace [INOTIFY_USER] Pseudo filesystems ---> diff --git a/chapter10/kernel/sysv.xml b/chapter10/kernel/sysv.xml index 7e615a56c..7e62725e6 100644 --- a/chapter10/kernel/sysv.xml +++ b/chapter10/kernel/sysv.xml @@ -13,12 +13,15 @@ [*] Control Group support ---> [CGROUPS] [*] Memory controller [MEMCG] [ ] Configure standard kernel features (expert users) ---> [EXPERT] + Processor type and features ---> [*] Build a relocatable kernel [RELOCATABLE] [*] Randomize the address of the kernel image (KASLR) [RANDOMIZE_BASE] + General architecture-dependent options ---> [*] Stack Protector buffer overflow detection [STACKPROTECTOR] [*] Strong Stack Protector [STACKPROTECTOR_STRONG] + Device Drivers ---> Generic Driver Options ---> [ ] Support for uevent helper [UEVENT_HELPER] diff --git a/chapter10/kernel/x2apic.xml b/chapter10/kernel/x2apic.xml index 4e4bd9571..9bd2a719f 100644 --- a/chapter10/kernel/x2apic.xml +++ b/chapter10/kernel/x2apic.xml @@ -5,6 +5,7 @@ DO NOT EDIT! --> Processor type and features ---> [*] Support x2apic [X86_X2APIC] + Device Drivers ---> [*] PCI support ---> [PCI] [*] Message Signaled Interrupts (MSI and MSI-X) [PCI_MSI]