Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jetpack 4.5 support boot from ssd #9

Open
diamondbarcode opened this issue Jan 22, 2021 · 8 comments
Open

jetpack 4.5 support boot from ssd #9

diamondbarcode opened this issue Jan 22, 2021 · 8 comments

Comments

@diamondbarcode
Copy link

Hi, do you plan to update code to support the new way to boot in jetpack 4.5?

@smyeungx
Copy link

@diamondbarcode

I tried the setssdroot package on a new installation of L4T Jetpack 4.5 on NX. The scripts can rsync all the files and setup the service, and boot and mount the NVME after restart. Do you encounter any problems? Do you want to use it on a NX or AGX?

Best,
Simon

@smyeungx
Copy link

FYI.

image

@diamondbarcode
Copy link
Author

in jetpack 4.5 there is a permanent solution to this but I don't understand the instruction well. This hack may counter problems when there is an OTA update.

@smyeungx
Copy link

smyeungx commented Feb 3, 2021

Hi,

I have tried to install Jetpack 4.5 directly using sdkmanager to NVME. Seems it can flash directly to NMVE, but it got stuck during the TCP connection stage.

I have tried a reverse approach in the following order (with modified copy-rootfs-ssd.sh):

  • determine if NVME partition (nvme0n1p1) is mounted as rootfs
  • determine if micro-sd card is mounted. If not mounted, mount it. Then find it's mounted directory
  • then perform a rsync from NVME to micro-sd with the following (from original copy-rootfs-ssd.sh):
    $ sudo rsync -axHAWX --numeric-ids --info=progress2 --exclude={"/dev/","/proc/","/sys/","/tmp/","/run/","/mnt/","/media/*","/lost+found"} / /media/ros/dfbc4d0a-835f-443b-ace8-457ff281e9532
    where /media/ros/dfbc4d0a-835f-443b-ace8-457ff281e9532 is the mounted location of the micro-sd card
    image

Seems it's working (experimental) in typical apt-get update/upgrade and copy all data back to micro-sd card. I didn't try with major OTA update.

Best,
Simon

@diamondbarcode
Copy link
Author

how to flash directly to NVME form dsk manager? when I try mine I have no option where to flash

@smyeungx
Copy link

smyeungx commented Feb 8, 2021

I have inserted the NVME only without the micro-SD. The sdkmanager got stuck after upload the JetPack. I suspect whether the sdkmanager actually did the job. If you don't mind, let me finished my current project on NX in the coming week. Then I try to document it a bit and get back to you?

Generally, this package work pretty well and the NVME is much much faster than micro-SD especially if you need to buffer/stream massive amount of video data (in my case)

@smyeungx
Copy link

smyeungx commented Feb 9, 2021

@diamondbarcode

I have touched up the NVME->SD card sync (experimental) script (from original copy-rootfs-ssd.sh):

#!/bin/bash

# Check SD card and NVME mountpoint
SD_MOUNTPOINT=$(findmnt /dev/mmcblk0p1 --output=target -n)
NVME_MOUNTPOINT=$(findmnt /dev/nvme0n1p1 --output=target -n)

# If SD card is mounted as / and NVME is not mounted
# sync SD card to NVME
if [ "$SD_MOUNTPOINT" == "/" ] && [ -z "$NVME_MOUNTPOINT" ]; then
echo "rsync SD card to NVME"
# Mount the SSD as /mnt
sudo mount /dev/nvme0n1p1 /mnt
# Copy over the rootfs from the SD card to the SSD
sudo rsync -axHAWX --numeric-ids --info=progress2 --exclude={"/dev/","/proc/","/sys/","/tmp/","/run/","/mnt/","/media/*","/lost+found"} / /mnt
# We want to keep the SSD mounted for further operations
# So we do not unmount the SSD
fi

# If NVME is mounted as / and SD card mounted
# sync NVME to SD card
if [ "$NVME_MOUNTPOINT" == "/" ]; then
echo "rsync NVME to SD card"
# If SD card is not mounted, mount it
if [ -z "$SD_MOUNTPOINT" ]; then
SD_MOUNTPOINT="/mnt/sdcard"
sudo mkdir "$SD_MOUNTPOINT"
sudo mount /dev/mmcblk0p1 "$SD_MOUNTPOINT"
fi
sudo rsync -axHAWX --numeric-ids --info=progress2 --exclude={"/dev/","/proc/","/sys/","/tmp/","/run/","/mnt/","/media/*","/lost+found"} / "$SD_MOUNTPOINT"
fi

@satyajitghana
Copy link

I just tested on a fresh JetPack 4.5 Flash Install on a Xavier NX, works like a charm :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants