Wire Chinese (Simplified) into build-book.sh as a first-class target
alongside en_US, pt_BR, and es_ES, and teach setup_translation.sh how
to install the system packages that translated editions need.
build-book.sh:
- Add zh_CN to LANGUAGES_ALL and to every language helper
(get_chapters_dir, get_appendices_dir, get_pandoc_lang,
get_lang_display, normalize_lang) so it flows through the
existing per-language build path with no special-casing.
- Wire Noto CJK fonts into the PDF build for zh_CN via the
Eisvogel template's CJKmainfont/CJKsansfont/CJKmonofont
variables (which auto-load xeCJK), plus a mainfont override
so Latin text in the body matches the surrounding Chinese.
The Latin defaults from metadata.yaml have no CJK glyphs,
so this is required for the zh_CN PDF to render.
- Refresh help text, error messages, output-file listing,
CONTENT SOURCES, EXAMPLES, and REQUIREMENTS to include
zh_CN and the CJK font / texlive-lang-chinese dependencies.
setup_translation.sh:
- Add install_language_dependencies(), which maps a language
code to the apt packages needed to build that edition:
Noto CJK fonts + texlive-lang-chinese/cjk for zh*, the
Japanese and Korean equivalents for ja/ko, and the
matching texlive-lang-* packs for pt/es/fr/de/it/ru.
- Print the exact apt-get and fc-cache commands before
running them so they can be reproduced manually, and
fall back cleanly when apt-get is unavailable (non-Debian
hosts) or sudo credentials are not cached.
- Add a --skip-deps flag for CI and unprivileged environments
that just want the directory scaffolding without touching
system packages.
- Update usage/help to document --skip-deps and the new
zh_CN example.
Introduce a preliminary Spanish version of the book, translated
with AI assistance using the qwen3.6:35b-a3b-bf16 model.
Note: This content has not been fully human-reviewed and may
contain errors or inconsistencies. The English version remains
the primary source of truth.
Update: scripts/book-build.sh to generate pt_BR and es_ES files
fix(docs): correct typo in chapter 6 crashing PDF workflow
Introduce an initial Brazilian Portuguese version of the book, translated
with AI assistance using the qwen3.6:35b-a3b-bf16 model.
This translated content has not yet been fully reviewed and may still contain
translation errors, terminology inconsistencies, or passages that sound
unnatural in Portuguese. If any part of the translation is unclear or seems
incorrect, readers should refer to the original English version as the source
of truth.
The previous example wasn't reliably demonstrating the danger of missing
null terminators because the stack happened to contain a '\0' byte
immediately after the array, making the broken code appear to work.
Added memset() to fill the stack with non-zero values before declaring
the unterminated array. This ensures the broken example actually exhibits
undefined behavior by reading past the array boundary, making the lesson
about null terminators clear and visible.
Changes:
- Added garbage array filled with 'Z' characters using memset()
- This forces printf() to read past the broken array until finding '\0'
- Readers now see actual garbage output demonstrating why null
terminators are required in C strings
Updated all git clone commands for the FreeBSD source repository to
explicitly checkout the releng/14.3 branch. This ensures readers are
working with FreeBSD 14.3 Release source code, which matches the
version used throughout the book examples.
Changed from:
git clone https://git.freebsd.org/src.git /usr/src
To:
git clone -b releng/14.3 https://git.freebsd.org/src.git /usr/src
This prevents confusion from version mismatches and ensures all kernel
module examples compile and function as documented.
The count variable was not being updated because the while loops were
running in subshells created by the pipe operator. Variable assignments
in subshells don't affect the parent shell, causing count to remain 0.
Changes:
- list_files.sh: Changed from pipe to here-document with command
substitution to keep the while loop in the main shell
- list_files_bash.sh: Changed from pipe to process substitution using
< <(...) syntax to avoid subshell creation for the while loop
Both scripts now correctly display the total number of files found.
THis fix make the script fully POSIX-compliant for FreeBSD /bin/sh
Replace bash-specific `read -d ''` with tmpfile approach.
The -d option is not available in POSIX sh, causing the script
to fail on FreeBSD systems.
- Use tmpfile=$(mktemp) instead of null-delimited pipe
- Add trap for cleanup
- Remove -print0 and read -d '' options
- Add empty filename safety check
Fixes: read: Illegal option -d
Adds the full draft of Chapter 6. This chapter has had only a single
review so far; readers should expect further edits and refinements
before the final book release.
Known issue:
- In the generated PDF, some code blocks appear before the section
titles they belong to. This seems to be a Pandoc rendering quirk.
I’ll investigate and fix later; for now, treat the Markdown as the
source of truth.
No functional changes to earlier chapters.