Problem with modules_install

I have made these steps in order to build a kernel: export TOOLCHAIN_SRC=bootlin-toolchain-gcc-93
export TOOLCHAIN_DIR=gcc-9.3-glibc-2.31
export KERNEL_SRC=l4t-sources-34-1
export KERNEL_DIR=kernel-4.9
export JETPACK=$HOME/Scaricati/Linux_for_Tegra
export KERNEL_OUT=$JETPACK/images
export KERNEL_MODULES_OUT=$JETPACK/images/modules

cd $JETPACK
mkdir -p sources && cd sources
wget https://developer.nvidia.com/embedded/l4t/r34_release_v1.1/sources/public_sources.tbz2
tar -xvf public_sources.tbz2 Linux_for_Tegra/source/public/kernel_src.tbz2 --strip-components=3
tar -xvf kernel_src.tbz2

mkdir -p $KERNEL_MODULES_OUT

cd $JETPACK/sources/kernel/$KERNEL_DIR
make mrproper
make ARCH=arm64 O=$KERNEL_OUT tegra_defconfig

make ARCH=arm64 O=$KERNEL_OUT CROSS_COMPILE=$CROSS_COMPILE -j4

Then I used the sshfs command to transfer the whole folder and make modules_install directly on the target platform, but I get errors like.
rm: cannot remove /lib/modules/4.9.253-tegra/kernel/cry

m: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/wireless/realtek/rtlwifi/btcoexist/btcoexist.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/rtl8192cu.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/wireless/realtek/rtlwifi/rtl_usb.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/wireless/realtek/rtlwifi/rtlwifi.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/rtl8192ce.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/wireless/realtek/rtlwifi/rtl8192c/rtl8192c-common.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/wireless/realtek/rtlwifi/rtl8192de/rtl8192de.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/rtl8188ee.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/wireless/realtek/rtlwifi/rtl_pci.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/wireless/realtek/rtl8821cu/rtl8821cu.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/wireless/realtek/rtl8822bu/rtl8822bu.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/wireless/realtek/rtl8812au/rtl8812au.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/wireless/realtek/rtl8814au/rtl8814au.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/wireless/realtek/rtl8821au/rtl8821au.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/wireless/bcmdhd/bcmdhd.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/wireless/marvell/mwifiex/mwifiex_sdio.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/wireless/marvell/mwifiex/mwifiex_pcie.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/wireless/marvell/mwifiex/mwifiex_usb.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/wireless/marvell/mwifiex/mwifiex.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/wireless/marvell/mwl8k.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/wireless/intersil/orinoco/orinoco.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/wireless/intersil/p54/p54pci.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/wireless/intersil/p54/p54common.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/wireless/intersil/p54/p54usb.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/usb/cx82310_eth.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/usb/plusb.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/usb/smsc95xx.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/usb/lan78xx.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/usb/sr9700.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/usb/rtl8150.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/usb/mcs7830.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/usb/gl620a.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/usb/smsc75xx.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/usb/sr9800.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/usb/kaweth.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/usb/dm9601.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/usb/catc.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/usb/rndis_host.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/usb/pegasus.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/can/m_can/m_can.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/can/sja1000/kvaser_pci.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/can/sja1000/plx_pci.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/can/sja1000/sja1000.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/can/sja1000/sja1000_platform.ko’: Permission denied
rm: cannot remove ‘/lib/modules/4.9.253-tegra/kernel/drivers/net/can/sja1000/sja1000_isa.ko’: Permission denied

I also tried with sudo make modules_install but i have this:
make: stat: GNUmakefile: Permission denied
make: stat: makefile: Permission denied
make: stat: Makefile: Permission denied
make: stat: modules_install: Permission denied
make: *** No rule to make target ‘modules_install’. Stop.

Can you help me?

Hi titina,

Are you using the devkit or custom board for Jetson Nano?
What’s your Jetpack version in use?

Are these steps finished on Jetson Nano or your host?

What you should be doing is to either do all the compilation stuff on your device, or build the kernel on your host PC, pack the output kernel modules as an archive, copy it to the device, and unpack it.
Since sshfs is a userspace filesystem driver, it may bring a lot of issues when you deal with some system folders.

1 Like

devkit, i’m using L4T 32.6, JetPack 4.6. I made these steps on my host, and then modules_install on the jetson nano

so you recommend that I also do modules_install in cross compilation and then once I’m done how do I install the modules on the jetson? I have to unpack them under lib\modules? But the steps I was doing to create and build the kernel were correct?

YES.

YES.

1 Like

so I do these steps, copy the kernel image and modules once I’m done on the target platform?

YES.
Anything you don’t get here?