diff --git a/README.md b/README.md index a074381..ec7624b 100644 --- a/README.md +++ b/README.md @@ -153,7 +153,7 @@ Set the IP address for the 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. +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_MODEL= 0,3,3P` - Bluetooth gets auto enabled if `ENABLE_CONSOLE` and `ENABLE_UBOOT` are set to `false` ##### `ENABLE_I2C`=false Enable I2C interface on the RPi2/3. Please check the [RPi2/3 pinout diagrams](https://elinux.org/RPi_Low-level_peripherals) to connect the right GPIO pins. diff --git a/bootstrap.d/12-locale.sh b/bootstrap.d/12-locale.sh index c469ec3..9817d7a 100644 --- a/bootstrap.d/12-locale.sh +++ b/bootstrap.d/12-locale.sh @@ -28,10 +28,10 @@ if [ "$(echo "$APT_INCLUDES" | grep ",locales")" ] ; then chroot_exec update-locale LANG="${DEFLOCAL}" # Install and setup default keyboard configuration - if [ "$XKB_MODEL" != "pc105" ] ; then + if [ "$XKB_MODEL" != "" ] ; then sed -i "s/^XKBMODEL.*/XKBMODEL=\"${XKB_MODEL}\"/" "${ETC_DIR}/default/keyboard" fi - if [ "$XKB_LAYOUT" != "us" ] ; then + if [ "$XKB_LAYOUT" != "" ] ; then sed -i "s/^XKBLAYOUT.*/XKBLAYOUT=\"${XKB_LAYOUT}\"/" "${ETC_DIR}/default/keyboard" fi if [ "$XKB_VARIANT" != "" ] ; then diff --git a/bootstrap.d/41-uboot.sh b/bootstrap.d/41-uboot.sh index c96b673..dded27d 100644 --- a/bootstrap.d/41-uboot.sh +++ b/bootstrap.d/41-uboot.sh @@ -79,7 +79,7 @@ if [ "$ENABLE_UBOOT" = true ] ; then fi # Set mkfile to use the correct dtb file - sed -i "s/^\(setenv dtbfile \).*/\1${DTB_FILE}/" "${BOOT_DIR}/uboot.mkimage" + sed -i "s|bcm2709-rpi-2-b.dtb|${DTB_FILE}|" "${BOOT_DIR}/uboot.mkimage" # Set mkfile to use the correct mach id if [ "$ENABLE_QEMU" = true ] ; then @@ -87,7 +87,7 @@ if [ "$ENABLE_UBOOT" = true ] ; then fi # Set mkfile to use kernel image - sed -i "s/^\(fatload mmc 0:1 \${kernel_addr_r} \).*/\1${KERNEL_IMAGE}/" "${BOOT_DIR}/uboot.mkimage" + sed -i "s|kernel7.img|${KERNEL_IMAGE}|" "${BOOT_DIR}/uboot.mkimage" # Remove all leading blank lines sed -i "/./,\$!d" "${BOOT_DIR}/uboot.mkimage" diff --git a/rpi23-gen-image.sh b/rpi23-gen-image.sh index 34e54e4..f696e08 100755 --- a/rpi23-gen-image.sh +++ b/rpi23-gen-image.sh @@ -59,7 +59,8 @@ VIDEOCORE_URL=${VIDEOCORE_URL:=https://github.com/raspberrypi/userland} BLUETOOTH_URL=${BLUETOOTH_URL:=https://github.com/RPi-Distro/pi-bluetooth.git} # Build directories -BASEDIR=${BASEDIR:=$(pwd)/images/${RELEASE}} +WORKDIR=$(pwd) +BASEDIR=${BASEDIR:=${WORKDIR}/images/${RELEASE}} BUILDDIR="${BASEDIR}/build" # Chroot directories @@ -186,7 +187,7 @@ CHROOT_SCRIPTS=${CHROOT_SCRIPTS:=""} # 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" +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:=""} @@ -200,6 +201,11 @@ COMPILER_PACKAGES="" set +x +#Check if apt-cacher-ng has its default port open on and set APT_PROXY +if [ -n "$(lsof -i :3142)" ] ; then +HTTP_PROXY=http://127.0.0.1:3142/ +fi + # Setup architecture specific settings if [ -n "$SET_ARCH" ] ; then # 64 bit configuration @@ -252,37 +258,37 @@ else echo "error: Please set '32' or '64' as value for SET_ARCH" exit 1 fi - # Device specific configuration and U-Boot configuration - case "$RPI_MODEL" in - 0) - DTB_FILE=${DTB_FILE:=bcm2708-rpi-0-w.dtb} - UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_defconfig} - ;; - 1) - DTB_FILE=${DTB_FILE:=bcm2708-rpi-b.dtb} - UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_defconfig} - ;; - 1P) - DTB_FILE=${DTB_FILE:=bcm2708-rpi-b-plus.dtb} - UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_defconfig} - ;; - 2) - DTB_FILE=${DTB_FILE:=bcm2709-rpi-2-b.dtb} - UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_2_defconfig} - ;; - 3) - DTB_FILE=${DTB_FILE:=bcm2710-rpi-3-b.dtb} - UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_3_defconfig} - ;; - 3P) - DTB_FILE=${DTB_FILE:=bcm2710-rpi-3-b.dtb} - UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_3_defconfig} - ;; - *) - echo "error: Raspberry Pi model $RPI_MODEL is not supported!" - exit 1 - ;; - esac +# Device specific configuration and U-Boot configuration +case "$RPI_MODEL" in + 0) + DTB_FILE=${DTB_FILE:=bcm2708-rpi-0-w.dtb} + UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_defconfig} + ;; + 1) + DTB_FILE=${DTB_FILE:=bcm2708-rpi-b.dtb} + UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_defconfig} + ;; + 1P) + DTB_FILE=${DTB_FILE:=bcm2708-rpi-b-plus.dtb} + UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_defconfig} + ;; + 2) + DTB_FILE=${DTB_FILE:=bcm2709-rpi-2-b.dtb} + UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_2_defconfig} + ;; + 3) + DTB_FILE=${DTB_FILE:=bcm2710-rpi-3-b.dtb} + UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_3_defconfig} + ;; + 3P) + DTB_FILE=${DTB_FILE:=bcm2710-rpi-3-b.dtb} + UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_3_defconfig} + ;; + *) + echo "error: Raspberry Pi model $RPI_MODEL is not supported!" + exit 1 + ;; +esac # Prepare date string for default image file name DATE="$(date +%Y-%m-%d)" @@ -297,8 +303,6 @@ if [ "$ENABLE_WIRELESS" = true ] ; then if [ "$RPI_MODEL" = 1 ] || [ "$RPI_MODEL" = 1P ] || [ "$RPI_MODEL" = 2 ] ; then echo "error: The selected Raspberry Pi model has no internal wireless interface" exit 1 - else - echo "Raspberry Pi $RPI_MODEL has WIFI support" fi fi @@ -365,7 +369,7 @@ fi # Check if all required packages are installed on the build system for package in $REQUIRED_PACKAGES ; do - if [ "$(dpkg-query -W -f='${Status}' $package)" != "install ok installed" ] ; then + if [ "$(dpkg-query -W -f='${Status}' "$package")" != "install ok installed" ] ; then MISSING_PACKAGES="${MISSING_PACKAGES} $package" fi done