Kernel panic when creating custom rootfs

First off I would really like to see good instructions on creating a custom (production) rootfs. The link here: https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide%2Frootfs_custom.html%23 refers to rootstock which has been deprecated long ago.

I followed the general directions located here: https://codepyre.com/2019/08/building-custom-root-filesystems/

Using a C02 Jetson TX2 dev board:

mkdir nvidia; cd nvidia
tar xf ~/Downloads/Tegra186_Linux_R32.4.3_aarch64.tbz2
cd Linux_for_Tegra
sudo tar -xpvf ~/Downloads/ubuntu-base-18.04.4-base-arm64.tar.gz -C ./rootfs
sudo ./apply_binaries.sh
(get errors due to missing package dependencies so…)
cd rootfs
sudo mount --bind /dev/ dev/
sudo mount --bind /sys/ sys/
sudo mount --bind /proc/ proc/
sudo cp /etc/resolv.conf etc/resolv.conf.host
sudo mv etc/resolv.conf etc/resolv.conf.saved
sudo mv etc/resolv.conf.host etc/resolv.conf
sudo LC_ALL=C LANG=C.UTF-8 chroot . /bin/bash
apt update
apt --fix-broken install
exit
sudo umount ./proc
sudo umount ./sys
sudo umount ./dev
sudo ./apply_binaries.sh
(succeeds after second fix broken install)
sudo ./flash.sh jetson-tx2 mmcblk0p1
(flashes ok and then restarts with following output)

[0000.172] I> Welcome to MB2(TBoot-BPMP)(version: 01.00.160913-t186-M-00.00-mobile-c700205d)
[0000.180] I> bit @ 0xd480000
[0000.183] I> Boot-device: eMMC
[0000.190] I> sdmmc bdev is already initialized
[0000.195] I> pmic: reset reason (nverc) : 0x0
[0000.227] I> Found 19 partitions in SDMMC_BOOT (instance 3)
[0000.246] I> Found 33 partitions in SDMMC_USER (instance 3)
[0000.252] W> No valid slot number is found in scratch register
[0000.257] W> Return default slot: _a
[0000.261] I> A/B: bin_type (16) slot 0
[0000.264] I> Loading partition bpmp-fw at 0xd7800000
[0000.269] I> Reading two headers - addr:0xd7800000 blocks:1
[0000.275] I> Addr: 0xd7800000, start-block: 58777608, num_blocks: 1
[0000.299] I> Binary(16) of size 533504 is loaded @ 0xd7800000
[0000.305] W> No valid slot number is found in scratch register
[0000.311] W> Return default slot: _a
[0000.314] I> A/B: bin_type (17) slot 0
[0000.318] I> Loading partition bpmp-fw-dtb at 0xd79f0000
[0000.323] I> Reading two headers - addr:0xd79f0000 blocks:1
[0000.328] I> Addr: 0xd79f0000, start-block: 58780024, num_blocks: 1
[0000.354] I> Binary(17) of size 604720 is loaded @ 0xd796c400
[0000.584] I> Loading SCE-FW …
[0000.587] W> No valid slot number is found in scratch register
[0000.593] W> Return default slot: _a
[0000.597] I> A/B: bin_type (12) slot 0
[0000.600] I> Loading partition sce-fw at 0xd7300000
[0000.605] I> Reading two headers - addr:0xd7300000 blocks:1
[0000.610] I> Addr: 0xd7300000, start-block: 58784120, num_blocks: 1
[0000.630] I> Binary(12) of size 125168 is loaded @ 0xd7300000
[0000.635] I> Init SCE
[0000.638] I> Loading APE-FW …
[0000.641] W> No valid slot number is found in scratch register
[0000.646] W> Return default slot: _a
[0000.650] I> A/B: bin_type (11) slot 0
[0000.653] I> Loading partition adsp-fw at 0xd7400000
[0000.658] I> Reading two headers - addr:0xd7400000 blocks:1
[0000.664] I> Addr: 0xd7400000, start-block: 58761224, num_blocks: 1
[0000.683] I> Binary(11) of size 107808 is loaded @ 0xd7400000
[0000.689] I> Copy BTCM section
[0000.692] W> No valid slot number is found in scratch register
[0000.697] W> Return default slot: _a
[0000.701] I> A/B: bin_type (13) slot 0
[0000.704] I> Loading partition cpu-bootloader at 0x96000000
[0000.710] I> Reading two headers - addr:0x96000000 blocks:1
[0000.715] I> Addr: 0x96000000, start-block: 58740744, num_blocks: 1
[0000.736] I> Binary(13) of size 284816 is loaded @ 0x96000000
[0000.742] W> No valid slot number is found in scratch register
[0000.747] W> Return default slot: _a
[0000.751] I> A/B: bin_type (20) slot 0
[0000.754] I> Loading partition bootloader-dtb at 0x8520f400
[0000.760] I> Reading two headers - addr:0x8520f400 blocks:1
[0000.765] I> Addr: 0x8520f400, start-block: 58742792, num_blocks: 1
[0000.787] I> Binary(20) of size 371424 is loaded @ 0x8520f400
[0000.793] W> No valid slot number is found in scratch register
[0000.799] W> Return default slot: _a
[0000.802] I> A/B: bin_type (14) slot 0
[0000.806] I> Loading partition secure-os at 0x8530f600
[0000.811] I> Reading two headers - addr:0x8530f600 blocks:1
[0000.816] I> Addr: 0x8530f600, start-block: 58744840, num_blocks: 1
[0000.838] I> Binary(14) of size 366000 is loaded @ 0x8530f600
[0000.846] I> TOS boot-params @ 0x85000000
[0000.850] I> TOS params prepared
[0000.853] I> Loading EKS …
[0000.855] I> A/B: bin_type (15) slot 0
[0000.859] I> Loading partition eks at 0x8590f800
[0000.864] I> Reading two headers - addr:0x8590f800 blocks:1
[0000.869] I> Addr: 0x8590f800, start-block: 58757128, num_blocks: 1
[0000.888] I> Binary(15) of size 1040 is loaded @ 0x8590f800
[0000.893] I> EKB detected (length: 0x400) @ 0x8590f800
[0000.898] I> Copied encrypted keys
[0000.902] I> boot profiler @ 0x275844000
[0000.906] I> boot profiler for TOS @ 0x275844000
[0000.911] I> Unhalting SCE
[0000.913] I> Primary Memory Start:80000000 Size:70000000
[0000.919] I> Extended Memory Start:f0110000 Size:1856f0000
[0000.925] I> MB2(TBoot-BPMP) done

