From bc6d966f8243dd759dfc1c0811528e37879ceb1b 2018-11-21 16:27:50 From: Unknown Date: 2018-11-21 16:27:50 Subject: [PATCH] cleanups --- diff --git a/README.md b/README.md index 8f45456..2a1afc3 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ The following list of Debian packages must be installed on the build system beca It is recommended to configure the `rpi23-gen-image.sh` script to build and install the latest Raspberry Pi Linux kernel. For the RPi3 this is mandatory. Kernel compilation and linking will be performed on the build system using an ARM (armhf) cross-compiler toolchain. -The script has been tested using the default `crossbuild-essential-armhf` toolchain meta package on Debian Linux and `stretch` build systems. Please check the [Debian CrossToolchains Wiki](https://wiki.debian.org/CrossToolchains) for further information. +The script has been tested using the default `crossbuild-essential-armhf` toolchain meta package on Debian Linux `stretch` build systems. Please check the [Debian CrossToolchains Wiki](https://wiki.debian.org/CrossToolchains) for further information. ## Command-line parameters The script accepts certain command-line parameters to enable or disable specific OS features, services and configuration settings. These parameters are passed to the `rpi23-gen-image.sh` script via (simple) shell-variables. Unlike environment shell-variables (simple) shell-variables are defined at the beginning of the command-line call of the `rpi23-gen-image.sh` script. @@ -57,6 +57,10 @@ A comma separated list of additional packages to be installed by apt after boots --- #### General system settings: +##### `SET_ARCH`=32 +Set Architecture to default 32bit. If you want to to compile 64bit (RPI3 or RPI3+) set it to `64`. This option will set every needed crosscompiler or boeard specific option for a successful build. +If you want to change e.g. cross-compiler -> Templates always override defaults + ##### `RPI_MODEL`=2 Specifiy the target Raspberry Pi hardware model. The script at this time supports the following Raspberry Pi models: `0` = Used for Raspberry Pi 0 and Raspberry Pi 0 W @@ -68,7 +72,7 @@ Specifiy the target Raspberry Pi hardware model. The script at this time support `BUILD_KERNEL`=true will automatically be set if the Raspberry Pi model `3` or `3P` is used. ##### `RELEASE`="buster" -Set the desired Debian release name. The script at this time supports the bootstrapping of the Debian releases "stretch" and "buster". `BUILD_KERNEL`=true will automatically be set if the Debian releases `stretch` or `buster` are used. +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. @@ -191,6 +195,9 @@ 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 + --- #### Advanced system features: @@ -243,7 +250,7 @@ Path to a directory with scripts that should be run in the chroot before the ima 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. This parameter is only supported if the Debian releases `stretch` or `buster` are used. +Enable automatic assignment of predictable, stable network interface names for all local Ethernet, WLAN interfaces. This might create complex and long interface names. ##### `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. @@ -269,8 +276,8 @@ Add SSH (v2) public key(s) from specified file to `authorized_keys` file to enab --- #### Kernel compilation: -##### `BUILD_KERNEL`=false -Build and install the latest RPi2/3 Linux kernel. Currently only the default RPi2/3 kernel configuration is used. `BUILD_KERNEL`=true will automatically be set if the Raspberry Pi model `3` is used. +##### `BUILD_KERNEL`=true +Build and install the latest RPi2/3 Linux kernel. Currently only the default RPi2/3 kernel configuration is used. ##### `CROSS_COMPILE`="arm-linux-gnueabihf-" This sets the cross compile enviornment for the compiler. @@ -483,10 +490,6 @@ Start QEMU full system emulation with cryptfs, initramfs and output to console: qemu-system-arm -m 2048M -M vexpress-a15 -cpu cortex-a15 -kernel kernel7.img -no-reboot -dtb vexpress-v2p-ca15_a7.dtb -sd ${IMAGE_NAME}.qcow2 -initrd "initramfs-${KERNEL_VERSION}" -append "root=/dev/mapper/secure cryptdevice=/dev/mmcblk0p2:secure rw rootfstype=ext4 console=ttyAMA0,115200 init=/bin/systemd" -serial stdio ``` -## Weekly image builds -The image files are provided by JRWR'S I/O PORT and are built once a Sunday at midnight UTC! -* [Debian Stretch Raspberry Pi2/3 Weekly Image Builds](https://jrwr.io/doku.php?id=projects:debianpi) - ## External links and references * [Debian worldwide mirror sites](https://www.debian.org/mirror/list) * [Debian Raspberry Pi 2 Wiki](https://wiki.debian.org/RaspberryPi2) diff --git a/bootstrap.d/13-kernel.sh b/bootstrap.d/13-kernel.sh index d991127..f3a1515 100644 --- a/bootstrap.d/13-kernel.sh +++ b/bootstrap.d/13-kernel.sh @@ -82,7 +82,7 @@ if [ "$BUILD_KERNEL" = true ] ; then -e "s/\(^CONFIG_DRM.*\=\).*/\1n/"\ "${KERNEL_DIR}/.config" fi - + if [ "$KERNELSRC_CONFIG" = true ] ; then # Load default raspberry kernel configuration make -C "${KERNEL_DIR}" ARCH="${KERNEL_ARCH}" CROSS_COMPILE="${CROSS_COMPILE}" "${KERNEL_DEFCONFIG}" @@ -209,7 +209,7 @@ if [ "$BUILD_KERNEL" = true ] ; then #https://github.com/torvalds/linux/blob/master/init/Kconfig#L848 # Enables BPF syscall for systemd-journald if [ "$KERNEL_BPF" = true ] && { [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; } ; then - set_kernel_config CONFIG_BPF_SYSCALL y + set_kernel_config CONFIG_BPF_SYSCALL y set_kernel_config CONFIG_CGROUP_BPF y fi @@ -237,7 +237,7 @@ if [ "$BUILD_KERNEL" = true ] ; then echo "CONFIG_CRYPTO_XTS=y" echo "CONFIG_CRYPTO_SHA512=y" echo "CONFIG_CRYPTO_MANAGER=y" - } >> "${KERNEL_DIR}/.config" + } >> "${KERNEL_DIR}"/.config fi fi diff --git a/bootstrap.d/15-rpi-config.sh b/bootstrap.d/15-rpi-config.sh index 694395c..3f6f73c 100644 --- a/bootstrap.d/15-rpi-config.sh +++ b/bootstrap.d/15-rpi-config.sh @@ -100,7 +100,7 @@ if [ "$ENABLE_INITRAMFS" = true ] ; then fi # Disable RPi3 Bluetooth and restore ttyAMA0 serial device -if [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] || [ "$RPI_MODEL" = 3P ]; then +if [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; then if [ "$ENABLE_CONSOLE" = true ] && [ "$ENABLE_UBOOT" = false ] ; then echo "dtoverlay=pi3-disable-bt" >> "${BOOT_DIR}/config.txt" echo "enable_uart=1" >> "${BOOT_DIR}/config.txt" @@ -147,16 +147,10 @@ if [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] || [ "$RPI_MODEL" = 3P ]; then # install_readonly "${R}/tmp/pi-bluetooth/brcm43438.service" "${ETC_DIR}/systemd/system/brcm43438.service" install_readonly "${R}/tmp/pi-bluetooth/debian/pi-bluetooth.bthelper@.service" "${ETC_DIR}/systemd/system/pi-bluetooth.bthelper@.service" install_readonly "${R}/tmp/pi-bluetooth/debian/pi-bluetooth.hciuart.service" "${ETC_DIR}/systemd/system/pi-bluetooth.hciuart.service" - - install_readonly "${R}/tmp/pi-bluetooth/99-com.rules" "${ETC_DIR}/udev/rules.d/99-com.rules" # Remove temporary directory rm -fr "${temp_dir}" - - # Get /dev/serial back for compability - - fi fi diff --git a/files/boot/uboot.mkimage b/files/boot/uboot.mkimage index 9dca77c..13267f6 100644 --- a/files/boot/uboot.mkimage +++ b/files/boot/uboot.mkimage @@ -1,5 +1,5 @@ # Set device tree fdtfile -setenv dtbfile bcm2710-rpi-3-b.dtb +setenv dtbfile bcm2709-rpi-2-b.dtb # Tell Linux that it is booting on a Raspberry Pi2/3 setenv machid 0x00000c42 @@ -9,7 +9,7 @@ saveenv # Load the existing Linux kernel into RAM mmc dev 0 -fatload mmc 0:1 ${kernel_addr_r} Image +fatload mmc 0:1 ${kernel_addr_r} kernel7.img fatload mmc 0:1 ${fdt_addr_r} ${dtbfile} fatload mmc 0:1 ${ramdisk_addr_r} ${initramfs} diff --git a/rpi23-gen-image.sh b/rpi23-gen-image.sh index 1a4e4ec..fe2088d 100755 --- a/rpi23-gen-image.sh +++ b/rpi23-gen-image.sh @@ -40,13 +40,13 @@ echo -n -e "\n#\n# RPi2/3 Bootstrap Settings\n#\n" set -x # Raspberry Pi model configuration -export RPI_MODEL=${RPI_MODEL:=2} +RPI_MODEL=${RPI_MODEL:=2} # Debian release -export RELEASE=${RELEASE:=buster} +RELEASE=${RELEASE:=buster} #Kernel Branch -export KERNEL_BRANCH=${KERNEL_BRANCH:=""} +KERNEL_BRANCH=${KERNEL_BRANCH:=""} # URLs KERNEL_URL=${KERNEL_URL:=https://github.com/raspberrypi/linux} @@ -86,6 +86,7 @@ WLAN_FIRMWARE_DIR="${LIB_DIR}/firmware/brcm" # Firmware directory: Blank if download from github RPI_FIRMWARE_DIR=${RPI_FIRMWARE_DIR:=""} + # General settings SET_ARCH=${SET_ARCH:=32} HOSTNAME=${HOSTNAME:=rpi${RPI_MODEL}-${RELEASE}}