Imx6ul kernel tmpdir tarball: Difference between revisions
From embeddedTS Manuals
No edit summary |
(Add missing -h (--dereference) flag when unpacking kernel tar images) |
||
Line 16: | Line 16: | ||
<source lang=bash> | <source lang=bash> | ||
# Unpack it to a mounted disk, this assumes the disk is mounted to "/mnt" | # Unpack it to a mounted disk, this assumes the disk is mounted to "/mnt" | ||
zcat linux-tsimx6ul...tar.gz | tar xh -C /mnt | |||
# Unpack it to the root directory of a booted system | # Unpack it to the root directory of a booted system | ||
zcat linux-tsimx6ul...tar.gz | tar xh -C / | |||
</source> | </source> |
Latest revision as of 15:30, 26 April 2024
The following will install the kernel and modules to a temporary directory, and then pack them up in to a single tarball:
TEMPDIR=$(mktemp -d)
mkdir "${TEMPDIR}/boot/"
cp arch/arm/boot/zImage "${TEMPDIR}"/boot/zImage
cp arch/arm/boot/dts/imx6ul*ts*.dtb "${TEMPDIR}"/boot/
INSTALL_MOD_PATH="${TEMPDIR}" make modules_install
INSTALL_HDR_PATH="${TEMPDIR}" make headers_install
tar czf linux-tsimx6ul-"$(cat include/config/kernel.release)"-"$(date +"%Y%m%d")".tar.gz -C "${TEMPDIR}" .
rm -rf "${TEMPDIR}"
This will output a tarball with the kernel version and short git hash, as well as the date the tarball was created. For example: linux-tsimx6ul-v4.9.171-60-g01e2117e-20190823.tar.gz
This tarball can be directly unpacked to the root folder of a bootable media for the device. It is also possible to unpack it directly on a booted system, however we do not recommend doing so on an active deployed system without extensive testing.
# Unpack it to a mounted disk, this assumes the disk is mounted to "/mnt"
zcat linux-tsimx6ul...tar.gz | tar xh -C /mnt
# Unpack it to the root directory of a booted system
zcat linux-tsimx6ul...tar.gz | tar xh -C /