##// END OF EJS Templates
fix: various fixes
drtyhlpr -
r398:1d7e96e7b66f
parent child
Show More
@@ -11,29 +11,24 if [ -z "$APT_PROXY" ] ; then
11 sed -i "s/\"\"/\"${APT_PROXY}\"/" "${ETC_DIR}/apt/apt.conf.d/10proxy"
11 sed -i "s/\"\"/\"${APT_PROXY}\"/" "${ETC_DIR}/apt/apt.conf.d/10proxy"
12 fi
12 fi
13
13
14 if [ "$BUILD_KERNEL" = false ] ; then
15 echo "Downloading precompiled kernel"
16 echo "error: not configured"
17 exit 1;
18 # BUILD_KERNEL=true
19 else
20 echo "No precompiled kernel repositories were added"
21 fi
22
14
23 # Upgrade package index and update all installed packages and changed dependencies
15 # Upgrade package index and update all installed packages and changed dependencies
24 chroot_exec apt-get -qq -y update
16 chroot_exec apt-get -qq -y update
25 chroot_exec apt-get -qq -y -u dist-upgrade
17 chroot_exec apt-get -qq -y -u dist-upgrade
26
18
19 # Install additional packages
27 if [ "$APT_INCLUDES_LATE" ] ; then
20 if [ "$APT_INCLUDES_LATE" ] ; then
28 chroot_exec apt-get -qq -y install "$(echo "$APT_INCLUDES_LATE" |tr , ' ')"
21 chroot_exec apt-get -qq -y install "$(echo "$APT_INCLUDES_LATE" |tr , ' ')"
29 fi
22 fi
30
23
24 # Install Debian custom packages
31 if [ -d packages ] ; then
25 if [ -d packages ] ; then
32 for package in packages/*.deb ; do
26 for package in packages/*.deb ; do
33 cp "$package" "${R}"/tmp
27 cp "$package" "${R}"/tmp
34 chroot_exec dpkg --unpack /tmp/"$(basename "$package")"
28 chroot_exec dpkg --unpack /tmp/"$(basename "$package")"
35 done
29 done
36 fi
30 fi
31
37 chroot_exec apt-get -qq -y -f install
32 chroot_exec apt-get -qq -y -f install
38
33
39 chroot_exec apt-get -qq -y check
34 chroot_exec apt-get -qq -y check
@@ -107,36 +107,21 if [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; then
107 # Set permissions
107 # Set permissions
108 chown -R root:root "${R}/tmp/pi-bluetooth"
108 chown -R root:root "${R}/tmp/pi-bluetooth"
109
109
110 # Install files to chroot
111 # Install tools
110 # Install tools
112 install_readonly "${R}/tmp/pi-bluetooth/usr/bin/btuart" "${R}/usr/bin/btuart"
111 install_readonly "${R}/tmp/pi-bluetooth/usr/bin/btuart" "${R}/usr/bin/btuart"
113 install_readonly "${R}/tmp/pi-bluetooth/usr/bin/bthelper" "${R}/usr/bin/bthelper"
112 install_readonly "${R}/tmp/pi-bluetooth/usr/bin/bthelper" "${R}/usr/bin/bthelper"
114
113
115 # Install bluetooth udev rule
114 # Install bluetooth udev rule
116 install_readonly "${R}/tmp/pi-bluetooth/lib/udev/rules.d/90-pi-bluetooth.rules" "${LIB_DIR}/udev/rules.d/90-pi-bluetooth.rules"
115 install_readonly "${R}/tmp/pi-bluetooth/lib/udev/rules.d/90-pi-bluetooth.rules" "${LIB_DIR}/udev/rules.d/90-pi-bluetooth.rules"
117 #aur
118 #install_readonly "${R}/tmp/pi-bluetooth/50-bluetooth-hci-auto-poweron.rules" "${ETC_DIR}/udev/rules.d/50-bluetooth-hci-auto-poweron.rules"
119
116
120 # Install Firmware Flash file and apropiate licence
117 # Install Firmware Flash file and apropiate licence
121 mkdir "${ETC_DIR}/firmware/"
118 mkdir "${ETC_DIR}/firmware/"
122
119
123 #aur https://aur.archlinux.org/packages/pi-bluetooth/
124 #install_readonly "${R}/tmp/pi-bluetooth/LICENCE.broadcom_bcm43xx" "${ETC_DIR}/firmware/LICENCE.broadcom_bcm43xx"
125 #install_readonly "${R}/tmp/pi-bluetooth/BCM43430A1.hcd" "${ETC_DIR}/firmware/BCM43430A1.hcd"
126
127 wget -O "${R}/tmp/pi-bluetooth/LICENCE.broadcom_bcm43xx" https://aur.archlinux.org/cgit/aur.git/plain/LICENCE.broadcom_bcm43xx?h=pi-bluetooth
120 wget -O "${R}/tmp/pi-bluetooth/LICENCE.broadcom_bcm43xx" https://aur.archlinux.org/cgit/aur.git/plain/LICENCE.broadcom_bcm43xx?h=pi-bluetooth
128 wget -O "${R}/tmp/pi-bluetooth/BCM43430A1.hcd" https://aur.archlinux.org/cgit/aur.git/plain/BCM43430A1.hcd?h=pi-bluetooth
121 wget -O "${R}/tmp/pi-bluetooth/BCM43430A1.hcd" https://aur.archlinux.org/cgit/aur.git/plain/BCM43430A1.hcd?h=pi-bluetooth
129
122
130 # Install systemd service for bluetooth
131 #install_readonly "${R}/tmp/pi-bluetooth/brcm43438.service" "${ETC_DIR}/systemd/system/brcm43438.service"
132
133 # Remove temporary directory
134 #rm -fr "${temp_dir}"
135
136 # Get /dev/serial back for compability
123 # Get /dev/serial back for compability
137 # Raspberry-sys-mod package
138 wget -O "${ETC_DIR}/udev/rules.d/99-com.rules" https://raw.githubusercontent.com/RPi-Distro/raspberrypi-sys-mods/master/etc.armhf/udev/rules.d/99-com.rules
124 wget -O "${ETC_DIR}/udev/rules.d/99-com.rules" https://raw.githubusercontent.com/RPi-Distro/raspberrypi-sys-mods/master/etc.armhf/udev/rules.d/99-com.rules
139
140 fi
125 fi
141 fi
126 fi
142
127
@@ -95,7 +95,7 fi
95 # Download the firmware binary blob required to use the RPi3 wireless interface
95 # Download the firmware binary blob required to use the RPi3 wireless interface
96 if [ "$ENABLE_WIRELESS" = true ] ; then
96 if [ "$ENABLE_WIRELESS" = true ] ; then
97 if [ ! -d "${WLAN_FIRMWARE_DIR}" ] ; then
97 if [ ! -d "${WLAN_FIRMWARE_DIR}" ] ; then
98 mkdir -p "${WLAN_FIRMWARE_DIR}"
98 mkdir -p "${WLAN_FIRMWARE_DIR}"
99 fi
99 fi
100
100
101 # Create temporary directory for firmware binary blob
101 # Create temporary directory for firmware binary blob
@@ -103,20 +103,21 if [ "$ENABLE_WIRELESS" = true ] ; then
103
103
104 # Fetch firmware binary blob for RPI3B+
104 # Fetch firmware binary blob for RPI3B+
105 if [ "$RPI_MODEL" = 3P ] ; then
105 if [ "$RPI_MODEL" = 3P ] ; then
106 as_nobody wget -q -O "${temp_dir}/brcmfmac43455-sdio.bin" "${WLAN_FIRMWARE_URL}/brcmfmac43455-sdio.bin"
106 # Fetch firmware binary blob for RPi3P
107 as_nobody wget -q -O "${temp_dir}/brcmfmac43455-sdio.txt" "${WLAN_FIRMWARE_URL}/brcmfmac43455-sdio.txt"
107 as_nobody wget -q -O "${temp_dir}/brcmfmac43455-sdio.bin" "${WLAN_FIRMWARE_URL}/brcmfmac43455-sdio.bin"
108 as_nobody wget -q -O "${temp_dir}/brcmfmac43455-sdio.clm_blob" "${WLAN_FIRMWARE_URL}/brcmfmac43455-sdio.clm_blob"
108 as_nobody wget -q -O "${temp_dir}/brcmfmac43455-sdio.txt" "${WLAN_FIRMWARE_URL}/brcmfmac43455-sdio.txt"
109 as_nobody wget -q -O "${temp_dir}/brcmfmac43455-sdio.clm_blob" "${WLAN_FIRMWARE_URL}/brcmfmac43455-sdio.clm_blob"
109 elif [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 0 ] ; then
110 elif [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 0 ] ; then
110 # Fetch firmware binary blob for RPI3
111 # Fetch firmware binary blob for RPi3
111 as_nobody wget -q -O "${temp_dir}/brcmfmac43430-sdio.bin" "${WLAN_FIRMWARE_URL}/brcmfmac43430-sdio.bin"
112 as_nobody wget -q -O "${temp_dir}/brcmfmac43430-sdio.bin" "${WLAN_FIRMWARE_URL}/brcmfmac43430-sdio.bin"
112 as_nobody wget -q -O "${temp_dir}/brcmfmac43430-sdio.txt" "${WLAN_FIRMWARE_URL}/brcmfmac43430-sdio.txt"
113 as_nobody wget -q -O "${temp_dir}/brcmfmac43430-sdio.txt" "${WLAN_FIRMWARE_URL}/brcmfmac43430-sdio.txt"
113 fi
114 fi
114
115
115 # Move downloaded firmware binary blob
116 # Move downloaded firmware binary blob
116 if [ "$RPI_MODEL" = 3P ] ; then
117 if [ "$RPI_MODEL" = 3P ] ; then
117 mv "${temp_dir}/brcmfmac43455-sdio."* "${WLAN_FIRMWARE_DIR}/"
118 mv "${temp_dir}/brcmfmac43455-sdio."* "${WLAN_FIRMWARE_DIR}/"
118 elif [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 0 ] ; then
119 elif [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 0 ] ; then
119 mv "${temp_dir}/brcmfmac43430-sdio."* "${WLAN_FIRMWARE_DIR}/"
120 mv "${temp_dir}/brcmfmac43430-sdio."* "${WLAN_FIRMWARE_DIR}/"
120 fi
121 fi
121
122
122 # Remove temporary directory for firmware binary blob
123 # Remove temporary directory for firmware binary blob
@@ -124,10 +125,10 if [ "$ENABLE_WIRELESS" = true ] ; then
124
125
125 # Set permissions of the firmware binary blob
126 # Set permissions of the firmware binary blob
126 if [ "$RPI_MODEL" = 3P ] ; then
127 if [ "$RPI_MODEL" = 3P ] ; then
127 chown root:root "${WLAN_FIRMWARE_DIR}/brcmfmac43455-sdio."*
128 chown root:root "${WLAN_FIRMWARE_DIR}/brcmfmac43455-sdio."*
128 chmod 600 "${WLAN_FIRMWARE_DIR}/brcmfmac43455-sdio."*
129 chmod 600 "${WLAN_FIRMWARE_DIR}/brcmfmac43455-sdio."*
129 elif [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 0 ] ; then
130 elif [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 0 ] ; then
130 chown root:root "${WLAN_FIRMWARE_DIR}/brcmfmac43430-sdio."*
131 chown root:root "${WLAN_FIRMWARE_DIR}/brcmfmac43430-sdio."*
131 chmod 600 "${WLAN_FIRMWARE_DIR}/brcmfmac43430-sdio."*
132 chmod 600 "${WLAN_FIRMWARE_DIR}/brcmfmac43430-sdio."*
132 fi
133 fi
133 fi
134 fi
@@ -72,7 +72,7 if [ "$ENABLE_UBOOT" = true ] ; then
72 printf "\n# 64bit-mode" >> "${BOOT_DIR}/config.txt"
72 printf "\n# 64bit-mode" >> "${BOOT_DIR}/config.txt"
73 printf "\n# arm_control=0x200 is deprecated https://www.raspberrypi.org/documentation/configuration/config-txt/misc.md" >> "${BOOT_DIR}/config.txt"
73 printf "\n# arm_control=0x200 is deprecated https://www.raspberrypi.org/documentation/configuration/config-txt/misc.md" >> "${BOOT_DIR}/config.txt"
74 printf "\narm_64bit=1" >> "${BOOT_DIR}/config.txt"
74 printf "\narm_64bit=1" >> "${BOOT_DIR}/config.txt"
75 #in 64bit uboot booti is used instead of bootz [like in KERNEL_BIN_IMAGE=zImage (armv7)|| Image(armv8)]
75
76 sed -i "s|bootz|booti|g" "${BOOT_DIR}/uboot.mkimage"
76 sed -i "s|bootz|booti|g" "${BOOT_DIR}/uboot.mkimage"
77 fi
77 fi
78
78
@@ -29,6 +29,7 if [ "$ENABLE_VIDEOCORE" = true ] ; then
29
29
30 # Create build dir
30 # Create build dir
31 mkdir "${R}"/tmp/userland/build
31 mkdir "${R}"/tmp/userland/build
32
32 # push us to build directory
33 # push us to build directory
33 pushd "${R}"/tmp/userland/build
34 pushd "${R}"/tmp/userland/build
34
35
@@ -46,6 +47,7 if [ "$ENABLE_VIDEOCORE" = true ] ; then
46
47
47 #build userland
48 #build userland
48 make -j "$(nproc)"
49 make -j "$(nproc)"
50
49 #pop us out of build dir
51 #pop us out of build dir
50 popd
52 popd
51 fi
53 fi
@@ -45,7 +45,7 RPI_MODEL=${RPI_MODEL:=2}
45 # Debian release
45 # Debian release
46 RELEASE=${RELEASE:=buster}
46 RELEASE=${RELEASE:=buster}
47
47
48 #Kernel Branch
48 # Kernel Branch
49 KERNEL_BRANCH=${KERNEL_BRANCH:=""}
49 KERNEL_BRANCH=${KERNEL_BRANCH:=""}
50
50
51 # URLs
51 # URLs
@@ -196,7 +196,7 CHROOT_SCRIPTS=${CHROOT_SCRIPTS:=""}
196 APT_INCLUDES=${APT_INCLUDES:=""}
196 APT_INCLUDES=${APT_INCLUDES:=""}
197 APT_INCLUDES="${APT_INCLUDES},apt-transport-https,apt-utils,ca-certificates,debian-archive-keyring,dialog,sudo,systemd,sysvinit-utils,locales,keyboard-configuration,console-setup"
197 APT_INCLUDES="${APT_INCLUDES},apt-transport-https,apt-utils,ca-certificates,debian-archive-keyring,dialog,sudo,systemd,sysvinit-utils,locales,keyboard-configuration,console-setup"
198
198
199 #Packages to exclude from chroot build environment
199 # Packages to exclude from chroot build environment
200 APT_EXCLUDES=${APT_EXCLUDES:=""}
200 APT_EXCLUDES=${APT_EXCLUDES:=""}
201
201
202 # Packages required for bootstrapping
202 # Packages required for bootstrapping
@@ -208,29 +208,17 COMPILER_PACKAGES=""
208
208
209 set +x
209 set +x
210
210
211 #If init and systemd-sysv are wanted e.g. halt/reboot/shutdown scripts
211 # Setup architecture specific settings
212 if [ "$ENABLE_SYSVINIT" = false ] ; then
213 APT_EXCLUDES="--exclude=${APT_EXCLUDES},init,systemd-sysv"
214 fi
215
216 #Check if apt-cacher-ng has its default port open on and set APT_PROXY
217 if [ -n "$(lsof -i :3142)" ] ; then
218 HTTP_PROXY=http://127.0.0.1:3142/
219 fi
220
221 #make script easier and more stable to use with convenient setup switch. Just setup SET_ARCH and RPI_MODEL and your good to go!
222 if [ -n "$SET_ARCH" ] ; then
212 if [ -n "$SET_ARCH" ] ; then
223 echo "Setting Architecture specific settings"
213
224 ##################################
214 # 64 bit configuration
225 # 64 bit config
226 ##################################
227 if [ "$SET_ARCH" = 64 ] ; then
215 if [ "$SET_ARCH" = 64 ] ; then
228 echo "64 bit mode selected - Setting up enviroment"
216 # General 64 bit depended settings
229 # 64 bit depended settings
230 QEMU_BINARY=${QEMU_BINARY:=/usr/bin/qemu-aarch64-static}
217 QEMU_BINARY=${QEMU_BINARY:=/usr/bin/qemu-aarch64-static}
231 KERNEL_ARCH=${KERNEL_ARCH:=arm64}
218 KERNEL_ARCH=${KERNEL_ARCH:=arm64}
232 KERNEL_BIN_IMAGE=${KERNEL_BIN_IMAGE:="Image"}
219 KERNEL_BIN_IMAGE=${KERNEL_BIN_IMAGE:="Image"}
233
220
221 # Board specific settings
234 if [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; then
222 if [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; then
235 REQUIRED_PACKAGES="${REQUIRED_PACKAGES} crossbuild-essential-arm64"
223 REQUIRED_PACKAGES="${REQUIRED_PACKAGES} crossbuild-essential-arm64"
236 KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcmrpi3_defconfig}
224 KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcmrpi3_defconfig}
@@ -238,32 +226,29 if [ -n "$SET_ARCH" ] ; then
238 KERNEL_IMAGE=${KERNEL_IMAGE:=kernel8.img}
226 KERNEL_IMAGE=${KERNEL_IMAGE:=kernel8.img}
239 CROSS_COMPILE=${CROSS_COMPILE:=aarch64-linux-gnu-}
227 CROSS_COMPILE=${CROSS_COMPILE:=aarch64-linux-gnu-}
240 else
228 else
241 echo "error: Only Raspberry PI 3 and 3B+ support 64bit"
229 echo "error: Only Raspberry PI 3 and 3B+ support 64 bit"
242 exit 1
230 exit 1
243 fi
231 fi
244 fi
232 fi
245
233
246 ##################################
234 # 32 bit configuration
247 # 32 bit config
248 ##################################
249 if [ "$SET_ARCH" = 32 ] ; then
235 if [ "$SET_ARCH" = 32 ] ; then
250 echo "32 bit mode selected - Setting up enviroment"
236 # General 32 bit dependend settings
251 #General 32bit configuration
252 QEMU_BINARY=${QEMU_BINARY:=/usr/bin/qemu-arm-static}
237 QEMU_BINARY=${QEMU_BINARY:=/usr/bin/qemu-arm-static}
253 KERNEL_ARCH=${KERNEL_ARCH:=arm}
238 KERNEL_ARCH=${KERNEL_ARCH:=arm}
254 KERNEL_BIN_IMAGE=${KERNEL_BIN_IMAGE:="zImage"}
239 KERNEL_BIN_IMAGE=${KERNEL_BIN_IMAGE:="zImage"}
255
240
256 #Raspberry setting grouped by board compability
241 # Hardware specific settings
257 if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 1 ] || [ "$RPI_MODEL" = 1P ] ; then
242 if [ "$RPI_MODEL" = 0 ] || [ "$RPI_MODEL" = 1 ] || [ "$RPI_MODEL" = 1P ] ; then
258 echo "Setting settings for bcm2835 Raspberry PI boards"
259 REQUIRED_PACKAGES="${REQUIRED_PACKAGES} crossbuild-essential-armel"
243 REQUIRED_PACKAGES="${REQUIRED_PACKAGES} crossbuild-essential-armel"
260 KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcmrpi_defconfig}
244 KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcmrpi_defconfig}
261 RELEASE_ARCH=${RELEASE_ARCH:=armel}
245 RELEASE_ARCH=${RELEASE_ARCH:=armel}
262 KERNEL_IMAGE=${KERNEL_IMAGE:=kernel.img}
246 KERNEL_IMAGE=${KERNEL_IMAGE:=kernel.img}
263 CROSS_COMPILE=${CROSS_COMPILE:=arm-linux-gnueabi-}
247 CROSS_COMPILE=${CROSS_COMPILE:=arm-linux-gnueabi-}
264 fi
248 fi
249
250 # Hardware specific settings
265 if [ "$RPI_MODEL" = 2 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; then
251 if [ "$RPI_MODEL" = 2 ] || [ "$RPI_MODEL" = 3 ] || [ "$RPI_MODEL" = 3P ] ; then
266 echo "Setting settings for bcm2837 Raspberry PI boards"
267 REQUIRED_PACKAGES="${REQUIRED_PACKAGES} crossbuild-essential-armhf"
252 REQUIRED_PACKAGES="${REQUIRED_PACKAGES} crossbuild-essential-armhf"
268 KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcm2709_defconfig}
253 KERNEL_DEFCONFIG=${KERNEL_DEFCONFIG:=bcm2709_defconfig}
269 RELEASE_ARCH=${RELEASE_ARCH:=armhf}
254 RELEASE_ARCH=${RELEASE_ARCH:=armhf}
@@ -276,9 +261,7 else
276 echo "error: Please set '32' or '64' as value for SET_ARCH"
261 echo "error: Please set '32' or '64' as value for SET_ARCH"
277 exit 1
262 exit 1
278 fi
263 fi
279
264 # Device specific configuration and U-Boot configuration
280 #Device specific configuration and uboot-config
281 echo "Select DTB-File"
282 case "$RPI_MODEL" in
265 case "$RPI_MODEL" in
283 0)
266 0)
284 DTB_FILE=${DTB_FILE:=bcm2708-rpi-0-w.dtb}
267 DTB_FILE=${DTB_FILE:=bcm2708-rpi-0-w.dtb}
@@ -329,6 +312,7 if [ -n "$DISABLE_UNDERVOLT_WARNINGS" ] ; then
329 fi
312 fi
330 fi
313 fi
331
314
315 # Add cmake to compile videocore sources
332 if [ "$ENABLE_VIDEOCORE" = true ] ; then
316 if [ "$ENABLE_VIDEOCORE" = true ] ; then
333 REQUIRED_PACKAGES="${REQUIRED_PACKAGES} cmake"
317 REQUIRED_PACKAGES="${REQUIRED_PACKAGES} cmake"
334 fi
318 fi
@@ -536,6 +520,21 if [ "$ENABLE_REDUCE" = true ] ; then
536 fi
520 fi
537 fi
521 fi
538
522
523 # Configure systemd-sysv exclude to make halt/reboot/shutdown scripts available
524 if [ "$ENABLE_SYSVINIT" = false ] ; then
525 APT_EXCLUDES="--exclude=${APT_EXCLUDES},init,systemd-sysv"
526 fi
527
528 # Check if kernel is getting compiled
529 if [ "$BUILD_KERNEL" = false ] ; then
530 echo "Downloading precompiled kernel"
531 echo "error: not configured"
532 exit 1;
533 # BUILD_KERNEL=true
534 else
535 echo "No precompiled kernel repositories were added"
536 fi
537
539 # Configure kernel sources if no KERNELSRC_DIR
538 # Configure kernel sources if no KERNELSRC_DIR
540 if [ "$BUILD_KERNEL" = true ] && [ -z "$KERNELSRC_DIR" ] ; then
539 if [ "$BUILD_KERNEL" = true ] && [ -z "$KERNELSRC_DIR" ] ; then
541 KERNELSRC_CONFIG=true
540 KERNELSRC_CONFIG=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