How to rebuild the kernel to activate KVM on the Nvidia Jetson Nano
11
stars
2
forks
source link
BUG : /dhd_linux.c:3827:39: error: argument to ?sizeof? in ?strncpy? call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess] #4
I'm trying to recompile the kernel of the jetson nano (running kernel 4.9.253-tegra) because I want to enable kvm. First of all I have installed ubuntu 20.04 on the jetson nano following this tutorial :
and then I've started to follow your tutorial giving these commands :
sudo apt update && sudo apt-get install -y build-essential bc git curl wget xxd kmod libssl-dev
mkdir /home/marietto/Desktop/jetson_nano_kvm
cd /home/marietto/Desktop/jetson_nano_kvm
wget https://developer.nvidia.com/embedded/l4t/r32_release_v5.1/r32_release_v5.1/sources/t210/public_sources.tbz2
tar -jxvf public_sources.tbz2
JETSON_NANO_KERNEL_SOURCE=/home/marietto/Desktop/jetson_nano_kvm/Linux_for_Tegra/source/public/
cd ${JETSON_NANO_KERNEL_SOURCE}
tar -jxvf kernel_src.tbz2
cd ${JETSON_NANO_KERNEL_SOURCE}/kernel/kernel-4.9
echo "CONFIG_KVM=y CONFIG_VHOST_NET=m" >> arch/arm64/configs/tegra_defconfig
patched: /home/marietto/Desktop/jetson_nano_kvm/Linux_for_Tegra/source/public/hardware/nvidia/soc/t210/kernel-dts/tegra210-soc/tegra210-soc-base.dtsi
JETSON_NANO_KERNEL_SOURCE=/home/marietto/Desktop/jetson_nano_kvm/Linux_for_Tegra/source/public/
TEGRA_KERNEL_OUT=$JETSON_NANO_KERNEL_SOURCE/build
KERNEL_MODULES_OUT=$JETSON_NANO_KERNEL_SOURCE/modules
cd $JETSON_NANO_KERNEL_SOURCE
make -C kernel/kernel-4.9/ ARCH=arm64 O=$TEGRA_KERNEL_OUT LOCALVERSION=-tegra tegra_defconfig
make -C kernel/kernel-4.9/ ARCH=arm64 O=$TEGRA_KERNEL_OUT LOCALVERSION=-tegra -j4 --output-sync=target zImage
make -C kernel/kernel-4.9/ ARCH=arm64 O=$TEGRA_KERNEL_OUT LOCALVERSION=-tegra -j4 --output-sync=target modules
......
CC [M] drivers/net/wireless/bcmdhd/dhd_linux.o
/home/marietto/Desktop/jetson_nano_kvm/Linux_for_Tegra/source/public/kernel/nvidia/drivers/net/wireless/bcmdhd/dhd_linux.c: In function ?dhd_ethtool?:
/home/marietto/Desktop/jetson_nano_kvm/Linux_for_Tegra/source/public/kernel/nvidia/drivers/net/wireless/bcmdhd/dhd_linux.c:3827:39: error: argument to ?sizeof? in ?strncpy? call is the same expression as the source; did you mean to use the size of the destination? [-Werror=sizeof-pointer-memaccess]
strncpy(drvname, info.driver, sizeof(info.driver));
^
cc1: all warnings being treated as errors
make[5]: *** [/home/marietto/Desktop/jetson_nano_kvm/Linux_for_Tegra/source/public/kernel/kernel-4.9/scripts/Makefile.build:335: drivers/net/wireless/bcmdhd/dhd_linux.o] Error 1
make[5]: *** Waiting for unfinished jobs....
CC [M] drivers/net/wireless/bcmdhd/bcmutils.o
CC [M] drivers/net/wireless/bcmdhd/hndpmu.o
make[4]: *** [/home/marietto/Desktop/jetson_nano_kvm/Linux_for_Tegra/source/public/kernel/kernel-4.9/scripts/Makefile.build:649: drivers/net/wireless/bcmdhd] Error 2
make[3]: *** [/home/marietto/Desktop/jetson_nano_kvm/Linux_for_Tegra/source/public/kernel/kernel-4.9/scripts/Makefile.build:649: drivers/net/wireless] Error 2
make[3]: *** Waiting for unfinished jobs....
CC [M] drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.o
LD [M] drivers/net/ethernet/intel/i40e/i40e.o
CC [M] drivers/net/ethernet/intel/ixgb/ixgb_ee.o
CC [M] drivers/net/ethernet/intel/ixgb/ixgb_hw.o
CC [M] drivers/net/ethernet/intel/ixgbevf/vf.o
CC [M] drivers/net/ethernet/intel/ixgb/ixgb_main.o
CC [M] drivers/net/ethernet/intel/ixgb/ixgb_ethtool.o
CC [M] drivers/net/ethernet/intel/ixgb/ixgb_param.o
LD [M] drivers/net/ethernet/intel/ixgb/ixgb.o
CC [M] drivers/net/ethernet/intel/ixgbevf/mbx.o
CC [M] drivers/net/ethernet/intel/ixgbevf/ethtool.o
CC [M] drivers/pci/pci-stub.o
CC [M] drivers/net/ethernet/marvell/skge.o
CC [M] drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.o
LD [M] drivers/net/ethernet/intel/ixgbevf/ixgbevf.o
CC [M] drivers/net/ethernet/mellanox/mlx4/alloc.o
CC [M] drivers/net/ethernet/mellanox/mlx4/catas.o
CC [M] drivers/net/ethernet/marvell/sky2.o
CC [M] drivers/net/ethernet/natsemi/natsemi.o
CC [M] drivers/net/ethernet/mellanox/mlx4/cq.o
CC [M] drivers/net/ethernet/natsemi/ns83820.o
CC [M] drivers/net/ethernet/mellanox/mlx4/eq.o
CC [M] drivers/net/ethernet/mellanox/mlx4/cmd.o
CC [M] drivers/net/ethernet/mellanox/mlx4/fw_qos.o
CC [M] drivers/net/ethernet/mellanox/mlx4/icm.o
CC [M] drivers/net/ethernet/mellanox/mlx4/fw.o
CC [M] drivers/net/ethernet/mellanox/mlx4/intf.o
CC [M] drivers/net/ethernet/mellanox/mlx4/mcg.o
CC [M] drivers/net/ethernet/mellanox/mlx4/mr.o
CC [M] drivers/net/ethernet/mellanox/mlx4/main.o
CC [M] drivers/net/ethernet/mellanox/mlx4/pd.o
CC [M] drivers/net/ethernet/neterion/s2io.o
CC [M] drivers/net/ethernet/mellanox/mlx4/profile.o
CC [M] drivers/net/ethernet/mellanox/mlx4/qp.o
CC [M] drivers/net/ethernet/mellanox/mlx4/reset.o
CC [M] drivers/net/ethernet/mellanox/mlx4/port.o
CC [M] drivers/net/ethernet/neterion/vxge/vxge-config.o
CC [M] drivers/net/ethernet/mellanox/mlx4/sense.o
CC [M] drivers/net/ethernet/mellanox/mlx4/srq.o
CC [M] drivers/net/ethernet/neterion/vxge/vxge-traffic.o
CC [M] drivers/net/ethernet/neterion/vxge/vxge-ethtool.o
CC [M] drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.o
CC [M] drivers/net/ethernet/mellanox/mlx4/resource_tracker.o
LD [M] drivers/net/ethernet/mellanox/mlx4/mlx4_core.o
CC [M] drivers/net/ethernet/netronome/nfp/nfp_net_offload.o
CC [M] drivers/net/ethernet/neterion/vxge/vxge-main.o
LD [M] drivers/net/ethernet/neterion/vxge/vxge.o
CC [M] drivers/net/ethernet/netronome/nfp/nfp_net_common.o
CC [M] drivers/net/ethernet/netronome/nfp/nfp_netvf_main.o
CC [M] drivers/net/ethernet/netronome/nfp/nfp_net_debugfs.o
LD [M] drivers/net/ethernet/netronome/nfp/nfp_netvf.o
CC [M] drivers/net/ethernet/packetengines/hamachi.o
CC [M] drivers/net/ethernet/packetengines/yellowfin.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/main.o
CC [M] drivers/net/ethernet/qlogic/qla3xxx.o
CC [M] drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.o
CC [M] drivers/net/ethernet/qlogic/netxen/netxen_nic_main.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/cmd.o
CC [M] drivers/net/ethernet/qlogic/netxen/netxen_nic_init.o
CC [M] drivers/net/ethernet/qlogic/qed/qed_cxt.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/debugfs.o
CC [M] drivers/net/ethernet/qlogic/qed/qed_dev.o
CC [M] drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.o
CC [M] drivers/net/ethernet/qlogic/qed/qed_hw.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/fw.o
CC [M] drivers/net/ethernet/qlogic/netxen/netxen_nic_ctx.o
LD [M] drivers/net/ethernet/qlogic/netxen/netxen_nic.o
CC [M] drivers/net/ethernet/qlogic/qed/qed_init_fw_funcs.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/eq.o
CC [M] drivers/net/ethernet/qlogic/qed/qed_init_ops.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/uar.o
CC [M] drivers/net/ethernet/qlogic/qede/qede_ethtool.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/pagealloc.o
CC [M] drivers/net/ethernet/qlogic/qed/qed_int.o
CC [M] drivers/net/ethernet/qlogic/qede/qede_main.o
LD [M] drivers/net/ethernet/qlogic/qede/qede.o
CC [M] drivers/net/ethernet/qlogic/qed/qed_main.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/health.o
CC [M] drivers/net/ethernet/qlogic/qed/qed_mcp.o
CC [M] drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/mcg.o
CC [M] drivers/net/ethernet/qlogic/qed/qed_sp_commands.o
CC [M] drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.o
CC [M] drivers/net/ethernet/qlogic/qed/qed_spq.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/cq.o
CC [M] drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.o
CC [M] drivers/net/ethernet/qlogic/qed/qed_selftest.o
CC [M] drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.o
CC [M] drivers/net/ethernet/qlogic/qed/qed_l2.o
CC [M] drivers/net/ethernet/qlogic/qed/qed_dcbx.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/srq.o
CC [M] drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/alloc.o
CC [M] drivers/net/ethernet/qlogic/qed/qed_sriov.o
CC [M] drivers/net/ethernet/qlogic/qed/qed_debug.o
CC [M] drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/qp.o
CC [M] drivers/net/ethernet/qlogic/qed/qed_vf.o
LD [M] drivers/net/ethernet/qlogic/qed/qed.o
CC [M] drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/port.o
CC [M] drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.o
CC [M] drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_vnic.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/mr.o
CC [M] drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.o
CC [M] drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/pd.o
CC [M] drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.o
CC [M] drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.o
LD [M] drivers/net/ethernet/qlogic/qlcnic/qlcnic.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/mad.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/transobj.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/sriov.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/vport.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/fs_counters.o
CC [M] drivers/net/ethernet/qlogic/qlge/qlge_main.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/fs_core.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/rl.o
CC [M] drivers/net/ethernet/qlogic/qlge/qlge_dbg.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/lag.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/dev.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/wq.o
CC [M] drivers/net/ethernet/qlogic/qlge/qlge_mpi.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.o
CC [M] drivers/net/ethernet/qlogic/qlge/qlge_ethtool.o
LD [M] drivers/net/ethernet/qlogic/qlge/qlge.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/en_common.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/eswitch.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/en_fs.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/en_tx.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/en_main.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/en_rx_am.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/en_txrx.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/en_clock.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/en_rx.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/vxlan.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/en_rep.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/en_arfs.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/en_tc.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/en_fs_ethtool.o
CC [M] drivers/net/ethernet/mellanox/mlx5/core/thermal.o
LD [M] drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.o
CC [M] drivers/net/ethernet/qualcomm/qca_framing.o
CC [M] drivers/net/ethernet/qualcomm/qca_spi.o
CC [M] drivers/net/ethernet/qualcomm/qca_7k.o
CC [M] drivers/net/ethernet/qualcomm/qca_debug.o
CC [M] drivers/net/ethernet/qualcomm/emac/emac.o
CC [M] drivers/net/ethernet/mellanox/mlxsw/pci.o
LD [M] drivers/net/ethernet/mellanox/mlxsw/mlxsw_pci.o
CC [M] drivers/net/ethernet/realtek/8139cp.o
CC [M] drivers/net/ethernet/realtek/8139too.o
CC [M] drivers/net/ethernet/qualcomm/emac/emac-mac.o
CC [M] drivers/net/ethernet/qualcomm/emac/emac-phy.o
CC [M] drivers/net/ethernet/qualcomm/emac/emac-sgmii.o
LD [M] drivers/net/ethernet/qualcomm/emac/qcom-emac.o
LD [M] drivers/net/ethernet/qualcomm/qcaspi.o
CC [M] drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.o
CC [M] drivers/net/ethernet/samsung/sxgbe/sxgbe_desc.o
CC [M] drivers/net/ethernet/samsung/sxgbe/sxgbe_core.o
CC [M] drivers/net/ethernet/samsung/sxgbe/sxgbe_dma.o
CC [M] drivers/net/ethernet/samsung/sxgbe/sxgbe_mtl.o
CC [M] drivers/net/ethernet/samsung/sxgbe/sxgbe_main.o
CC [M] drivers/net/ethernet/samsung/sxgbe/sxgbe_mdio.o
CC [M] drivers/net/ethernet/samsung/sxgbe/sxgbe_ethtool.o
LD [M] drivers/net/ethernet/samsung/sxgbe/samsung-sxgbe.o
CC [M] drivers/net/ethernet/sfc/nic.o
CC [M] drivers/net/ethernet/sfc/siena.o
CC [M] drivers/net/ethernet/sfc/efx.o
CC [M] drivers/net/ethernet/sfc/falcon.o
CC [M] drivers/net/ethernet/sfc/farch.o
CC [M] drivers/net/ethernet/sfc/tx.o
CC [M] drivers/net/ethernet/sfc/rx.o
CC [M] drivers/net/ethernet/sfc/selftest.o
CC [M] drivers/net/ethernet/sfc/mdio_10g.o
CC [M] drivers/net/ethernet/sfc/qt202x_phy.o
CC [M] drivers/net/ethernet/sfc/ethtool.o
CC [M] drivers/net/ethernet/sfc/ef10.o
CC [M] drivers/net/ethernet/sfc/tenxpress.o
CC [M] drivers/net/ethernet/sfc/txc43128_phy.o
CC [M] drivers/net/ethernet/sfc/falcon_boards.o
CC [M] drivers/net/ethernet/sfc/mcdi_mon.o
CC [M] drivers/net/ethernet/sfc/mcdi_port.o
CC [M] drivers/net/ethernet/sfc/mcdi.o
CC [M] drivers/net/ethernet/sfc/mtd.o
CC [M] drivers/net/ethernet/sfc/ptp.o
CC [M] drivers/net/ethernet/sfc/sriov.o
CC [M] drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.o
CC [M] drivers/net/ethernet/sfc/ef10_sriov.o
CC [M] drivers/net/ethernet/sfc/siena_sriov.o
LD [M] drivers/net/ethernet/sfc/sfc.o
CC [M] drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.o
CC [M] drivers/net/ethernet/stmicro/stmmac/ring_mode.o
CC [M] drivers/net/ethernet/stmicro/stmmac/chain_mode.o
CC [M] drivers/net/ethernet/stmicro/stmmac/dwmac_lib.o
CC [M] drivers/net/ethernet/stmicro/stmmac/stmmac_main.o
CC [M] drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.o
CC [M] drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.o
CC [M] drivers/net/ethernet/stmicro/stmmac/dwmac100_core.o
CC [M] drivers/net/ethernet/stmicro/stmmac/dwmac100_dma.o
CC [M] drivers/net/ethernet/stmicro/stmmac/enh_desc.o
CC [M] drivers/net/ethernet/stmicro/stmmac/norm_desc.o
CC [M] drivers/net/ethernet/stmicro/stmmac/mmc_core.o
CC [M] drivers/platform/tegra/tegra_cpu_sysfs.o
CC [M] drivers/platform/tegra/bad.o
CC [M] drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.o
CC [M] drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.o
CC [M] drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.o
CC [M] drivers/platform/tegra/nvadsp/dev.o
CC [M] drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.o
CC [M] drivers/net/ethernet/stmicro/stmmac/dwmac4_lib.o
CC [M] drivers/net/ethernet/stmicro/stmmac/dwmac4_core.o
CC [M] drivers/platform/tegra/nvadsp/os.o
CC [M] drivers/net/ethernet/stmicro/stmmac/dwmac-generic.o
LD [M] drivers/net/ethernet/stmicro/stmmac/stmmac.o
CC [M] drivers/net/ethernet/stmicro/stmmac/stmmac_platform.o
LD [M] drivers/net/ethernet/stmicro/stmmac/stmmac-platform.o
make[2]: *** [/home/marietto/Desktop/jetson_nano_kvm/Linux_for_Tegra/source/public/kernel/kernel-4.9/scripts/Makefile.build:649: drivers/net] Error 2
make[2]: *** Waiting for unfinished jobs....
CC [M] drivers/platform/tegra/nvadsp/nvadsp_shared_sema.o
CC [M] drivers/platform/tegra/nvadsp/amc.o
CC [M] drivers/platform/tegra/nvadsp/app.o
CC [M] drivers/platform/tegra/nvadsp/app_loader_linker.o
CC [M] drivers/platform/tegra/nvadsp/hwmailbox.o
CC [M] drivers/platform/tegra/nvadsp/mem_manager.o
CC [M] drivers/platform/tegra/nvadsp/msgq.o
CC [M] drivers/platform/tegra/nvadsp/mailbox.o
CC [M] drivers/platform/tegra/nvadsp/dram_app_mem_manager.o
CC [M] drivers/platform/tegra/nvadsp/aram_manager.o
CC [M] drivers/platform/tegra/nvadsp/os-t21x.o
CC [M] drivers/platform/tegra/nvadsp/dev-t21x.o
CC [M] drivers/platform/tegra/nvadsp/dev-t18x.o
CC [M] drivers/platform/tegra/nvadsp/os-t18x.o
CC [M] drivers/platform/tegra/nvadsp/acast.o
CC [M] drivers/platform/tegra/nvadsp/adsp_console_dbfs.o
CC [M] drivers/platform/tegra/nvadsp/adsp_dfs.o
LD [M] drivers/platform/tegra/nvadsp/nvadsp.o
make[1]: *** [/home/marietto/Desktop/jetson_nano_kvm/Linux_for_Tegra/source/public/kernel/kernel-4.9/Makefile:1121: drivers] Error 2
make: *** [Makefile:171: sub-make] Error 2
Hello.
I'm trying to recompile the kernel of the jetson nano (running kernel 4.9.253-tegra) because I want to enable kvm. First of all I have installed ubuntu 20.04 on the jetson nano following this tutorial :
https://qengineering.eu/install-ubuntu-20.04-on-jetson-nano.html
and then I've started to follow your tutorial giving these commands :