@@ -24,7 +24,11 if [ "$BUILD_KERNEL" = true ] ; then | |||
|
24 | 24 | temp_dir=$(sudo -u nobody mktemp -d) |
|
25 | 25 | |
|
26 | 26 | # Fetch current RPi2/3 kernel sources |
|
27 | sudo -u nobody git -C "${temp_dir}" clone --depth=1 "${KERNEL_URL}" | |
|
27 | if [ -z "${KERNEL_BRANCH}" ] ; then | |
|
28 | sudo -u nobody git -C "${temp_dir}" clone --depth=1 "${KERNEL_URL}" | |
|
29 | else | |
|
30 | sudo -u nobody git -C "${temp_dir}" clone --depth=1 --branch "${KERNEL_BRANCH}" "${KERNEL_URL}" | |
|
31 | fi | |
|
28 | 32 | |
|
29 | 33 | # Copy downloaded kernel sources |
|
30 | 34 | mv "${temp_dir}/linux" "${R}/usr/src/" |
@@ -94,12 +98,12 if [ "$BUILD_KERNEL" = true ] ; then | |||
|
94 | 98 | fi |
|
95 | 99 | |
|
96 | 100 | # Cross compile kernel and modules |
|
97 |
make -C "${KERNEL_DIR}" -j${KERNEL_THREADS} ARCH="${KERNEL_ARCH}" CROSS_COMPILE="${CROSS_COMPILE}" |
|
|
101 | make -C "${KERNEL_DIR}" -j${KERNEL_THREADS} ARCH="${KERNEL_ARCH}" CROSS_COMPILE="${CROSS_COMPILE}" "${KERNEL_BIN_IMAGE}" modules dtbs | |
|
98 | 102 | fi |
|
99 | 103 | |
|
100 | 104 | # Check if kernel compilation was successful |
|
101 |
if [ ! -r "${KERNEL_DIR}/arch/${KERNEL_ARCH}/boot/ |
|
|
102 |
echo "error: kernel compilation failed! ( |
|
|
105 | if [ ! -r "${KERNEL_DIR}/arch/${KERNEL_ARCH}/boot/${KERNEL_BIN_IMAGE}" ] ; then | |
|
106 | echo "error: kernel compilation failed! (kernel image not found)" | |
|
103 | 107 | cleanup |
|
104 | 108 | exit 1 |
|
105 | 109 | fi |
@@ -130,16 +134,23 if [ "$BUILD_KERNEL" = true ] ; then | |||
|
130 | 134 | |
|
131 | 135 | # Copy dts and dtb device tree sources and binaries |
|
132 | 136 | mkdir "${BOOT_DIR}/overlays" |
|
133 | install_readonly "${KERNEL_DIR}/arch/${KERNEL_ARCH}/boot/dts/"*.dtb "${BOOT_DIR}/" | |
|
137 | ||
|
138 | # Ensure the proper .dtb is located | |
|
139 | if [ "$KERNEL_ARCH" = "arm" ] ; then | |
|
140 | install_readonly "${KERNEL_DIR}/arch/${KERNEL_ARCH}/boot/dts/"*.dtb "${BOOT_DIR}/" | |
|
141 | else | |
|
142 | install_readonly "${KERNEL_DIR}/arch/${KERNEL_ARCH}/boot/dts/broadcom/"*.dtb "${BOOT_DIR}/" | |
|
143 | fi | |
|
144 | ||
|
134 | 145 | install_readonly "${KERNEL_DIR}/arch/${KERNEL_ARCH}/boot/dts/overlays/"*.dtb* "${BOOT_DIR}/overlays/" |
|
135 | 146 | install_readonly "${KERNEL_DIR}/arch/${KERNEL_ARCH}/boot/dts/overlays/README" "${BOOT_DIR}/overlays/README" |
|
136 | 147 | |
|
137 | 148 | if [ "$ENABLE_UBOOT" = false ] ; then |
|
138 |
# Convert and copy |
|
|
139 |
"${KERNEL_DIR}/scripts/mkknlimg" "${KERNEL_DIR}/arch/${KERNEL_ARCH}/boot/ |
|
|
149 | # Convert and copy kernel image to the boot directory | |
|
150 | "${KERNEL_DIR}/scripts/mkknlimg" "${KERNEL_DIR}/arch/${KERNEL_ARCH}/boot/${KERNEL_BIN_IMAGE}" "${BOOT_DIR}/${KERNEL_IMAGE}" | |
|
140 | 151 | else |
|
141 |
# Copy |
|
|
142 |
install_readonly "${KERNEL_DIR}/arch/${KERNEL_ARCH}/boot/ |
|
|
152 | # Copy kernel image to the boot directory | |
|
153 | install_readonly "${KERNEL_DIR}/arch/${KERNEL_ARCH}/boot/${KERNEL_BIN_IMAGE}" "${BOOT_DIR}/${KERNEL_IMAGE}" | |
|
143 | 154 | fi |
|
144 | 155 | |
|
145 | 156 | # Remove kernel sources |
@@ -167,6 +178,3 else # BUILD_KERNEL=false | |||
|
167 | 178 | cleanup |
|
168 | 179 | exit 1 |
|
169 | 180 | fi |
|
170 | # Copy vmlinuz kernel to the boot directory | |
|
171 | install_readonly "${VMLINUZ}" "${BOOT_DIR}/${KERNEL_IMAGE}" | |
|
172 | fi |
General Comments 0
Vous devez vous connecter pour laisser un commentaire.
Se connecter maintenant