diff --git a/README-CN.md b/README-CN.md
deleted file mode 100644
index 7a5f0de..0000000
--- a/README-CN.md
+++ /dev/null
@@ -1,450 +0,0 @@
-## 介绍
-`rpi23-gen-image.sh` 是一个自动生成树莓派2/3系统镜像的脚本工具, 当前支持自动生成32位 armhf 架构的Debian, 发行版本`jessie`, `stretch` 和 `buster`. 树莓派3 64位镜像需要使用特定的配置参数 (```templates/rpi3-stretch-arm64-4.14.y```).
-
-## 构建环境所依赖的包
-一定要安装好下列deb包, 他们是构建过程需要的核心包. 脚本会自动检查, 如果缺少,经用户确认后会自动安装.
-
- ```debootstrap debian-archive-keyring qemu-user-static binfmt-support dosfstools rsync bmap-tools whois git bc psmisc dbus sudo```
-
-推荐通过配置 `rpi23-gen-image.sh` 脚本编译安装最新的树莓派 Linux 内核, 对于树莓派3, 只能如此. 在构建系统上使用 ARM (armhf) 交叉编译工具链编译内核.
-
-脚本已经在Debian Liux `jessie` 和`stretch` 构建系统下使用默认的 `crossbuild-essential-armhf` 工具链进行过测试. 获取更多信息请查看 [Debian 交叉工具链 Wiki](https://wiki.debian.org/CrossToolchains) .
-
-如果使用Debian Linux `jessie` 构建系统, 先要添加交叉编译工具链的源 [Debian 交叉工具链仓库](http://emdebian.org/tools/debian/):
-
-```
-echo "deb http://emdebian.org/tools/debian/ jessie main" > /etc/apt/sources.list.d/crosstools.list
-sudo -u nobody wget -O - http://emdebian.org/tools/debian/emdebian-toolchain-archive.key | apt-key add -
-dpkg --add-architecture armhf
-apt-get update
-```
-
-## 命令行参数
-脚本可以使用特定的命令行参数来允许或禁止操作系统的某些特性、服务和配置信息. 这些参数通过(简单)脚本变量传递给 `rpi23-gen-image.sh`. 不同于环境变量, (简单)脚本变量在调用`rpi23-gen-image.sh`的命令行前面定义.
-
-##### 命令行示例:
-```shell
-ENABLE_UBOOT=true ./rpi23-gen-image.sh
-ENABLE_CONSOLE=false ENABLE_IPV6=false ./rpi23-gen-image.sh
-ENABLE_WM=xfce4 ENABLE_FBTURBO=true ENABLE_MINBASE=true ./rpi23-gen-image.sh
-ENABLE_HARDNET=true ENABLE_IPTABLES=true /rpi23-gen-image.sh
-APT_SERVER=ftp.de.debian.org APT_PROXY="http://127.0.0.1:3142/" ./rpi23-gen-image.sh
-ENABLE_MINBASE=true ./rpi23-gen-image.sh
-BUILD_KERNEL=true ENABLE_MINBASE=true ENABLE_IPV6=false ./rpi23-gen-image.sh
-BUILD_KERNEL=true KERNELSRC_DIR=/tmp/linux ./rpi23-gen-image.sh
-ENABLE_MINBASE=true ENABLE_REDUCE=true ENABLE_MINGPU=true BUILD_KERNEL=true ./rpi23-gen-image.sh
-ENABLE_CRYPTFS=true CRYPTFS_PASSWORD=changeme EXPANDROOT=false ENABLE_MINBASE=true ENABLE_REDUCE=true ENABLE_MINGPU=true BUILD_KERNEL=true ./rpi23-gen-image.sh
-RELEASE=stretch BUILD_KERNEL=true ./rpi23-gen-image.sh
-RPI_MODEL=3 ENABLE_WIRELESS=true ENABLE_MINBASE=true BUILD_KERNEL=true ./rpi23-gen-image.sh
-RELEASE=stretch RPI_MODEL=3 ENABLE_WIRELESS=true ENABLE_MINBASE=true BUILD_KERNEL=true ./rpi23-gen-image.sh
-```
-
-## 参数模板文件
-为了避免冗长的命令行参数以及存储感兴趣的参数配置, `rpi23-gen-image.sh` 支持所谓的参数模板文件 (`CONFIG_TEMPLATE`=template). 这些文本文件位于 `./templates` 目录, 文件中含有将会使用的配置参数. 新的配置模板文件会被添加到 `./templates` 目录.
-
-##### 命令行示例:
-```shell
-CONFIG_TEMPLATE=rpi3stretch ./rpi23-gen-image.sh
-CONFIG_TEMPLATE=rpi2stretch ./rpi23-gen-image.sh
-```
-
-## 支持的参数和设置
-#### APT 设置:
-##### `APT_SERVER`="ftp.debian.org"
-设置 Debian 仓库地址. 选择一个 [镜像站点](https://www.debian.org/mirror/list). 选一个近的镜像站点会加快镜像生成过程中所需文件的下载速度.
-
-##### `APT_PROXY`=""
-设置代理服务器地址. 使用本地缓存代理, 比如 `apt-cacher-ng` 可以缩短镜像生成时间, 因为所需要的 Debian 包文件只需下载一次.
-
-##### `APT_INCLUDES`=""
-生成镜像过程中最先由debootstrap程序自动安装的附加包, 逗号分隔.
-
-##### `APT_INCLUDES_LATE`=""
-生成镜像过程中最初的debootstrap完成后, 需要的使用apt命令安装的附加包, 逗号分隔. 特别用在含有 pre-depend 依赖关系的包的, 其依赖关系在打包过程中debootstrap程序中无法正确处理.
-
----
-
-#### 通用系统设置:
-##### `RPI_MODEL`=2
-指定树莓派型号. 当前支持树莓派 `2` 和 `3`. 设为 `3` 时 `BUILD_KERNEL` 自动设为true .
-
-##### `RELEASE`="jessie"
-设置 Debian 发行版. 脚本当前支持 Debian 发行版 "jessie", "stretch" 和 "buster" 的自动生成. 设为`stretch` 或 `buster`时 `BUILD_KERNEL` 自动设为true.
-
-##### `RELEASE_ARCH`="armhf"
-设置期望的 Debian 发行架构.
-
-##### `HOSTNAME`="rpi$RPI_MODEL-$RELEASE"
-设置主机名称. 建议所在的子网中主机名称是唯一的.
-
-##### `PASSWORD`="raspberry"
-设置系统的 `root` 用户密码. **强烈**建议选择一个自定义密码 .
-
-##### `USER_PASSWORD`="raspberry"
-设置由 `USER_NAME`=pi 参数创建的普通用户的密码. 如果 `ENABLE_USER`=false 则忽略. **强烈**建议选择一个自定义密码.
-
-##### `DEFLOCAL`="en_US.UTF-8"
-设置系统默认 locale. 将来可以在运行的系统中执行 `dpkg-reconfigure locales` 命令更改此项设置. 设置这项脚本会自动安装 `locales`, `keyboard-configuration` 和 `console-setup` 三个包.
-
-##### `TIMEZONE`="Europe/Berlin"
-设置系统默认时区. 可以在`/usr/share/zoneinfo/` 目录中找到全部可用时区. 将来可以在运行的系统中执行 `dpkg-reconfigure tzdata` 命令更改此项设置.
-
-##### `EXPANDROOT`=true
-第一次运行时自动扩展根分区和文件系统.
-
----
-
-#### 键盘设置:
-这些选项用来配置键盘布局文件 `/etc/default/keyboard` 影响控制台和X窗口. 将来可以在运行的系统中执行 `dpkg-reconfigure keyboard-configuration` 命令更改此项设置.
-
-##### `XKB_MODEL`=""
-设置键盘类型, 大陆常见pc104.
-
-##### `XKB_LAYOUT`=""
-设置键盘布局, 大陆常见us.
-
-##### `XKB_VARIANT`=""
-设置键盘布局变种.
-
-##### `XKB_OPTIONS`=""
-设置其它 XKB 配置选项.
-
----
-
-#### 网络设置 (动态):
-设置网络为自动获取IP地址. 配置文件位于 `/etc/systemd/network/eth.network`. 在Debian `stretch`中, 默认位置更改为 `/lib/systemd/network`.
-
-##### `ENABLE_DHCP`=true
-设置系统使用 DHCP 获取动态IP. 需要有一个 DHCP 服务器.
-
----
-
-#### 网络设置 (静态):
-设置系统为手动配置IP地址. 配置文件位于 `/etc/systemd/network/eth.network`. 在Debian `stretch` 中, 默认位置更改为 `/lib/systemd/network`.
-当 `ENABLE_DHCP`=false 时下面这些静态IP设置才起作用.
-
-##### `NET_ADDRESS`=""
-设置静态 IPv4 或 IPv6, 使用CIDR "/"形式, 如 "192.169.0.3/24".
-
-##### `NET_GATEWAY`=""
-设置默认网关的地址.
-
-##### `NET_DNS_1`=""
-设置主域名服务器地址.
-
-##### `NET_DNS_2`=""
-设置辅域名服务器地址.
-
-##### `NET_DNS_DOMAINS`=""
-设置默认的域名搜索后缀, 当主机名称不是一个完整域名(FQDN)时使用.
-
-##### `NET_NTP_1`=""
-设置主时间服务器地址.
-
-##### `NET_NTP_2`=""
-设置辅时间服务器地址.
-
----
-
-#### 基本系统特性:
-##### `ENABLE_CONSOLE`=true
-允许串行控制台接口. 没有连接显示器键盘的树莓派推荐打开, 此时如果网络无法连接至树莓派, 可以使用串行控制台连至系统.
-
-##### `ENABLE_I2C`=false
-允许树莓派2/3的 I2C 接口. 请对照 [树莓派2/3 引脚示意图](https://elinux.org/RPi_Low-level_peripherals) 正确连接 GPIO 引脚.
-
-##### `ENABLE_SPI`=false
-允许树莓派2/3的 SPI 接口. 请对照 [树莓派2/3 引脚示意图](https://elinux.org/RPi_Low-level_peripherals) 正确连接 GPIO 引脚.
-
-##### `ENABLE_IPV6`=true
-允许 IPv6 . 通过 systemd-networkd 配置管理网络接口.
-
-##### `ENABLE_SSHD`=true
-安装并且允许 OpenSSH 服务. 此服务默认禁止 `root` 用户远程登录. 使用普通用户 `pi` 远程登录然后使用 `su -` 或 `sudo` 来取得root权限.
-
-##### `ENABLE_NONFREE`=false
-允许安装仓库中的 non-free 类的软件包. 需要安装闭源的固件, 二进制大对象 blob.
-
-##### `ENABLE_WIRELESS`=false
-下载安装树莓派3无线接口所需要的闭源固件 二进制blob [树莓派3无线接口固件](https://github.com/RPi-Distro/firmware-nonfree/tree/master/brcm80211/brcm). 如果 `RPI_MODEL` 不是 `3` 则忽略.
-
-##### `ENABLE_RSYSLOG`=true
-如果设置为 false, 禁用并卸载 rsyslog, 则只能通过日志文件查看logs.
-
-##### `ENABLE_SOUND`=true
-允许声卡并且安装 ALSA.
-
-##### `ENABLE_HWRANDOM`=true
-允许硬件随机数发生器. 强随机数对大多数使用加密的网络通信是非常重要的. 推荐允许此设置.
-
-##### `ENABLE_MINGPU`=false
-最小化显存 (16MB, no X), 目前无法完全禁用GPU.
-
-##### `ENABLE_DBUS`=true
-安装并允许 D-Bus 消息总线. 虽然 systemd 可以在没有 D-bus的情况下工作, 但是推荐允许D-Bus.
-
-##### `ENABLE_XORG`=false
-是否安装 Xorg, 开源 X11 系统.
-
-##### `ENABLE_WM`=""
-安装用户指定的X Window 窗口管理器. 如果设置了`ENABLE_WM`, 系统确定所有被依赖的X11相关软件包都安装好了以后`ENABLE_XORG`会自动设置为true, `rpi23-gen-image.sh` 脚本已经通过下列窗口管理器的测试: `blackbox`, `openbox`, `fluxbox`, `jwm`, `dwm`, `xfce4`, `awesome`.
-
----
-
-#### 高级系统特性:
-##### `ENABLE_MINBASE`=false
-使用 debootstrap 脚本变量 `minbase`, 只含有必不可少的核心包和apt. 体积大约 65 MB.
-
-##### `ENABLE_REDUCE`=false
-卸载包、删除文件以减小体积 详情查看 `REDUCE_*` 参数.
-
-##### `ENABLE_UBOOT`=false
-使用 [U-Boot 引导器](https://git.denx.de/?p=u-boot.git;a=summary) 替代树莓派2/3 默认的第二阶段引导器(bootcode.bin). U-Boot 可以通过网络使用 BOOTP/TFTP 协议引导镜像文件.
-
-##### `UBOOTSRC_DIR`=""
-存放已下载 [U-Boot 引导器源文件](https://git.denx.de/?p=u-boot.git;a=summary) 的目录(`u-boot`).
-
-##### `ENABLE_FBTURBO`=false
-安装并且允许 [硬件加速的 Xorg 显卡驱动](https://github.com/ssvb/xf86-video-fbturbo) `fbturbo`. 当前仅支持窗口的移动和滚动的硬件加速.
-
-##### `FBTURBOSRC_DIR`=""
-设置存放已下载的 [硬件加速的 Xorg 显卡驱动](https://github.com/ssvb/xf86-video-fbturbo) 的目录 (`xf86-video-fbturbo`) , 可以复制到chroot内配置、构建和安装.
-
-##### `ENABLE_IPTABLES`=false
-允许 iptables 防火墙. 使用最简单的规则集: 允许所有出站连接;禁止除OpenSSH外的所有入站连接.
-
-##### `ENABLE_USER`=true
-创建普通用户, 默认用户名`pi`, 默认密码raspberry. 可以使用 `USER_NAME`=user 更改默认用户名;使用 `USER_PASSWORD`=raspberry 更改默认密码.
-
-##### `USER_NAME`=pi
-创建普通用户pi. 如果`ENABLE_USER`=false 此参数被忽略.
-
-##### `ENABLE_ROOT`=false
-允许root用户登录, 需要设置 root 用户密码.
-
-##### `ENABLE_HARDNET`=false
-允许加固 IPv4/IPv6 协议栈, 防止DoS攻击.
-
-##### `ENABLE_SPLITFS`=false
-允许将根分区放在USB驱动器中. 将会生成两个镜像文件, 一个挂载为 `/boot/firmware` , 另一个挂载为 `/`.
-
-##### `CHROOT_SCRIPTS`=""
-设置自定义脚本目录的路径, 该目录中的脚本在镜像文件构建完成之前在chroot中运行. 这个目录里的可执行文件按着字典序运行.
-
-##### `ENABLE_INITRAMFS`=false
-创建 Linux 启动时加载的 initramfs .如果 `ENABLE_CRYPTFS`=true 那么 `ENABLE_INITRAMFS` 自动设为true . 如果 `BUILD_KERNEL`=false 此参数被忽略.
-
-##### `ENABLE_IFNAMES`=true
-允许一致/可预测网络接口命名, 支持 Debian 发行版 `stretch` 或 `buster` .
-
-##### `DISABLE_UNDERVOLT_WARNINGS`=
-禁止树莓派2/3 的低电压警告. 设为 `1` 禁止警告. 设为 `2` 额外允许低电压下的turbo增强模式.
-
----
-
-#### SSH 设置:
-##### `SSH_ENABLE_ROOT`=false
-允许root通过密码验证方式远程登录系统. 如果没有修改默认密码, 这将是个巨大的安全隐患. `ENABLE_ROOT` 必须设为 `true`.
-
-##### `SSH_DISABLE_PASSWORD_AUTH`=false
-禁用SSH的密码验证方式, 只支持SSH (v2)的公钥认证.
-
-##### `SSH_LIMIT_USERS`=false
-限制通过SSH远程登录的用户. 只允许由 `USER_NAME`=pi 参数创建的普通用户, 以及当 `SSH_ENABLE_ROOT`=true 时 root 用户远程登录. 如果使用的守护程序是 `dropbear` (通过 `REDUCE_SSHD`=true 设置) 则忽略此参数.
-
-##### `SSH_ROOT_PUB_KEY`=""
-从指定文件(可包含多个公钥)添加 SSH (v2) 公钥到 `authorized_keys` 文件, 使得 `root` 用户可以使用SSH (v2)的公钥验证方式远程登录, 不支持SSH (v1). `ENABLE_ROOT` **和** `SSH_ENABLE_ROOT` 必须同时设为 `true`.
-
-##### `SSH_USER_PUB_KEY`=""
-从指定文件(可包含多个公钥)添加 SSH (v2) 公钥到 `authorized_keys` 文件, 使得由 `USER_NAME`=pi 参数创建的普通用户可以使用SSH (v2)的公钥验证方式远程登录, 不支持SSH (v1).
-
----
-
-#### 内核编译:
-##### `BUILD_KERNEL`=false
-构建安装最新的树莓派 2/3 Linux 内核, 当前只支持默认内核配置. 如果设置为树莓派`3`那么自动设置`BUILD_KERNEL`=true .
-
-##### `CROSS_COMPILE`="arm-linux-gnueabihf-"
-设置交叉编译器.
-
-##### `KERNEL_ARCH`="arm"
-设置内核架构.
-
-##### `KERNEL_IMAGE`="kernel7.img"
-内核镜像名称, 如果没有设置, 编译32位内核默认“kernel7.img” 64位内核默认 "kernel8.img".
-
-##### `KERNEL_BRANCH`=""
-GIT里的树莓派内核源代码分支名称, 默认使用当前默认分支.
-
-##### `QEMU_BINARY`="/usr/bin/qemu-arm-static"
-设置构建系统中的QEMU程序位置. 如果没有设置, 32位内核默认 “/usr/bin/qemu-arm-static” 64位内核默认 "/usr/bin/qemu-aarch64-static".
-
-##### `KERNEL_DEFCONFIG`="bcm2709_defconfig"
-设置编译内核的默认配置. 如果没有设置, 32位内核默认"bcm2709_defconfig" 64位内核默认"bcmrpi3\_defconfig".
-
-##### `KERNEL_REDUCE`=false
-缩小内核体积, 移除不想要的设备驱动、网络驱动和文件系统驱动 (实验性质).
-
-##### `KERNEL_THREADS`=1
-编译内核时的并发线程数量. 如果使用默认设置, 系统会自动检测CPU的内核数量, 设置线程数量, 加速内核编译.
-
-##### `KERNEL_HEADERS`=true
-安装内核相应的头文件.
-
-##### `KERNEL_MENUCONFIG`=false
-运行`make menuconfig`使用菜单界面配置内核. 退出配置菜单后脚本继续运行.
-
-##### `KERNEL_REMOVESRC`=true
-编译安装完成后, 删掉内核源代码, 产生的镜像不含内核源代码.
-
-##### `KERNELSRC_DIR`=""
-已下载好的 [Github上的树莓派官方内核](https://github.com/raspberrypi/linux) 源码所在目录 (`linux`) 的路径, 可以复制到chroot内配置、构建和安装.
-
-##### `KERNELSRC_CLEAN`=false
-当`KERNELSRC_DIR`被复制到 chroot 之后开始编译之前(使用 `make mrproper`)清理内核源代码. 如果 `KERNELSRC_DIR` 没有设置或者 `KERNELSRC_PREBUILT`=true时忽略此设置.
-
-##### `KERNELSRC_CONFIG`=true
-在编译前使用 `make bcm2709_defconfig` (也可以选择 `make menuconfig`) 配置内核源代码. 如果`KERNELSRC_DIR`指定的源码存放目录不存在,这个参数自动设为 `true`. 如果 `KERNELSRC_PREBUILT`=true 忽略此参数.
-
-##### `KERNELSRC_USRCONFIG`=""
-复制自己的配置文件到内核的 `.config`. 如果 `KERNEL_MENUCONFIG`=true 拷贝完成后自动运行 make menuconfig.
-
-##### `KERNELSRC_PREBUILT`=false
-如果这个参数设为true 表示内核源代码目录中包含成功交叉编译好的内核. 忽略 `KERNELSRC_CLEAN`, `KERNELSRC_CONFIG`, `KERNELSRC_USRCONFIG` and `KERNEL_MENUCONFIG` 这四个参数,不再执行交叉编译操作.
-
-##### `RPI_FIRMWARE_DIR`=""
-指定目录 (`firmware`) 含有已经从 [Github上的树莓派官方固件](https://github.com/raspberrypi/firmware)下载到本地的固件. 默认直接从网上下载最新的固件.
-
----
-
-#### 缩小体积:
-如果 `ENABLE_REDUCE`=false 则忽略下列参数.
-
-##### `REDUCE_APT`=true
-配置 APT,压缩仓库文件列表,不缓存下载的包文件.
-
-##### `REDUCE_DOC`=true
-移除所有的doc文档文件(harsh). 配置 APT, 将来使用`apt-get`安装deb包时不包括doc文件.
-
-##### `REDUCE_MAN`=true
-移除所有的man手册页和info文件 (harsh). 配置 APT, 将来使用`apt-get`安装deb包时不包括man手册页.
-
-##### `REDUCE_VIM`=false
-使用vim的小型克隆 `levee` 替代 `vim-tiny`.
-
-##### `REDUCE_BASH`=false
-使用 `dash` 代替 `bash` (实验性质).
-
-##### `REDUCE_HWDB`=true
-移除与 PCI 相关的 hwdb 文件 (实验性质).
-
-##### `REDUCE_SSHD`=true
-使用`dropbear`代替 `openssh-server`.
-
-##### `REDUCE_LOCALE`=true
-移除所有的 `locale` 本地化文件.
-
----
-
-#### 加密根分区:
-##### `ENABLE_CRYPTFS`=false
-使用dm-crypt进行全盘加密. 创建一个 LUKS 加密根分区 (加密方法 aes-xts-plain64:sha512) 并生成所需要的 initramfs. /boot 目录不会被加密. 当`BUILD_KERNEL`=false时忽略此参数. `ENABLE_CRYPTFS` 这个参数当前是实验性质的. SSH-to-initramfs 当前不支持,正在进行中.
-
-##### `CRYPTFS_PASSWORD`=""
-设置根分区的加密密码. 如果 `ENABLE_CRYPTFS`=true,请务必设置此参数.
-
-##### `CRYPTFS_MAPPING`="secure"
-设置device-mapper映射名称.
-
-##### `CRYPTFS_CIPHER`="aes-xts-plain64:sha512"
-加密算法. 推荐 `aes-xts*`加密法.
-
-##### `CRYPTFS_XTSKEYSIZE`=512
-设置密钥长度,8的倍数,以bit为单位.
-
----
-
-#### Build settings构建设置:
-##### `BASEDIR`=$(pwd)/images/${RELEASE}
-设置产生镜像的目录.
-
-##### `IMAGE_NAME`=${BASEDIR}/${DATE}-${KERNEL_ARCH}-${KERNEL_BRANCH}-rpi${RPI_MODEL}-${RELEASE}-${RELEASE_ARCH}
-设置镜像文件名. 如果`ENABLE_SPLITFS`=false则文件名$IMAGE_NAME.img 如果`ENABLE_SPLITFS`=true则文件名$IMAGE_NAME-frmw.img 和 $IMAGE_NAME-root.img. 如果没有设置 `KERNEL_BRANCH` 则使用 "CURRENT" .
-
-## 理解脚本
-制作镜像的每个阶段所实现的功能都由各自的脚本完成, 位于 `bootstrap.d` 目录. 按着字典序执行:
-
-| 脚本 | 说明 |
-| --- | --- |
-| `10-bootstrap.sh` | 生成基本系统 |
-| `11-apt.sh` | 设置 APT 仓库源 |
-| `12-locale.sh` | 设置 Locales 和 keyboard |
-| `13-kernel.sh` | 编译安装树莓派 2/3 内核 |
-| `14-fstab.sh` | 设置 fstab 和 initramfs |
-| `15-rpi-config.sh` | 设置 RPi2/3 config and cmdline |
-| `20-networking.sh` | 设置网络 |
-| `21-firewall.sh` | 设置防火墙 |
-| `30-security.sh` | 设置用户以及安全相关 |
-| `31-logging.sh` | 设置日志 |
-| `32-sshd.sh` | 设置 SSH 和公钥 |
-| `41-uboot.sh` | 编译设置 U-Boot |
-| `42-fbturbo.sh` | 编译设置 fbturbo Xorg 驱动 |
-| `50-firstboot.sh` | 首次启动执行的任务 |
-| `99-reduce.sh` | 缩小体积 |
-
-所有需要拷贝到镜像文件的配置文件都位于 `files` 目录. 最好不要手动更改这些配置文件.
-
-| 目录 | 说明 |
-| --- | --- |
-| `apt` | APT 管理配置文件 |
-| `boot` | 引导文件 树莓派2/3配置文件 |
-| `dpkg` | 包管理配置文件 |
-| `etc` | 配置文件以及 rc 启动脚本 |
-| `firstboot` | 首次引导执行的脚本 |
-| `initramfs` | Initramfs 脚本 |
-| `iptables` | 防火墙配置文件 |
-| `locales` | Locales 配置 |
-| `modules` | 内核模块配置 |
-| `mount` | Fstab 配置 |
-| `network` | 网络配置文件 |
-| `sysctl.d` | 交换文件以及IP协议加固配置文件 |
-| `xorg` | fbturbo Xorg 驱动配置 |
-
-## 自定义包和脚本
- `packages` 目录里放置自定义deb包, 比如系统仓库里没有的软件.在安装完系统仓库中的包之后安装. 自定义包所依赖的deb包会自动从系统仓库下载. 不要把自定义包添加到 `APT_INCLUDES` 参数中.
- `custom.d` 目录中的脚本会在其它安装都完成后, 创建镜像文件之前执行.
-
-## 记录镜像产生过程的信息
-所有镜像产生过程的信息、`rpi23-gen-image.sh` 脚本执行的命令都可以通过shell的 `script` 命令保存到日志文件中:
-
-```shell
-script -c 'APT_SERVER=ftp.de.debian.org ./rpi23-gen-image.sh' ./build.log
-```
-
-## 烧录镜像文件
-`rpi23-gen-image.sh` 所生成的镜像文件需要使用 `bmaptool` 或 `dd` 烧录到 microSD 卡. `bmaptool` 速度快比 `dd` 聪明.
-
-##### 烧录示例:
-```shell
-bmaptool copy ./images/jessie/2017-01-23-rpi3-jessie.img /dev/mmcblk0
-dd bs=4M if=./images/jessie/2017-01-23-rpi3-jessie.img of=/dev/mmcblk0
-```
-如果设置过 `ENABLE_SPLITFS`, 烧录 `-frmw` 文件到 microSD 卡, 烧录 `-root` 文件到 USB 驱动器:
-```shell
-bmaptool copy ./images/jessie/2017-01-23-rpi3-jessie-frmw.img /dev/mmcblk0
-bmaptool copy ./images/jessie/2017-01-23-rpi3-jessie-root.img /dev/sdc
-```
-## 每周镜像
-这些镜像由JRWR'S I/O PORT提供, 每周日午夜UTC 0点编译!
-* [Debian Stretch Raspberry Pi2/3 周构建镜像](https://jrwr.io/doku.php?id=projects:debianpi)
-
-## External links and references外部链接, 各种资源
-* [Debian 全世界镜像列表](https://www.debian.org/mirror/list)
-* [Debian 树莓派 2 Wiki](https://wiki.debian.org/RaspberryPi2)
-* [Debian 交叉工具链 Wiki](https://wiki.debian.org/CrossToolchains)
-* [Github上的树莓派官方固件](https://github.com/raspberrypi/firmware)
-* [Github上的树莓派官方内核](https://github.com/raspberrypi/linux)
-* [U-BOOT git 仓库](https://git.denx.de/?p=u-boot.git;a=summary)
-* [Xorg DDX fbturbo驱动](https://github.com/ssvb/xf86-video-fbturbo)
-* [树莓派3无线接口固件](https://github.com/RPi-Distro/firmware-nonfree/tree/master/brcm80211/brcm)
-* [Collabora 树莓派2预编译内核](https://repositories.collabora.co.uk/debian/)
diff --git a/README.md b/README.md
index ef194c3..c0a0e69 100644
--- a/README.md
+++ b/README.md
@@ -26,9 +26,9 @@ BUILD_KERNEL=true ENABLE_MINBASE=true ENABLE_IPV6=false ./rpi23-gen-image.sh
BUILD_KERNEL=true KERNELSRC_DIR=/tmp/linux ./rpi23-gen-image.sh
ENABLE_MINBASE=true ENABLE_REDUCE=true ENABLE_MINGPU=true BUILD_KERNEL=true ./rpi23-gen-image.sh
ENABLE_CRYPTFS=true CRYPTFS_PASSWORD=changeme EXPANDROOT=false ENABLE_MINBASE=true ENABLE_REDUCE=true ENABLE_MINGPU=true BUILD_KERNEL=true ./rpi23-gen-image.sh
-RELEASE=stretch BUILD_KERNEL=true ./rpi23-gen-image.sh
+RELEASE=buster BUILD_KERNEL=true ./rpi23-gen-image.sh
RPI_MODEL=3 ENABLE_WIRELESS=true ENABLE_MINBASE=true BUILD_KERNEL=true ./rpi23-gen-image.sh
-RELEASE=stretch RPI_MODEL=3 ENABLE_WIRELESS=true ENABLE_MINBASE=true BUILD_KERNEL=true ./rpi23-gen-image.sh
+RELEASE=buster RPI_MODEL=3 ENABLE_WIRELESS=true ENABLE_MINBASE=true BUILD_KERNEL=true ./rpi23-gen-image.sh
```
## Configuration template files
@@ -40,438 +40,269 @@ CONFIG_TEMPLATE=rpi3stretch ./rpi23-gen-image.sh
CONFIG_TEMPLATE=rpi2stretch ./rpi23-gen-image.sh
```
-## Supported parameters and settings
-#### APT settings:
-##### `APT_SERVER`="ftp.debian.org"
-Set Debian packages server address. Choose a server from the list of Debian worldwide [mirror sites](https://www.debian.org/mirror/list). Using a nearby server will probably speed-up all required downloads within the bootstrapping process.
-
-##### `APT_PROXY`=""
-Set Proxy server address. Using a local Proxy-Cache like `apt-cacher-ng` will speed-up the bootstrapping process because all required Debian packages will only be downloaded from the Debian mirror site once. If `apt-cacher-ng` is running on default `http://127.0.0.1:3142` it is autodetected and you don't need to set this.
-
-##### `KEEP_APT_PROXY`=false
-Keep the APT_PROXY settings used in the bootsrapping process in the generated image.
+## Working with the your template:
+ * **A Pipe ("|") represents a logical OR**
+ * **A valuetype of boolean represents the options true or false**
+ * **Values without a default are required if you want do use that feature. It is possible that not every feature has a (working) sanity check.**
+ * **If it's not working as expected, search your option in all the files in this repository (With e.g.grep or notepad++).**
+ * **Check if your missing a required option while looking at the code**
-##### `APT_INCLUDES`=""
-A comma-separated list of additional packages to be installed by debootstrap during bootstrapping.
-
-##### `APT_INCLUDES_LATE`=""
-A comma-separated list of additional packages to be installed by apt after bootstrapping and after APT sources are set up. This is useful for packages with pre-depends, which debootstrap do not handle well.
+## Supported parameters and settings
+#### APT settings:
+|Option|Value|default value|value format|desciption|
+|---|---|---|---|---|
+|APT_SERVER|string|ftp.debian.org|`URL`|Set Debian packages server address. Choose a server from the list of Debian worldwide [mirror sites](https://www.debian.org/mirror/list). Using a nearby server will probably speed-up all required downloads within the bootstrapping process.|
+|APT_PROXY|string||`URL`|Set Proxy server address. Using a local Proxy-Cache like `apt-cacher-ng` will speed-up the bootstrapping process because all required Debian packages will only be downloaded from the Debian mirror site once. If `apt-cacher-ng` is running on default `http://127.0.0.1:3142` it is autodetected and you don't need to set this.|
+|KEEP_APT_PROXY|boolean|false|`true`\|`false`|true=Keep the APT_PROXY settings used in the bootsrapping process in the generated image|
+|APT_INCLUDES|string list||`packageA`,`packageB`,...|A comma-separated list of additional packages to be installed by debootstrap during bootstrapping.|
+|APT_INCLUDES_LATE|string list||`packageA`,`packageB`,...|A comma-separated list of additional packages to be installed by apt after bootstrapping and after APT sources are set up. This is useful for packages with pre-depends, which debootstrap do not handle well.|
+|APT_EXCLUDES|string list||`packageA`,`packageB`,...|A comma-separated list of packages to exclude. Use carefully|
---
#### General system settings:
-##### `SET_ARCH`=32
-Set Architecture to default 32bit. If you want to compile 64-bit (RPI3/RPI3+/RPI4) set it to `64`. This option will set every needed cross-compiler or board specific option for a successful build.
-
-##### `RPI_MODEL`=2
-Specify the target Raspberry Pi hardware model. The script at this time supports the following Raspberry Pi models:
-- `0` = Raspberry Pi 0 and Raspberry Pi 0 W
-- `1` = Raspberry Pi 1 model A and B
-- `1P` = Raspberry Pi 1 model B+ and A+
-- `2` = Raspberry Pi 2 model B
-- `3` = Raspberry Pi 3 model B
-- `3P` = Raspberry Pi 3 model B+
-- `4` = Raspberry Pi 4 model B
-
-##### `RELEASE`="buster"
-Set the desired Debian release name. The script at this time supports the bootstrapping of the Debian releases `stretch` and `buster`.
-
-##### `RELEASE_ARCH`="armhf"
-Set the desired Debian release architecture.
-
-##### `HOSTNAME`="rpi$RPI_MODEL-$RELEASE"
-Set system hostname. It's recommended that the hostname is unique in the corresponding subnet.
-
-##### `PASSWORD`="raspberry"
-Set system `root` password. It's **STRONGLY** recommended that you choose a custom password.
-
-##### `USER_PASSWORD`="raspberry"
-Set password for the created non-root user `USER_NAME`=pi. Ignored if `ENABLE_USER`=false. It's **STRONGLY** recommended that you choose a custom password.
-
-##### `DEFLOCAL`="en_US.UTF-8"
-Set default system locale. This setting can also be changed inside the running OS using the `dpkg-reconfigure locales` command. Please note that on using this parameter the script will automatically install the required packages `locales`, `keyboard-configuration` and `console-setup`.
+|Option|Value|default value|value format|desciption|
+|---|---|---|---|---|
+|SET_ARCH|integer|32|`32`\|`64`|Set Architecture to default 32bit. If you want to compile 64-bit (RPI3/RPI3+/RPI4) set it to `64`. This option will set every needed cross-compiler or board specific option for a successful build.|
+|RPI_MODEL|string|3P|`0`\|`1`\|`1P`\|`2`\|`3`\|`3P`\|`4`|Set Architecture. This option will set most build options accordingly. Specify the target Raspberry Pi hardware model.|
+|RELEASE|string|buster|`jessie`\|`buster`\|`stretch`
\|`bullseye`\|`testing`\|`stable`
\|`oldstable`|Set the desired Debian release name. The script at this time supports the bootstrapping of the Debian releases `stretch` and `buster`.|
+|HOSTNAME|string|RPI_MODEL-RELEASE(e.g. RPI3-buster)|`SomeImageName.img`|Set system hostname. It's recommended that the hostname is unique in the corresponding subnet.|
+|DEFLOCAL|string|en_US.UTF-8|`Locale.Charset`|Set default system locale. This setting can also be changed inside the running OS using the `dpkg-reconfigure locales` command. Please note that on using this parameter the script will automatically install the required packages `locales`, `keyboard-configuration` and `console-setup`.|
+|TIMEZONE|string|Europe/Berlin|`Timezone`|Set default system timezone. All available timezones can be found in the `/usr/share/zoneinfo/` directory. This setting can also be changed inside the running OS using the `dpkg-reconfigure tzdata` command.|
+|EXPANDROOT|boolean|true|`true`\|`false`|true=Expand the root partition and filesystem automatically on first boot|
-##### `TIMEZONE`="Europe/Berlin"
-Set default system timezone. All available timezones can be found in the `/usr/share/zoneinfo/` directory. This setting can also be changed inside the running OS using the `dpkg-reconfigure tzdata` command.
-
-##### `EXPANDROOT`=true
-Expand the root partition and filesystem automatically on first boot.
-
-##### `ENABLE_DPHYSSWAP`=true
-Enable swap. The size of the swapfile is chosen relative to the size of the root partition. It'll use the `dphys-swapfile` package for that.
+---
-##### `ENABLE_QEMU`=false
-Generate kernel (`vexpress_defconfig`), file system image (`qcow2`) and DTB files that can be used for QEMU full system emulation (`vexpress-A15`). The output files are stored in the `$(pwd)/images/qemu` directory. You can find more information about running the generated image in the QEMU section of this readme file.
+#### User settings:
+|Option|Value|default value|desciption|
+|---|---|---|---|
+|ENABLE_ROOT|boolean|false|true=root login if ROOT_PASSWORD is set|
+|ROOT_PASSWORD|string|raspberry|Set password for `root` user. It's **STRONGLY** recommended that you choose a custom password.|
+|ENABLE_USER|boolean|true|true=Create non-root user with password `USER_PASSWORD` and username `USER_NAME`|
+|USER_NAME|string|pi|Set username for non-root user, if `ENABLE_USER` is true|
+|USER_PASSWORD|string|raspberry|Set password for non-root user, if `ENABLE_USER` is true. It's **STRONGLY** recommended that you choose a custom password.|
---
#### Keyboard settings:
+
These options are used to configure keyboard layout in `/etc/default/keyboard` for console and Xorg. These settings can also be changed inside the running OS using the `dpkg-reconfigure keyboard-configuration` command.
-##### `XKB_MODEL`=""
-Set the name of the model of your keyboard type.
+|Option|Value|default value|value format|desciption|
+|---|---|---|---|---|
+|XKB_MODEL|string||`pc104`|Set the name of the model of your keyboard type|
+|XKB_LAYOUT|string||`us`|Set the supported keyboard layout(s)|
+|XKB_VARIANT|string||`basic`|Set the supported variant(s) of the keyboard layout(s)|
+|XKB_OPTIONS|string||`grp:alt_shift_toggle`|Set extra xkb configuration options|
-##### `XKB_LAYOUT`=""
-Set the supported keyboard layout(s).
+---
+
+#### Networking settings:
+ethernet setting go to `/etc/systemd/network/eth0.network`.
+wifi settings go to `/etc/systemd/network/wlan0.network`.
-##### `XKB_VARIANT`=""
-Set the supported variant(s) of the keyboard layout(s).
+The default location of network configuration files in the Debian `stretch` release was changed to `/lib/systemd/network`.`
-##### `XKB_OPTIONS`=""
-Set extra xkb configuration options.
+|Option|Value|default value|desciption|
+|---|---|---|---|
+|ENABLE_IPV6|boolean|true|true=Enable IPv6 support via systemd-networkd|
+|ENABLE_WIRELESS|boolean|false|true=Download and install the [closed-source firmware binary blob](https://github.com/RPi-Distro/firmware-nonfree/raw/master/brcm) that is required to run the internal wireless interface of the Raspberry Pi model `3`. This parameter is ignored if the specified `RPI_MODEL` is not `0`,`3`,`3P`,`4`|
+|ENABLE_IPTABLES|boolean|false|true=Enable iptables IPv4/IPv6 firewall. Simplified ruleset: Allow all outgoing connections. Block all incoming connections except to OpenSSH service.|
+|ENABLE_HARDNET|boolean|false|true=Enable IPv4/IPv6 network stack hardening settings|
+|ENABLE_IFNAMES|boolean|true|true=creates complex and long interface names like e.g. encx8945924. Enable automatic assignment of predictable, stable network interface names for all NICs|
---
#### Networking settings (DHCP):
-This parameter is used to set up networking auto-configuration in `/etc/systemd/network/eth.network`. The default location of network configuration files in the Debian `stretch` release was changed to `/lib/systemd/network`.`
-##### `ENABLE_DHCP`=true
-Set the system to use DHCP. This requires an DHCP server.
+
+|Option|Value|default value|desciption|
+|---|---|---|---|
+|ENABLE_ETH_DHCP|boolean|true|Set the system to use DHCP on wired interface. This requires an DHCP server|
+|ENABLE_WIFI_DHCP|boolean|true|Set the system to use DHCP on wifi interface. This requires an DHCP server. Requires ENABLE_WIRELESS|
---
-#### Networking settings (static):
-These parameters are used to set up a static networking configuration in `/etc/systemd/network/eth.network`. The following static networking parameters are only supported if `ENABLE_DHCP` was set to `false`. The default location of network configuration files in the Debian `stretch` release was changed to `/lib/systemd/network`.
+#### Networking settings (ethernet static):
+The following static networking parameters are only supported if `ENABLE_ETH_DHCP` was set to `false`.
-##### `NET_ADDRESS`=""
-Set a static IPv4 or IPv6 address and its prefix, separated by "/", eg. "192.169.0.3/24".
+|Option|Value|value format|desciption|
+|---|---|---|---|
+|NET_ETH_ADDRESS|string|`CIDR`|static IPv4 or IPv6 address and its prefix, separated by "/", eg. "192.169.0.3/24"|
+|NET_ETH_GATEWAY|string|`IP`|default gateway|
+|NET_ETH_DNS_1|string|`IP`|first DNS server|
+|NET_ETH_DNS_2|string|`IP`|second DNS server|
+|NET_ETH_DNS_DOMAINS|string|`example.local`|default DNS search domains to use for non fully qualified hostnames|
+|NET_ETH_NTP_1|string|`IP`|first NTP server|
+|NET_ETH_NTP_2|string|`IP`|second NTP server|
-##### `NET_GATEWAY`=""
-Set the IP address for the default gateway.
+---
-##### `NET_DNS_1`=""
-Set the IP address for the first DNS server.
+#### Networking settings (WIFI):
-##### `NET_DNS_2`=""
-Set the IP address for the second DNS server.
+|Option|Value|value format|desciption|
+|---|---|---|---|
+|NET_WIFI_SSID|string|`yourwifiname`|WIFI SSID|
+|NET_WIFI_PSK|string|`yourwifikeytojoinnetwork`|WPA/WPA2 PSK|
-##### `NET_DNS_DOMAINS`=""
-Set the default DNS search domains to use for non fully qualified hostnames.
+---
-##### `NET_NTP_1`=""
-Set the IP address for the first NTP server.
+#### Networking settings (WIFI static):
+The following static networking parameters are only supported if `ENABLE_WIFI_DHCP` was set to `false`.
-##### `NET_NTP_2`=""
-Set the IP address for the second NTP server.
+|Option|Value|value format|desciption|
+|---|---|---|---|
+|NET_WIFI_ADDRESS|string|`CIDR`|static IPv4 or IPv6 address and its prefix, separated by "/", eg. "192.169.0.3/24"|
+|NET_WIFI_GATEWAY|string|`IP`|default gateway|
+|NET_WIFI_DNS_1|string|`IP`|first DNS server|
+|NET_WIFI_DNS_2|string|`IP`|second DNS server|
+|NET_WIFI_DNS_DOMAINS|string|`example.local`|default DNS search domains to use for non fully qualified hostnames|
+|NET_WIFI_NTP_1|string|`IP`|first NTP server|
+|NET_WIFI_NTP_2|string|`IP`|second NTP server|
---
#### Basic system features:
-##### `ENABLE_CONSOLE`=true
-Enable serial console interface. Recommended if no monitor or keyboard is connected to the RPi2/3. In case of problems fe. if the network (auto) configuration failed - the serial console can be used to access the system. On RPI `0` `3` `3P` the CPU speed is locked at lowest speed.
-
-##### `ENABLE_PRINTK`=false
-Enables printing kernel messages to konsole. printk is `3 4 1 3` as in raspbian.
-
-##### `ENABLE_BLUETOOTH`=false
-Enable onboard Bluetooth interface on the RPi0/3/3P. See: [Configuring the GPIO serial port on Raspbian jessie and stretch](https://spellfoundry.com/2016/05/29/configuring-gpio-serial-port-raspbian-jessie-including-pi-3/).
-
-##### `ENABLE_MINIUART_OVERLAY`=false
-Enable Bluetooth to use this. Adds overlay to swap UART0 with UART1. Enabling (slower) Bluetooth and full speed serial console. - RPI `0` `3` `3P` have a fast `hardware UART0` (ttyAMA0) and a `mini UART1` (ttyS0)! RPI `1` `1P` `2` only have a `hardware UART0`. `UART0` is considered better, because is faster and more stable than `mini UART1`. By default the Bluetooth modem is mapped to the `hardware UART0` and `mini UART` is used for console. The `mini UART` is a problem for the serial console, because its baudrate depends on the CPU frequency, which is changing on runtime. Resulting in a volatile baudrate and thus in an unusable serial console.
-
-##### `ENABLE_TURBO`=false
-Enable Turbo mode. This setting locks cpu at the highest frequency. As setting ENABLE_CONSOLE=true locks RPI to lowest CPU speed, this is can be used additionally to lock cpu hat max speed. Need a good power supply and probably cooling for the Raspberry PI.
-
-##### `ENABLE_I2C`=false
-Enable I2C interface on the RPi 0/1/2/3. Please check the [RPi 0/1/2/3 pinout diagrams](https://elinux.org/RPi_Low-level_peripherals) to connect the right GPIO pins.
-
-##### `ENABLE_SPI`=false
-Enable SPI interface on the RPi 0/1/2/3. Please check the [RPi 0/1/2/3 pinout diagrams](https://elinux.org/RPi_Low-level_peripherals) to connect the right GPIO pins.
-##### `ENABLE_IPV6`=true
-Enable IPv6 support. The network interface configuration is managed via systemd-networkd.
-
-##### `ENABLE_SSHD`=true
-Install and enable OpenSSH service. The default configuration of the service doesn't allow `root` to login. Please use the user `pi` instead and `su -` or `sudo` to execute commands as root.
-
-##### `ENABLE_NONFREE`=false
-Allow the installation of non-free Debian packages that do not comply with the DFSG. This is required to install closed-source firmware binary blobs.
-
-##### `ENABLE_WIRELESS`=false
-Download and install the [closed-source firmware binary blob](https://github.com/RPi-Distro/firmware-nonfree/raw/master/brcm) that is required to run the internal wireless interface of the Raspberry Pi model `3`. This parameter is ignored if the specified `RPI_MODEL` is not `3`.
-
-##### `ENABLE_RSYSLOG`=true
-If set to false, disable and uninstall rsyslog (so logs will be available only in journal files)
-
-##### `ENABLE_SOUND`=true
-Enable sound hardware and install Advanced Linux Sound Architecture.
-
-##### `ENABLE_HWRANDOM`=true
-Enable Hardware Random Number Generator. Strong random numbers are important for most network-based communications that use encryption. It's recommended to be enabled.
-
-##### `ENABLE_MINGPU`=false
-Minimize the amount of shared memory reserved for the GPU. It doesn't seem to be possible to fully disable the GPU.
-
-##### `ENABLE_DBUS`=true
-Install and enable D-Bus message bus. Please note that systemd should work without D-bus but it's recommended to be enabled.
-
-##### `ENABLE_XORG`=false
-Install Xorg open-source X Window System.
-
-##### `ENABLE_WM`=""
-Install a user-defined window manager for the X Window System. To make sure all X related package dependencies are getting installed `ENABLE_XORG` will automatically get enabled if `ENABLE_WM` is used. The `rpi23-gen-image.sh` script has been tested with the following list of window managers: `blackbox`, `openbox`, `fluxbox`, `jwm`, `dwm`, `xfce4`, `awesome`.
-
-##### `ENABLE_SYSVINIT`=false
-Support for halt,init,poweroff,reboot,runlevel,shutdown,telinit commands
+|Option|Value|default value|value format|desciption|
+|---|---|---|---|---|
+|ENABLE_CONSOLE|boolean|false|`true`\|`false`|true=Enable serial console interface.Recommended if no monitor or keyboard is connected to the RPi2/3. In case of problems fe. if the network (auto) configuration failed - the serial console can be used to access the system. On RPI `0` `3` `3P` the CPU speed is locked at lowest speed.|
+|ENABLE_PRINTK|boolean|false|`true`\|`false`|true=Enables printing kernel messages to konsole. printk is `3 4 1 3` as in raspbian|
+|ENABLE_BLUETOOTH|boolean|false|`true`\|`false`|true=Enable onboard Bluetooth interface on the RPi0/3/3P. See: [Configuring the GPIO serial port on Raspbian jessie and stretch](https://spellfoundry.com/2016/05/29/configuring-gpio-serial-port-raspbian-jessie-including-pi-3/)|
+|ENABLE_MINIUART_OVERLAY|boolean|false|`true`\|`false`|true=Enable Bluetooth to use this. Adds overlay to swap UART0 with UART1. Enabling (slower) Bluetooth and full speed serial console. - RPI `0` `3` `3P` have a fast `hardware UART0` (ttyAMA0) and a `mini UART1` (ttyS0)! RPI `1` `1P` `2` only have a `hardware UART0`. `UART0` is considered better, because is faster and more stable than `mini UART1`. By default the Bluetooth modem is mapped to the `hardware UART0` and `mini UART` is used for console. The `mini UART` is a problem for the serial console, because its baudrate depends on the CPU frequency, which is changing on runtime. Resulting in a volatile baudrate and thus in an unusable serial console.|
+|ENABLE_TURBO|boolean|false|`true`\|`false`|true=Enable Turbo mode. This setting locks cpu at the highest frequency. As setting ENABLE_CONSOLE=true locks RPI to lowest CPU speed, this is can be used additionally to lock cpu hat max speed. Need a good power supply and probably cooling for the Raspberry PI|
+|ENABLE_I2C|boolean|true|`true`\|`false`|true=Enable I2C interface on the RPi 0/1/2/3. Please check the [RPi 0/1/2/3 pinout diagrams](https://elinux.org/RPi_Low-level_peripherals) to connect the right GPIO pins|
+|ENABLE_SPI|boolean|true|`true`\|`false`|true=Enable SPI interface on the RPi 0/1/2/3. Please check the [RPi 0/1/2/3 pinout diagrams](https://elinux.org/RPi_Low-level_peripherals) to connect the right GPIO pins|
+|SSH_ENABLE|boolean|true|`true`\|`false`|Install and enable OpenSSH service. The default configuration of the service doesn't allow `root` to login. Please use the user `pi` instead and `su -` or `sudo` to execute commands as root|
+|ENABLE_NONFREE|boolean|false|`true`\|`false`|true=enable non-free\|false=disable non free. Edits /etc/apt/sources.list in your resulting image|
+|ENABLE_RSYSLOG|boolean|false|`true`\|`false`|true=keep rsyslog\|false=remove rsyslog. If rsyslog is removed (false), logs will be available only in journal files)|
+|ENABLE_SOUND|boolean|false|`true`\|`false`|true=Enable sound\|false=Disable sound|
+|ENABLE_HWRANDOM|boolean|true|`true`\|`false`|true=Enable Hardware Random Number Generator(RNG)\|false=Disable Hardware RNG\|Strong random numbers are important for most network-based communications that use encryption. It's recommended to be enabled|
+|ENABLE_MINGPU|boolean|false|`true`\|`false`|true=GPU 16MB RAM\|false=64MB RAM\|Minimize the amount of shared memory reserved for the GPU. It doesn't seem to be possible to fully disable the GPU. Also removes start.elf,fixup.dat,start_x.elf,fixup_x.dat form /boot|
+|ENABLE_XORG|boolean|false|`true`\|`false`|true=Install Xorg X Window System|\false=install no Xorg|
+|ENABLE_WM|string||`blackbox`, `openbox`, `fluxbox`,
`jwm`, `dwm`, `xfce4`, `awesome`|Install a user-defined window manager for the X Window System. To make sure all X related package dependencies are getting installed `ENABLE_XORG` will automatically set true if `ENABLE_WM` is used|
+|ENABLE_SYSVINIT|boolean|false|`true`\|`false`|true=Support for halt,init,poweroff,reboot,runlevel,shutdown,init commands\|false=use systemd commands|
+|ENABLE_SPLASH|boolean|true|`true`\|`false`|true=Enable default Raspberry Pi boot up rainbow splash screen|
+|ENABLE_LOGO|boolean|true|`true`\|`false`|true=Enable default Raspberry Pi console logo (image of four raspberries in the top left corner)|
+|ENABLE_SILENT_BOOT|boolean|false|`true`\|`false`|true=Set the verbosity of console messages shown during boot up to a strict minimum|
+|DISABLE_UNDERVOLT_WARNINGS|integer||`1`\|`2`|Unset to keep default behaviour. Setting the parameter to `1` will disable the warning overlay. Setting it to `2` will additionally allow RPi2/3 turbo mode when low-voltage is present|
---
#### Advanced system features:
-##### `ENABLE_KEYGEN`=false
-Recover your lost codec license
-
-##### `ENABLE_SYSTEMDSWAP`=false
-Enables [Systemd-swap service](https://github.com/Nefelim4ag/systemd-swap). Usefull if `KERNEL_ZSWAP` is enabled.
-
-##### `ENABLE_MINBASE`=false
-Use debootstrap script variant `minbase` which only includes essential packages and apt. This will reduce the disk usage by about 65 MB.
-
-##### `ENABLE_REDUCE`=false
-Reduce the disk space usage by deleting packages and files. See `REDUCE_*` parameters for detailed information.
-
-##### `ENABLE_UBOOT`=false
-Replace the default RPi 0/1/2/3 second stage bootloader (bootcode.bin) with [U-Boot bootloader](https://git.denx.de/?p=u-boot.git;a=summary). U-Boot can boot images via the network using the BOOTP/TFTP protocol.
-RPI4 needs tbd
-
-##### `UBOOTSRC_DIR`=""
-Path to a directory (`u-boot`) of [U-Boot bootloader sources](https://git.denx.de/?p=u-boot.git;a=summary) that will be copied, configured, build and installed inside the chroot.
-
-##### `ENABLE_FBTURBO`=false
-Install and enable the [hardware accelerated Xorg video driver](https://github.com/ssvb/xf86-video-fbturbo) `fbturbo`. Please note that this driver is currently limited to hardware accelerated window moving and scrolling.
-
-##### `FBTURBOSRC_DIR`=""
-Path to a directory (`xf86-video-fbturbo`) of [hardware accelerated Xorg video driver sources](https://github.com/ssvb/xf86-video-fbturbo) that will be copied, configured, build and installed inside the chroot.
-
-##### `ENABLE_VIDEOCORE`=false
-Install and enable the [ARM side libraries for interfacing to Raspberry Pi GPU](https://github.com/raspberrypi/userland) `vcgencmd`. Please note that this driver is currently limited to hardware accelerated window moving and scrolling.
-
-##### `VIDEOCORESRC_DIR`=""
-Path to a directory (`userland`) of [ARM side libraries for interfacing to Raspberry Pi GPU](https://github.com/raspberrypi/userland) that will be copied, configured, build and installed inside the chroot.
-
-##### `ENABLE_NEXMON`=false
-Install and enable the [Source code for a C-based firmware patching framework for Broadcom/Cypress WiFi chips that enables you to write your own firmware patches, for example, to enable monitor mode with radiotap headers and frame injection](https://github.com/seemoo-lab/nexmon.git).
-
-##### `NEXMONSRC_DIR`=""
-Path to a directory (`nexmon`) of [Source code for ARM side libraries for interfacing to Raspberry Pi GPU](https://github.com/raspberrypi/userland) that will be copied, configured, build and installed inside the chroot.
-
-##### `ENABLE_IPTABLES`=false
-Enable iptables IPv4/IPv6 firewall. Simplified ruleset: Allow all outgoing connections. Block all incoming connections except to OpenSSH service.
-
-##### `ENABLE_USER`=true
-Create non-root user with password `USER_PASSWORD`=raspberry. Unless overridden with `USER_NAME`=user, the username will be `pi`.
-
-##### `USER_NAME`=pi
-Non-root user to create. Ignored if `ENABLE_USER`=false
-
-##### `ENABLE_ROOT`=false
-Set root user password so root login will be enabled
-
-##### `ENABLE_HARDNET`=false
-Enable IPv4/IPv6 network stack hardening settings.
-
-##### `ENABLE_SPLITFS`=false
-Enable having root partition on an USB drive by creating two image files: one for the `/boot/firmware` mount point, and another for `/`.
-##### `CHROOT_SCRIPTS`=""
-Path to a directory with scripts that should be run in the chroot before the image is finally built. Every executable file in this directory is run in lexicographical order.
-
-##### `ENABLE_INITRAMFS`=false
-Create an initramfs that that will be loaded during the Linux startup process. `ENABLE_INITRAMFS` will automatically get enabled if `ENABLE_CRYPTFS`=true. This parameter will be ignored if `BUILD_KERNEL`=false.
-
-##### `ENABLE_IFNAMES`=true
-Enable automatic assignment of predictable, stable network interface names for all local Ethernet, WLAN interfaces. This might create complex and long interface names.
-
-##### `ENABLE_SPLASH`=true
-Enable default Raspberry Pi boot up rainbow splash screen.
-
-##### `ENABLE_LOGO`=true
-Enable default Raspberry Pi console logo (image of four raspberries in the top left corner).
-
-##### `ENABLE_SILENT_BOOT`=false
-Set the verbosity of console messages shown during boot up to a strict minimum.
-
-##### `DISABLE_UNDERVOLT_WARNINGS`=
-Disable RPi2/3 under-voltage warnings and overlays. Setting the parameter to `1` will disable the warning overlay. Setting it to `2` will additionally allow RPi2/3 turbo mode when low-voltage is present.
+|Option|Value|default value|value format|desciption|
+|---|---|---|---|---|
+|ENABLE_DPHYSSWAP|boolean|true|`true`\|`false`|Enable swap. The size of the swapfile is chosen relative to the size of the root partition. It'll use the `dphys-swapfile` package for that|
+|ENABLE_SYSTEMDSWAP|boolean|false|`true`\|`false`|Enables [Systemd-swap service](https://github.com/Nefelim4ag/systemd-swap). Usefull if `KERNEL_ZSWAP` is enabled|
+|ENABLE_QEMU|boolean|false|`true`\|`false`|Generate kernel (`vexpress_defconfig`), file system image (`qcow2`) and DTB files that can be used for QEMU full system emulation (`vexpress-A15`). The output files are stored in the `$(pwd)/images/qemu` directory. You can find more information about running the generated image in the QEMU section of this readme file|
+|QEMU_BINARY|string||`FullPathToQemuBinaryFile`|Sets the QEMU enviornment for the Debian archive. **Set by RPI_MODEL**|
+|ENABLE_KEYGEN|boolean|false|`true`\|`false`|Recover your lost codec license|
+|ENABLE_MINBASE|boolean|false|`true`\|`false`|Use debootstrap script variant `minbase` which only includes essential packages and apt. This will reduce the disk usage by about 65 MB|
+|ENABLE_SPLITFS|boolean|false|`true`\|`false`|Enable having root partition on an USB drive by creating two image files: one for the `/boot/firmware` mount point, and another for `/`|
+|ENABLE_INITRAMFS|boolean|false|`true`\|`false`|Create an initramfs that that will be loaded during the Linux startup process. `ENABLE_INITRAMFS` will automatically get enabled if `ENABLE_CRYPTFS`=true. This parameter will be ignored if `BUILD_KERNEL`=false|
+|ENABLE_DBUS|boolean|true|`true`\|`false`|Install and enable D-Bus message bus. Please note that systemd should work without D-bus but it's recommended to be enabled|
+|ENABLE_USBBOOT|boolean|false|`true`\|`false`|true=prepare image for usbboot. use with `ENABLE_SPLTFS`=true|
+|CHROOT_SCRIPTS|string||`FullPathToScriptFolder`|Full path to a directory with scripts that should be run in the chroot before the image is finally built. Every executable file in this directory is run in lexicographical order|
+|ENABLE_UBOOT|boolean|false|`true`\|`false`|Replace the default RPi 0/1/2/3 second stage bootloader (bootcode.bin) with [U-Boot bootloader](https://git.denx.de/?p=u-boot.git;a=summary). U-Boot can boot images via the network using the BOOTP/TFTP protocol. RPI4 needs tbd|
+|UBOOTSRC_DIR|string||`FullPathToUBootFolder`|Full path to a directory named `u-boot` of [U-Boot bootloader sources](https://git.denx.de/?p=u-boot.git;a=summary) that will be copied, configured, build and installed inside the chroot|
+|ENABLE_FBTURBO|boolean|false|`true`\|`false`|Install and enable the [hardware accelerated Xorg video driver](https://github.com/ssvb/xf86-video-fbturbo) `fbturbo`. Please note that this driver is currently limited to hardware accelerated window moving and scrolling|
+|FBTURBOSRC_DIR|string||`FullPathToFbTurboFolder`|Full path to a directory named `xf86-video-fbturbo` of [hardware accelerated Xorg video driver sources](https://github.com/ssvb/xf86-video-fbturbo) that will be copied, configured, build and installed inside the chroot|
+|ENABLE_VIDEOCORE|boolean|false|`true`\|`false`|Install and enable the [ARM side libraries for interfacing to Raspberry Pi GPU](https://github.com/raspberrypi/userland) `vcgencmd`. Please note that this driver is currently limited to hardware accelerated window moving and scrolling|
+|VIDEOCORESRC_DIR|string||`FullPathToVideoSrcFolder`|Full path to a directory named `userland` of [ARM side libraries for interfacing to Raspberry Pi GPU](https://github.com/raspberrypi/userland) that will be copied, configured, build and installed inside the chroot|
+|ENABLE_NEXMON|boolean|false|`true`\|`false`|Install and enable the source code for a C-based firmware patching framework for Broadcom/Cypress WiFi chips that enables you to write your own firmware patches, for example, to enable monitor mode with radiotap headers and frame injection](https://github.com/seemoo-lab/nexmon.git)|
+|NEXMONSRC_DIR|string||`FullPathToNexmonFolder`|Full path to a directory named `nexmon` of [Source code for ARM side libraries for interfacing to Raspberry Pi GPU](https://github.com/raspberrypi/userland) that will be copied, configured, build and installed inside the chroot|
---
#### SSH settings:
-##### `SSH_ENABLE_ROOT`=false
-Enable password-based root login via SSH. This may be a security risk with the default password set, use only in trusted environments. `ENABLE_ROOT` must be set to `true`.
-
-##### `SSH_DISABLE_PASSWORD_AUTH`=false
-Disable password-based SSH authentication. Only public key based SSH (v2) authentication will be supported.
-##### `SSH_LIMIT_USERS`=false
-Limit the users that are allowed to login via SSH. Only allow user `USER_NAME`=pi and root if `SSH_ENABLE_ROOT`=true to login. This parameter will be ignored if `dropbear` SSH is used (`REDUCE_SSHD`=true).
-
-##### `SSH_ROOT_PUB_KEY`=""
-Add SSH (v2) public key(s) from specified file to `authorized_keys` file to enable public key based SSH (v2) authentication of user `root`. The specified file can also contain multiple SSH (v2) public keys. SSH protocol version 1 is not supported. `ENABLE_ROOT` **and** `SSH_ENABLE_ROOT` must be set to `true`.
-
-##### `SSH_USER_PUB_KEY`=""
-Add SSH (v2) public key(s) from specified file to `authorized_keys` file to enable public key based SSH (v2) authentication of user `USER_NAME`=pi. The specified file can also contain multiple SSH (v2) public keys. SSH protocol version 1 is not supported.
+|Option|Value|default value|value format|desciption|
+|---|---|---|---|---|
+|SSH_ENABLE_ROOT|boolean|false|`true`\|`false`|Enable password-based root login via SSH. This may be a security risk with the default password set, use only in trusted environments. `ENABLE_ROOT` must be set to `true`|
+|SSH_DISABLE_PASSWORD_AUTH|boolean|false|`true`\|`false`|Disable password-based SSH authentication. Only public key based SSH (v2) authentication will be supported|
+|SSH_LIMIT_USERS|boolean|false|`true`\|`false`|Limit the users that are allowed to login via SSH. Only allow user `USER_NAME`=pi and root if `SSH_ENABLE_ROOT`=true to login. This parameter will be ignored if `dropbear` SSH is used (`REDUCE_SSHD`=true)|
+|SSH_ROOT_PUB_KEY|string||`PathToYourROOT`
`RSAPublicKeyFile`|Full path to file. Add SSH (v2) public key(s) from specified file to `authorized_keys` file to enable public key based SSH (v2) authentication of user `root`. The specified file can also contain multiple SSH (v2) public keys. SSH protocol version 1 is not supported. `ENABLE_ROOT` **and** `SSH_ENABLE_ROOT` must be set to `true`|
+|SSH_USER_PUB_KEY|string||`PathToYourUSER`
`RSAPublicKeyFile`|Full path to file. Add SSH (v2) public key(s) from specified file to `authorized_keys` file to enable public key based SSH (v2) authentication of user `USER_NAME`=pi. The specified file can also contain multiple SSH (v2) public keys. SSH protocol version 1 is not supported|
---
-#### Kernel compilation:
-##### `BUILD_KERNEL`=true
-Build and install the latest RPi 0/1/2/3/4 Linux kernel. The default RPi 0/1/2/3/ kernel configuration is used most of the time.
-ENABLE_NEXMON - Changes Kernel Source to [https://github.com/Re4son/](Kali Linux Kernel)
-Precompiled 32bit kernel for RPI0/1/2/3 by [https://github.com/hypriot/](hypriot)
-Precompiled 64bit kernel for RPI3/4 by [https://github.com/sakaki-/](sakaki)
-
-
-##### `CROSS_COMPILE`="arm-linux-gnueabihf-"
-This sets the cross-compile environment for the compiler.
-
-##### `KERNEL_ARCH`="arm"
-This sets the kernel architecture for the compiler.
-
-##### `KERNEL_IMAGE`="kernel7.img"
-Name of the image file in the boot partition. If not set, `KERNEL_IMAGE` will be set to "kernel8.img" automatically if building for arm64.
-
-##### `KERNEL_BRANCH`=""
-Name of the requested branch from the GIT location for the RPi Kernel. Default is using the current default branch from the GIT site.
-
-##### `QEMU_BINARY`="/usr/bin/qemu-arm-static"
-Sets the QEMU enviornment for the Debian archive. If not set, `QEMU_BINARY` will be set to "/usr/bin/qemu-aarch64-static" automatically if building for arm64.
-
-##### `KERNEL_DEFCONFIG`="bcm2709_defconfig"
-Sets the default config for kernel compiling. If not set, `KERNEL_DEFCONFIG` will be set to "bcmrpi3\_defconfig" automatically if building for arm64.
-
-##### `KERNEL_REDUCE`=false
-Reduce the size of the generated kernel by removing unwanted devices, network and filesystem drivers (experimental).
-
-##### `KERNEL_THREADS`=1
-Number of parallel kernel building threads. If the parameter is left untouched the script will automatically determine the number of CPU cores to set the number of parallel threads to speed the kernel compilation.
-
-##### `KERNEL_HEADERS`=true
-Install kernel headers with the built kernel.
-
-##### `KERNEL_MENUCONFIG`=false
-Start `make menuconfig` interactive menu-driven kernel configuration. The script will continue after `make menuconfig` was terminated.
-
-##### `KERNEL_OLDDEFCONFIG`=false
-Run `make olddefconfig` to automatically set all new kernel configuration options to their recommended default values.
-
-##### `KERNEL_CCACHE`=false
-Compile the kernel using ccache. This speeds up kernel recompilation by caching previous compilations and detecting when the same compilation is being done again.
-
-##### `KERNEL_REMOVESRC`=true
-Remove all kernel sources from the generated OS image after it was built and installed.
-
-##### `KERNELSRC_DIR`=""
-Path to a directory (`linux`) of [RaspberryPi Linux kernel sources](https://github.com/raspberrypi/linux) that will be copied, configured, build and installed inside the chroot.
-
-##### `KERNELSRC_CLEAN`=false
-Clean the existing kernel sources directory `KERNELSRC_DIR` (using `make mrproper`) after it was copied to the chroot and before the compilation of the kernel has started. This parameter will be ignored if no `KERNELSRC_DIR` was specified or if `KERNELSRC_PREBUILT`=true.
-
-##### `KERNELSRC_CONFIG`=true
-Run `make bcm2709_defconfig` (and optional `make menuconfig`) to configure the kernel sources before building. This parameter is automatically set to `true` if no existing kernel sources directory was specified using `KERNELSRC_DIR`. This parameter is ignored if `KERNELSRC_PREBUILT`=true.
-
-##### `KERNELSRC_USRCONFIG`=""
-Copy own config file to kernel `.config`. If `KERNEL_MENUCONFIG`=true then running after copy.
-
-##### `KERNELSRC_PREBUILT`=false
-With this parameter set to true the script expects the existing kernel sources directory to be already successfully cross-compiled. The parameters `KERNELSRC_CLEAN`, `KERNELSRC_CONFIG`, `KERNELSRC_USRCONFIG` and `KERNEL_MENUCONFIG` are ignored and no kernel compilation tasks are performed.
-
-##### `RPI_FIRMWARE_DIR`=""
-The directory (`firmware`) containing a local copy of the firmware from the [RaspberryPi firmware project](https://github.com/raspberrypi/firmware). Default is to download the latest firmware directly from the project.
-
-##### `KERNEL_DEFAULT_GOV`="ONDEMAND"
-Set the default cpu governor at kernel compilation. Supported values are: PERFORMANCE POWERSAVE USERSPACE ONDEMAND CONSERVATIVE SCHEDUTIL
-
-##### `KERNEL_NF`=false
-Enable Netfilter modules as kernel modules
-
-##### `KERNEL_VIRT`=false
-Enable Kernel KVM support (/dev/kvm)
-
-##### `KERNEL_ZSWAP`=false
-Enable Kernel Zswap support. Best use on high RAM load and mediocre CPU load usecases
-
-##### `KERNEL_BPF`=true
-Allow attaching eBPF programs to a cgroup using the bpf syscall (CONFIG_BPF_SYSCALL CONFIG_CGROUP_BPF) [systemd compilations about it - File /lib/systemd/system/systemd-journald.server:36 configures an IP firewall (IPAddressDeny=all), but the local system does not support BPF/cgroup based firewalls]
-
-##### `KERNEL_SECURITY`=false
-Enables Apparmor, integrity subsystem, auditing.
-
-##### `KERNEL_BTRFS`="false"
-enable btrfs kernel support
-
-##### `KERNEL_POEHAT`="false"
-enable Enable RPI POE HAT fan kernel support
-
-##### `KERNEL_NSPAWN`="false"
-Enable per-interface network priority control - for systemd-nspawn
-
-##### `KERNEL_DHKEY`="true"
-Diffie-Hellman operations on retained keys - required for >keyutils-1.6
+#### Kernel settings:
+
+|Option|Value|default value|value format|desciption|
+|---|---|---|---|---|
+|BUILD_KERNEL||true|`true`\|`false`|Build and install the latest RPi 0/1/2/3/4 Linux kernel. The default RPi 0/1/2/3/ kernel configuration is used most of the time. ENABLE_NEXMON - Changes Kernel Source to [https://github.com/Re4son/](Kali Linux Kernel) Precompiled 32bit kernel for RPI0/1/2/3 by [https://github.com/hypriot/](hypriot) Precompiled 64bit kernel for RPI3/4 by [https://github.com/sakaki-/](sakaki)|
+|CROSS_COMPILE|string|||This sets the cross-compile environment for the compiler. Set by RPI_MODEL|
+|KERNEL_ARCH|string|||This sets the kernel architecture for the compiler. Set by RPI_MODEL|
+|KERNEL_IMAGE|string|||Name of the image file in the boot partition. Set by RPI_MODEL|
+|KERNEL_BRANCH|string|||Name of the requested branch from the GIT location for the RPi Kernel. Default is using the current default branch from the GIT site|
+|KERNEL_DEFCONFIG|string|||Sets the default config for kernel compiling. Set by RPI_MODEL|
+|KERNEL_THREADS|integer|1|`1`\|`2`\|`3`\|...|Number of threads to build the kernel. If not set, the script will automatically determine the maximum number of CPU cores to speed up kernel compilation|
+|KERNEL_HEADERS|boolean|true|`true`\|`false`|Install kernel headers with the built kernel|
+|KERNEL_MENUCONFIG|boolean|false|`true`\|`false`|Start `make menuconfig` interactive menu-driven kernel configuration. The script will continue after `make menuconfig` was terminated|
+|KERNEL_OLDDEFCONFIG|boolean|false|`true`\|`false`|Run `make olddefconfig` to automatically set all new kernel configuration options to their recommended default values|
+|KERNEL_CCACHE|boolean|false|`true`\|`false`|Compile the kernel using ccache. This speeds up kernel recompilation by caching previous compilations and detecting when the same compilation is being done again|
+|KERNEL_REMOVESRC|boolean|true|`true`\|`false`|Remove all kernel sources from the generated OS image after it was built and installed|
+|KERNELSRC_DIR|string||`FullPathToKernelSrcDir`|Full path to a directory named `linux` of [RaspberryPi Linux kernel sources](https://github.com/raspberrypi/linux) that will be copied, configured, build and installed inside the chroot|
+|KERNELSRC_CLEAN|boolean|false|`true`\|`false`|Clean the existing kernel sources directory `KERNELSRC_DIR` (using `make mrproper`) after it was copied to the chroot and before the compilation of the kernel has started. This parameter will be ignored if no `KERNELSRC_DIR` was specified or if `KERNELSRC_PREBUILT`=true|
+|KERNELSRC_CONFIG|boolean|true|`true`\|`false`|true=enable custom kernel options. This parameter is automatically set to `true` if no existing kernel sources directory was specified using `KERNELSRC_DIR`. This parameter is ignored if `KERNELSRC_PREBUILT`=true|
+|KERNELSRC_USRCONFIG|string||`FullPathToUserKernel.config`|Copy own config file to kernel `.config`. If `KERNEL_MENUCONFIG`=true then running after copy|
+|KERNELSRC_PREBUILT|boolean|false|`true`\|`false`|With this parameter set to true the script expects the existing kernel sources directory to be already successfully cross-compiled. The parameters `KERNELSRC_CLEAN`, `KERNELSRC_CONFIG`, `KERNELSRC_USRCONFIG` and `KERNEL_MENUCONFIG` are ignored and no kernel compilation tasks are performed|
+|RPI_FIRMWARE_DIR|string||`FullPathToFolder`|Full path to a directory named `firmware`, containing a local copy of the firmware from the [RaspberryPi firmware project](https://github.com/raspberrypi/firmware). Default is to download the latest firmware directly from the project|
+|KERNEL_DEFAULT_GOV|string|ondemand|`performance`\|`powersave`
\|`userspace`\|`ondemand`
\|`conservative`\|`schedutil`|Set the default cpu governor at kernel compilation|
+|KERNEL_NF|boolean|false|`true`\|`false`|Enable Netfilter modules as kernel modules. You want that for iptables|
+|KERNEL_VIRT|boolean|false|`true`\|`false`|Enable Kernel KVM support (/dev/kvm)|
+|KERNEL_ZSWAP|boolean|false|`true`\|`false`|Enable Kernel Zswap support. Best use on high RAM load and mediocre CPU load usecases|
+|KERNEL_BPF|boolean|true|`true`\|`false`|Allow attaching eBPF programs to a cgroup using the bpf syscall (CONFIG_BPF_SYSCALL CONFIG_CGROUP_BPF) [systemd wants it - File /lib/systemd/system/systemd-journald.server:36 configures an IP firewall (IPAddressDeny=all), but the local system does not support BPF/cgroup based firewalls]|
+|KERNEL_SECURITY|boolean|false|`true`\|`false`|Enables Apparmor, integrity subsystem, auditing|
+|KERNEL_BTRFS|boolean|false|`true`\|`false`|enable btrfs kernel support|
+|KERNEL_POEHAT|boolean|false|`true`\|`false`|enable Enable RPI POE HAT fan kernel support|
+|KERNEL_NSPAWN|boolean|false|`true`\|`false`|Enable per-interface network priority control - for systemd-nspawn|
+|KERNEL_DHKEY|boolean|true|`true`\|`false`|Diffie-Hellman operations on retained keys - required for >keyutils-1.6|
---
#### Reduce disk usage:
The following list of parameters is ignored if `ENABLE_REDUCE`=false.
-##### `REDUCE_APT`=true
-Configure APT to use compressed package repository lists and no package caching files.
-
-##### `REDUCE_DOC`=true
-Remove all doc files (harsh). Configure APT to not include doc files on future `apt-get` package installations.
-
-##### `REDUCE_MAN`=true
-Remove all man pages and info files (harsh). Configure APT to not include man pages on future `apt-get` package installations.
-
-##### `REDUCE_VIM`=false
-Replace `vim-tiny` package by `levee` a tiny vim clone.
-
-##### `REDUCE_BASH`=false
-Remove `bash` package and switch to `dash` shell (experimental).
-
-##### `REDUCE_HWDB`=true
-Remove PCI related hwdb files (experimental).
-
-##### `REDUCE_SSHD`=true
-Replace `openssh-server` with `dropbear`.
-
-##### `REDUCE_LOCALE`=true
-Remove all `locale` translation files.
-
+|Option|Value|default value|value format|desciption|
+|---|---|---|---|---|
+|ENABLE_REDUCE|boolean|false|`true`\|`false`|Reduce the disk space usage by deleting packages and files. See `REDUCE_*` parameters for detailed information|
+|REDUCE_APT|boolean|true|`true`\|`false`|Configure APT to use compressed package repository lists and no package caching files|
+|REDUCE_DOC|boolean|false|`true`\|`false`|Remove all doc files (harsh). Configure APT to not include doc files on future `apt-get` package installations|
+|REDUCE_MAN|boolean|false|`true`\|`false`|Remove all man pages and info files (harsh). Configure APT to not include man pages on future `apt-get` package installations|
+|REDUCE_VIM|boolean|false|`true`\|`false`|Replace `vim-tiny` package by `levee` a tiny vim clone|
+|REDUCE_BASH|boolean|false|`true`\|`false`|Remove `bash` package and switch to `dash` shell (experimental)|
+|REDUCE_HWDB|boolean|false|`true`\|`false`|Remove PCI related hwdb files (experimental)|
+|REDUCE_SSHD|boolean|false|`true`\|`false`|Replace `openssh-server` with `dropbear`|
+|REDUCE_LOCALE|boolean|false|`true`\|`false`|Remove all `locale` translation files|
+|REDUCE_KERNEL|boolean|false|`true`\|`false`|Reduce the size of the generated kernel by removing unwanted devices, network and filesystem drivers (experimental)|
---
#### Encrypted root partition:
-##### `ENABLE_CRYPTFS`=false
-Enable full system encryption with dm-crypt. Setup a fully LUKS encrypted root partition (aes-xts-plain64:sha512) and generate required initramfs. The /boot directory will not be encrypted. This parameter will be ignored if `BUILD_KERNEL`=false. `ENABLE_CRYPTFS` is experimental. SSH-to-initramfs is currently not supported but will be soon - feel free to help.
-
-##### `CRYPTFS_PASSWORD`=""
-Set password of the encrypted root partition. This parameter is mandatory if `ENABLE_CRYPTFS`=true.
-
-##### `CRYPTFS_MAPPING`="secure"
-Set name of dm-crypt managed device-mapper mapping.
-
-##### `CRYPTFS_CIPHER`="aes-xts-plain64"
-Set cipher specification string. `aes-xts*` ciphers are strongly recommended.
-
-##### `CRYPTFS_HASH`=sha512
-Hash function and size to be used
-
-##### `CRYPTFS_XTSKEYSIZE`=512
-Sets key size in bits. The argument has to be a multiple of 8.
-
-##### `CRYPTFS_DROPBEAR`=false
-Enable Dropbear Initramfs support
-
-##### `CRYPTFS_DROPBEAR_PUBKEY`=""
-Provide path to dropbear Public RSA-OpenSSH Key
+#### On first boot, you will be asked to enter you password several time
+#### See cryptsetup options for a more information about opttion values(https://wiki.archlinux.org/index.php/Dm-crypt/Device_encryption)
+
+|Option|Value|default value|value format|desciption|
+|---|---|---|---|---|
+|ENABLE_CRYPTFS|boolean|false|`true`\|`false`|Enable full system encryption with dm-crypt. Setup a fully LUKS encrypted root partition (aes-xts-plain64:sha512) and generate required initramfs. The /boot directory will not be encrypted. This parameter will be ignored if `BUILD_KERNEL`=false. `ENABLE_CRYPTFS` is experimental|
+|CRYPTFS_PASSWORD|string||`YourPasswordToUnlockCrypto`|Set password of the encrypted root partition. This parameter is mandatory if `ENABLE_CRYPTFS`=true|
+|CRYPTFS_MAPPING|string|secure|`YourDevMNapperName`|crypsetup device-mapper name|
+|CRYPTFS_CIPHER|string|aes-xts-plain64|`aes-cbc-essiv:sha256`|cryptsetup cipher `aes-xts*` ciphers are strongly recommended|
+|CRYPTFS_HASH|string|sha256|`sha256`\|`sha512`|cryptsetup hash algorithm|
+|CRYPTFS_XTSKEYSIZE|integer|256|`256`\|`512`||Sets key size in bits. The argument has to be a multiple of 8|
+|CRYPTFS_DROPBEAR|boolean|false|`true`\|`false`|true=Enable Dropbear Initramfs support\|false=disable dropbear|
+|CRYPTFS_DROPBEAR_PUBKEY|string||`PathToYourPublicDropbearKeyFile`|Full path to dropbear Public RSA-OpenSSH Key|
---
#### Build settings:
-##### `BASEDIR`=$(pwd)/images/${RELEASE}
-Set a path to a working directory used by the script to generate an image.
+|Option|Value|default value|value format|desciption|
+|---|---|---|---|---|
+|BASEDIR|string||`FullPathToScriptRootDir`|If unset start from scriptroot or set to Full path to rpi123-gen-image directory|
+|IMAGE_NAME|string||`YourImageName`|if unset creates a name after this template: rpi`RPI_MODEL`-`RELEASE`-`RELEASE_ARCH`|
-##### `IMAGE_NAME`=${BASEDIR}/${DATE}-${KERNEL_ARCH}-${KERNEL_BRANCH}-rpi${RPI_MODEL}-${RELEASE}-${RELEASE_ARCH}
-Set a filename for the output file(s). Note: the script will create $IMAGE_NAME.img if `ENABLE_SPLITFS`=false or $IMAGE_NAME-frmw.img and $IMAGE_NAME-root.img if `ENABLE_SPLITFS`=true. Note 2: If the KERNEL_BRANCH is not set, the word "CURRENT" is used.
+---
## Understanding the script
The functions of this script that are required for the different stages of the bootstrapping are split up into single files located inside the `bootstrap.d` directory. During the bootstrapping every script in this directory gets executed in lexicographical order:
diff --git a/bootstrap.d/10-bootstrap.sh b/bootstrap.d/10-bootstrap.sh
index d8cfb69..2be3e8c 100644
--- a/bootstrap.d/10-bootstrap.sh
+++ b/bootstrap.d/10-bootstrap.sh
@@ -9,7 +9,8 @@ VARIANT=""
COMPONENTS="main"
# Use non-free Debian packages if needed
-if [ "$ENABLE_NONFREE" = true ] ; then
+# One use variable which is only needed by wifi firmware blob => reworked to use non free in /etc/apt/sources.list - we could just use ENABLE_WIRELESS here
+if [ "$ENABLE_WIRELESS" = true ] ; then
COMPONENTS="main,non-free,contrib"
fi
diff --git a/bootstrap.d/11-apt.sh b/bootstrap.d/11-apt.sh
index e763862..1fb699d 100644
--- a/bootstrap.d/11-apt.sh
+++ b/bootstrap.d/11-apt.sh
@@ -23,6 +23,10 @@ sed -i "s,buster\\/updates,testing-security," "${ETC_DIR}/apt/sources.list"
sed -i "s/ buster/ ${RELEASE}/" "${ETC_DIR}/apt/sources.list"
fi
+if [ "$ENABLE_NONFREE" = "true" ] ; then
+sed -i "s,main contrib,main contrib non-free," "${ETC_DIR}/apt/sources.list"
+fi
+
if [ -z "$RELEASE" ] ; then
# Change release in sources list
sed -i "s/ buster/ ${RELEASE}/" "${ETC_DIR}/apt/sources.list"
diff --git a/bootstrap.d/13-kernel.sh b/bootstrap.d/13-kernel.sh
index 594195e..8d1f576 100644
--- a/bootstrap.d/13-kernel.sh
+++ b/bootstrap.d/13-kernel.sh
@@ -49,10 +49,16 @@ if [ "$BUILD_KERNEL" = true ] ; then
fi
# Calculate optimal number of kernel building threads
- if [ "$KERNEL_THREADS" = "1" ] && [ -r /proc/cpuinfo ] ; then
+ if [ -n "$KERNEL_THREADS" ] && [ -r /proc/cpuinfo ] ; then
KERNEL_THREADS=$(grep -c processor /proc/cpuinfo)
fi
+# TODO: Check if defined Threadcount is higher than actual cores
+# if [ "$KERNEL_THREADS" > grep -c processor /proc/cpuinfo] ; then
+# echo "Defined more Threads than core assigned to this system"
+# exit 1
+# fi
+
#Copy 32bit config to 64bit
if [ "$ENABLE_QEMU" = true ] && [ "$KERNEL_ARCH" = arm64 ]; then
cp "${KERNEL_DIR}"/arch/arm/configs/vexpress_defconfig "${KERNEL_DIR}"/arch/arm64/configs/
@@ -61,7 +67,7 @@ if [ "$BUILD_KERNEL" = true ] ; then
# Configure and build kernel
if [ "$KERNELSRC_PREBUILT" = false ] ; then
# Remove device, network and filesystem drivers from kernel configuration
- if [ "$KERNEL_REDUCE" = true ] ; then
+ if [ "$REDUCE_KERNEL" = true ] ; then
make -C "${KERNEL_DIR}" ARCH="${KERNEL_ARCH}" CROSS_COMPILE="${CROSS_COMPILE}" "${KERNEL_DEFCONFIG}"
sed -i\
-e "s/\(^CONFIG_SND.*\=\).*/\1n/"\
@@ -464,8 +470,24 @@ if [ "$BUILD_KERNEL" = true ] ; then
set_kernel_config CONFIG_IMA_KEYRINGS_PERMIT_SIGNED_BY_BUILTIN_OR_SECONDARY n
set_kernel_config CONFIG_SYSTEM_TRUSTED_KEYS m
set_kernel_config CONFIG_SYSTEM_EXTRA_CERTIFICATE_SIZE 4096
-
- set_kernel_config CONFIG_ARM64_CRYPTO y
+ fi
+
+ if [ "$ENABLE_CRYPTFS" = true ] ; then
+ set_kernel_config CONFIG_EMBEDDED y
+ set_kernel_config CONFIG_EXPERT y
+ set_kernel_config CONFIG_DAX y
+ set_kernel_config CONFIG_MD y
+ set_kernel_config CONFIG_BLK_DEV_MD y
+ set_kernel_config CONFIG_MD_AUTODETECT y
+ set_kernel_config CONFIG_BLK_DEV_DM y
+ set_kernel_config CONFIG_BLK_DEV_DM_BUILTIN y
+ set_kernel_config CONFIG_DM_CRYPT y
+ set_kernel_config CONFIG_CRYPTO_BLKCIPHER y
+ set_kernel_config CONFIG_CRYPTO_CBC y
+ set_kernel_config CONFIG_CRYPTO_XTS y
+ set_kernel_config CONFIG_CRYPTO_SHA512 y
+ set_kernel_config CONFIG_CRYPTO_MANAGER y
+ set_kernel_config CONFIG_ARM64_CRYPTO y
set_kernel_config CONFIG_CRYPTO_SHA256_ARM64 m
set_kernel_config CONFIG_CRYPTO_SHA512_ARM64 m
set_kernel_config CONFIG_CRYPTO_SHA1_ARM64_CE m
@@ -585,12 +607,8 @@ if [ "$BUILD_KERNEL" = true ] ; then
set_kernel_config CONFIG_NF_REJECT_IPV4 m
set_kernel_config CONFIG_NF_REJECT_IPV6 m
set_kernel_config CONFIG_NF_TABLES m
- set_kernel_config CONFIG_NF_TABLES_ARP m
- set_kernel_config CONFIG_NF_TABLES_BRIDGE m
- set_kernel_config CONFIG_NF_TABLES_INET m
set_kernel_config CONFIG_NF_TABLES_IPV4 y
set_kernel_config CONFIG_NF_TABLES_IPV6 y
- set_kernel_config CONFIG_NF_TABLES_NETDEV m
set_kernel_config CONFIG_NF_TABLES_SET m
set_kernel_config CONFIG_NF_TABLES_INET y
set_kernel_config CONFIG_NF_TABLES_NETDEV y
@@ -620,8 +638,7 @@ if [ "$BUILD_KERNEL" = true ] ; then
fi
# KERNEL_DEFAULT_GOV was set by user
- if [ "$KERNEL_DEFAULT_GOV" != powersave ] && [ -n "$KERNEL_DEFAULT_GOV" ] ; then
-
+ if [ "$KERNEL_DEFAULT_GOV" != ondemand ] && [ -n "$KERNEL_DEFAULT_GOV" ] ; then
case "$KERNEL_DEFAULT_GOV" in
performance)
set_kernel_config CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE y
@@ -643,9 +660,8 @@ if [ "$BUILD_KERNEL" = true ] ; then
exit 1
;;
esac
-
- # unset previous default governor
- unset_kernel_config CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE
+ # unset previous default governor
+ unset_kernel_config CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND
fi
#Revert to previous directory
@@ -655,25 +671,6 @@ if [ "$BUILD_KERNEL" = true ] ; then
if [ "$ENABLE_QEMU" = true ] ; then
echo "CONFIG_FHANDLE=y" >> "${KERNEL_DIR}"/.config
echo "CONFIG_LBDAF=y" >> "${KERNEL_DIR}"/.config
-
- if [ "$ENABLE_CRYPTFS" = true ] ; then
- {
- echo "CONFIG_EMBEDDED=y"
- echo "CONFIG_EXPERT=y"
- echo "CONFIG_DAX=y"
- echo "CONFIG_MD=y"
- echo "CONFIG_BLK_DEV_MD=y"
- echo "CONFIG_MD_AUTODETECT=y"
- echo "CONFIG_BLK_DEV_DM=y"
- echo "CONFIG_BLK_DEV_DM_BUILTIN=y"
- echo "CONFIG_DM_CRYPT=y"
- echo "CONFIG_CRYPTO_BLKCIPHER=y"
- echo "CONFIG_CRYPTO_CBC=y"
- echo "CONFIG_CRYPTO_XTS=y"
- echo "CONFIG_CRYPTO_SHA512=y"
- echo "CONFIG_CRYPTO_MANAGER=y"
- } >> "${KERNEL_DIR}"/.config
- fi
fi
# Copy custom kernel configuration file
@@ -734,7 +731,7 @@ if [ "$BUILD_KERNEL" = true ] ; then
fi
# Install kernel headers
- if [ "$KERNEL_HEADERS" = true ] && [ "$KERNEL_REDUCE" = false ] ; then
+ if [ "$KERNEL_HEADERS" = true ] && [ "$REDUCE_KERNEL" = false ] ; then
make -C "${KERNEL_DIR}" ARCH="${KERNEL_ARCH}" CROSS_COMPILE="${CROSS_COMPILE}" INSTALL_HDR_PATH=../.. headers_install
fi
@@ -886,4 +883,4 @@ else # BUILD_KERNEL=false
cleanup
exit 1
fi
-fi
+fi
\ No newline at end of file
diff --git a/bootstrap.d/14-fstab.sh b/bootstrap.d/14-fstab.sh
index e59063f..e408758 100644
--- a/bootstrap.d/14-fstab.sh
+++ b/bootstrap.d/14-fstab.sh
@@ -38,17 +38,17 @@ if [ "$ENABLE_INITRAMFS" = true ] ; then
sed -i "s/mmcblk0p2/sda1/" "${ETC_DIR}/crypttab"
fi
- if [ "$CRYPTFS_DROPBEAR" = true ]; then
- if [ "$ENABLE_DHCP" = false ] ; then
+ if [ "$CRYPTFS_DROPBEAR" = true ] ; then
+ if [ "$ENABLE_ETH_DHCP" = false ] ; then
# Get cdir from NET_ADDRESS e.g. 24
- cdir=$(printf "%s" "${NET_ADDRESS}" | cut -d '/' -f2)
+ cdir=$(printf "%s" "${NET_ETH_ADDRESS}" | cut -d '/' -f2)
# Convert cdir ro netmask e.g. 24 to 255.255.255.0
NET_MASK=$(cdr2mask "$cdir")
# Write static ip settings to "${ETC_DIR}"/initramfs-tools/initramfs.conf
- # ip=::::::
- sed -i "\$a\nIP=${NET_ADDRESS}::${NET_GATEWAY}:${NET_MASK}:${HOSTNAME}:" "${ETC_DIR}"/initramfs-tools/initramfs.conf
+ # ip=::::::
+ sed -i "\$a\nIP=${NET_ETH_ADDRESS}::${NET_ETH_GATEWAY}:${NET_MASK}:${HOSTNAME}:" "${ETC_DIR}"/initramfs-tools/initramfs.conf
else
sed -i "\$a\nIP=::::${HOSTNAME}::dhcp" "${ETC_DIR}"/initramfs-tools/initramfs.conf
fi
diff --git a/bootstrap.d/15-rpi-config.sh b/bootstrap.d/15-rpi-config.sh
index 021e3a1..2c35a7b 100644
--- a/bootstrap.d/15-rpi-config.sh
+++ b/bootstrap.d/15-rpi-config.sh
@@ -192,7 +192,10 @@ fi
# may need sudo systemctl disable hciuart
if [ "$ENABLE_CONSOLE" = true ] ; then
- echo "enable_uart=1" >> "${BOOT_DIR}/config.txt"
+ echo "enable_uart=1" >> "${BOOT_DIR}/config.txt"
+ #More debug output on early but with serial console
+ echo "uart_2ndstage=1" >> "${BOOT_DIR}/config.txt"
+
# add string to cmdline
CMDLINE="${CMDLINE} console=serial0,115200"
diff --git a/bootstrap.d/20-networking.sh b/bootstrap.d/20-networking.sh
index a1213db..3ae980d 100644
--- a/bootstrap.d/20-networking.sh
+++ b/bootstrap.d/20-networking.sh
@@ -14,8 +14,8 @@ install_readonly files/network/hosts "${ETC_DIR}/hosts"
sed -i "s/RaspberryPI/${HOSTNAME}/" "${ETC_DIR}/hosts"
# Setup hostname entry with static IP
-if [ "$NET_ADDRESS" != "" ] ; then
- NET_IP=$(echo "${NET_ADDRESS}" | cut -f 1 -d'/')
+if [ "$NET_ETH_ADDRESS" != "" ] ; then
+ NET_IP=$(echo "${NET_ETH_ADDRESS}" | cut -f 1 -d'/')
sed -i "s/^127.0.1.1/${NET_IP}/" "${ETC_DIR}/hosts"
fi
@@ -28,52 +28,102 @@ fi
install_readonly files/network/interfaces "${ETC_DIR}/network/interfaces"
# Install configuration for interface eth0
-install_readonly files/network/eth.network "${ETC_DIR}/systemd/network/eth.network"
+install_readonly files/network/eth0.network "${ETC_DIR}/systemd/network/eth0.network"
if [ "$RPI_MODEL" = 3P ] ; then
-printf "\n[Link]\nGenericReceiveOffload=off\nTCPSegmentationOffload=off\nGenericSegmentationOffload=off" >> "${ETC_DIR}/systemd/network/eth.network"
+printf "\n[Link]\nGenericReceiveOffload=off\nTCPSegmentationOffload=off\nGenericSegmentationOffload=off" >> "${ETC_DIR}/systemd/network/eth0.network"
fi
# Install configuration for interface wl*
-install_readonly files/network/wlan.network "${ETC_DIR}/systemd/network/wlan.network"
+install_readonly files/network/wlan0.network "${ETC_DIR}/systemd/network/wlan0.network"
#always with dhcp since wpa_supplicant integration is missing
-sed -i -e "s/DHCP=.*/DHCP=yes/" -e "/DHCP/q" "${ETC_DIR}/systemd/network/wlan.network"
+sed -i -e "s/DHCP=.*/DHCP=yes/" -e "/DHCP/q" "${ETC_DIR}/systemd/network/wlan0.network"
-if [ "$ENABLE_DHCP" = true ] ; then
+if [ "$ENABLE_ETH_DHCP" = true ] ; then
# Enable DHCP configuration for interface eth0
- sed -i -e "s/DHCP=.*/DHCP=yes/" -e "/DHCP/q" "${ETC_DIR}/systemd/network/eth.network"
+ sed -i -e "s/DHCP=.*/DHCP=yes/" -e "/DHCP/q" "${ETC_DIR}/systemd/network/eth0.network"
# Set DHCP configuration to IPv4 only
if [ "$ENABLE_IPV6" = false ] ; then
- sed -i "s/DHCP=.*/DHCP=v4/" "${ETC_DIR}/systemd/network/eth.network"
+ sed -i "s/DHCP=.*/DHCP=v4/" "${ETC_DIR}/systemd/network/eth0.network"
+ sed '/IPv6PrivacyExtensions=true/d' "${ETC_DIR}/systemd/network/eth0.network"
fi
-else # ENABLE_DHCP=false
+else # ENABLE_ETH_DHCP=false
# Set static network configuration for interface eth0
- sed -i\
- -e "s|DHCP=.*|DHCP=no|"\
- -e "s|Address=\$|Address=${NET_ADDRESS}|"\
- -e "s|Gateway=\$|Gateway=${NET_GATEWAY}|"\
- -e "0,/DNS=\$/ s|DNS=\$|DNS=${NET_DNS_1}|"\
- -e "0,/DNS=\$/ s|DNS=\$|DNS=${NET_DNS_2}|"\
- -e "s|Domains=\$|Domains=${NET_DNS_DOMAINS}|"\
- -e "0,/NTP=\$/ s|NTP=\$|NTP=${NET_NTP_1}|"\
- -e "0,/NTP=\$/ s|NTP=\$|NTP=${NET_NTP_2}|"\
- "${ETC_DIR}/systemd/network/eth.network"
+ if [ -n NET_ETH_ADDRESS ] && [ -n NET_ETH_GATEWAY ] && [ -n NET_ETH_DNS_1 ] ; then
+ sed -i\
+ -e "s|DHCP=.*|DHCP=no|"\
+ -e "s|Address=\$|Address=${NET_ETH_ADDRESS}|"\
+ -e "s|Gateway=\$|Gateway=${NET_ETH_GATEWAY}|"\
+ -e "0,/DNS=\$/ s|DNS=\$|DNS=${NET_ETH_DNS_1}|"\
+ -e "0,/DNS=\$/ s|DNS=\$|DNS=${NET_ETH_DNS_2}|"\
+ -e "s|Domains=\$|Domains=${NET_ETH_DNS_DOMAINS}|"\
+ -e "0,/NTP=\$/ s|NTP=\$|NTP=${NET_ETH_NTP_1}|"\
+ -e "0,/NTP=\$/ s|NTP=\$|NTP=${NET_ETH_NTP_2}|"\
+ "${ETC_DIR}/systemd/network/eth0.network"
+ fi
fi
-# Remove empty settings from network configuration
-sed -i "/.*=\$/d" "${ETC_DIR}/systemd/network/eth.network"
-# Remove empty settings from wlan configuration
-sed -i "/.*=\$/d" "${ETC_DIR}/systemd/network/wlan.network"
-# Move systemd network configuration if required by Debian release
-mv -v "${ETC_DIR}/systemd/network/eth.network" "${LIB_DIR}/systemd/network/10-eth.network"
-# If WLAN is enabled copy wlan configuration too
if [ "$ENABLE_WIRELESS" = true ] ; then
- mv -v "${ETC_DIR}/systemd/network/wlan.network" "${LIB_DIR}/systemd/network/11-wlan.network"
+ if [ "$ENABLE_WIFI_DHCP" = true ] ; then
+ # Enable DHCP configuration for interface eth0
+ sed -i -e "s/DHCP=.*/DHCP=yes/" -e "/DHCP/q" "${ETC_DIR}/systemd/network/wlan0.network"
+
+ # Set DHCP configuration to IPv4 only
+ if [ "$ENABLE_IPV6" = false ] ; then
+ sed -i "s/DHCP=.*/DHCP=v4/" "${ETC_DIR}/systemd/network/wlan0.network"
+ sed '/IPv6PrivacyExtensions=true/d' "${ETC_DIR}/systemd/network/wlan0.network"
+ fi
+
+ else # ENABLE_WIFI_DHCP=false
+ # Set static network configuration for interface eth0
+ if [ -n NET_WIFI_ADDRESS ] && [ -n NET_WIFI_GATEWAY ] && [ -n NET_WIFI_DNS_1 ] ; then
+ sed -i\
+ -e "s|DHCP=.*|DHCP=no|"\
+ -e "s|Address=\$|Address=${NET_WIFI_ADDRESS}|"\
+ -e "s|Gateway=\$|Gateway=${NET_WIFI_GATEWAY}|"\
+ -e "0,/DNS=\$/ s|DNS=\$|DNS=${NET_WIFI_DNS_1}|"\
+ -e "0,/DNS=\$/ s|DNS=\$|DNS=${NET_WIFI_DNS_2}|"\
+ -e "s|Domains=\$|Domains=${NET_WIFI_DNS_DOMAINS}|"\
+ -e "0,/NTP=\$/ s|NTP=\$|NTP=${NET_WIFI_NTP_1}|"\
+ -e "0,/NTP=\$/ s|NTP=\$|NTP=${NET_WIFI_NTP_2}|"\
+ "${ETC_DIR}/systemd/network/wlan0.network"
+ fi
+ fi
+
+ if [ -z "$NET_WIFI_SSID" ] && [ -z "$NET_WIFI_PSK" ] ; then
+ printf "
+ ctrl_interface=/run/wpa_supplicant
+ ctrl_interface_group=wheel
+ update_config=1
+ eapol_version=1
+ ap_scan=1
+ fast_reauth=1
+
+ " > /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
+
+ #Configure WPA_supplicant
+ chroot_exec wpa_passphrase "$NET_SSID" "$NET_WPAPSK" >> /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
+
+ chroot_exec systemctl enable wpa_supplicant.service
+ chroot_exec systemctl enable wpa_supplicant@wlan0.service
+ fi
+ # Remove empty settings from wlan configuration
+ sed -i "/.*=\$/d" "${ETC_DIR}/systemd/network/wlan0.network"
+ # If WLAN is enabled copy wlan configuration too
+ mv -v "${ETC_DIR}/systemd/network/wlan0.network" "${LIB_DIR}/systemd/network/11-wlan0.network"
fi
+
+# Remove empty settings from network configuration
+sed -i "/.*=\$/d" "${ETC_DIR}/systemd/network/eth0.network"
+
+# Move systemd network configuration if required by Debian release
+mv -v "${ETC_DIR}/systemd/network/eth0.network" "${LIB_DIR}/systemd/network/10-eth0.network"
+
+#Clean up
rm -fr "${ETC_DIR}/systemd/network"
# Enable systemd-networkd service
diff --git a/bootstrap.d/21-firewall.sh b/bootstrap.d/21-firewall.sh
index ee9831d..e8e9707 100644
--- a/bootstrap.d/21-firewall.sh
+++ b/bootstrap.d/21-firewall.sh
@@ -46,7 +46,7 @@ if [ "$ENABLE_IPTABLES" = true ] ; then
chroot_exec systemctl enable ip6tables.service
fi
- if [ "$ENABLE_SSHD" = false ] ; then
+ if [ "$SSH_ENABLE" = false ] ; then
# Remove SSHD related iptables rules
sed -i "/^#/! {/SSH/ s/^/# /}" "${ETC_DIR}/iptables/iptables.rules" 2> /dev/null
sed -i "/^#/! {/SSH/ s/^/# /}" "${ETC_DIR}/iptables/ip6tables.rules" 2> /dev/null
diff --git a/bootstrap.d/30-security.sh b/bootstrap.d/30-security.sh
index 75e3625..16d78c3 100644
--- a/bootstrap.d/30-security.sh
+++ b/bootstrap.d/30-security.sh
@@ -6,7 +6,7 @@
. ./functions.sh
# Generate crypt(3) password string
-ENCRYPTED_PASSWORD=$(mkpasswd -m sha-512 "${PASSWORD}")
+ENCRYPTED_PASSWORD=$(mkpasswd -m sha-512 "${ROOT_PASSWORD}")
ENCRYPTED_USER_PASSWORD=$(mkpasswd -m sha-512 "${USER_PASSWORD}")
# Setup default user
diff --git a/bootstrap.d/32-sshd.sh b/bootstrap.d/32-sshd.sh
index 9d28d51..c439a1e 100644
--- a/bootstrap.d/32-sshd.sh
+++ b/bootstrap.d/32-sshd.sh
@@ -5,7 +5,7 @@
# Load utility functions
. ./functions.sh
-if [ "$ENABLE_SSHD" = true ] ; then
+if [ "$SSH_ENABLE" = true ] ; then
DROPBEAR_ARGS=""
if [ "$SSH_ENABLE_ROOT" = false ] ; then
diff --git a/bootstrap.d/50-firstboot.sh b/bootstrap.d/50-firstboot.sh
index 1b17876..dedec4a 100644
--- a/bootstrap.d/50-firstboot.sh
+++ b/bootstrap.d/50-firstboot.sh
@@ -24,12 +24,14 @@ if [ "$EXPANDROOT" = true ] ; then
fi
# Ensure openssh server host keys are regenerated on first boot
-if [ "$ENABLE_SSHD" = true ] ; then
+if [ "$SSH_ENABLE" = true ] ; then
cat files/firstboot/30-generate-ssh-keys.sh >> "${ETC_DIR}/rc.firstboot"
fi
+if [ "$ENABLE_DBUS" = true ] ; then
# Ensure that dbus machine-id exists
cat files/firstboot/40-generate-machineid.sh >> "${ETC_DIR}/rc.firstboot"
+fi
# Create /etc/resolv.conf symlink
cat files/firstboot/41-create-resolv-symlink.sh >> "${ETC_DIR}/rc.firstboot"
diff --git a/bootstrap.d/99-reduce.sh b/bootstrap.d/99-reduce.sh
index 9576bd6..3b7fc57 100644
--- a/bootstrap.d/99-reduce.sh
+++ b/bootstrap.d/99-reduce.sh
@@ -5,6 +5,28 @@
# Load utility functions
. ./functions.sh
+if [ "$ENABLE_IPV6" = false ] ; then
+"$LIB_DIR"/xtables/libip6t_ah.so
+"$LIB_DIR"/xtables/libip6t_dst.so
+"$LIB_DIR"/xtables/libip6t_eui64.so
+"$LIB_DIR"/xtables/libip6t_frag.so
+"$LIB_DIR"/xtables/libip6t_hbh.so
+"$LIB_DIR"/xtables/libip6t_hl.so
+"$LIB_DIR"/xtables/libip6t_HL.so
+"$LIB_DIR"/xtables/libip6t_icmp6.so
+"$LIB_DIR"/xtables/libip6t_ipv6header.so
+"$LIB_DIR"/xtables/libip6t_LOG.so
+"$LIB_DIR"/xtables/libip6t_mh.so
+"$LIB_DIR"/xtables/libip6t_REJECT.so
+"$LIB_DIR"/xtables/libip6t_rt.so
+"$LIB_DIR"/xtables/libip6t_DNAT.so
+"$LIB_DIR"/xtables/libip6t_DNPT.so
+"$LIB_DIR"/xtables/libip6t_MASQUERADE.so
+"$LIB_DIR"/xtables/libip6t_NETMAP.so
+"$LIB_DIR"/xtables/libip6t_REDIRECT.so
+"$LIB_DIR"/xtables/libip6t_SNAT.so
+"$LIB_DIR"/xtables/libip6t_SNPT.so
+fi
# Reduce the image size by various operations
if [ "$ENABLE_REDUCE" = true ] ; then
if [ "$REDUCE_APT" = true ] ; then
diff --git a/files/firstboot/42-config-ifnames.sh b/files/firstboot/42-config-ifnames.sh
index 9724155..5de911e 100644
--- a/files/firstboot/42-config-ifnames.sh
+++ b/files/firstboot/42-config-ifnames.sh
@@ -1,13 +1,32 @@
logger -t "rc.firstboot" "Configuring network interface name"
-INTERFACE_NAME=$(dmesg | grep "renamed from eth0" | awk -F ":| " '{ print $9 }')
+INTERFACE_NAME_ETH=$(dmesg | grep "renamed from eth0" | awk -F ":| " '{ print $9 }')
+INTERFACE_NAME_WIFI=$(dmesg | grep "renamed from wlan0" | awk -F ":| " '{ print $9 }')
-if [ ! -z INTERFACE_NAME ] ; then
- if [ -r "/etc/systemd/network/eth.network" ] ; then
- sed -i "s/eth0/${INTERFACE_NAME}/" /etc/systemd/network/eth.network
+if [ ! -z INTERFACE_NAME_ETH ] ; then
+ if [ -r "/etc/systemd/network/eth0.network" ] ; then
+ sed -i "s/eth0/${INTERFACE_NAME_ETH}/" /etc/systemd/network/eth0.network
fi
- if [ -r "/lib/systemd/network/10-eth.network" ] ; then
- sed -i "s/eth0/${INTERFACE_NAME}/" /lib/systemd/network/10-eth.network
+ if [ -r "/lib/systemd/network/10-eth0.network" ] ; then
+ sed -i "s/eth0/${INTERFACE_NAME_ETH}/" /lib/systemd/network/10-eth0.network
fi
+ # Move config to new interface name
+ mv /etc/systemd/network/eth0.network /etc/systemd/network/"${INTERFACE_NAME_ETH}".network
+fi
+
+if [ ! -z INTERFACE_NAME_WIFI ] ; then
+ if [ -r "/etc/systemd/network/wlan0.network" ] ; then
+ sed -i "s/wlan0/${INTERFACE_NAME_WIFI}/" /etc/systemd/network/wlan0.network
+ fi
+
+ if [ -r "/lib/systemd/network/11-wlan0.network" ] ; then
+ sed -i "s/wlan0/${INTERFACE_NAME_WIFI}/" /lib/systemd/network/11-wlan0.network
+ fi
+ # Move config to new interface name
+ mv /etc/systemd/network/wlan0.network /etc/systemd/network/"${INTERFACE_NAME_WIFI}".network
+
+ systemctl disable wpa_supplicant@wlan0.service
+ systemctl enable wpa_supplicant@"${INTERFACE_NAME_WIFI}".service
+ systemctl start wpa_supplicant@"${INTERFACE_NAME_WIFI}".service
fi
diff --git a/files/network/eth0.network b/files/network/eth0.network
new file mode 100644
index 0000000..143ca4b
--- /dev/null
+++ b/files/network/eth0.network
@@ -0,0 +1,14 @@
+[Match]
+Name=eth0
+
+[Network]
+RouteMetric=10
+IPv6PrivacyExtensions=true
+DHCP=no
+Address=
+Gateway=
+DNS=
+DNS=
+Domains=
+NTP=
+NTP=
diff --git a/files/network/wlan0.network b/files/network/wlan0.network
new file mode 100644
index 0000000..49091fe
--- /dev/null
+++ b/files/network/wlan0.network
@@ -0,0 +1,14 @@
+[Match]
+Name=wlan0
+
+[Network]
+RouteMetric=20
+IPv6PrivacyExtensions=true
+DHCP=no
+Address=
+Gateway=
+DNS=
+DNS=
+Domains=
+NTP=
+NTP=
diff --git a/rpi23-gen-image.sh b/rpi23-gen-image.sh
index 2a9debd..586860f 100755
--- a/rpi23-gen-image.sh
+++ b/rpi23-gen-image.sh
@@ -40,7 +40,7 @@ echo -n -e "\n#\n# RPi 0/1/2/3/4 Bootstrap Settings\n#\n"
set -x
# Raspberry Pi model configuration
-RPI_MODEL=${RPI_MODEL:=2}
+RPI_MODEL=${RPI_MODEL:=3P}
# Debian release
RELEASE=${RELEASE:=buster}
@@ -66,13 +66,13 @@ SYSTEMDSWAP_URL=${SYSTEMDSWAP_URL:=https://github.com/Nefelim4ag/systemd-swap.gi
RPI_32_KERNEL_URL=${RPI_32_KERNEL_URL:=https://github.com/hypriot/rpi-kernel/releases/download/v4.14.34/raspberrypi-kernel_20180422-141901_armhf.deb}
RPI_32_KERNELHEADER_URL=${RPI_32_KERNELHEADER_URL:=https://github.com/hypriot/rpi-kernel/releases/download/v4.14.34/raspberrypi-kernel-headers_20180422-141901_armhf.deb}
# Kernel has KVM and zswap enabled - use if KERNEL_* parameters and precompiled kernel are used
-RPI3_64_BIS_KERNEL_URL=${RPI3_64_BIS_KERNEL_URL:=https://github.com/sakaki-/bcmrpi3-kernel-bis/releases/download/4.19.80.20191022/bcmrpi3-kernel-bis-4.19.80.20191022.tar.xz}
+RPI3_64_BIS_KERNEL_URL=${RPI3_64_BIS_KERNEL_URL:=https://github.com/sakaki-/bcmrpi3-kernel-bis/releases/download/4.19.102.20200211/bcmrpi3-kernel-bis-4.19.102.20200211.tar.xz}
# Default precompiled 64bit kernel
-RPI3_64_DEF_KERNEL_URL=${RPI3_64_DEF_KERNEL_URL:=https://github.com/sakaki-/bcmrpi3-kernel/releases/download/4.19.80.20191022/bcmrpi3-kernel-4.19.80.20191022.tar.xz}
+RPI3_64_DEF_KERNEL_URL=${RPI3_64_DEF_KERNEL_URL:=https://github.com/sakaki-/bcmrpi3-kernel/releases/download/4.19.102.20200211/bcmrpi3-kernel-4.19.102.20200211.tar.xz}
# Sakaki BIS Kernel RPI4 - https://github.com/sakaki-/bcm2711-kernel-bis
-RPI4_64_BIS_KERNEL_URL=${RPI4_64_BIS_KERNEL_URL:=https://github.com/sakaki-/bcm2711-kernel-bis/releases/download/4.19.59.20190724/bcm2711-kernel-bis-4.19.59.20190724.tar.xz}
+RPI4_64_BIS_KERNEL_URL=${RPI4_64_BIS_KERNEL_URL:=https://github.com/sakaki-/bcm2711-kernel-bis/releases/download/4.19.102.20200211/bcm2711-kernel-bis-4.19.102.20200211.tar.xz}
# Default precompiled 64bit kernel - https://github.com/sakaki-/bcm2711-kernel
-RPI4_64_DEF_KERNEL_URL=${RPI4_64_DEF_KERNEL_URL:=https://github.com/sakaki-/bcm2711-kernel-bis/releases/download/4.19.59.20190724/bcm2711-kernel-bis-4.19.59.20190724.tar.xz}
+RPI4_64_DEF_KERNEL_URL=${RPI4_64_DEF_KERNEL_URL:=https://github.com/sakaki-/bcm2711-kernel-bis/releases/download/4.19.102.20200211/bcm2711-kernel-bis-4.19.102.20200211.tar.xz}
# Generic
RPI3_64_KERNEL_URL=${RPI3_64_KERNEL_URL:=$RPI3_64_DEF_KERNEL_URL}
RPI4_64_KERNEL_URL=${RPI4_64_KERNEL_URL:=$RPI4_64_DEF_KERNEL_URL}
@@ -93,18 +93,28 @@ KERNEL_DIR="${R}/usr/src/linux"
WLAN_FIRMWARE_DIR="${LIB_DIR}/firmware/brcm"
BLUETOOTH_FIRMWARE_DIR="${ETC_DIR}/firmware/bt"
-# Firmware directory: Blank if download from github
-RPI_FIRMWARE_DIR=${RPI_FIRMWARE_DIR:=""}
+# APT settings
+APT_SERVER=${APT_SERVER:="ftp.debian.org"}
+APT_PROXY=${APT_PROXY:=""}
+KEEP_APT_PROXY=${KEEP_APT_PROXY:=false}
+# Packages required in the chroot build environment
+APT_INCLUDES=${APT_INCLUDES:=""}
+APT_INCLUDES="${APT_INCLUDES},apt-transport-https,apt-utils,ca-certificates,debian-archive-keyring,dialog,sudo,systemd,sysvinit-utils,locales,keyboard-configuration,console-setup,libnss-systemd"
+# Packages to exclude from chroot build environment
+APT_EXCLUDES=${APT_EXCLUDES:=""}
# General settings
SET_ARCH=${SET_ARCH:=32}
HOSTNAME=${HOSTNAME:=rpi${RPI_MODEL}-${RELEASE}}
-PASSWORD=${PASSWORD:=raspberry}
-USER_PASSWORD=${USER_PASSWORD:=raspberry}
DEFLOCAL=${DEFLOCAL:="en_US.UTF-8"}
TIMEZONE=${TIMEZONE:="Europe/Berlin"}
EXPANDROOT=${EXPANDROOT:=true}
-ENABLE_DPHYSSWAP=${ENABLE_DPHYSSWAP:=true}
+
+ENABLE_ROOT=${ENABLE_ROOT:=false}
+ROOT_PASSWORD=${ROOT_PASSWORD:=raspberry}
+ENABLE_USER=${ENABLE_USER:=true}
+USER_NAME=${USER_NAME:="pi"}
+USER_PASSWORD=${USER_PASSWORD:=raspberry}
# Keyboard settings
XKB_MODEL=${XKB_MODEL:=""}
@@ -112,135 +122,139 @@ XKB_LAYOUT=${XKB_LAYOUT:=""}
XKB_VARIANT=${XKB_VARIANT:=""}
XKB_OPTIONS=${XKB_OPTIONS:=""}
+# Networking settings:
+ENABLE_IPV6=${ENABLE_IPV6:=true}
+ENABLE_WIRELESS=${ENABLE_WIRELESS:=false}
+ENABLE_IPTABLES=${ENABLE_IPTABLES:=false}
+ENABLE_HARDNET=${ENABLE_HARDNET:=false}
+ENABLE_IFNAMES=${ENABLE_IFNAMES:=true}
+
# Network settings (DHCP)
-ENABLE_DHCP=${ENABLE_DHCP:=true}
+ENABLE_ETH_DHCP=${ENABLE_ETH_DHCP:=true}
+ENABLE_WIFI_DHCP=${ENABLE_ETH_DHCP:=true}
# Network settings (static)
-NET_ADDRESS=${NET_ADDRESS:=""}
-NET_GATEWAY=${NET_GATEWAY:=""}
-NET_DNS_1=${NET_DNS_1:=""}
-NET_DNS_2=${NET_DNS_2:=""}
-NET_DNS_DOMAINS=${NET_DNS_DOMAINS:=""}
-NET_NTP_1=${NET_NTP_1:=""}
-NET_NTP_2=${NET_NTP_2:=""}
+NET_ETH_ADDRESS=${NET_ETH_ADDRESS:=""}
+NET_ETH_GATEWAY=${NET_ETH_GATEWAY:=""}
+NET_ETH_DNS_1=${NET_ETH_DNS_1:=""}
+NET_ETH_DNS_2=${NET_ETH_DNS_2:=""}
+NET_ETH_DNS_DOMAINS=${NET_ETH_DNS_DOMAINS:=""}
+NET_ETH_NTP_1=${NET_ETH_NTP_1:=""}
+NET_ETH_NTP_2=${NET_ETH_NTP_2:=""}
+
+# Networking settings (WIFI):
+NET_WIFI_SSID=${NET_WIFI_SSID:=""}
+NET_WIFI_PSK=${NET_WIFI_PSK:=""}
-# APT settings
-APT_PROXY=${APT_PROXY:=""}
-APT_SERVER=${APT_SERVER:="ftp.debian.org"}
-KEEP_APT_PROXY=${KEEP_APT_PROXY:=false}
+# Network settings (static)
+NET_WIFI_ADDRESS=${NET_WIFI_ADDRESS:=""}
+NET_WIFI_GATEWAY=${NET_WIFI_GATEWAY:=""}
+NET_WIFI_DNS_1=${NET_WIFI_DNS_1:=""}
+NET_WIFI_DNS_2=${NET_WIFI_DNS_2:=""}
+NET_WIFI_DNS_DOMAINS=${NET_WIFI_DNS_DOMAINS:=""}
+NET_WIFI_NTP_1=${NET_WIFI_NTP_1:=""}
+NET_WIFI_NTP_2=${NET_WIFI_NTP_2:=""}
# Feature settings
+ENABLE_CONSOLE=${ENABLE_CONSOLE:=false}
ENABLE_PRINTK=${ENABLE_PRINTK:=false}
ENABLE_BLUETOOTH=${ENABLE_BLUETOOTH:=false}
ENABLE_MINIUART_OVERLAY=${ENABLE_MINIUART_OVERLAY:=false}
-ENABLE_CONSOLE=${ENABLE_CONSOLE:=true}
+ENABLE_TURBO=${ENABLE_TURBO:=false}
ENABLE_I2C=${ENABLE_I2C:=false}
ENABLE_SPI=${ENABLE_SPI:=false}
-ENABLE_IPV6=${ENABLE_IPV6:=true}
-ENABLE_SSHD=${ENABLE_SSHD:=true}
+
ENABLE_NONFREE=${ENABLE_NONFREE:=false}
-ENABLE_WIRELESS=${ENABLE_WIRELESS:=false}
-ENABLE_SOUND=${ENABLE_SOUND:=true}
-ENABLE_DBUS=${ENABLE_DBUS:=true}
+ENABLE_RSYSLOG=${ENABLE_RSYSLOG:=true}
+ENABLE_SOUND=${ENABLE_SOUND:=false}
ENABLE_HWRANDOM=${ENABLE_HWRANDOM:=true}
ENABLE_MINGPU=${ENABLE_MINGPU:=false}
ENABLE_XORG=${ENABLE_XORG:=false}
ENABLE_WM=${ENABLE_WM:=""}
-ENABLE_RSYSLOG=${ENABLE_RSYSLOG:=true}
-ENABLE_USER=${ENABLE_USER:=true}
-USER_NAME=${USER_NAME:="pi"}
-ENABLE_ROOT=${ENABLE_ROOT:=false}
-ENABLE_QEMU=${ENABLE_QEMU:=false}
ENABLE_SYSVINIT=${ENABLE_SYSVINIT:=false}
-
-# SSH settings
-SSH_ENABLE_ROOT=${SSH_ENABLE_ROOT:=false}
-SSH_DISABLE_PASSWORD_AUTH=${SSH_DISABLE_PASSWORD_AUTH:=false}
-SSH_LIMIT_USERS=${SSH_LIMIT_USERS:=false}
-SSH_ROOT_PUB_KEY=${SSH_ROOT_PUB_KEY:=""}
-SSH_USER_PUB_KEY=${SSH_USER_PUB_KEY:=""}
+ENABLE_SPLASH=${ENABLE_SPLASH:=true}
+ENABLE_LOGO=${ENABLE_LOGO:=true}
+ENABLE_SILENT_BOOT=${ENABLE_SILENT_BOOT=false}
+DISABLE_UNDERVOLT_WARNINGS=${DISABLE_UNDERVOLT_WARNINGS:=}
# Advanced settings
+ENABLE_DPHYSSWAP=${ENABLE_DPHYSSWAP:=true}
ENABLE_SYSTEMDSWAP=${ENABLE_SYSTEMDSWAP:=false}
+ENABLE_QEMU=${ENABLE_QEMU:=false}
+ENABLE_KEYGEN=${ENABLE_KEYGEN:=false}
ENABLE_MINBASE=${ENABLE_MINBASE:=false}
-ENABLE_REDUCE=${ENABLE_REDUCE:=false}
+ENABLE_SPLITFS=${ENABLE_SPLITFS:=false}
+ENABLE_INITRAMFS=${ENABLE_INITRAMFS:=false}
+ENABLE_DBUS=${ENABLE_DBUS:=true}
+ENABLE_USBBOOT=${ENABLE_USBBOOT=false}
+CHROOT_SCRIPTS=${CHROOT_SCRIPTS:=""}
ENABLE_UBOOT=${ENABLE_UBOOT:=false}
UBOOTSRC_DIR=${UBOOTSRC_DIR:=""}
-ENABLE_USBBOOT=${ENABLE_USBBOOT=false}
ENABLE_FBTURBO=${ENABLE_FBTURBO:=false}
+FBTURBOSRC_DIR=${FBTURBOSRC_DIR:=""}
ENABLE_VIDEOCORE=${ENABLE_VIDEOCORE:=false}
-ENABLE_NEXMON=${ENABLE_NEXMON:=false}
VIDEOCORESRC_DIR=${VIDEOCORESRC_DIR:=""}
-FBTURBOSRC_DIR=${FBTURBOSRC_DIR:=""}
+ENABLE_NEXMON=${ENABLE_NEXMON:=false}
NEXMONSRC_DIR=${NEXMONSRC_DIR:=""}
-ENABLE_HARDNET=${ENABLE_HARDNET:=false}
-ENABLE_IPTABLES=${ENABLE_IPTABLES:=false}
-ENABLE_SPLITFS=${ENABLE_SPLITFS:=false}
-ENABLE_INITRAMFS=${ENABLE_INITRAMFS:=false}
-ENABLE_IFNAMES=${ENABLE_IFNAMES:=true}
-ENABLE_SPLASH=${ENABLE_SPLASH:=true}
-ENABLE_LOGO=${ENABLE_LOGO:=true}
-ENABLE_SILENT_BOOT=${ENABLE_SILENT_BOOT=false}
-DISABLE_UNDERVOLT_WARNINGS=${DISABLE_UNDERVOLT_WARNINGS:=}
+
+# SSH settings
+SSH_ENABLE=${SSH_ENABLE:=true}
+SSH_ENABLE_ROOT=${SSH_ENABLE_ROOT:=false}
+SSH_DISABLE_PASSWORD_AUTH=${SSH_DISABLE_PASSWORD_AUTH:=false}
+SSH_LIMIT_USERS=${SSH_LIMIT_USERS:=false}
+SSH_ROOT_PUB_KEY=${SSH_ROOT_PUB_KEY:=""}
+SSH_USER_PUB_KEY=${SSH_USER_PUB_KEY:=""}
# Kernel compilation settings
BUILD_KERNEL=${BUILD_KERNEL:=true}
-KERNEL_REDUCE=${KERNEL_REDUCE:=false}
KERNEL_THREADS=${KERNEL_THREADS:=1}
KERNEL_HEADERS=${KERNEL_HEADERS:=true}
KERNEL_MENUCONFIG=${KERNEL_MENUCONFIG:=false}
-KERNEL_REMOVESRC=${KERNEL_REMOVESRC:=true}
KERNEL_OLDDEFCONFIG=${KERNEL_OLDDEFCONFIG:=false}
KERNEL_CCACHE=${KERNEL_CCACHE:=false}
-KERNEL_ZSWAP=${KERNEL_ZSWAP:=false}
+KERNEL_REMOVESRC=${KERNEL_REMOVESRC:=true}
+KERNELSRC_DIR=${KERNELSRC_DIR:=""}
+KERNELSRC_CLEAN=${KERNELSRC_CLEAN:=false}
+KERNELSRC_CONFIG=${KERNELSRC_CONFIG:=true}
+KERNELSRC_USRCONFIG=${KERNELSRC_USRCONFIG:=""}
+KERNELSRC_PREBUILT=${KERNELSRC_PREBUILT:=false}
+# Firmware directory: Blank if download from github
+RPI_FIRMWARE_DIR=${RPI_FIRMWARE_DIR:=""}
+KERNEL_DEFAULT_GOV=${KERNEL_DEFAULT_GOV:=ondemand}
+KERNEL_NF=${KERNEL_NF:=false}
KERNEL_VIRT=${KERNEL_VIRT:=false}
+KERNEL_ZSWAP=${KERNEL_ZSWAP:=false}
KERNEL_BPF=${KERNEL_BPF:=false}
-KERNEL_DEFAULT_GOV=${KERNEL_DEFAULT_GOV:=ondemand}
KERNEL_SECURITY=${KERNEL_SECURITY:=false}
-KERNEL_NF=${KERNEL_NF:=false}
-KERNEL_DHKEY=${KERNEL_DHKEY:=true}
KERNEL_BTRFS=${KERNEL_BTRFS:=false}
-KERNEL_NSPAN=${KERNEL_NSPAN:=false}
KERNEL_POEHAT=${KERNEL_POEHAT:=false}
-
-# Kernel compilation from source directory settings
-KERNELSRC_DIR=${KERNELSRC_DIR:=""}
-KERNELSRC_CLEAN=${KERNELSRC_CLEAN:=false}
-KERNELSRC_CONFIG=${KERNELSRC_CONFIG:=true}
-KERNELSRC_PREBUILT=${KERNELSRC_PREBUILT:=false}
+KERNEL_NSPAN=${KERNEL_NSPAN:=false}
+KERNEL_DHKEY=${KERNEL_DHKEY:=true}
# Reduce disk usage settings
+ENABLE_REDUCE=${ENABLE_REDUCE:=false}
REDUCE_APT=${REDUCE_APT:=true}
-REDUCE_DOC=${REDUCE_DOC:=true}
-REDUCE_MAN=${REDUCE_MAN:=true}
+REDUCE_DOC=${REDUCE_DOC:=false}
+REDUCE_MAN=${REDUCE_MAN:=false}
REDUCE_VIM=${REDUCE_VIM:=false}
REDUCE_BASH=${REDUCE_BASH:=false}
-REDUCE_HWDB=${REDUCE_HWDB:=true}
-REDUCE_SSHD=${REDUCE_SSHD:=true}
-REDUCE_LOCALE=${REDUCE_LOCALE:=true}
+REDUCE_HWDB=${REDUCE_HWDB:=false}
+REDUCE_SSHD=${REDUCE_SSHD:=false}
+REDUCE_LOCALE=${REDUCE_LOCALE:=false}
+REDUCE_KERNEL=${REDUCE_KERNEL:=false}
# Encrypted filesystem settings
ENABLE_CRYPTFS=${ENABLE_CRYPTFS:=false}
CRYPTFS_PASSWORD=${CRYPTFS_PASSWORD:=""}
CRYPTFS_MAPPING=${CRYPTFS_MAPPING:="secure"}
CRYPTFS_CIPHER=${CRYPTFS_CIPHER:="aes-xts-plain64"}
-CRYPTFS_HASH=${CRYPTFS_HASH:="sha512"}
-CRYPTFS_XTSKEYSIZE=${CRYPTFS_XTSKEYSIZE:=512}
+CRYPTFS_HASH=${CRYPTFS_HASH:="sha256"}
+CRYPTFS_XTSKEYSIZE=${CRYPTFS_XTSKEYSIZE:=256}
#Dropbear-initramfs supports unlocking encrypted filesystem via SSH on bootup
CRYPTFS_DROPBEAR=${CRYPTFS_DROPBEAR:=false}
#Provide your own Dropbear Public RSA-OpenSSH Key otherwise it will be generated
CRYPTFS_DROPBEAR_PUBKEY=${CRYPTFS_DROPBEAR_PUBKEY:=""}
-# Chroot scripts directory
-CHROOT_SCRIPTS=${CHROOT_SCRIPTS:=""}
-
-# Packages required in the chroot build environment
-APT_INCLUDES=${APT_INCLUDES:=""}
-APT_INCLUDES="${APT_INCLUDES},flex,bison,libssl-dev,apt-transport-https,apt-utils,ca-certificates,debian-archive-keyring,dialog,sudo,systemd,sysvinit-utils,locales,keyboard-configuration,console-setup,libnss-systemd"
-
-# Packages to exclude from chroot build environment
-APT_EXCLUDES=${APT_EXCLUDES:=""}
-
# Packages required for bootstrapping
REQUIRED_PACKAGES="debootstrap debian-archive-keyring qemu-user-static binfmt-support dosfstools rsync bmap-tools whois git bc psmisc dbus bison flex libssl-dev sudo"
MISSING_PACKAGES=""
@@ -295,8 +309,17 @@ if [ -n "$SET_ARCH" ] ; then
RELEASE_ARCH=${RELEASE_ARCH:=armel}
KERNEL_IMAGE=${KERNEL_IMAGE:=kernel.img}
CROSS_COMPILE=${CROSS_COMPILE:=arm-linux-gnueabi-}
+
+ if [ $ENABLE_XORG = true ] ; then
+ if [$RELEASE = "stretch" ] || [$RELEASE = "oldstable" ] ; then
+ printf "\nBest support for armel architecture is provided under Debian stretch/oldstable. Choose yes to change release to Debian stretch[y/n] "
+ read -r confirm
+ if [ "$confirm" = "y" ] ; then
+ $RELEASE = "stretch"
+ fi
+ fi
+ fi
fi
-
# Raspberry Pi model specific settings
if [ "$RPI_MODEL" = 2 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] || [ "$RPI_MODEL" = 4 ] ; then
if [ "$RPI_MODEL" != 4 ] ; then
@@ -361,7 +384,7 @@ if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] || [ "$
APT_INCLUDES="${APT_INCLUDES},bluetooth,bluez"
fi
if [ "$ENABLE_WIRELESS" = true ] ; then
- APT_INCLUDES="${APT_INCLUDES},wireless-tools,crda,wireless-regdb"
+ APT_INCLUDES="${APT_INCLUDES},wireless-tools,crda,wireless-regdb,wpasupplicant"
fi
else # Raspberry PI 1,1P,2 without Wifi and bluetooth onboard
# Check if the internal wireless interface is not supported by the RPi model
@@ -436,7 +459,7 @@ fi
# Add device-tree-compiler required for building the U-Boot bootloader
if [ "$ENABLE_UBOOT" = true ] ; then
- APT_INCLUDES="${APT_INCLUDES},device-tree-compiler,bison,flex,bc"
+ APT_INCLUDES="${APT_INCLUDES},device-tree-compiler,bc"
fi
if [ "$ENABLE_USBBOOT" = true ] ; then
@@ -591,7 +614,7 @@ if [ "$KERNEL_SECURITY" = true ] ; then
fi
# Add openssh server package
-if [ "$ENABLE_SSHD" = true ] ; then
+if [ "$SSH_ENABLE" = true ] ; then
APT_INCLUDES="${APT_INCLUDES},openssh-server"
fi
diff --git a/templates/rpi3buster-fullconfig b/templates/rpi3buster-fullconfig
new file mode 100644
index 0000000..01255e3
--- /dev/null
+++ b/templates/rpi3buster-fullconfig
@@ -0,0 +1,188 @@
+############################
+########APT settings########
+############################
+APT_SERVER=ftp.debian.org
+APT_PROXY=
+KEEP_APT_PROXY=false
+APT_INCLUDES_LATE=
+APT_INCLUDES=
+############################
+##General system settings###
+############################
+SET_ARCH=32
+RPI_MODEL=3P
+RELEASE=buster
+HOSTNAME=
+DEFLOCAL=en_US.UTF-8
+TIMEZONE=Europe/Berlin
+EXPANDROOT=true
+############################
+#######User settings########
+############################
+ENABLE_ROOT=false
+ROOT_PASSWORD=raspberry
+ENABLE_USER=true
+USER_NAME=pi
+USER_PASSWORD=raspberry
+############################
+####Keyboard settings#######
+############################
+XKB_MODEL=
+XKB_LAYOUT=
+XKB_VARIANT=
+XKB_OPTIONS=
+############################
+######Network settings######
+############################
+ENABLE_IPV6=true
+ENABLE_WIRELESS=false
+ENABLE_IPTABLES=false
+ENABLE_HARDNET=false
+ENABLE_IFNAMES=true
+############################
+# Network settings (DHCP)
+ENABLE_ETH_DHCP=true
+ENABLE_WIFI_DHCP=true
+############################
+# Network settings (static)
+NET_ETH_ADDRESS=
+NET_ETH_GATEWAY=
+NET_ETH_DNS_1=
+NET_ETH_DNS_2=
+NET_ETH_DNS_DOMAINS=
+NET_ETH_NTP_1=
+NET_ETH_NTP_2=
+############################
+NET_WIFI_SSID=
+NET_WIFI_PSK=
+############################
+# Network settings (static)
+NET_WIFI_ADDRESS=
+NET_WIFI_GATEWAY=
+NET_WIFI_DNS_1=
+NET_WIFI_DNS_2=
+NET_WIFI_DNS_DOMAINS=
+NET_WIFI_NTP_1=
+NET_WIFI_NTP_2=
+############################
+###Basic system settings####
+############################
+ENABLE_CONSOLE=false
+ENABLE_PRINTK=false
+ENABLE_BLUETOOTH=false
+ENABLE_MINIUART_OVERLAY=false
+ENABLE_TURBO=false
+ENABLE_I2C=true
+ENABLE_SPI=true
+ENABLE_NONFREE=false
+ENABLE_RSYSLOG=false
+ENABLE_SOUND=false
+ENABLE_HWRANDOM=true
+ENABLE_MINGPU=false
+ENABLE_XORG=false
+ENABLE_WM=
+ENABLE_SYSVINIT=false
+ENABLE_SPLASH=true
+ENABLE_LOGO=true
+ENABLE_SILENT_BOOT=false
+############################
+#1=disable overlay,2=turbo+overlay, otherwise leave unset
+DISABLE_UNDERVOLT_WARNINGS=
+############################
+##Advanced system settings##
+############################
+ENABLE_DPHYSSWAP=true
+ENABLE_SYSTEMDSWAP=false
+############################
+ENABLE_QEMU=false
+QEMU_BINARY=
+ENABLE_KEYGEN=false
+ENABLE_MINBASE=false
+ENABLE_SPLITFS=false
+ENABLE_INITRAMFS=false
+ENABLE_DBUS=true
+ENABLE_USBBOOT=false
+############################
+CHROOT_SCRIPTS=
+############################
+ENABLE_UBOOT=false
+UBOOTSRC_DIR=
+############################
+ENABLE_FBTURBO=false
+FBTURBOSRC_DIR=
+############################
+ENABLE_VIDEOCORE=false
+VIDEOCORESRC_DIR=
+############################
+ENABLE_NEXMON=false
+NEXMONSRC_DIR=
+############################
+########SSH settings########
+############################
+SSH_ENABLE=true
+SSH_ENABLE_ROOT=false
+SSH_DISABLE_PASSWORD_AUTH=false
+SSH_LIMIT_USERS=false
+SSH_ROOT_PUB_KEY=
+SSH_USER_PUB_KEY=
+############################
+#####Kernel settings########
+############################
+BUILD_KERNEL=true
+CROSS_COMPILE=
+KERNEL_ARCH=
+KERNEL_IMAGE=
+KERNEL_BRANCH=
+KERNEL_DEFCONFIG=
+
+KERNEL_THREADS=1
+KERNEL_HEADERS=true
+KERNEL_MENUCONFIG=false
+KERNEL_OLDDEFCONFIG=false
+KERNEL_CCACHE=false
+KERNEL_REMOVESRC=true
+KERNELSRC_DIR=
+KERNELSRC_CLEAN=false
+KERNELSRC_CONFIG=true
+KERNELSRC_USRCONFIG=
+KERNELSRC_PREBUILT=false
+RPI_FIRMWARE_DIR=
+KERNEL_DEFAULT_GOV=ondemand
+KERNEL_NF=false
+KERNEL_VIRT=false
+KERNEL_ZSWAP=false
+KERNEL_BPF=true
+KERNEL_SECURITY=false
+KERNEL_BTRFS=false
+KERNEL_POEHAT=false
+KERNEL_NSPAWN=false
+KERNEL_DHKEY=true
+############################
+#######Save diskspace#######
+############################
+ENABLE_REDUCE=false
+REDUCE_APT=true
+REDUCE_DOC=false
+REDUCE_MAN=false
+REDUCE_VIM=false
+REDUCE_BASH=false
+REDUCE_HWDB=false
+REDUCE_SSHD=false
+REDUCE_LOCALE=false
+REDUCE_KERNEL=false
+############################
+######CryptFS Settings######
+############################
+ENABLE_CRYPTFS=false
+CRYPTFS_PASSWORD=
+CRYPTFS_MAPPING=secure
+CRYPTFS_CIPHER=aes-xts-plain64
+CRYPTFS_HASH=sha256
+CRYPTFS_XTSKEYSIZE=256
+CRYPTFS_DROPBEAR=false
+CRYPTFS_DROPBEAR_PUBKEY=
+############################
+#######Build settings#######
+############################
+BASEDIR=
+IMAGE_NAME=
\ No newline at end of file