Creating a recovery initrd

Hi ,
Is there any steps available for creating a recovery initrdfs and booting from it for nvidia xavier nx ?

https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/flashing.html#wwpID0EQHA
I followed this steps and modified the init script and added a print statement.It was not displayed in my serial console.
I just want to boot in to my initrd.

Hi,

I think that is already what you want. The initrd is customized now.
Just didn’t print out the log. I am not sure if adding print would show up in uart console.

Do i need to change anything in extlinux.conf in order to boot from ramdisk?

Thanks

The default one already booted into initrd and then switch to the rootfs. extlinux.conf shall show the path of initrd.

What is the exact goal you want here? You want to use the initrd cmdline?

yes , I want to use initrd cmdline.
Thanks

Add root=“” to your kernel cmdline and it shall boot to the initrd cmdline.

Is there any way to do it without flashing??

Write it to your extlinux.conf.

LABEL primary
MENU LABEL primary kernel
LINUX /boot/Image
INITRD /boot/initrd
APPEND ${cbootargs} quiet root=“” rw rootwait rootfstype=ext4 console=tty0 fbcon=map:0 net.ifnames=0
Like this right?

  ��WARNING: at platform/drivers/pg/pg-gpu-t194.c:185                             

WARNING: at platform/drivers/pg/pg-gpu-t194.c:185
��[ 6.253611] tegra-ivc ivc-bc00000.rtcpu: region 0: iova=0xbfee0000-0xbfeff2
[ 6.255497] tegra-ivc ivc-bc00000.rtcpu:echo@0: echo: ver=0 grp=1 RX[16x64]=0
[ 6.257363] tegra-ivc ivc-bc00000.rtcpu:dbg@1: dbg: ver=0 grp=1 RX[1x384]=0x0
[ 6.259207] tegra-ivc ivc-bc00000.rtcpu:dbg@2: dbg: ver=0 grp=1 RX[1x8192]=00
[ 6.262124] tegra-ivc ivc-bc00000.rtcpu:ivccontrol@3: ivccontrol: ver=0 grp=0
[ 6.263827] tegra-ivc ivc-bc00000.rtcpu:ivccapture@4: ivccapture: ver=0 grp=0
[ 6.265731] tegra186-cam-rtcpu bc00000.rtcpu: using cam RTCPU IRQ (65)
[ 6.267317] tegra186-cam-rtcpu bc00000.rtcpu: tegra_camrtc_mon_create is sucl
[ 6.270146] tegra186-cam-rtcpu bc00000.rtcpu: firmware version cpu=rce cmd=5a
[ 6.272318] Wake83 for irq=211
[ 6.273953] gpio tegra-gpio wake67 for gpio=48(G:0)
[ 6.275627] gpio tegra-gpio-aon wake29 for gpio=36(EE:4)
[ 6.279350] input: gpio-keys as /devices/gpio-keys/input/input4
[ 6.319035] tegra_rtc c2a0000.rtc: setting system clock to 2000-01-01 01:00:)
[ 6.321284] mmcblk mmc0:0001: Card claimed for testing.
[ 6.357968] bpmp: mounted debugfs mirror
[ 6.365624] ALSA device list:
[ 6.367213] #0: tegra-hda-xnx at 0x3518000 irq 64
[ 6.368834] #1: jetson-xaviernx-ape
[ 6.370736] RAMDISK: gzip image found at block 0
[ 6.451093] RAMDISK: incomplete write (21335 != 32768)
[ 6.452765] write error
[ 6.454378] Waiting for root device …
[ 38.241000] vdd-1v8-sd: disabling
[ 38.242609] vdd-1v8-cvb: disabling
[ 38.244157] vdd-epb-1v0: disabling
[ 38.245693] avdd-cam-2v8: disabling
[ 38.247168] vdd-fan: disabling
[ 38.248665] vdd_sys_en: disabling
[ 64.864977] tegra-xusb 3610000.xhci: cannot find firmware…retry after 1 sd
[ 65.888927] tegra-xusb 3610000.xhci: Direct firmware load for tegra19x_xusb_2
[ 65.890578] tegra-xusb 3610000.xhci: Falling back to user helper
[ 126.304952] tegra-xusb 3610000.xhci: cannot find firmware…retry after 1 sd
[ 127.328908] tegra-xusb 3610000.xhci: Direct firmware load for tegra19x_xusb_2
[ 127.330545] tegra-xusb 3610000.xhci: Falling back to user helper
[ 140.958524] random: crng init done

please try if adding “break=mount” to extlinux.conf would make it.

APPEND ${cbootargs} quiet root=“” rw rootwait rootfstype=ext4 break=mount console=tty0 fbcon=map:0 net.ifnames=0

added “break=mount” to this line still getting the same error.

Try to change root to some non-exist node like /dev/sdz1 and see if it would enter.

now it’s showing that waiting for root device /dev/sdz1…

Can you use the default initrd first to check?

I’m wondering if you have the possibility of posting your initrd here? Being able to see the example might provide some clues. For example, I see the inability to find firmware, perhaps firmware should be in the initrd but is not…in which case transfer of firmware to initrd would help. Not sure though, and actual initrd you are using up to this point might help.

Also, I too would be interested in knowing if you are using (A) a local monitor and keyboard, or (B), serial console (or better yet “both” and comparing).

Hi Wayne,
I only added a print statement to the init script ,I think it will not make any change to it’s working.
Attaching the log with this comment.
nvidia_nx_uartlog (79.7 KB)

I just want to boot to my recovery initrdfs and check some parameters and after that boot to real fs.

Hi linuxdex,
I just took a copy of the default initrd and added a print statement at the top.

And I am using both console and local monitor with keyboard and mouse.I was not able to input anything to the console but I could see the logs.
Thanks

Hi ,
I think the issue is happening because of this cmd - find . | cpio -H newc -o | gzip -9 -n > …/initrd

[ 7.310577] RAMDISK: gzip image found at block 0
[ 7.395027] RAMDISK: incomplete write (28583 != 29663)
[ 7.396471] write error

I was able to boot to initrd when using a fresh installation.