aboutsummaryrefslogtreecommitdiffstats
path: root/chapter10
diff options
context:
space:
mode:
authorXi Ruoyao <xry111@xry111.site>2023-08-01 00:08:56 +0800
committerXi Ruoyao <xry111@xry111.site>2023-08-01 00:08:56 +0800
commit70bf5512d96389ea1c068cd20a48093a10d6a963 (patch)
tree5226c92cd220ba616094c0e6e03d24c0272ed8ee /chapter10
parent2cf01ab7023ce34da711af45413f4ed7850a9837 (diff)
kernel: Use new kernel configuration rendering method
Import kernel-config infrastructure from BLFS and use it for kernel configuration. Note that kernel-config.py is slightly different from BLFS: we need role="nodump" for <screen> here.
Diffstat (limited to 'chapter10')
-rw-r--r--chapter10/kernel.xml107
-rw-r--r--chapter10/kernel/.gitignore2
-rw-r--r--chapter10/kernel/Makefile19
-rw-r--r--chapter10/kernel/highmem.toml1
-rw-r--r--chapter10/kernel/highmem.xml8
-rwxr-xr-xchapter10/kernel/kernel-config.py293
-rw-r--r--chapter10/kernel/kernel.version1
-rwxr-xr-xchapter10/kernel/kernel_version.py27
-rw-r--r--chapter10/kernel/nvme.toml1
-rw-r--r--chapter10/kernel/nvme.xml8
-rw-r--r--chapter10/kernel/systemd.toml30
-rw-r--r--chapter10/kernel/systemd.xml48
-rw-r--r--chapter10/kernel/sysv.toml18
-rw-r--r--chapter10/kernel/sysv.xml32
-rw-r--r--chapter10/kernel/x2apic.toml5
-rw-r--r--chapter10/kernel/x2apic.xml12
16 files changed, 520 insertions, 92 deletions
diff --git a/chapter10/kernel.xml b/chapter10/kernel.xml
index 9e522cb0d..8609b1474 100644
--- a/chapter10/kernel.xml
+++ b/chapter10/kernel.xml
@@ -130,84 +130,15 @@
<para>Be sure to enable/disable/set the following features or the system might
not work correctly or boot at all:</para>
-<screen role="nodump" revision="sysv"><emphasis role='blue'>G</emphasis>eneral setup ---&gt;
- [ ] <emphasis role='blue'>C</emphasis>ompile the kernel with warnings as errors [CONFIG_WERROR]
- <emphasis role='blue'>C</emphasis>PU/Task time and stats accounting ---&gt;
- [*] <emphasis role='blue'>P</emphasis>ressure stall information tracking [CONFIG_PSI]
- [ ] <emphasis role='blue'>R</emphasis>equire boot parameter to enable pressure stall information tracking
- [CONFIG_PSI_DEFAULT_DISABLED]
- &lt; &gt; <emphasis role='blue'>E</emphasis>nable kernel headers through /sys/kernel/kheaders.tar.xz [CONFIG_IKHEADERS]
- [*] <emphasis role='blue'>C</emphasis>ontrol Group support [CONFIG_CGROUPS] ---&gt;
- [*] M<emphasis role='blue'>e</emphasis>mory controller [CONFIG_MEMCG]
- [ ] <emphasis role='blue'>C</emphasis>onfigure standard kernel features (expert users) [CONFIG_EXPERT]
-
-<emphasis role='blue'>P</emphasis>rocessor type and features ---&gt;
- [*] <emphasis role='blue'>B</emphasis>uild a relocatable kernel [CONFIG_RELOCATABLE]
- [*] <emphasis role='blue'>R</emphasis>andomize the address of the kernel image (KASLR) [CONFIG_RANDOMIZE_BASE]
-
-<emphasis role='blue'>G</emphasis>eneral architecture-dependent options ---&gt;
- [*] <emphasis role='blue'>S</emphasis>tack Protector buffer overflow detection [CONFIG_STACKPROTECTOR]
- [*] <emphasis role='blue'>S</emphasis>trong Stack Protector [CONFIG_STACKPROTECTOR_STRONG]
-
-<emphasis role='blue'>D</emphasis>evice Drivers ---&gt;
- <emphasis role='blue'>G</emphasis>eneric Driver Options ---&gt;
- [ ] <emphasis role='blue'>S</emphasis>upport for uevent helper [CONFIG_UEVENT_HELPER]
- [*] M<emphasis role='blue'>a</emphasis>intain a devtmpfs filesystem to mount at /dev [CONFIG_DEVTMPFS]
- [*] <emphasis role='blue'>A</emphasis>utomount devtmpfs at /dev, after the kernel mounted the rootfs
- [CONFIG_DEVTMPFS_MOUNT]
- <emphasis role='blue'>G</emphasis>raphics support ---&gt;
- <emphasis role='blue'>F</emphasis>rame buffer Devices ---&gt;
- &lt;*&gt; <emphasis role='blue'>S</emphasis>upport for frame buffer devices ---&gt;
- <emphasis role='blue'>C</emphasis>onsole display driver support ---&gt;
- [*] <emphasis role='blue'>F</emphasis>ramebuffer Console support [CONFIG_FRAMEBUFFER_CONSOLE]</screen>
-
-<screen role="nodump" revision="systemd">
-General setup ---&gt;
- [ ] Compile the kernel with warnings as errors [CONFIG_WERROR]
- [ ] Auditing Support [CONFIG_AUDIT]
- CPU/Task time and stats accounting ---&gt;
- [*] Pressure stall information tracking [CONFIG_PSI]
- [ ] Require boot parameter to enable pressure stall information tracking
- [CONFIG_PSI_DEFAULT_DISABLED]
- &lt; &gt; Enable kernel headers through /sys/kernel/kheaders.tar.xz [CONFIG_IKHEADERS]
- [*] Control Group support [CONFIG_CGROUPS] ---&gt;
- [*] Memory controller [CONFIG_MEMCG]
- [ ] Configure standard kernel features (expert users) [CONFIG_EXPERT]
-
-Processor type and features ---&gt;
- [*] Build a relocatable kernel [CONFIG_RELOCATABLE]
- [*] Randomize the address of the kernel image (KASLR) [CONFIG_RANDOMIZE_BASE]
-
-General architecture-dependent options ---&gt;
- [*] Enable seccomp to safely compute untrusted bytecode [CONFIG_SECCOMP]
- [*] Stack Protector buffer overflow detection [CONFIG_STACKPROTECTOR]
- [*] Strong Stack Protector [CONFIG_STACKPROTECTOR_STRONG]
-
-[*] Networking support ---&gt; [CONFIG_NET]
- Networking options ---&gt;
- [*] TCP/IP networking [CONFIG_INET]
- &lt;*&gt; The IPv6 protocol [CONFIG_IPV6]
-
-Device Drivers ---&gt;
- Generic Driver Options ---&gt;
- [ ] Support for uevent helper [CONFIG_UEVENT_HELPER]
- [*] Maintain a devtmpfs filesystem to mount at /dev [CONFIG_DEVTMPFS]
- [*] Automount devtmpfs at /dev, after the kernel mounted the rootfs
- [CONFIG_DEVTMPFS_MOUNT]
- Firmware Loader ---&gt;
- [ ] Enable the firmware sysfs fallback mechanism [CONFIG_FW_LOADER_USER_HELPER]
- Firmware Drivers ---&gt;
- [*] Export DMI identification via sysfs to userspace [CONFIG_DMIID]
- Graphics support ---&gt;
- Frame buffer Devices ---&gt;
- &lt;*&gt; Support for frame buffer devices ---&gt;
- Console display driver support ---&gt;
- [*] Framebuffer Console support [CONFIG_FRAMEBUFFER_CONSOLE]
-
-File systems ---&gt;
- [*] Inotify support for userspace [CONFIG_INOTIFY_USER]
- Pseudo filesystems ---&gt;
- [*] Tmpfs POSIX Access Control Lists [CONFIG_TMPFS_POSIX_ACL]</screen>
+ <!-- To editors: for updating kernel configuration, edit
+ kernel/*.toml and regenerate kernel/*.xml with
+ "make -C kernel KERNEL_TREE=</usr/src/linux-&linux-version> -->
+
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
+ href="kernel/sysv.xml"/>
+
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
+ href="kernel/systemd.xml"/>
<para>Enable some additional features if you are building a 64-bit
system. If you are using menuconfig, enable them in the order of
@@ -216,31 +147,23 @@ File systems ---&gt;
<parameter>CONFIG_X86_X2APIC</parameter> because an option only
shows up after its dependencies are selected.</para>
-<screen role="nodump"><emphasis role='blue'>P</emphasis>rocessor type and features ---&gt;
- [*] <emphasis role='blue'>S</emphasis>upport x2apic [CONFIG_X86_X2APIC]
-
-Device Drivers ---&gt;
- [*] <emphasis role='blue'>P</emphasis>CI Support ---&gt; [CONFIG_PCI]
- [*] M<emphasis role='blue'>e</emphasis>ssage Signaled Interrupts (MSI and MSI-X) [CONFIG_PCI_MSI]
- [*] <emphasis role='blue'>I</emphasis>OMMU Hardware Support ---&gt; [CONFIG_IOMMU_SUPPORT]
- [*] <emphasis role='blue'>S</emphasis>upport for Interrupt Remapping [CONFIG_IRQ_REMAP]</screen>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
+ href="kernel/x2apic.xml"/>
<para>If you are building a 32-bit system running on a hardware
with RAM more than 4GB, adjust the configuration so the kernel will
be able to use up to 64GB physical RAM:</para>
- <screen role="nodump"><emphasis role='blue'>P</emphasis>rocessor type and features ---&gt;
- H<emphasis role='blue'>i</emphasis>gh Memory Support ---&gt;
- (X) <emphasis role='blue'>6</emphasis>4GB [CONFIG_HIGHMEM64G]</screen>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
+ href="kernel/highmem.xml"/>
<para>If the partition for the LFS system is in a NVME SSD (i. e. the
device node for the partition is <filename>/dev/nvme*</filename>
instead of <filename>/dev/sd*</filename>), enable NVME support or
the LFS system won't boot:</para>
- <screen role="nodump"><emphasis role='blue'>D</emphasis>evice Drivers ---&gt;
- N<emphasis role='blue'>V</emphasis>ME Support ---&gt;
- &lt;*&gt; N<emphasis role='blue'>V</emphasis>M Express block device [CONFIG_BLK_DEV_NVME]</screen>
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
+ href="kernel/nvme.xml"/>
</note>
<note revision="systemd">
diff --git a/chapter10/kernel/.gitignore b/chapter10/kernel/.gitignore
new file mode 100644
index 000000000..e22d2c3a4
--- /dev/null
+++ b/chapter10/kernel/.gitignore
@@ -0,0 +1,2 @@
+__pycache__
+s-kernel-version
diff --git a/chapter10/kernel/Makefile b/chapter10/kernel/Makefile
new file mode 100644
index 000000000..d02408dcc
--- /dev/null
+++ b/chapter10/kernel/Makefile
@@ -0,0 +1,19 @@
+INPUT = $(wildcard *.toml)
+OUTPUT = $(patsubst %.toml, %.xml, $(INPUT))
+
+ifeq ($(KERNEL_TREE),)
+$(error "must set KERNEL_TREE=/path/to/kernel/source")
+endif
+
+all: $(OUTPUT)
+
+kernel.version: s-kernel-version; @true
+s-kernel-version: Makefile kernel_version.py
+ ./kernel_version.py $(KERNEL_TREE) > tmp-kernel.version
+ if ! diff tmp-kernel.version $@ 2>/dev/null >/dev/null; then \
+ mv tmp-kernel.version kernel.version; \
+ fi
+ touch s-kernel-version
+
+%.xml: %.toml kernel-config.py kernel_version.py kernel.version
+ ./kernel-config.py $(KERNEL_TREE) $< > $@
diff --git a/chapter10/kernel/highmem.toml b/chapter10/kernel/highmem.toml
new file mode 100644
index 000000000..2caf42385
--- /dev/null
+++ b/chapter10/kernel/highmem.toml
@@ -0,0 +1 @@
+HIGHMEM64G='X'
diff --git a/chapter10/kernel/highmem.xml b/chapter10/kernel/highmem.xml
new file mode 100644
index 000000000..4f0938142
--- /dev/null
+++ b/chapter10/kernel/highmem.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE note PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<!-- Automatically generated by kernel-config.py
+ DO NOT EDIT! -->
+<screen role="nodump"><emphasis role='blue'>P</emphasis>rocessor type and features ---&gt;
+ H<emphasis role='blue'>i</emphasis>gh Memory Support ---&gt;
+ (X) <emphasis role='blue'>6</emphasis>4GB [HIGHMEM64G]</screen>
diff --git a/chapter10/kernel/kernel-config.py b/chapter10/kernel/kernel-config.py
new file mode 100755
index 000000000..93b203a46
--- /dev/null
+++ b/chapter10/kernel/kernel-config.py
@@ -0,0 +1,293 @@
+#!/usr/bin/env python3
+
+# SPDX-License-Identifier: MIT
+# Copyright 2023 The LFS Editors
+
+# Stupid script to render "mconf"-style kernel configuration
+# Usage: kernel-config.py [path to kernel tree] [needed config].toml
+# The toml file should be like:
+# for bool and tristate:
+# EXT4="*"
+# DRM="*M"
+# EXPERT=" "
+# DRM_I915="*M"
+# for choice:
+# HIGHMEM64G="X"
+# an entry with comment:
+# DRM_I915 = { value = " *M", comment = "for i915, crocus, or iris" }
+
+choice_bit = 1 << 30
+ind0 = 0
+ind1 = 0
+menu_id = 1
+stack = []
+if_stack = []
+
+expand_var_mp = { 'SRCARCH': 'x86' }
+main_dep = {}
+
+def expand_var(s):
+ for k in expand_var_mp:
+ s = s.replace('$(' + k + ')', expand_var_mp[k])
+ return s
+
+def pop_stack(cond):
+ global ind0, ind1, stack
+ assert(cond(stack[-1][0]))
+ s, i0, i1, _ = stack[-1]
+ stack = stack[:-1]
+ ind0 -= i0
+ ind1 -= i1
+
+def pop_stack_while(cond):
+ while stack and cond(stack[-1][0]):
+ pop_stack(cond)
+
+def cur_menu():
+ global stack
+ return stack[-1][3] if stack else 0
+
+def cur_if():
+ global if_stack
+ return if_stack[-1][:] if if_stack else []
+
+def clean_dep(d):
+ d = d.strip()
+ if d.endswith('=y') or d.endswith('=M'):
+ d = d[:-2]
+ elif d.endswith(' != ""'):
+ d = d[:-6]
+ return d
+
+def parse_config(buf):
+ global ind0, ind1, stack, menu_id
+ is_choice = buf[0].strip() == 'choice'
+ is_menu = buf[0].startswith('menu') or is_choice
+ is_nonconfig_menu = buf[0].startswith('menu ') or is_choice
+ key = None if is_nonconfig_menu else buf[0].split()[1].strip()
+ title = buf[0][len('menu '):] if is_nonconfig_menu else None
+ deps = ['menu'] + cur_if()
+ klass = None
+
+ for line in buf[1:]:
+ line = line.strip()
+ if line.startswith('depends on '):
+ new_deps = line[len('depends on '):].split('&&')
+ deps += [clean_dep(x) for x in new_deps]
+ elif line.startswith('prompt'):
+ title = line[len('prompt '):]
+ else:
+ for prefix in ['tristate', 'bool', 'string']:
+ if line.startswith(prefix + ' '):
+ title = line[len(prefix) + 1:]
+ klass = prefix
+ elif line == prefix:
+ klass = prefix
+ elif line.startswith('def_' + prefix + ' '):
+ klass = prefix
+ else:
+ continue
+
+ if '"' in line:
+ tail = line[line.rfind('"') + 1:].strip()
+ if tail[:3] == 'if ':
+ deps += [clean_dep(x) for x in tail[3:].split('&&')]
+
+ pop_stack_while(lambda x: x not in deps)
+
+ menu_id += is_menu
+ internal_key = key or menu_id
+ if stack:
+ fa = stack[-1][0]
+ if fa == 'menu':
+ fa = cur_menu() & ~choice_bit
+ main_dep[internal_key] = fa
+
+ val = known_config.get(key)
+ comment = None
+ forced = None
+
+ if type(val) == dict:
+ comment = val.get('comment')
+ forced = val.get('forced')
+ val = val['value']
+
+ klass = klass or 'string'
+ if title:
+ title = title.strip().lstrip('"')
+ title = title[:title.find('"')]
+
+ if not val:
+ pass
+ elif klass == 'string':
+ val = '(' + val + ')'
+ else:
+ assert((val == 'X') == bool(cur_menu() & choice_bit))
+ if (val == 'X'):
+ val = '(X)'
+ else:
+ val = list(val)
+ val.sort()
+ for c in val:
+ if c not in 'M* ' or (c == 'M' and klass != 'tristate'):
+ raise Exception('unknown setting %s for %s' % (c, key))
+ bracket = None
+ if klass == 'tristate' and forced != '*' :
+ bracket = '{}' if forced else '<>'
+ else:
+ bracket = '--' if forced else '[]'
+
+ val = bracket[0] + '/'.join(val) + bracket[1]
+
+ arrow = ' --->' if is_menu else ''
+ r = [ind0, val, ind1, title, arrow, internal_key, cur_menu(), comment]
+
+ # Don't indent for untitled (internal) entries
+ x = 2 if title else 0
+
+ key = key or 'menu'
+ menu = (menu_id if is_menu else cur_menu())
+ menu |= choice_bit if is_choice else 0
+ stack_ent = (key, 2, 0, menu) if is_menu else (key, 0, x, menu)
+ ind0 += stack_ent[1]
+ ind1 += stack_ent[2]
+ stack += [stack_ent]
+
+ return r
+
+def load_kconfig(file):
+ global ind0, ind1, stack, path, menu_id, if_stack
+ r = []
+ config_buf = []
+ with open(path + file) as f:
+ for line in f:
+ if config_buf:
+ if not (line.startswith('\t') or line.startswith(' ')):
+ r += [parse_config(config_buf)]
+ config_buf = []
+ else:
+ config_buf += [line]
+ continue
+ if line.startswith('source') or line.startswith('\tsource'):
+ sub = expand_var(line.strip().split()[1].strip('"'))
+ r += load_kconfig(sub)
+ elif line.startswith('config') or line.startswith('menu'):
+ config_buf = [line]
+ elif line.startswith('choice'):
+ config_buf = [line]
+ elif line.startswith('endmenu') or line.startswith('endchoice'):
+ pop_stack_while(lambda x: x != 'menu')
+ pop_stack(lambda x: x == 'menu')
+ elif line.startswith('if '):
+ line = line[3:]
+ top = cur_if()
+ top += [x.strip() for x in line.split("&&")]
+ if_stack += [top]
+ elif line.startswith('endif'):
+ if_stack = if_stack[:-1]
+ return r
+
+known_config = {}
+
+def escape(x):
+ return x.replace('<', '&lt;').replace('>', '&gt;')
+
+from sys import argv
+import tomllib
+
+path = argv[1]
+if path[-1] != '/':
+ path += '/'
+with open(argv[2], 'rb') as f:
+ known_config = tomllib.load(f)
+
+r = load_kconfig('Kconfig')
+
+# Refcount all menus
+
+index_ikey = {}
+for i in reversed(range(len(r))):
+ index_ikey[r[i][5]] = i
+
+for i in reversed(range(len(r))):
+ if r[i][1] != None:
+ key = r[i][5]
+ fa = main_dep.get(key)
+ if not fa:
+ continue
+ j = index_ikey[fa]
+ if type(fa) == int or not r[j][3]:
+ # The main dependency is a menu or untitled magic entry,
+ # just mark it used
+ r[j][1] = ''
+ if r[j][1] is None:
+ raise Exception('[%s] needs unselected [%s]' % (key, fa))
+
+r = [i for i in r if i[1] != None and i[3]]
+
+# Now we are going to pretty-print r
+
+## Calculate the maximum value length for each menu
+max_val_len = {}
+for _, val, _, _, _, _, menu, _ in r:
+ x = max_val_len.get(menu) or 0
+ max_val_len[menu] = max(x, len(val))
+
+## Output
+
+max_line = 80
+buf = []
+
+done = [x[5] for x in r] + ['revision']
+for i in known_config:
+ if i not in done:
+ raise Exception("%s seems not exist" % i)
+
+for i0, val, i1, title, arrow, key, menu, comment in r:
+ rem = max_line
+
+ if val:
+ val += (max_val_len[menu] - len(val)) * ' '
+
+ rem -= i0 + i1 + bool(val) + len(val)
+ line = i0 * ' ' + escape(val) + (i1 + bool(val)) * ' '
+
+ rem -= len(arrow)
+
+ if len(title) > rem:
+ title = title[:rem - 3] + '...'
+
+ b = title.lstrip('YyMmNnHh')
+ a = title[:len(title) - len(b)]
+ b0 = "<emphasis role='blue'>" + escape(b[0]) + "</emphasis>"
+ line += escape(a) + b0 + escape(b[1:]) + escape(arrow)
+
+ rem -= len(title)
+
+ key = ' [' + key + ']' if type(key) == str else ''
+
+ if len(key) <= rem:
+ line += (rem - len(key)) * ' ' + key
+ else:
+ key = '... ' + key
+ line += '\n' + ' ' * (max_line - len(key)) + key
+ if type(comment) == str:
+ comment = [comment]
+ if comment:
+ comment = '\n'.join([' ' * i0 + '# ' + line for line in comment])
+ line = escape(comment) + ':\n' + line
+
+ buf += [line.rstrip()]
+
+from jinja2 import Template
+
+t = Template('''<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE note PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<!-- Automatically generated by kernel-config.py
+ DO NOT EDIT! -->
+<screen role="nodump"{{ rev }}>{{ '\n'.join(buf) }}</screen>''')
+
+rev = known_config.get('revision')
+rev = ' revision="%s"' % rev if rev else ''
+print(t.render(rev = rev, buf = buf))
diff --git a/chapter10/kernel/kernel.version b/chapter10/kernel/kernel.version
new file mode 100644
index 000000000..3c43d7159
--- /dev/null
+++ b/chapter10/kernel/kernel.version
@@ -0,0 +1 @@
+6.4.7
diff --git a/chapter10/kernel/kernel_version.py b/chapter10/kernel/kernel_version.py
new file mode 100755
index 000000000..764bb2d33
--- /dev/null
+++ b/chapter10/kernel/kernel_version.py
@@ -0,0 +1,27 @@
+#!/usr/bin/env python3
+
+def kernel_version(path):
+ version = None
+ patchlevel = None
+ sublevel = None
+
+ with open(path + 'Makefile') as f:
+ for line in f:
+ if line.startswith('VERSION ='):
+ version = line[len('VERSION ='):].strip()
+ elif line.startswith('PATCHLEVEL ='):
+ patchlevel = line[len('PATCHLEVEL ='):].strip()
+ elif line.startswith('SUBLEVEL ='):
+ sublevel = line[len('SUBLEVEL ='):].strip()
+
+ assert(version and patchlevel and sublevel)
+ return '.'.join([version, patchlevel, sublevel])
+
+if __name__ == '__main__':
+ from sys import argv
+
+ path = argv[1]
+ if path[:-1] != '/':
+ path += '/'
+
+ print(kernel_version(path))
diff --git a/chapter10/kernel/nvme.toml b/chapter10/kernel/nvme.toml
new file mode 100644
index 000000000..1e3170fe9
--- /dev/null
+++ b/chapter10/kernel/nvme.toml
@@ -0,0 +1 @@
+BLK_DEV_NVME='*'
diff --git a/chapter10/kernel/nvme.xml b/chapter10/kernel/nvme.xml
new file mode 100644
index 000000000..2b55b7c1d
--- /dev/null
+++ b/chapter10/kernel/nvme.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE note PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<!-- Automatically generated by kernel-config.py
+ DO NOT EDIT! -->
+<screen role="nodump"><emphasis role='blue'>D</emphasis>evice Drivers ---&gt;
+ N<emphasis role='blue'>V</emphasis>ME Support ---&gt;
+ &lt;*&gt; N<emphasis role='blue'>V</emphasis>M Express block device [BLK_DEV_NVME]</screen>
diff --git a/chapter10/kernel/systemd.toml b/chapter10/kernel/systemd.toml
new file mode 100644
index 000000000..936c50492
--- /dev/null
+++ b/chapter10/kernel/systemd.toml
@@ -0,0 +1,30 @@
+# This part should be sync with sysv.toml
+WERROR=' '
+PSI='*'
+PSI_DEFAULT_DISABLED=' '
+IKHEADERS=' '
+CGROUPS='*'
+MEMCG='*'
+EXPERT=' '
+RELOCATABLE='*'
+RANDOMIZE_BASE='*'
+STACKPROTECTOR='*'
+STACKPROTECTOR_STRONG='*'
+UEVENT_HELPER=' '
+DEVTMPFS='*'
+DEVTMPFS_MOUNT='*'
+FB='*'
+FRAMEBUFFER_CONSOLE='*'
+
+AUDIT=' '
+NET='*'
+INET='*'
+IPV6='*'
+FW_LOADER=' *'
+FW_LOADER_USER_HELPER='*'
+DMIID='*'
+INOTIFY_USER='*'
+TMPFS='*'
+TMPFS_POSIX_ACL='*'
+
+revision='systemd'
diff --git a/chapter10/kernel/systemd.xml b/chapter10/kernel/systemd.xml
new file mode 100644
index 000000000..0bbe1d42a
--- /dev/null
+++ b/chapter10/kernel/systemd.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE note PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<!-- Automatically generated by kernel-config.py
+ DO NOT EDIT! -->
+<screen role="nodump" revision="systemd"><emphasis role='blue'>G</emphasis>eneral setup ---&gt;
+ [ ] <emphasis role='blue'>C</emphasis>ompile the kernel with warnings as errors [WERROR]
+ [ ] <emphasis role='blue'>A</emphasis>uditing support [AUDIT]
+ <emphasis role='blue'>C</emphasis>PU/Task time and stats accounting ---&gt;
+ [*] <emphasis role='blue'>P</emphasis>ressure stall information tracking [PSI]
+ [ ] <emphasis role='blue'>R</emphasis>equire boot parameter to enable pressure stall information tracking
+ ... [PSI_DEFAULT_DISABLED]
+ &lt; &gt; <emphasis role='blue'>E</emphasis>nable kernel headers through /sys/kernel/kheaders.tar.xz [IKHEADERS]
+ [*] <emphasis role='blue'>C</emphasis>ontrol Group support ---&gt; [CGROUPS]
+ [*] M<emphasis role='blue'>e</emphasis>mory controller [MEMCG]
+ [ ] <emphasis role='blue'>C</emphasis>onfigure standard kernel features (expert users) ---&gt; [EXPERT]
+<emphasis role='blue'>P</emphasis>rocessor type and features ---&gt;
+ [*] <emphasis role='blue'>B</emphasis>uild a relocatable kernel [RELOCATABLE]
+ [*] <emphasis role='blue'>R</emphasis>andomize the address of the kernel image (KASLR) [RANDOMIZE_BASE]
+<emphasis role='blue'>G</emphasis>eneral architecture-dependent options ---&gt;
+ [*] <emphasis role='blue'>S</emphasis>tack Protector buffer overflow detection [STACKPROTECTOR]
+ [*] <emphasis role='blue'>S</emphasis>trong Stack Protector [STACKPROTECTOR_STRONG]
+[*] N<emphasis role='blue'>e</emphasis>tworking support ---&gt; [NET]
+ N<emphasis role='blue'>e</emphasis>tworking options ---&gt;
+ [*] <emphasis role='blue'>T</emphasis>CP/IP networking [INET]
+ &lt;*&gt; <emphasis role='blue'>T</emphasis>he IPv6 protocol ---&gt; [IPV6]
+<emphasis role='blue'>D</emphasis>evice Drivers ---&gt;
+ <emphasis role='blue'>G</emphasis>eneric Driver Options ---&gt;
+ [ ] <emphasis role='blue'>S</emphasis>upport for uevent helper [UEVENT_HELPER]
+ [*] M<emphasis role='blue'>a</emphasis>intain a devtmpfs filesystem to mount at /dev [DEVTMPFS]
+ [*] <emphasis role='blue'>A</emphasis>utomount devtmpfs at /dev, after the kernel mounted the rootfs
+ ... [DEVTMPFS_MOUNT]
+ <emphasis role='blue'>F</emphasis>irmware loader ---&gt;
+ &lt; /*&gt; <emphasis role='blue'>F</emphasis>irmware loading facility [FW_LOADER]
+ [*] <emphasis role='blue'>E</emphasis>nable the firmware sysfs fallback mechanism
+ ... [FW_LOADER_USER_HELPER]
+ <emphasis role='blue'>F</emphasis>irmware Drivers ---&gt;
+ [*] <emphasis role='blue'>E</emphasis>xport DMI identification via sysfs to userspace [DMIID]
+ <emphasis role='blue'>G</emphasis>raphics support ---&gt;
+ <emphasis role='blue'>F</emphasis>rame buffer Devices ---&gt;
+ &lt;*&gt; <emphasis role='blue'>S</emphasis>upport for frame buffer devices ---&gt; [FB]
+ <emphasis role='blue'>C</emphasis>onsole display driver support ---&gt;
+ [*] <emphasis role='blue'>F</emphasis>ramebuffer Console support [FRAMEBUFFER_CONSOLE]
+<emphasis role='blue'>F</emphasis>ile systems ---&gt;
+ [*] <emphasis role='blue'>I</emphasis>notify support for userspace [INOTIFY_USER]
+ <emphasis role='blue'>P</emphasis>seudo filesystems ---&gt;
+ [*] <emphasis role='blue'>T</emphasis>mpfs virtual memory file system support (former shm fs) [TMPFS]
+ [*] <emphasis role='blue'>T</emphasis>mpfs POSIX Access Control Lists [TMPFS_POSIX_ACL]</screen>
diff --git a/chapter10/kernel/sysv.toml b/chapter10/kernel/sysv.toml
new file mode 100644
index 000000000..5c8b2df6e
--- /dev/null
+++ b/chapter10/kernel/sysv.toml
@@ -0,0 +1,18 @@
+WERROR=' '
+PSI='*'
+PSI_DEFAULT_DISABLED=' '
+IKHEADERS=' '
+CGROUPS='*'
+MEMCG='*'
+EXPERT=' '
+RELOCATABLE='*'
+RANDOMIZE_BASE='*'
+STACKPROTECTOR='*'
+STACKPROTECTOR_STRONG='*'
+UEVENT_HELPER=' '
+DEVTMPFS='*'
+DEVTMPFS_MOUNT='*'
+FB='*'
+FRAMEBUFFER_CONSOLE='*'
+
+revision='sysv'
diff --git a/chapter10/kernel/sysv.xml b/chapter10/kernel/sysv.xml
new file mode 100644
index 000000000..7e615a56c
--- /dev/null
+++ b/chapter10/kernel/sysv.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE note PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<!-- Automatically generated by kernel-config.py
+ DO NOT EDIT! -->
+<screen role="nodump" revision="sysv"><emphasis role='blue'>G</emphasis>eneral setup ---&gt;
+ [ ] <emphasis role='blue'>C</emphasis>ompile the kernel with warnings as errors [WERROR]
+ <emphasis role='blue'>C</emphasis>PU/Task time and stats accounting ---&gt;
+ [*] <emphasis role='blue'>P</emphasis>ressure stall information tracking [PSI]
+ [ ] <emphasis role='blue'>R</emphasis>equire boot parameter to enable pressure stall information tracking
+ ... [PSI_DEFAULT_DISABLED]
+ &lt; &gt; <emphasis role='blue'>E</emphasis>nable kernel headers through /sys/kernel/kheaders.tar.xz [IKHEADERS]
+ [*] <emphasis role='blue'>C</emphasis>ontrol Group support ---&gt; [CGROUPS]
+ [*] M<emphasis role='blue'>e</emphasis>mory controller [MEMCG]
+ [ ] <emphasis role='blue'>C</emphasis>onfigure standard kernel features (expert users) ---&gt; [EXPERT]
+<emphasis role='blue'>P</emphasis>rocessor type and features ---&gt;
+ [*] <emphasis role='blue'>B</emphasis>uild a relocatable kernel [RELOCATABLE]
+ [*] <emphasis role='blue'>R</emphasis>andomize the address of the kernel image (KASLR) [RANDOMIZE_BASE]
+<emphasis role='blue'>G</emphasis>eneral architecture-dependent options ---&gt;
+ [*] <emphasis role='blue'>S</emphasis>tack Protector buffer overflow detection [STACKPROTECTOR]
+ [*] <emphasis role='blue'>S</emphasis>trong Stack Protector [STACKPROTECTOR_STRONG]
+<emphasis role='blue'>D</emphasis>evice Drivers ---&gt;
+ <emphasis role='blue'>G</emphasis>eneric Driver Options ---&gt;
+ [ ] <emphasis role='blue'>S</emphasis>upport for uevent helper [UEVENT_HELPER]
+ [*] M<emphasis role='blue'>a</emphasis>intain a devtmpfs filesystem to mount at /dev [DEVTMPFS]
+ [*] <emphasis role='blue'>A</emphasis>utomount devtmpfs at /dev, after the kernel mounted the rootfs
+ ... [DEVTMPFS_MOUNT]
+ <emphasis role='blue'>G</emphasis>raphics support ---&gt;
+ <emphasis role='blue'>F</emphasis>rame buffer Devices ---&gt;
+ &lt;*&gt; <emphasis role='blue'>S</emphasis>upport for frame buffer devices ---&gt; [FB]
+ <emphasis role='blue'>C</emphasis>onsole display driver support ---&gt;
+ [*] <emphasis role='blue'>F</emphasis>ramebuffer Console support [FRAMEBUFFER_CONSOLE]</screen>
diff --git a/chapter10/kernel/x2apic.toml b/chapter10/kernel/x2apic.toml
new file mode 100644
index 000000000..6f7657b13
--- /dev/null
+++ b/chapter10/kernel/x2apic.toml
@@ -0,0 +1,5 @@
+X86_X2APIC='*'
+PCI='*'
+PCI_MSI='*'
+IOMMU_SUPPORT='*'
+IRQ_REMAP='*'
diff --git a/chapter10/kernel/x2apic.xml b/chapter10/kernel/x2apic.xml
new file mode 100644
index 000000000..4e4bd9571
--- /dev/null
+++ b/chapter10/kernel/x2apic.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE note PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+ "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<!-- Automatically generated by kernel-config.py
+ DO NOT EDIT! -->
+<screen role="nodump"><emphasis role='blue'>P</emphasis>rocessor type and features ---&gt;
+ [*] <emphasis role='blue'>S</emphasis>upport x2apic [X86_X2APIC]
+<emphasis role='blue'>D</emphasis>evice Drivers ---&gt;
+ [*] <emphasis role='blue'>P</emphasis>CI support ---&gt; [PCI]
+ [*] M<emphasis role='blue'>e</emphasis>ssage Signaled Interrupts (MSI and MSI-X) [PCI_MSI]
+ [*] <emphasis role='blue'>I</emphasis>OMMU Hardware Support ---&gt; [IOMMU_SUPPORT]
+ [*] <emphasis role='blue'>S</emphasis>upport for Interrupt Remapping [IRQ_REMAP]</screen>