Difference between revisions of "Funtoo on the Nvidia TK1"
(Created page with "== Introduction == Read [http://elinux.org/Tegra/Downstream_SW/Gentoo_From_eMMC this].") |
m |
||
(23 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== Introduction == | == Introduction == | ||
Read [http://elinux.org/Tegra/Downstream_SW/Gentoo_From_eMMC this]. | Read [http://elinux.org/Tegra/Downstream_SW/Gentoo_From_eMMC this]. | ||
And [https://devtalk.nvidia.com/default/topic/762653/-howto-build-own-kernel-for-jetson-tk1/ this] | |||
And [https://cyclicredundancy.wordpress.com/2014/05/10/flashing-the-rootfs-on-a-nvidia-jetson-tk1/ this]. | |||
== Getting the Sources == | |||
Use the tools issued by Nvidia to handle kernel sources via git. Checkout the desired kernel version, probably the newest, update the environment variables and great a branch named by the kernel version. | |||
{{console|body= | |||
# wget http://developer.nvidia.com/embedded/dlc/l4t-Jetson-TK1-Driver-Package-R21-5 -O $TOOLS/l4t-Jetson-TK1-Driver-Package-R21-5 | |||
# cd $TOOLS | |||
# tar jxf l4t-Jetson-TK1-Driver-Package-R21-5 | |||
# rm l4t-Jetson-TK1-Driver-Package-R21-5 | |||
# cd Linux_for_Tegra | |||
# ./source_sync.sh #skip tag selection both times | |||
# cd sources/kernel_source | |||
# git ls-remote | |||
# git checkout tegra-l4t-r24.2.1 | |||
# ln -s $PWD $XC_KERNEL_SRC | |||
# . xcompile_variables.sh | |||
# git checkout -b `get_kernel_version` | |||
}} | |||
== Kernel Building == | |||
You need a working kernel config. You can get one from a running TK1 and get it into your $XC_KERNEL_SRC directory. | |||
{{console|body= | |||
# zcat /proc/config.gz > my_TK1_config | |||
# scp my_TK1_config <xc_user>@<xc_host>:~ | |||
# cp ~/my_TK1_config $CONFIGS/`get_kernel_version`.kconf | |||
}} | |||
Or you can get it from the kernel headers. | |||
{{console|body= | |||
# cd $TOOLS/Linux_for_Tegra/kernel | |||
# tar xvf kernel_headers.tbz2 | |||
# cp linux-headers-<kernel_version>/.config $CONFIGS/`get_kernel_version`.kconf | |||
}} | |||
== Make the Kernel == | |||
{{console|body= | |||
# . xcompile_variables.sh | |||
# cd $XC_KERNEL_SRC | |||
# cp $XC_KERNEL_OLDCONFIG .config | |||
# ARCH=$ARCH CROSS_COMPILE=$CROSSDEV_TARGET- make oldconfig | |||
# ARCH=$ARCH CROSS_COMPILE=$CROSSDEV_TARGET- make zImage modules dtbs | |||
}} | |||
== Download and Configure Stage3 == | |||
See http://www.funtoo.org/Crossdev_Automation#Stage3_Configuration | |||
Don't configure fstab and leave a serial console configured on ttyS2 in $XC_STAGES/etc/inittab. | |||
{{console|body= | |||
# echo "# UNCONFIGURED FSTAB FOR BASE SYSTEM" > $XC_STAGE3S/fstab | |||
}} | |||
== Install Super Special Blobs == | |||
This probably messes with portage, but we have to do it. | |||
{{console|body= | |||
# cd $TOOLS/Linux_for_Tegra | |||
# rmdir rootfs | |||
# ln -s $XC_STAGE3S rootfs | |||
# ./apply_binaries.sh | |||
}} | |||
== Copy over Everything == | |||
{{console|body= | |||
# cd $XC_KERNEL_SRC | |||
# ARCH=$ARCH CROSS_COMPILE=$CROSSDEV_TARGET- INSTALL_MOD_PATH=$XC_STAGE3S INSTALL_MOD_STRIP=1 make modules_install | |||
# ARCH=$ARCH CROSS_COMPILE=$CROSSDEV_TARGET- INSTALL_MOD_PATH=$XC_STAGE3S make firmware_install | |||
# rsync -avz $XC_FIRMWARE/ $XC_STAGE3S/lib/firmware | |||
# rsync -avz arch/arm/boot/zImage $XC_STAGE3S/boot | |||
# rsync -avz arch/arm/boot/dts/*.dtb $XC_STAGE3S/boot | |||
# rm $XC_STAGE3S/lib/modules/`get_kernel_release`/{build,source} | |||
}} | |||
== Flash the TK1 == | |||
Put your system into “reset recovery mode” by holding down the “RECOVERY” button and press “RESET” button once on the main board. | |||
Ensure your Linux host system is connected to the target device through the USB cable for flashing. | |||
{{console|body= | |||
# lsusb | grep -i nvidia | |||
Bus 003 Device 002: ID 0955:7140 NVidia Corp. | |||
}} | |||
Cross your fingers. | |||
{{console|body= | |||
# cd $TOOLS | |||
# ./flash.sh -S 8GiB jetson-tk1 mmcblk0p1 | |||
}} |
Revision as of 22:33, February 24, 2017
Introduction
Read this.
And this
And this.
Getting the Sources
Use the tools issued by Nvidia to handle kernel sources via git. Checkout the desired kernel version, probably the newest, update the environment variables and great a branch named by the kernel version.
root # wget http://developer.nvidia.com/embedded/dlc/l4t-Jetson-TK1-Driver-Package-R21-5 -O $TOOLS/l4t-Jetson-TK1-Driver-Package-R21-5 root # cd $TOOLS root # tar jxf l4t-Jetson-TK1-Driver-Package-R21-5 root # rm l4t-Jetson-TK1-Driver-Package-R21-5 root # cd Linux_for_Tegra root # ./source_sync.sh #skip tag selection both times root # cd sources/kernel_source root # git ls-remote root # git checkout tegra-l4t-r24.2.1 root # ln -s $PWD $XC_KERNEL_SRC root # . xcompile_variables.sh root # git checkout -b `get_kernel_version`
Kernel Building
You need a working kernel config. You can get one from a running TK1 and get it into your $XC_KERNEL_SRC directory.
root # zcat /proc/config.gz > my_TK1_config root # scp my_TK1_config <xc_user>@<xc_host>:~ root # cp ~/my_TK1_config $CONFIGS/`get_kernel_version`.kconf
Or you can get it from the kernel headers.
root # cd $TOOLS/Linux_for_Tegra/kernel root # tar xvf kernel_headers.tbz2 root # cp linux-headers-<kernel_version>/.config $CONFIGS/`get_kernel_version`.kconf
Make the Kernel
root # . xcompile_variables.sh root # cd $XC_KERNEL_SRC root # cp $XC_KERNEL_OLDCONFIG .config root # ARCH=$ARCH CROSS_COMPILE=$CROSSDEV_TARGET- make oldconfig root # ARCH=$ARCH CROSS_COMPILE=$CROSSDEV_TARGET- make zImage modules dtbs
Download and Configure Stage3
See http://www.funtoo.org/Crossdev_Automation#Stage3_Configuration
Don't configure fstab and leave a serial console configured on ttyS2 in $XC_STAGES/etc/inittab.
root # echo "# UNCONFIGURED FSTAB FOR BASE SYSTEM" > $XC_STAGE3S/fstab
Install Super Special Blobs
This probably messes with portage, but we have to do it.
root # cd $TOOLS/Linux_for_Tegra root # rmdir rootfs root # ln -s $XC_STAGE3S rootfs root # ./apply_binaries.sh
Copy over Everything
root # cd $XC_KERNEL_SRC root # ARCH=$ARCH CROSS_COMPILE=$CROSSDEV_TARGET- INSTALL_MOD_PATH=$XC_STAGE3S INSTALL_MOD_STRIP=1 make modules_install root # ARCH=$ARCH CROSS_COMPILE=$CROSSDEV_TARGET- INSTALL_MOD_PATH=$XC_STAGE3S make firmware_install root # rsync -avz $XC_FIRMWARE/ $XC_STAGE3S/lib/firmware root # rsync -avz arch/arm/boot/zImage $XC_STAGE3S/boot root # rsync -avz arch/arm/boot/dts/*.dtb $XC_STAGE3S/boot root # rm $XC_STAGE3S/lib/modules/`get_kernel_release`/{build,source}
Flash the TK1
Put your system into “reset recovery mode” by holding down the “RECOVERY” button and press “RESET” button once on the main board.
Ensure your Linux host system is connected to the target device through the USB cable for flashing.
root # lsusb
Cross your fingers.
root # cd $TOOLS root # ./flash.sh -S 8GiB jetson-tk1 mmcblk0p1