NOTICE: BL31: v1.3(release):41d46a9cf
NOTICE: BL31: Built : 21:14:44, Jun 25 2020
ipc-unittest-main: 1519: Welcome to IPC unittest!!!
ipc-unittest-main: 1531: waiting forever
ipc-unittest-srv: 329: Init unittest services!!!
hwkey-agent: 40: hwkey-agent is running!!
hwkey-agent: 182: key_mgnt_processing …
hwkey-agent: 157: Init hweky-agent services!!
platform_bootstrap_epilog: trusty bootstrap complete
[0001.298] I> Welcome to Cboot
[0001.301] I> Cboot Version: t186-02737b3e
[0001.305] I> CPU-BL Params @ 0x275800000
[0001.308] I> 0) Base:0x00000000 Size:0x00000000
[0001.313] I> 1) Base:0x277f00000 Size:0x00100000
[0001.317] I> 2) Base:0x277e00000 Size:0x00100000
[0001.322] I> 3) Base:0x277d00000 Size:0x00100000
[0001.326] I> 4) Base:0x277c00000 Size:0x00100000
[0001.331] I> 5) Base:0x277b00000 Size:0x00100000
[0001.335] I> 6) Base:0x277800000 Size:0x00200000
[0001.340] I> 7) Base:0x277400000 Size:0x00400000
[0001.345] I> 8) Base:0x277a00000 Size:0x00100000
[0001.349] I> 9) Base:0x277300000 Size:0x00100000
[0001.354] I> 10) Base:0x276800000 Size:0x00800000
[0001.358] I> 11) Base:0x30000000 Size:0x00040000
[0001.362] I> 12) Base:0xf0000000 Size:0x00100000
[0001.367] I> 13) Base:0x30040000 Size:0x00001000
[0001.371] I> 14) Base:0x30048000 Size:0x00001000
[0001.376] I> 15) Base:0x30049000 Size:0x00001000
[0001.380] I> 16) Base:0x3004a000 Size:0x00001000
[0001.385] I> 17) Base:0x3004b000 Size:0x00001000
[0001.389] I> 18) Base:0x3004c000 Size:0x00001000
[0001.394] I> 19) Base:0x3004d000 Size:0x00001000
[0001.398] I> 20) Base:0x3004e000 Size:0x00001000
[0001.402] I> 21) Base:0x3004f000 Size:0x00001000
[0001.407] I> 22) Base:0x00000000 Size:0x00000000
[0001.411] I> 23) Base:0xf0100000 Size:0x00010000
[0001.416] I> 24) Base:0x00000000 Size:0x00000000
[0001.420] I> 25) Base:0x00000000 Size:0x00000000
[0001.425] I> 26) Base:0x00000000 Size:0x00000000
[0001.429] I> 27) Base:0x00000000 Size:0x00000000
[0001.433] I> 28) Base:0x84400000 Size:0x00400000
[0001.438] I> 29) Base:0x30000000 Size:0x00010000
[0001.442] I> 30) Base:0x278000000 Size:0x08000000
[0001.447] I> 31) Base:0x00000000 Size:0x00000000
[0001.451] I> 32) Base:0x276000000 Size:0x00600000
[0001.456] I> 33) Base:0x80000000 Size:0x70000000
[0001.460] I> 34) Base:0xf0110000 Size:0x1856f0000
[0001.465] I> 35) Base:0x00000000 Size:0x00000000
[0001.469] I> 36) Base:0x00000000 Size:0x00000000
[0001.474] I> 37) Base:0x2772e0000 Size:0x00020000
[0001.478] I> 38) Base:0x84000000 Size:0x00400000
[0001.482] I> 39) Base:0x96000000 Size:0x02000000
[0001.487] I> 40) Base:0x85000000 Size:0x01200000
[0001.491] I> 41) Base:0x275800000 Size:0x00500000
[0001.496] I> 42) Base:0x00000000 Size:0x00000000
[0001.500] I> 43) Base:0x00000000 Size:0x00000000
[0001.505] GIC-SPI Target CPU: 4
[0001.508] Interrupts Init done
[0001.511] calling constructors
[0001.514] initializing heap
[0001.517] initializing threads
[0001.520] initializing timers
[0001.523] creating bootstrap completion thread
[0001.528] top of bootstrap2()
[0001.531] CPU: ARM Cortex A57
[0001.534] CPU: MIDR: 0x411FD073, MPIDR: 0x80000100
[0001.539] initializing platform
[0001.543] I> Bl_dtb @0x8520f400
[0001.546] I> gpio framework initialized
[0001.552] I> tegrabl_gpio_driver_register: register ‘nvidia,tegra186-gpio’ driver
[0001.562] I> tegrabl_gpio_driver_register: register ‘nvidia,tegra186-gpio-aon’ driver
[0001.570] I> GPIO framework and drivers are initialized.
[0001.575] I> Boot-device: eMMC
[0001.582] I> sdmmc bdev is already initialized
[0001.613] I> Found 19 partitions in SDMMC_BOOT (instance 3)
[0001.630] I> Found 33 partitions in SDMMC_USER (instance 3)
[0001.636] W> opt-in fuse is not set, skip fuse_burning
[0001.641] I> Reserved memory at 0xfbe00000 for U-Boot relocation
[0001.646] W> No valid slot number is found in scratch register
[0001.652] W> Return default slot: _a
[0001.655] I> A/B: bin_type (21) slot 0
[0001.659] I> Loading kernel-dtb from partition
[0001.663] I> Loading partition kernel-dtb at 0x80000000 from device(0x1)
[0001.681] I> Kernel_dtb @0x80000000
[0001.685] I> tegrabl_tca9539_init: i2c bus: 0, slave addr: 0xee
[0001.695] I> tegrabl_gpio_driver_register: register ‘tca9539_gpio_driver’ driver
[0001.702] I> tegrabl_tca9539_init: i2c bus: 0, slave addr: 0xe8
[0001.711] I> tegrabl_gpio_driver_register: register ‘tca9539_gpio_driver’ driver
[0001.721] I> fixed regulator driver initialized
[0001.754] I> register ‘maxim’ power off handle
[0001.760] I> virtual i2c enabled
[0001.763] I> registered ‘maxim,max77620’ pmic
[0001.768] I> tegrabl_gpio_driver_register: register ‘max77620-gpio’ driver
[0001.783] I> Find /i2c@c250000’s alias i2c7
[0001.787] I> Reading eeprom i2c=7 address=0x50
[0001.816] I> Device at /i2c@c250000:0x50
[0001.820] I> Reading eeprom i2c=7 address=0x57
[0001.848] I> Device at /i2c@c250000:0x57
[0001.853] I> Find /i2c@c240000’s alias i2c1
[0001.857] I> Reading eeprom i2c=1 address=0x51
[0001.862] E> I2C: slave not found in slaves.
[0001.866] E> I2C: Could not write 0 bytes to slave: 0x00a2 with repeat start true.
[0001.874] E> I2C_DEV: Failed to send register address 0x00000000.
[0001.880] E> I2C_DEV: Could not read 256 registers of size 1 from slave 0xa2 at 0x00000000 via instance 1.
[0001.889] E> eeprom: Retry to read I2C slave device.
[0001.894] E> I2C: slave not found in slaves.
[0001.898] E> I2C: Could not write 0 bytes to slave: 0x00a2 with repeat start true.
[0001.906] E> I2C_DEV: Failed to send register address 0x00000000.
[0001.912] E> I2C_DEV: Could not read 256 registers of size 1 from slave 0xa2 at 0x00000000 via instance 1.
[0001.921] E> eeprom: Failed to read I2C slave device
[0001.926] I> Eeprom read failed 0x3526070d
[0001.930] I> Find /i2c@3160000’s alias i2c0
[0001.934] I> Reading eeprom i2c=0 address=0x50
[0001.939] E> I2C: slave not found in slaves.
[0001.943] E> I2C: Could not write 0 bytes to slave: 0x00a0 with repeat start true.
[0001.951] E> I2C_DEV: Failed to send register address 0x00000000.
[0001.957] E> I2C_DEV: Could not read 256 registers of size 1 from slave 0xa0 at 0x00000000 via instance 0.
[0001.966] E> eeprom: Failed to read I2C slave device
[0001.971] I> Eeprom read failed 0x3526070d
[0001.976] I> Find /i2c@3180000’s alias i2c2
[0001.980] I> Reading eeprom i2c=2 address=0x54
[0001.984] I> Enabling gpio chip_id = 2, gpio pin = 9
[0002.014] I> Disabling gpio chip_id = 2, gpio pin = 9
[0002.020] I> Device at /i2c@3180000:0x54
[0002.023] I> Reading eeprom i2c=2 address=0x57
[0002.028] I> Enabling gpio chip_id = 2, gpio pin = 9
[0002.033] E> I2C: slave not found in slaves.
[0002.037] E> I2C: Could not write 0 bytes to slave: 0x00ae with repeat start true.
[0002.045] E> I2C_DEV: Failed to send register address 0x00000000.
[0002.051] E> I2C_DEV: Could not read 256 registers of size 1 from slave 0xae at 0x00000000 via instance 2.
[0002.060] E> eeprom: Failed to read I2C slave device
[0002.065] I> Disabling gpio chip_id = 2, gpio pin = 9
[0002.070] I> Eeprom read failed 0x00000000
[0002.074] I> create_pm_ids: id: 3310-1000-D00-J, len: 15
[0002.079] I> config: mem-type:00,power-config:00,misc-config:00,modem-config:00,touch-config:00,display-config:00, len: 93
[0002.090] I> create_pm_ids: id: 2597-0000-900-E, len: 15
[0002.096] I> config: mem-type:00,power-config:00,misc-config:00,modem-config:00,touch-config:00,display-config:00, len: 93
[0002.106] I> create_pm_ids: id: 3326-1000-000-M, len: 15
[0002.112] I> config: mem-type:ff,power-config:ff,misc-config:ff,modem-config:ff,touch-config:ff,display-config:ff, len: 93
[0002.146] I> enabling ‘vdd-hdmi’ regulator
[0002.162] I> regulator ‘vdd-hdmi’ already enabled
[0002.166] E> tegrabl_display_init_regulator: hdmi cable is not connected
[0002.173] E> tegrabl_display_get_pdata, failed to parse dtb settings
[0002.182] E> cannot find any other nvdisp nodes
[0002.186] E> no valid display unit config found in dtb
[0002.192] W> display init failed
[0002.195] initializing target
[0002.198] calling apps_init()
[0002.201] starting app kernel_boot_app
[0002.224] I> found decompressor handler: lz4-legacy
[0002.229] I> decompressing BMP blob …
[0002.238] I> Kernel type = Normal
[0002.242] I> Loading kernel-bootctrl from partition
[0002.246] I> Loading partition kernel-bootctrl at 0xa8000000 from device(0x1)
[0002.266] W> tegrabl_get_kernel_bootctrl: magic number(0x00000000) is invalid
[0002.273] W> tegrabl_get_kernel_bootctrl: use default dummy boot control data
[0002.280] I> ########## Fixed storage boot ##########
[0002.285] W> No valid slot number is found in scratch register
[0002.290] W> Return default slot: _a
[0002.294] I> A/B: bin_type (24) slot 0
[0002.309] I> Boot image size read from image header: 74aba
[0002.315] I> Boot image load address: 0x80400000
[0002.319] I> Loading kernel from partition
[0002.323] I> Loading partition kernel at 0x80400000 from device(0x1)
[0003.558] I> Validate kernel …
[0003.561] I> T18x: Authenticate kernel (bin_type 24), max size 0x4000000
[0003.568] I> kernel-dtb is already loaded
[0003.572] I> Validate kernel-dtb …
[0003.575] I> T18x: Authenticate kernel-dtb (bin_type 21), max size 0x100000
[0003.583] I> Checking boot.img header magic … [0003.587] I> [OK]
[0003.589] I> Kernel hdr @0x80400000
[0003.592] I> Kernel dtb @0x80000000
[0003.596] I> decompressor handler not found
[0003.600] I> Copying kernel image (477882 bytes) from 0x80400800 to 0x80600000 … [0003.607] I> Done
[0003.609] I> Move ramdisk (len: 0) from 0x80475800 to 0x947b0000
[0003.616] I> Updated bpmp info to DTB
[0003.622] I> Ramdisk: Base: 0x947b0000; Size: 0x0
[0003.627] I> Updated initrd info to DTB
[0003.630] W> WARN: Fail to override “console=none” in commandline
[0003.636] E> tegrabl_linuxboot_add_disp_param, du 0 failed to get display params
[0003.643] E> tegrabl_linuxboot_add_disp_param, du 0 failed to get display params
[0003.651] E> tegrabl_linuxboot_add_disp_param, du 0 failed to get display params
[0003.658] I> disabled_core_mask: 0xffffff0c
[0003.662] W> No valid slot number is found in scratch register
[0003.667] W> Return default slot: _a
[0003.671] I> Active slot suffix:
[0003.674] I> add_boot_slot_suffix: slot_suffix =
[0003.679] I> Linux Cmdline: console=ttyS0,115200 androidboot.presilicon=true firmware_class.path=/etc/firmware root=/dev/mmcblk0p1 rw rootwait rootfstyp
[0003.723] I> Updated bootarg info to DTB
[0003.727] I> eeprom_get_mac_addr: MAC (type: 0): 00:04:4b:f8:b0:91
[0003.733] I> eeprom_get_mac_addr: MAC (type: 1): 00:04:4b:f8:b0:92
[0003.740] I> eeprom_get_mac_addr: MAC (type: 2): 00:04:4b:f8:b0:93
[0003.746] E> Found no plugin manager ids in source DT
[0003.751] W> Add plugin manager ids from board info
[0003.756] W> “plugin-manager” doesn’t exist, creating
[0003.760] W> “ids” doesn’t exist, creating
[0003.764] W> “connection” doesn’t exist, creating
[0003.769] W> “configs” doesn’t exist, creating
[0003.773] I> create_pm_ids: id: 3310-1000-D00-J, len: 15
[0003.779] I> config: mem-type:00,power-config:00,misc-config:00,modem-config:00,touch-config:00,display-config:00, len: 93
[0003.789] I> create_pm_ids: id: 2597-0000-900-E, len: 15
[0003.795] I> config: mem-type:00,power-config:00,misc-config:00,modem-config:00,touch-config:00,display-config:00, len: 93
[0003.806] I> create_pm_ids: id: 3326-1000-000-M, len: 15
[0003.811] I> config: mem-type:ff,power-config:ff,misc-config:ff,modem-config:ff,touch-config:ff,display-config:ff, len: 93
[0003.822] I> Adding plugin-manager/ids/3310-1000-D00=/i2c@c250000:module@0x50
[0003.829] W> “i2c@c250000” doesn’t exist, creating
[0003.834] W> “module@0x50” doesn’t exist, creating
[0003.839] I> Adding plugin-manager/ids/2597-0000-900=/i2c@c250000:module@0x57
[0003.846] W> “module@0x57” doesn’t exist, creating
[0003.851] I> Adding plugin-manager/ids/3326-1000-000=/i2c@3180000:module@0x54
[0003.858] W> “i2c@3180000” doesn’t exist, creating
[0003.863] W> “module@0x54” doesn’t exist, creating
[0003.869] I> Adding plugin-manager/ids/3310-1000-D00-J
[0003.876] I> Adding plugin-manager/configs/3310-mem-type 00
[0003.882] I> Adding plugin-manager/configs/3310-power-config 00
[0003.888] I> Adding plugin-manager/configs/3310-misc-config 00
[0003.894] I> Adding plugin-manager/configs/3310-modem-config 00
[0003.900] I> Adding plugin-manager/configs/3310-touch-config 00
[0003.906] I> Adding plugin-manager/configs/3310-display-config 00
[0003.912] I> Adding plugin-manager/cvm
[0003.916] W> “chip-id” doesn’t exist, creating
[0003.920] I> Adding plugin-manager/chip-id/A02P
[0003.925] W> “odm-data” doesn’t exist, creating
[0003.929] I> Adding /chosen/plugin-manager/odm-data
[0003.939] I> added [base:0x80000000, size:0x70000000] to /memory
[0003.945] I> added [base:0xf0200000, size:0x185600000] to /memory
[0003.951] I> added [base:0x275e00000, size:0x200000] to /memory
[0003.957] I> added [base:0x276600000, size:0x200000] to /memory
[0003.962] I> added [base:0x277000000, size:0x200000] to /memory
[0003.968] I> Updated memory info to DTB
[0003.973] E> add_disp_param: failed to get display params for du=0
[0003.980] W> “reset” doesn’t exist, creating
[0003.985] W> “pmc-reset-reason” doesn’t exist, creating
[0003.990] W> “pmic-reset-reason” doesn’t exist, creating
[0003.997] I> Adding ecid(00000001645cc4002000000019060380) to DT
[0004.002] I> disabled_core_mask: 0xffffff0c
[0004.015] I> Add serial number:1421120016548 as DT property
[0004.024] I> Plugin-manager override starting
[0004.030] I> node /plugin-manager/fragement@0 matches
[0004.040] I> node /plugin-manager/fragement@4 matches
[0004.053] I> node /plugin-manager/fragment-sdwake-p3310-1000-300 matches
[0004.073] I> node /plugin-manager/fragement-pmon-p3310-1000-300 matches
[0004.082] I> node /plugin-manager/fragement-pmon-p3310-1000-800 matches
[0004.091] I> node /plugin-manager/fragment-devslp@0 matches
[0004.104] I> node /plugin-manager/fragment-500-pcie-config matches
[0004.118] I> node /plugin-manager/fragment-500-xusb-config matches
[0004.141] I> node /plugin-manager/fragment-p3310-c00-comm matches
[0004.155] I> node /plugin-manager/fragment-p3310-c00-pmic matches
[0004.165] I> node /plugin-manager/fragment-p3310-c01 matches
[0004.178] I> node /plugin-manager/fragment-p3310-c03 matches
[0004.213] I> node /plugin-manager/fragment-e3326@0 matches
[0004.294] I> node /plugin-manager/fragment-p3310-c00-camera matches
[0004.321] I> Disable plugin-manager status in FDT
[0004.326] I> Plugin-manager override finished successfully
[0004.331] I> tegrabl_load_kernel_and_dtb: Done
[0004.335] E> tegrabl_display_clear: display is not initialized
[0004.341] W> Boot logo display failed…
[0004.345] I> Kernel EP: 0x80600000, DTB: 0x80000000

