Skip to content
Snippets Groups Projects
Unverified Commit 1ef0a1b7 authored by Nils Dagsson Moskopp's avatar Nils Dagsson Moskopp
Browse files

Refactor Linux kernel and dtb build scripts

parent d7149a66
No related branches found
No related tags found
1 merge request!12RC1 of MNT Reform System Image and Rescue Image
...@@ -3,28 +3,27 @@ ...@@ -3,28 +3,27 @@
>/dev/null command -v flex >/dev/null command -v flex
>/dev/null command -v bison >/dev/null command -v bison
redo-ifchange "${2}".tar.gz LINUX_VERSION="${2}"
redo-ifchange "${LINUX_VERSION}".tar.gz
tar \ tar \
--extract \ --extract \
--gzip \ --gzip \
--file "${2}".tar.gz \ --file "${2}".tar.gz \
--skip-old-files \ --skip-old-files \
LINUX_D="${2}"
redo-ifchange \ redo-ifchange \
"${LINUX_D}"/.config \ "${LINUX_VERSION}"/.config \
"${LINUX_D}"/arch/arm64/boot/dts/freescale/imx8mq-mnt-reform2.dts \ "${LINUX_VERSION}"/arch/arm64/boot/dts/freescale/imx8mq-mnt-reform2.dts \
"${LINUX_D}"/arch/arm64/boot/dts/freescale/imx8mq.dtsi \ "${LINUX_VERSION}"/arch/arm64/boot/dts/freescale/imx8mq.dtsi \
export \ export \
ARCH=arm64 \ ARCH=arm64 \
LOADADDR=0x40480000 \ LOADADDR=0x40480000 \
CROSS_COMPILE=aarch64-linux-gnu- \ CROSS_COMPILE=aarch64-linux-gnu- \
redo "${LINUX_D}"/arch/arm64/boot/dts/freescale/imx8mq.dtsi
( (
cd "${LINUX_D}" cd "${LINUX_VERSION}"
for PATCHFILE in ../template-kernel/patches/*.patch; do for PATCHFILE in ../template-kernel/patches/*.patch; do
git apply --check "${PATCHFILE}" git apply --check "${PATCHFILE}"
git apply "${PATCHFILE}" git apply "${PATCHFILE}"
...@@ -37,4 +36,4 @@ redo "${LINUX_D}"/arch/arm64/boot/dts/freescale/imx8mq.dtsi ...@@ -37,4 +36,4 @@ redo "${LINUX_D}"/arch/arm64/boot/dts/freescale/imx8mq.dtsi
>&2 make -j "$(nproc)" freescale/imx8mq-mnt-reform2.dtb >&2 make -j "$(nproc)" freescale/imx8mq-mnt-reform2.dtb
) )
cp "${LINUX_D}"/arch/arm64/boot/dts/freescale/imx8mq-mnt-reform2.dts "${3}" cp "${LINUX_VERSION}"/arch/arm64/boot/dts/freescale/imx8mq-mnt-reform2.dts "${3}"
...@@ -3,18 +3,19 @@ ...@@ -3,18 +3,19 @@
>/dev/null command -v flex >/dev/null command -v flex
>/dev/null command -v bison >/dev/null command -v bison
redo-ifchange "${2}".tar.gz LINUX_VERSION="${2}"
redo-ifchange "${LINUX_VERSION}".tar.gz
tar \ tar \
--extract \ --extract \
--gzip \ --gzip \
--file "${2}".tar.gz \ --file "${2}".tar.gz \
--skip-old-files \ --skip-old-files \
LINUX_D="${2}"
redo-ifchange \ redo-ifchange \
"${LINUX_D}"/.config \ "${LINUX_VERSION}"/.config \
"${LINUX_D}"/arch/arm64/boot/dts/freescale/imx8mq-mnt-reform2.dts \ "${LINUX_VERSION}"/arch/arm64/boot/dts/freescale/imx8mq-mnt-reform2.dts \
"${LINUX_D}"/arch/arm64/boot/dts/freescale/imx8mq.dtsi \ "${LINUX_VERSION}"/arch/arm64/boot/dts/freescale/imx8mq.dtsi \
export \ export \
ARCH=arm64 \ ARCH=arm64 \
...@@ -22,7 +23,7 @@ export \ ...@@ -22,7 +23,7 @@ export \
CROSS_COMPILE=aarch64-linux-gnu- \ CROSS_COMPILE=aarch64-linux-gnu- \
( (
cd "${LINUX_D}" cd "${LINUX_VERSION}"
for PATCHFILE in ../template-kernel/patches/*.patch; do for PATCHFILE in ../template-kernel/patches/*.patch; do
git apply --check "${PATCHFILE}" git apply --check "${PATCHFILE}"
git apply "${PATCHFILE}" git apply "${PATCHFILE}"
...@@ -31,4 +32,4 @@ export \ ...@@ -31,4 +32,4 @@ export \
>&2 make -j "$(nproc)" Image >&2 make -j "$(nproc)" Image
) )
cp "${LINUX_D}"/arch/arm64/boot/Image "${3}" cp "${LINUX_VERSION}"/arch/arm64/boot/Image "${3}"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment