@@ -0,0 +1,5 | |||||
|
1 | # Restart dphys-swapfile service if it exists | |||
|
2 | logger -t "rc.firstboot" "Restarting dphys-swapfile" | |||
|
3 | ||||
|
4 | systemctl enable dphys-swapfile | |||
|
5 | systemctl restart dphys-swapfile |
@@ -0,0 +1,4 | |||||
|
1 | # Configuration template file used by rpi23-gen-image.sh | |||
|
2 | RPI_MODEL=3 | |||
|
3 | RELEASE=buster | |||
|
4 | BUILD_KERNEL=true |
@@ -0,0 +1,4 | |||||
|
1 | # Configuration template file used by rpi23-gen-image.sh | |||
|
2 | RPI_MODEL=3 | |||
|
3 | RELEASE=buster | |||
|
4 | BUILD_KERNEL=true |
@@ -0,0 +1,15 | |||||
|
1 | # Configuration template file used by rpi23-gen-image.sh | |||
|
2 | # Debian Stretch using the Arm64 for kernel compilation and Debian distribution. | |||
|
3 | ||||
|
4 | RPI_MODEL=3 | |||
|
5 | RELEASE=stretch | |||
|
6 | BUILD_KERNEL=true | |||
|
7 | KERNEL_ARCH=arm64 | |||
|
8 | RELEASE_ARCH=arm64 | |||
|
9 | CROSS_COMPILE=aarch64-linux-gnu- | |||
|
10 | QEMU_BINARY=/usr/bin/qemu-aarch64-static | |||
|
11 | KERNEL_DEFCONFIG=bcmrpi3_defconfig | |||
|
12 | KERNEL_BIN_IMAGE=Image | |||
|
13 | KERNEL_IMAGE=kernel8.img | |||
|
14 | KERNEL_BRANCH=rpi-4.14.y | |||
|
15 | ENABLE_WIRELESS=true |
@@ -0,0 +1,15 | |||||
|
1 | # Configuration template file used by rpi23-gen-image.sh | |||
|
2 | # Debian Stretch using the Arm64 for kernel compilation and Debian distribution. | |||
|
3 | ||||
|
4 | RPI_MODEL=3 | |||
|
5 | RELEASE=stretch | |||
|
6 | BUILD_KERNEL=true | |||
|
7 | KERNEL_ARCH=arm64 | |||
|
8 | RELEASE_ARCH=arm64 | |||
|
9 | CROSS_COMPILE=aarch64-linux-gnu- | |||
|
10 | QEMU_BINARY=/usr/bin/qemu-aarch64-static | |||
|
11 | KERNEL_DEFCONFIG=bcmrpi3_defconfig | |||
|
12 | KERNEL_BIN_IMAGE=Image | |||
|
13 | KERNEL_IMAGE=kernel8.img | |||
|
14 | KERNEL_BRANCH=rpi-4.14.y | |||
|
15 | ENABLE_WIRELESS=true |
@@ -1,5 +1,5 | |||||
1 | ## 介绍 |
|
1 | ## 介绍 | |
2 |
`rpi23-gen-image.sh` 是一个自动生成树莓派2/3系统镜像的脚本工具, 当前支持自动生成32位 armhf 架构的Debian, 发行版本`jessie`, `stretch` 和 `buster`. 树莓派3 64位镜像需要使用特定的配置参数 (```templates/rpi3-stretch-arm64-4.1 |
|
2 | `rpi23-gen-image.sh` 是一个自动生成树莓派2/3系统镜像的脚本工具, 当前支持自动生成32位 armhf 架构的Debian, 发行版本`jessie`, `stretch` 和 `buster`. 树莓派3 64位镜像需要使用特定的配置参数 (```templates/rpi3-stretch-arm64-4.14.y```). | |
3 |
|
3 | |||
4 | ## 构建环境所依赖的包 |
|
4 | ## 构建环境所依赖的包 | |
5 | 一定要安装好下列deb包, 他们是构建过程需要的核心包. 脚本会自动检查, 如果缺少,经用户确认后会自动安装. |
|
5 | 一定要安装好下列deb包, 他们是构建过程需要的核心包. 脚本会自动检查, 如果缺少,经用户确认后会自动安装. |
@@ -96,6 +96,9 Set default system timezone. All available timezones can be found in the `/usr/s | |||||
96 | ##### `EXPANDROOT`=true |
|
96 | ##### `EXPANDROOT`=true | |
97 | Expand the root partition and filesystem automatically on first boot. |
|
97 | Expand the root partition and filesystem automatically on first boot. | |
98 |
|
98 | |||
|
99 | ##### `ENABLE_DPHYSSWAP`=true | |||
|
100 | 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. | |||
|
101 | ||||
99 | ##### `ENABLE_QEMU`=false |
|
102 | ##### `ENABLE_QEMU`=false | |
100 | 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. |
|
103 | 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. | |
101 |
|
104 | |||
@@ -382,7 +385,8 Enable Kernel Zswap support. Best use on high RAM load and mediocre CPU load use | |||||
382 | 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] |
|
385 | 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] | |
383 |
|
386 | |||
384 | ##### `KERNEL_SECURITY`=false |
|
387 | ##### `KERNEL_SECURITY`=false | |
385 |
Enables Apparmor, integrity subsystem, auditing |
|
388 | Enables Apparmor, integrity subsystem, auditing. | |
|
389 | ||||
386 | --- |
|
390 | --- | |
387 |
|
391 | |||
388 | #### Reduce disk usage: |
|
392 | #### Reduce disk usage: | |
@@ -540,5 +544,5 qemu-system-arm -m 2048M -M vexpress-a15 -cpu cortex-a15 -kernel kernel7.img -no | |||||
540 | * [Official Raspberry Pi Kernel on github](https://github.com/raspberrypi/linux) |
|
544 | * [Official Raspberry Pi Kernel on github](https://github.com/raspberrypi/linux) | |
541 | * [U-BOOT git repository](https://git.denx.de/?p=u-boot.git;a=summary) |
|
545 | * [U-BOOT git repository](https://git.denx.de/?p=u-boot.git;a=summary) | |
542 | * [Xorg DDX driver fbturbo](https://github.com/ssvb/xf86-video-fbturbo) |
|
546 | * [Xorg DDX driver fbturbo](https://github.com/ssvb/xf86-video-fbturbo) | |
543 |
* [RPi3 Wireless interface firmware](https://github.com/RPi-Distro/firmware-nonfree/tree/master/brcm |
|
547 | * [RPi3 Wireless interface firmware](https://github.com/RPi-Distro/firmware-nonfree/tree/master/brcm) | |
544 | * [Collabora RPi2 Kernel precompiled](https://repositories.collabora.co.uk/debian/) |
|
548 | * [Collabora RPi2 Kernel precompiled](https://repositories.collabora.co.uk/debian/) |
@@ -23,15 +23,15 if [ "$(echo "$APT_INCLUDES" | grep ",locales")" ] ; then | |||||
23 | # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=684134 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=685957 |
|
23 | # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=684134 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=685957 | |
24 | # ... so we have to set locales manually |
|
24 | # ... so we have to set locales manually | |
25 | if [ "$DEFLOCAL" = "en_US.UTF-8" ] ; then |
|
25 | if [ "$DEFLOCAL" = "en_US.UTF-8" ] ; then | |
26 |
chroot_exec echo "locales locales/locales_to_be_generated multiselect ${DEFLOCAL} UTF-8" |
|
26 | chroot_exec echo "locales locales/locales_to_be_generated multiselect ${DEFLOCAL} UTF-8 | debconf-set-selections" | |
27 | else |
|
27 | else | |
28 | # en_US.UTF-8 should be available anyway : https://www.debian.org/doc/manuals/debian-reference/ch08.en.html#_the_reconfiguration_of_the_locale |
|
28 | # en_US.UTF-8 should be available anyway : https://www.debian.org/doc/manuals/debian-reference/ch08.en.html#_the_reconfiguration_of_the_locale | |
29 |
chroot_exec echo "locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8, ${DEFLOCAL} UTF-8" |
|
29 | chroot_exec echo "locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8, ${DEFLOCAL} UTF-8 | debconf-set-selections" | |
30 | sed -i "/en_US.UTF-8/s/^#//" "${ETC_DIR}/locale.gen" |
|
30 | sed -i "/en_US.UTF-8/s/^#//" "${ETC_DIR}/locale.gen" | |
31 | fi |
|
31 | fi | |
32 |
|
32 | |||
33 | sed -i "/${DEFLOCAL}/s/^#//" "${ETC_DIR}/locale.gen" |
|
33 | sed -i "/${DEFLOCAL}/s/^#//" "${ETC_DIR}/locale.gen" | |
34 |
chroot_exec echo "locales locales/default_environment_locale select ${DEFLOCAL}" |
|
34 | chroot_exec echo "locales locales/default_environment_locale select ${DEFLOCAL} | debconf-set-selections" | |
35 | chroot_exec locale-gen |
|
35 | chroot_exec locale-gen | |
36 | chroot_exec update-locale LANG="${DEFLOCAL}" |
|
36 | chroot_exec update-locale LANG="${DEFLOCAL}" | |
37 |
|
37 |
@@ -564,20 +564,28 if [ "$BUILD_KERNEL" = true ] ; then | |||||
564 | fi |
|
564 | fi | |
565 |
|
565 | |||
566 | else # BUILD_KERNEL=false |
|
566 | else # BUILD_KERNEL=false | |
567 | if [ "$SET_ARCH" = 64 ] && { [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; } ; then |
|
567 | if [ "$SET_ARCH" = 64 ] | |
|
568 | if [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; then | |||
|
569 | # Use Sakakis modified kernel if ZSWAP is active | |||
|
570 | if [ "$KERNEL_ZSWAP" = true ] || [ "$KERNEL_VIRT" = true ] || [ "$KERNEL_NF" = true ] || [ "$KERNEL_BPF" = true ] ; then | |||
|
571 | RPI3_64_KERNEL_URL="${RPI3_64_BIS_KERNEL_URL}" | |||
|
572 | fi | |||
568 |
|
573 | |||
569 | # Use Sakakis modified kernel if ZSWAP is active |
|
574 | # Create temporary directory for dl | |
570 | if [ "$KERNEL_ZSWAP" = true ] || [ "$KERNEL_VIRT" = true ] || [ "$KERNEL_NF" = true ] || [ "$KERNEL_BPF" = true ] ; then |
|
575 | temp_dir=$(as_nobody mktemp -d) | |
571 | RPI3_64_KERNEL_URL="${RPI3_64_BIS_KERNEL_URL}" |
|
|||
572 | fi |
|
|||
573 |
|
576 | |||
574 | # Create temporary directory for dl |
|
577 | # Fetch kernel dl | |
575 | temp_dir=$(as_nobody mktemp -d) |
|
578 | as_nobody wget -O "${temp_dir}"/kernel.tar.xz -c "$RPI3_64_KERNEL_URL" | |
576 |
|
579 | fi | ||
577 | # Fetch kernel dl |
|
580 | if [ "$SET_ARCH" = 64 ] && [ "$RPI_MODEL" = 4 ] ; then | |
578 | as_nobody wget -O "${temp_dir}"/kernel.tar.xz -c "$RPI3_64_KERNEL_URL" |
|
581 | # Create temporary directory for dl | |
|
582 | temp_dir=$(as_nobody mktemp -d) | |||
579 |
|
583 | |||
580 | #extract download |
|
584 | # Fetch kernel dl | |
|
585 | as_nobody wget -O "${temp_dir}"/kernel.tar.xz -c "$RPI4_64_KERNEL_URL" | |||
|
586 | fi | |||
|
587 | ||||
|
588 | #extract download | |||
581 | tar -xJf "${temp_dir}"/kernel.tar.xz -C "${temp_dir}" |
|
589 | tar -xJf "${temp_dir}"/kernel.tar.xz -C "${temp_dir}" | |
582 |
|
590 | |||
583 | #move extracted kernel to /boot/firmware |
|
591 | #move extracted kernel to /boot/firmware | |
@@ -593,15 +601,15 else # BUILD_KERNEL=false | |||||
593 | chown -R root:root "${R}/lib/modules" |
|
601 | chown -R root:root "${R}/lib/modules" | |
594 | fi |
|
602 | fi | |
595 |
|
603 | |||
596 | # Install Kernel from hypriot comptabile with all Raspberry PI |
|
604 | # Install Kernel from hypriot comptabile with all Raspberry PI (dunno if its compatible with RPI4 - better compile your own kernel) | |
597 | if [ "$SET_ARCH" = 32 ] ; then |
|
605 | if [ "$SET_ARCH" = 32 ] && [ "$RPI_MODEL" != 4 ] ; then | |
598 | # Create temporary directory for dl |
|
606 | # Create temporary directory for dl | |
599 | temp_dir=$(as_nobody mktemp -d) |
|
607 | temp_dir=$(as_nobody mktemp -d) | |
600 |
|
608 | |||
601 | # Fetch kernel |
|
609 | # Fetch kernel | |
602 | as_nobody wget -O "${temp_dir}"/kernel.deb -c "$RPI_32_KERNEL_URL" |
|
610 | as_nobody wget -O "${temp_dir}"/kernel.deb -c "$RPI_32_KERNEL_URL" | |
603 |
|
611 | |||
604 |
# Copy downloaded |
|
612 | # Copy downloaded kernel package | |
605 | mv "${temp_dir}"/kernel.deb "${R}"/tmp/kernel.deb |
|
613 | mv "${temp_dir}"/kernel.deb "${R}"/tmp/kernel.deb | |
606 |
|
614 | |||
607 | # Set permissions |
|
615 | # Set permissions |
@@ -127,7 +127,7 if [ "$ENABLE_TURBO" = true ] ; then | |||||
127 | echo "boot_delay=1" >> "${BOOT_DIR}/config.txt" |
|
127 | echo "boot_delay=1" >> "${BOOT_DIR}/config.txt" | |
128 | fi |
|
128 | fi | |
129 |
|
129 | |||
130 | if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; then |
|
130 | if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] || [ "$RPI_MODEL" = 4 ]; then | |
131 |
|
131 | |||
132 | # Bluetooth enabled |
|
132 | # Bluetooth enabled | |
133 | if [ "$ENABLE_BLUETOOTH" = true ] ; then |
|
133 | if [ "$ENABLE_BLUETOOTH" = true ] ; then | |
@@ -208,6 +208,11 else | |||||
208 | echo "enable_uart=0" >> "${BOOT_DIR}/config.txt" |
|
208 | echo "enable_uart=0" >> "${BOOT_DIR}/config.txt" | |
209 | fi |
|
209 | fi | |
210 |
|
210 | |||
|
211 | # Disable dphys-swapfile service. Will get enabled on first boot | |||
|
212 | if [ "$ENABLE_DPHYSSWAP" = true ] ; then | |||
|
213 | chroot_exec systemctl disable dphys-swapfile | |||
|
214 | fi | |||
|
215 | ||||
211 | if [ "$ENABLE_SYSTEMDSWAP" = true ] ; then |
|
216 | if [ "$ENABLE_SYSTEMDSWAP" = true ] ; then | |
212 | # Create temporary directory for systemd-swap sources |
|
217 | # Create temporary directory for systemd-swap sources | |
213 | temp_dir=$(as_nobody mktemp -d) |
|
218 | temp_dir=$(as_nobody mktemp -d) |
@@ -106,7 +106,7 if [ "$ENABLE_WIRELESS" = true ] ; then | |||||
106 | temp_dir=$(as_nobody mktemp -d) |
|
106 | temp_dir=$(as_nobody mktemp -d) | |
107 |
|
107 | |||
108 | # Fetch firmware binary blob for RPI3B+ |
|
108 | # Fetch firmware binary blob for RPI3B+ | |
109 | if [ "$RPI_MODEL" = 3P ] ; then |
|
109 | if [ "$RPI_MODEL" = 3P ] || [ "$RPI_MODEL" = 4 ] ; then | |
110 | # Fetch firmware binary blob for RPi3P |
|
110 | # Fetch firmware binary blob for RPi3P | |
111 | as_nobody wget -q -O "${temp_dir}/brcmfmac43455-sdio.bin" "${WLAN_FIRMWARE_URL}/brcmfmac43455-sdio.bin" |
|
111 | as_nobody wget -q -O "${temp_dir}/brcmfmac43455-sdio.bin" "${WLAN_FIRMWARE_URL}/brcmfmac43455-sdio.bin" | |
112 | as_nobody wget -q -O "${temp_dir}/brcmfmac43455-sdio.txt" "${WLAN_FIRMWARE_URL}/brcmfmac43455-sdio.txt" |
|
112 | as_nobody wget -q -O "${temp_dir}/brcmfmac43455-sdio.txt" "${WLAN_FIRMWARE_URL}/brcmfmac43455-sdio.txt" |
@@ -74,7 +74,7 if [ "$ENABLE_NEXMON" = true ] && [ "$ENABLE_WIRELESS" = true ]; then | |||||
74 | cp -f "${NEXMON_ROOT}"/patches/bcm43430a1/7_45_41_46/nexmon/brcmfmac43430-sdio.bin "${WLAN_FIRMWARE_DIR}"/brcmfmac43430-sdio.bin |
|
74 | cp -f "${NEXMON_ROOT}"/patches/bcm43430a1/7_45_41_46/nexmon/brcmfmac43430-sdio.bin "${WLAN_FIRMWARE_DIR}"/brcmfmac43430-sdio.bin | |
75 | fi |
|
75 | fi | |
76 |
|
76 | |||
77 | if [ "$RPI_MODEL" = 3P ] ; then |
|
77 | if [ "$RPI_MODEL" = 3P ] || [ "$RPI_MODEL" = 4 ] ; then | |
78 | cd "${NEXMON_ROOT}"/patches/bcm43455c0/7_45_154/nexmon || exit |
|
78 | cd "${NEXMON_ROOT}"/patches/bcm43455c0/7_45_154/nexmon || exit | |
79 | sed -i -e 's/all:.*/all: $(RAM_FILE)/g' ${NEXMON_ROOT}/patches/bcm43455c0/7_45_154/nexmon/Makefile |
|
79 | sed -i -e 's/all:.*/all: $(RAM_FILE)/g' ${NEXMON_ROOT}/patches/bcm43455c0/7_45_154/nexmon/Makefile | |
80 | make clean |
|
80 | make clean |
@@ -8,30 +8,35 | |||||
8 | # Prepare rc.firstboot script |
|
8 | # Prepare rc.firstboot script | |
9 | cat files/firstboot/10-begin.sh > "${ETC_DIR}/rc.firstboot" |
|
9 | cat files/firstboot/10-begin.sh > "${ETC_DIR}/rc.firstboot" | |
10 |
|
10 | |||
11 | # Ensure openssh server host keys are regenerated on first boot |
|
|||
12 | if [ "$ENABLE_SSHD" = true ] ; then |
|
|||
13 | cat files/firstboot/21-generate-ssh-keys.sh >> "${ETC_DIR}/rc.firstboot" |
|
|||
14 | fi |
|
|||
15 |
|
||||
16 | # Prepare filesystem auto expand |
|
11 | # Prepare filesystem auto expand | |
17 | if [ "$EXPANDROOT" = true ] ; then |
|
12 | if [ "$EXPANDROOT" = true ] ; then | |
18 | if [ "$ENABLE_CRYPTFS" = false ] ; then |
|
13 | if [ "$ENABLE_CRYPTFS" = false ] ; then | |
19 |
cat files/firstboot/2 |
|
14 | cat files/firstboot/20-expandroot.sh >> "${ETC_DIR}/rc.firstboot" | |
20 | else |
|
15 | else | |
21 | # Regenerate initramfs to remove encrypted root partition auto expand |
|
16 | # Regenerate initramfs to remove encrypted root partition auto expand | |
22 |
cat files/firstboot/2 |
|
17 | cat files/firstboot/21-regenerate-initramfs.sh >> "${ETC_DIR}/rc.firstboot" | |
|
18 | fi | |||
|
19 | ||||
|
20 | # Restart dphys-swapfile so the size of the swap file is relative to the resized root partition | |||
|
21 | if [ "$ENABLE_DPHYSSWAP" = true ] ; then | |||
|
22 | cat files/firstboot/23-restart-dphys-swapfile.sh >> "${ETC_DIR}/rc.firstboot" | |||
23 | fi |
|
23 | fi | |
24 | fi |
|
24 | fi | |
25 |
|
25 | |||
|
26 | # Ensure openssh server host keys are regenerated on first boot | |||
|
27 | if [ "$ENABLE_SSHD" = true ] ; then | |||
|
28 | cat files/firstboot/30-generate-ssh-keys.sh >> "${ETC_DIR}/rc.firstboot" | |||
|
29 | fi | |||
|
30 | ||||
26 | # Ensure that dbus machine-id exists |
|
31 | # Ensure that dbus machine-id exists | |
27 |
cat files/firstboot/ |
|
32 | cat files/firstboot/40-generate-machineid.sh >> "${ETC_DIR}/rc.firstboot" | |
28 |
|
33 | |||
29 | # Create /etc/resolv.conf symlink |
|
34 | # Create /etc/resolv.conf symlink | |
30 |
cat files/firstboot/ |
|
35 | cat files/firstboot/41-create-resolv-symlink.sh >> "${ETC_DIR}/rc.firstboot" | |
31 |
|
36 | |||
32 | # Configure automatic network interface names |
|
37 | # Configure automatic network interface names | |
33 | if [ "$ENABLE_IFNAMES" = true ] ; then |
|
38 | if [ "$ENABLE_IFNAMES" = true ] ; then | |
34 |
cat files/firstboot/2 |
|
39 | cat files/firstboot/42-config-ifnames.sh >> "${ETC_DIR}/rc.firstboot" | |
35 | fi |
|
40 | fi | |
36 |
|
41 | |||
37 | # Finalize rc.firstboot script |
|
42 | # Finalize rc.firstboot script |
1 | NO CONTENT: file renamed from files/firstboot/22-expandroot.sh to files/firstboot/20-expandroot.sh |
|
NO CONTENT: file renamed from files/firstboot/22-expandroot.sh to files/firstboot/20-expandroot.sh |
1 | NO CONTENT: file renamed from files/firstboot/23-regenerate-initramfs.sh to files/firstboot/21-regenerate-initramfs.sh |
|
NO CONTENT: file renamed from files/firstboot/23-regenerate-initramfs.sh to files/firstboot/21-regenerate-initramfs.sh |
1 | NO CONTENT: file renamed from files/firstboot/21-generate-ssh-keys.sh to files/firstboot/30-generate-ssh-keys.sh |
|
NO CONTENT: file renamed from files/firstboot/21-generate-ssh-keys.sh to files/firstboot/30-generate-ssh-keys.sh |
1 | NO CONTENT: file renamed from files/firstboot/24-generate-machineid.sh to files/firstboot/40-generate-machineid.sh |
|
NO CONTENT: file renamed from files/firstboot/24-generate-machineid.sh to files/firstboot/40-generate-machineid.sh |
1 | NO CONTENT: file renamed from files/firstboot/25-create-resolv-symlink.sh to files/firstboot/41-create-resolv-symlink.sh |
|
NO CONTENT: file renamed from files/firstboot/25-create-resolv-symlink.sh to files/firstboot/41-create-resolv-symlink.sh |
1 | NO CONTENT: file renamed from files/firstboot/26-config-ifnames.sh to files/firstboot/42-config-ifnames.sh |
|
NO CONTENT: file renamed from files/firstboot/26-config-ifnames.sh to files/firstboot/42-config-ifnames.sh |
@@ -67,8 +67,11 RPI_32_KERNELHEADER_URL=${RPI_32_KERNELHEADER_URL:=https://github.com/hypriot/rp | |||||
67 | RPI3_64_BIS_KERNEL_URL=${RPI3_64_BIS_KERNEL_URL:=https://github.com/sakaki-/bcmrpi3-kernel-bis/releases/download/4.14.80.20181113/bcmrpi3-kernel-bis-4.14.80.20181113.tar.xz} |
|
67 | RPI3_64_BIS_KERNEL_URL=${RPI3_64_BIS_KERNEL_URL:=https://github.com/sakaki-/bcmrpi3-kernel-bis/releases/download/4.14.80.20181113/bcmrpi3-kernel-bis-4.14.80.20181113.tar.xz} | |
68 | # Default precompiled 64bit kernel |
|
68 | # Default precompiled 64bit kernel | |
69 | RPI3_64_DEF_KERNEL_URL=${RPI3_64_DEF_KERNEL_URL:=https://github.com/sakaki-/bcmrpi3-kernel/releases/download/4.14.80.20181113/bcmrpi3-kernel-4.14.80.20181113.tar.xz} |
|
69 | RPI3_64_DEF_KERNEL_URL=${RPI3_64_DEF_KERNEL_URL:=https://github.com/sakaki-/bcmrpi3-kernel/releases/download/4.14.80.20181113/bcmrpi3-kernel-4.14.80.20181113.tar.xz} | |
|
70 | # Sakaki BIS Kernel RPI4 | |||
|
71 | 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 | |||
70 | # Generic |
|
72 | # Generic | |
71 | RPI3_64_KERNEL_URL=${RPI3_64_KERNEL_URL:=$RPI3_64_DEF_KERNEL_URL} |
|
73 | RPI3_64_KERNEL_URL=${RPI3_64_KERNEL_URL:=$RPI3_64_DEF_KERNEL_URL} | |
|
74 | RPI4_64_KERNEL_URL=${RPI3_64_KERNEL_URL:=$RPI4_64_DEF_KERNEL_URL} | |||
72 | # Kali kernel src - used if ENABLE_NEXMON=true (they patch the wlan kernel modul) |
|
75 | # Kali kernel src - used if ENABLE_NEXMON=true (they patch the wlan kernel modul) | |
73 | KALI_KERNEL_URL=${KALI_KERNEL_URL:=https://github.com/Re4son/re4son-raspberrypi-linux.git} |
|
76 | KALI_KERNEL_URL=${KALI_KERNEL_URL:=https://github.com/Re4son/re4son-raspberrypi-linux.git} | |
74 |
|
77 | |||
@@ -97,6 +100,7 USER_PASSWORD=${USER_PASSWORD:=raspberry} | |||||
97 | DEFLOCAL=${DEFLOCAL:="en_US.UTF-8"} |
|
100 | DEFLOCAL=${DEFLOCAL:="en_US.UTF-8"} | |
98 | TIMEZONE=${TIMEZONE:="Europe/Berlin"} |
|
101 | TIMEZONE=${TIMEZONE:="Europe/Berlin"} | |
99 | EXPANDROOT=${EXPANDROOT:=true} |
|
102 | EXPANDROOT=${EXPANDROOT:=true} | |
|
103 | ENABLE_DPHYSSWAP=${ENABLE_DPHYSSWAP:=true} | |||
100 |
|
104 | |||
101 | # Keyboard settings |
|
105 | # Keyboard settings | |
102 | XKB_MODEL=${XKB_MODEL:=""} |
|
106 | XKB_MODEL=${XKB_MODEL:=""} | |
@@ -243,27 +247,7 if [ "${APT_CACHER_RUNNING}" = "apt-cacher-ng" ] ; then | |||||
243 | APT_PROXY=http://127.0.0.1:3142/ |
|
247 | APT_PROXY=http://127.0.0.1:3142/ | |
244 | fi |
|
248 | fi | |
245 |
|
249 | |||
246 | # netselect-apt does not know buster yet |
|
250 | # Setup architecture specific settings | |
247 | #if [ "$RELEASE" = "buster" ] ; then |
|
|||
248 | # RLS=testing |
|
|||
249 | #else |
|
|||
250 | # RLS="$RELEASE" |
|
|||
251 | #fi |
|
|||
252 |
|
||||
253 | #if [ -f "$(pwd)/files/apt/sources.list" ] ; then |
|
|||
254 | #rm "$(pwd)/files/apt/sources.list" |
|
|||
255 | #fi |
|
|||
256 |
|
||||
257 | #if [ "$ENABLE_NONFREE" = true ] ; then |
|
|||
258 | # netselect-apt --arch "$RELEASE_ARCH" -t 3 --sources --nonfree --outfile "$(pwd)/files/apt/sources.list" -d "$RLS" |
|
|||
259 | #else |
|
|||
260 | # netselect-apt --arch "$RELEASE_ARCH" -t 3 --sources --outfile "$(pwd)/files/apt/sources.list" -d "$RLS" |
|
|||
261 | #fi |
|
|||
262 |
|
||||
263 | # sed and cut the result string so we can use it as APT_SERVER |
|
|||
264 | #APT_SERVER=$(grep -m 1 http files/apt/sources.list | sed "s|http://| |g" | cut -d ' ' -f 3 | sed 's|/$|''|') |
|
|||
265 |
|
||||
266 | # make script easier and more stable to use with convenient setup switch. Just setup SET_ARCH and RPI_MODEL and your good to go! |
|
|||
267 | if [ -n "$SET_ARCH" ] ; then |
|
251 | if [ -n "$SET_ARCH" ] ; then | |
268 | # 64-bit configuration |
|
252 | # 64-bit configuration | |
269 | if [ "$SET_ARCH" = 64 ] ; then |
|
253 | if [ "$SET_ARCH" = 64 ] ; then | |
@@ -273,14 +257,19 if [ -n "$SET_ARCH" ] ; then | |||||
273 | KERNEL_BIN_IMAGE=${KERNEL_BIN_IMAGE:="Image"} |
|
257 | KERNEL_BIN_IMAGE=${KERNEL_BIN_IMAGE:="Image"} | |
274 |
|
258 | |||
275 | # Raspberry Pi model specific settings |
|
259 | # Raspberry Pi model specific settings | |
276 | if [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; then |
|
260 | if [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] || [ "$RPI_MODEL" = 4 ] ; then | |
|
261 | if [ "$RPI_MODEL" != 4 ] ; then | |||
|
262 | KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcmrpi3_defconfig} | |||
|
263 | else | |||
|
264 | KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcm2711_defconfig} | |||
|
265 | fi | |||
|
266 | ||||
277 | REQUIRED_PACKAGES="${REQUIRED_PACKAGES} crossbuild-essential-arm64" |
|
267 | REQUIRED_PACKAGES="${REQUIRED_PACKAGES} crossbuild-essential-arm64" | |
278 | KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcmrpi3_defconfig} |
|
|||
279 | RELEASE_ARCH=${RELEASE_ARCH:=arm64} |
|
268 | RELEASE_ARCH=${RELEASE_ARCH:=arm64} | |
280 | KERNEL_IMAGE=${KERNEL_IMAGE:=kernel8.img} |
|
269 | KERNEL_IMAGE=${KERNEL_IMAGE:=kernel8.img} | |
281 | CROSS_COMPILE=${CROSS_COMPILE:=aarch64-linux-gnu-} |
|
270 | CROSS_COMPILE=${CROSS_COMPILE:=aarch64-linux-gnu-} | |
282 | else |
|
271 | else | |
283 |
echo "error: Only Raspberry PI 3 |
|
272 | echo "error: Only Raspberry PI 3, 3B+ and 4 support 64-bit" | |
284 | exit 1 |
|
273 | exit 1 | |
285 | fi |
|
274 | fi | |
286 | fi |
|
275 | fi | |
@@ -302,9 +291,14 if [ -n "$SET_ARCH" ] ; then | |||||
302 | fi |
|
291 | fi | |
303 |
|
292 | |||
304 | # Raspberry Pi model specific settings |
|
293 | # Raspberry Pi model specific settings | |
305 | if [ "$RPI_MODEL" = 2 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; then |
|
294 | if [ "$RPI_MODEL" = 2 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] || [ "$RPI_MODEL" = 4 ] ; then | |
|
295 | if [ "$RPI_MODEL" != 4 ] ; then | |||
|
296 | KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcm2709_defconfig} | |||
|
297 | else | |||
|
298 | KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcm2711_defconfig} | |||
|
299 | fi | |||
|
300 | ||||
306 | REQUIRED_PACKAGES="${REQUIRED_PACKAGES} crossbuild-essential-armhf" |
|
301 | REQUIRED_PACKAGES="${REQUIRED_PACKAGES} crossbuild-essential-armhf" | |
307 | KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcm2709_defconfig} |
|
|||
308 | RELEASE_ARCH=${RELEASE_ARCH:=armhf} |
|
302 | RELEASE_ARCH=${RELEASE_ARCH:=armhf} | |
309 | KERNEL_IMAGE=${KERNEL_IMAGE:=kernel7.img} |
|
303 | KERNEL_IMAGE=${KERNEL_IMAGE:=kernel7.img} | |
310 | CROSS_COMPILE=${CROSS_COMPILE:=arm-linux-gnueabihf-} |
|
304 | CROSS_COMPILE=${CROSS_COMPILE:=arm-linux-gnueabihf-} | |
@@ -341,6 +335,10 case "$RPI_MODEL" in | |||||
341 | DTB_FILE=${DTB_FILE:=bcm2710-rpi-3-b.dtb} |
|
335 | DTB_FILE=${DTB_FILE:=bcm2710-rpi-3-b.dtb} | |
342 | UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_3_defconfig} |
|
336 | UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_3_defconfig} | |
343 | ;; |
|
337 | ;; | |
|
338 | 4) | |||
|
339 | DTB_FILE=${DTB_FILE:=bcm2711-rpi-4-b.dtb} | |||
|
340 | UBOOT_CONFIG=${UBOOT_CONFIG:=rpi_4_defconfig} | |||
|
341 | ;; | |||
344 | *) |
|
342 | *) | |
345 | echo "error: Raspberry Pi model $RPI_MODEL is not supported!" |
|
343 | echo "error: Raspberry Pi model $RPI_MODEL is not supported!" | |
346 | exit 1 |
|
344 | exit 1 | |
@@ -348,13 +346,13 case "$RPI_MODEL" in | |||||
348 | esac |
|
346 | esac | |
349 |
|
347 | |||
350 | # Raspberry PI 0,3,3P with Bluetooth and Wifi onboard |
|
348 | # Raspberry PI 0,3,3P with Bluetooth and Wifi onboard | |
351 | if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; then |
|
349 | if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] || [ "$RPI_MODEL" = 4 ] ; then | |
352 | # Include bluetooth packages on supported boards |
|
350 | # Include bluetooth packages on supported boards | |
353 | if [ "$ENABLE_BLUETOOTH" = true ] ; then |
|
351 | if [ "$ENABLE_BLUETOOTH" = true ] ; then | |
354 | APT_INCLUDES="${APT_INCLUDES},bluetooth,bluez" |
|
352 | APT_INCLUDES="${APT_INCLUDES},bluetooth,bluez" | |
355 | fi |
|
353 | fi | |
356 | if [ "$ENABLE_WIRELESS" = true ] ; then |
|
354 | if [ "$ENABLE_WIRELESS" = true ] ; then | |
357 |
APT_INCLUDES="${APT_INCLUDES},wireless-tools,crda,wireless-regdb |
|
355 | APT_INCLUDES="${APT_INCLUDES},wireless-tools,crda,wireless-regdb" | |
358 | fi |
|
356 | fi | |
359 | else # Raspberry PI 1,1P,2 without Wifi and bluetooth onboard |
|
357 | else # Raspberry PI 1,1P,2 without Wifi and bluetooth onboard | |
360 | # Check if the internal wireless interface is not supported by the RPi model |
|
358 | # Check if the internal wireless interface is not supported by the RPi model | |
@@ -571,6 +569,11 if [ "$EXPANDROOT" = true ] ; then | |||||
571 | APT_INCLUDES="${APT_INCLUDES},parted" |
|
569 | APT_INCLUDES="${APT_INCLUDES},parted" | |
572 | fi |
|
570 | fi | |
573 |
|
571 | |||
|
572 | # Add dphys-swapfile package, required to enable swap | |||
|
573 | if [ "$ENABLE_DPHYSSWAP" = true ] ; then | |||
|
574 | APT_INCLUDES="${APT_INCLUDES},dphys-swapfile" | |||
|
575 | fi | |||
|
576 | ||||
574 | # Add dbus package, recommended if using systemd |
|
577 | # Add dbus package, recommended if using systemd | |
575 | if [ "$ENABLE_DBUS" = true ] ; then |
|
578 | if [ "$ENABLE_DBUS" = true ] ; then | |
576 | APT_INCLUDES="${APT_INCLUDES},dbus" |
|
579 | APT_INCLUDES="${APT_INCLUDES},dbus" |
@@ -1,4 +1,4 | |||||
1 | # Configuration template file used by rpi23-gen-image.sh |
|
1 | # Configuration template file used by rpi23-gen-image.sh | |
2 | RPI_MODEL=3 |
|
2 | RPI_MODEL=3 | |
3 | RELEASE=buster |
|
3 | RELEASE=buster | |
4 | BUILD_KERNEL=true |
|
4 | BUILD_KERNEL=true |
@@ -1,15 +1,15 | |||||
1 | # Configuration template file used by rpi23-gen-image.sh |
|
1 | # Configuration template file used by rpi23-gen-image.sh | |
2 | # Debian Stretch using the Arm64 for kernel compilation and Debian distribution. |
|
2 | # Debian Stretch using the Arm64 for kernel compilation and Debian distribution. | |
3 |
|
3 | |||
4 | RPI_MODEL=3 |
|
4 | RPI_MODEL=3 | |
5 | RELEASE=stretch |
|
5 | RELEASE=stretch | |
6 | BUILD_KERNEL=true |
|
6 | BUILD_KERNEL=true | |
7 | KERNEL_ARCH=arm64 |
|
7 | KERNEL_ARCH=arm64 | |
8 | RELEASE_ARCH=arm64 |
|
8 | RELEASE_ARCH=arm64 | |
9 | CROSS_COMPILE=aarch64-linux-gnu- |
|
9 | CROSS_COMPILE=aarch64-linux-gnu- | |
10 | QEMU_BINARY=/usr/bin/qemu-aarch64-static |
|
10 | QEMU_BINARY=/usr/bin/qemu-aarch64-static | |
11 | KERNEL_DEFCONFIG=bcmrpi3_defconfig |
|
11 | KERNEL_DEFCONFIG=bcmrpi3_defconfig | |
12 | KERNEL_BIN_IMAGE=Image |
|
12 | KERNEL_BIN_IMAGE=Image | |
13 | KERNEL_IMAGE=kernel8.img |
|
13 | KERNEL_IMAGE=kernel8.img | |
14 | KERNEL_BRANCH=rpi-4.14.y |
|
14 | KERNEL_BRANCH=rpi-4.14.y | |
15 | ENABLE_WIRELESS=true |
|
15 | ENABLE_WIRELESS=true |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
General Comments 0
Vous devez vous connecter pour laisser un commentaire.
Se connecter maintenant