U-Boot 2016.07-ge6da093be3 (Jun 25 2020 - 21:14:32 -0700)

TEGRA186
Model: NVIDIA P2771-0000-500
DRAM: 7.8 GiB
MC: Tegra SD/MMC: 0, Tegra SD/MMC: 1
*** Warning - bad CRC, using default environment

In: serial
Out: serial
Err: serial
Net: eth0: ethernet@2490000
Hit any key to stop autoboot: 0
MMC: no card present
switch to partitions #0, OK
mmc0(part 0) is current device
Scanning mmc 0:1…
Found /boot/extlinux/extlinux.conf
Retrieving file: /boot/extlinux/extlinux.conf
857 bytes read in 128 ms (5.9 KiB/s)
1: primary kernel
Retrieving file: /boot/initrd
5565615 bytes read in 263 ms (20.2 MiB/s)
Retrieving file: /boot/Image
34330632 bytes read in 856 ms (38.2 MiB/s)
append: console=ttyS0,115200 androidboot.presilicon=true firmware_class.path=/etc/firmware root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyS0,

Flattened Device Tree blob at 80000000

Booting using the fdt blob at 0x80000000
reserving fdt memory region: addr=80000000 size=10000
Using Device Tree in place at 0000000080000000, end 000000008005fa73

Starting kernel …

[ 0.000000] Booting Linux on physical CPU 0x100
[ 0.000000] Linux version 4.9.140-tegra (buildbrain@mobile-u64-3357) (gcc version 7.3.1 20180425 [linaro-7.3-2018.05 revision d29120a424ecfbc167ef90060
[ 0.000000] Boot CPU: AArch64 Processor [411fd073]
[ 0.000000] OF: fdt:memory scan node memory@80000000, reg size 16416,
[ 0.000000] OF: fdt: - 80000000 , 70000000
[ 0.000000] OF: fdt: - f0200000 , 185600000
[ 0.000000] OF: fdt: - 275e00000 , 200000
[ 0.000000] OF: fdt: - 276600000 , 200000
[ 0.000000] OF: fdt: - 277000000 , 200000
[ 0.000000] earlycon: uart8250 at MMIO32 0x0000000003100000 (options ‘’)
[ 0.000000] bootconsole [uart8250] enabled
[ 1.755331] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00007f00
[ 1.755331]
[ 1.764462] CPU: 5 PID: 1 Comm: chroot Not tainted 4.9.140-tegra #1
[ 1.770719] Hardware name: quill (DT)
[ 1.774375] Call trace:
[ 1.776823] [] dump_backtrace+0x0/0x198
[ 1.782215] [] show_stack+0x24/0x30
[ 1.787260] [] dump_stack+0x98/0xc0
[ 1.792306] [] panic+0x11c/0x298
[ 1.793169] tegra-pcie 10003000.pcie-controller: link 0 down, retrying
[ 1.803604] [] do_exit+0xa04/0xa08
[ 1.808559] [] do_group_exit+0x40/0xa8
[ 1.813862] [] __wake_up_parent+0x0/0x40
[ 1.819339] [] el0_svc_naked+0x34/0x38
[ 1.824645] SMP: stopping secondary CPUs
[ 1.828574] Kernel Offset: disabled
[ 1.832055] Memory Limit: none
[ 1.835104] trusty-log panic notifier - trusty version Built: 21:16:26 Jun 25 2020 [ 1.846518] Rebooting in 5 seconds…

hello cgreen,

FYI,
we had confirmation that L4T Sample Root File System from download center to set up the rootfs successfully.
could you please based-on the sample file system to have your own customization,
thanks

Hello Jerry,

I have previously used the L4T Sample Root File System successfully. However, the Nvidia documentation from this location states that “The sample root file system is provided as a convenience. NVIDIA disclaims any obligations to provide support, including bug fixes and security updates, and provides no warranty for this software. Customers are responsible for root file system selection and support.”

Starting from a sample root file system and figuring out what is unnecessary and can be removed is not standard practice in embedded Linux development. Standard practices generally either utilize a Buildroot/Yocto type build system (such as https://github.com/OE4T/meta-tegra ) or start from a core image and add the necessary packages to the core. Other uC/uP vendors typically provide a “from scratch” build system framework (the other SOC that I’m evaluating from a competitor provides Yocto layers).

In order to “productionize” the TX2 I will need to implement a CI/CD system that can produce an image with precisely known content. Starting from a sample root file system and working backwards is not a suitable option.

Using the above mentioned Yocto meta-tegra layer does boot (see attached boot log) however I get errors for:

ERROR: reserving fdt memory region failed (addr=0 size=0)

Error, FB vsync ioctl [-1]

A 4.5 GB root file system (~15% of the available space on the eMMC) is very bloated. I would like to create a core/headless root file system around 1.5 GB in size.

I hope that Nvidia is committed to supporting developers to build systems for production in addition to a demo system.

1 Like

I have not built a custom rootfs, but if I were, then I’d learn these two things before I actually went for my final solution:

  • Learn to boot anything simple from the existing kernel and boot software. Probably an initrd which does nothing more than run a bash shell.
  • If I had to build my own boot chain, then I’d try to make all modifications successfully using the existing sample rootfs.
  • Work on getting pivot_root to work with whichever boot chain and initrd you’ve started with, even if the pivot_root did nothing more than load another bash shell.
  • Examine what packages and files are installed from the driver package’s “apply_binaries.sh”.
  • Design surrounding linker and libraries around the content of apply_binaries.sh. NVIDIA-supplied binaries are not something you can simply give up unless you are willing to give up direct hardware acceleration.
  • Make specific adjustments such that the exact same release of Xorg (due to ABI requirements) is used as in the sample rootfs. This is a very special case since the NVIDIA GPU driver binary connects through the Xorg server (and not just the linker) for a large part of the software (especially OpenGL/ES accelerated software). Xorg has specifications for the ABI version of several loadable “subsystems”. If you go to “/var/log/Xorg.0.log” (or maybe “/var/log/Xorg.1.log”, depending on setup), and search for ABI, then you will see the ABI releases (the “Video Driver” is the one the GPU binary depends on), and it will look like this:
[    10.884] (II) Module ABI versions:
[    10.884]    X.Org ANSI C Emulation: 0.4
[    10.884]    X.Org Video Driver: 23.0
[    10.884]    X.Org XInput driver : 24.1
[    10.884]    X.Org Server Extension : 10.0
[    10.885] (++) using VT number 1

If you just stick to the existing kernel life will be much easier, and I have doubts all hardware acceleration would work correctly if you use a newer kernel. If you do not stick to the existing kernel, then you would certainly want to start with it anyway and perhaps backport newer features into it.

I tried using ubuntu-base-18.04-base-arm64.tar.gz which has revision d20 of the kernel (the same as the sample root file system) but had the same kernel panic error. I also tried several variations of commands (omitting mount/umount) with no luck.

Then I tried using qemu-debootstrap and got that to work (with the following error):

systemd-gpt-auto-generator[2148]: Failed to dissect: Input/output error
systemd[2142]: /lib/systemd/system-generators/systemd-gpt-auto-generator failed with exit status 1.

At least I don’t get the kernel panic and adding a password for root (in the chroot environment before running flash.sh) allows me to login.

Next I’ll look at modifying apply_binaries.sh and/or nv_tegra/nv-apply-debs.sh to remove the installation of unwanted packages.

Here is the command sequence for those interested:

tar xf ~/Downloads/Tegra186_Linux_R32.4.3_aarch64.tbz2
cd Linux_for_Tegra/
sudo qemu-debootstrap --arch arm64 bionic ./rootfs
cd rootfs/
sudo cp ~/Downloads/extracted_sample_rootfs/etc/apt/sources.list etc/apt/
sudo LC_ALL=C LANG=C.UTF-8 chroot . /bin/bash
apt update
exit
cd …/
sudo ./apply_binaries.sh
cd rootfs/
sudo LC_ALL=C LANG=C.UTF-8 chroot . /bin/bash
apt --fix-broken install
exit
cd …/
sudo ./apply_binaries.sh
cd rootfs/
sudo LC_ALL=C LANG=C.UTF-8 chroot . /bin/bash
apt --fix-broken install
exit
cd …/
sudo ./apply_binaries.sh
sudo ./flash.sh jetson-tx2 mmcblk0p1

I do not know if your commands are correct or not (I’ll emphasize that I am not trying this on an actual Jetson), but I do see apply_binaries.sh twice (I don’t know if that is a typo or intentional).

Do you have evidence of an initrd being called (or not being called)? If an initrd is called, does it have your modifications/kernel? Do you have evidence that the correct device tree is being loaded? Either of those would be mandatory to confirm as correct for your case before you could move forward on a custom rootfs.

I have same issue on nano ,
Do you have solved this issue ? thanks