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

Deploy tarball for Xavier NX target does not work #34

Open
l4es opened this issue Jan 31, 2022 · 6 comments
Open

Deploy tarball for Xavier NX target does not work #34

l4es opened this issue Jan 31, 2022 · 6 comments

Comments

@l4es
Copy link

l4es commented Jan 31, 2022

Hi again,

I'm still working with master and l4t-32.5.1. When I ran deploy.sh command to generate the tarball for Jetson Xavier NX as target, I got following error :

Generate Multi-Spec BUP Tool

Error: Invalid target board - jetson-nano-devkit.
...

Error: Invalid target board - jetson-nano-devkit-emmc.

...

Error: Invalid target board - jetson-nano-2gb-devkit.

...

Error: Invalid target board - jetson-tx1-devkit.

...
t21x payload generation complete with 10 failure(s)
^M
FAILURE: error cleaning BUP tmp files^M
FAILURE: no payload made for config "boardid=3448;fab=000;boardsku=0000;boardrev=;fuselevel_s=1;chiprev=0;board=jetson-nano-devkit;rootdev=mmcblk0p1"^M
FAILURE: no payload made for config "boardid=3448;fab=100;boardsku=0000;boardrev=;fuselevel_s=1;chiprev=0;board=jetson-nano-devkit;rootdev=mmcblk0p1"^M
FAILURE: no payload made for config "boardid=3448;fab=200;boardsku=0000;boardrev=;fuselevel_s=1;chiprev=0;board=jetson-nano-devkit;rootdev=mmcblk0p1"^M
FAILURE: no payload made for config "boardid=3448;fab=300;boardsku=0000;boardrev=;fuselevel_s=1;chiprev=0;board=jetson-nano-devkit;rootdev=mmcblk0p1"^M
FAILURE: no payload made for config "boardid=3448;fab=200;boardsku=0002;boardrev=;fuselevel_s=1;chiprev=0;board=jetson-nano-devkit-emmc;rootdev=mmcblk0p1"^M
FAILURE: no payload made for config "boardid=3448;fab=300;boardsku=0002;boardrev=;fuselevel_s=1;chiprev=0;board=jetson-nano-devkit-emmc;rootdev=mmcblk0p1"^M
FAILURE: no payload made for config "boardid=3448;fab=300;boardsku=0003;boardrev=;fuselevel_s=1;chiprev=0;board=jetson-nano-2gb-devkit;rootdev=mmcblk0p1"^M
FAILURE: no payload made for config "boardid=2180;fab=100;boardsku=;boardrev=;fuselevel_s=1;chiprev=0;board=jetson-tx1-devkit;rootdev=mmcblk0p1"^M
FAILURE: error cleaning BUP tmp files
cp: cannot stat '/devel/RTR/SW/alliedvision_linux_nvidia_jetson/avt_build/nx-workdir/Linux_for_Tegra/bootloader/payloads_t21x/bl_update_payload': No such file or directory

It seems that NX is not really taken into account in the createDeployTarball() function :

createDeployTarball()
{
rm -rf "$PATH_TARGET_DEPLOY_TMP_FOLDER"
mkdir -p "$PATH_TARGET_DEPLOY_TMP_FOLDER"

    cp "$FILE_INSTALL_SCRIPT" "$PATH_TARGET_DEPLOY_TMP_FOLDER"
    cp "$FILE_KERNEL_IMAGE" "$PATH_TARGET_DEPLOY_TMP_FOLDER"

    if [ "$DEDICATED_BOARD" = "$DEDICATED_BOARD_XAVIER" ]
    then
            #sed -i -e '/REQ_MACHINE=/c\REQ_MACHINE="NVidia Jetson AGX Xavier"' "$PATH_TARGET_DEPLOY_TMP_FOLDER/install.sh"
            #cp "$FILE_DEVICE_TREE_BLOB_XAVIER" "$PATH_TARGET_DEPLOY_TMP_FOLDER"
            (
                    cd ${PATH_TARGET_L4T}
                    ./l4t_generate_soc_bup.sh t19x
            )
            cp ${PATH_TARGET_L4T}/bootloader/payloads_t19x/bl_update_payload "$PATH_TARGET_DEPLOY_TMP_FOLDER"
            sed -i -e '/REQ_MACHINE=/c\REQ_MACHINE="NVidia Jetson Xavier"' "$PATH_TARGET_DEPLOY_TMP_FOLDER/install.sh"

    elif [ "$DEDICATED_BOARD" = "$DEDICATED_BOARD_TX2" ]
    then
            #cp "$FILE_DEVICE_TREE_BLOB_TX2" "$PATH_TARGET_DEPLOY_TMP_FOLDER"
            (
                    cd ${PATH_TARGET_L4T}
                    ./l4t_generate_soc_bup.sh t18x
            )
            cp ${PATH_TARGET_L4T}/bootloader/payloads_t18x/bl_update_payload "$PATH_TARGET_DEPLOY_TMP_FOLDER"
            sed -i -e '/REQ_MACHINE=/c\REQ_MACHINE="NVidia Jetson TX2"' "$PATH_TARGET_DEPLOY_TMP_FOLDER/install.sh"

    else
            (
                    cd ${PATH_TARGET_L4T}
                    ./l4t_generate_soc_bup.sh t21x
            )
            cp ${PATH_TARGET_L4T}/bootloader/payloads_t21x/bl_update_payload "$PATH_TARGET_DEPLOY_TMP_FOLDER"

            #sed -i -e '/REQ_MACHINE=/c\REQ_MACHINE="NVidia Jetson Xavier"' "$PATH_TARGET_DEPLOY_TMP_FOLDER/install.sh"
            #cp "$FILE_DEVICE_TREE_BLOB_NANO_DEVKIT" "$PATH_TARGET_DEPLOY_TMP_FOLDER"
            #cp "$FILE_DEVICE_TREE_BLOB_NANO_PRODUCTION" "$PATH_TARGET_DEPLOY_TMP_FOLDER"
            #cp "$FILE_DEVICE_TREE_BLOB_NANO_2GB" "$PATH_TARGET_DEPLOY_TMP_FOLDER"
            sed -i -e '/REQ_MACHINE=/c\REQ_MACHINE="NVidia Jetson Nano"' "$PATH_TARGET_DEPLOY_TMP_FOLDER/install.sh"
    fi



    if ! (cd "${PATH_TARGET_L4T}/rootfs"; tar -zcvf "${PATH_TARGET_DEPLOY_TMP_FOLDER}/${FILE_DEPLOY_MODULES}" "${RELATIVE_PATH_KERNEL_MODULES}")
    then
            log error "Could not find modules folder! ${PATH_TARGET_DEPLOY_TMP_FOLDER}/${FILE_DEPLOY_MODULES} ${RELATIVE_PATH_KERNEL_MODULES}"
            SUCCESS_FLAG=$FALSE
    else
            if (cd "$PATH_TARGET_DEPLOY" && tar -zcvf "${FNAME}${KR}".tar.gz $(basename "${PATH_TARGET_DEPLOY_TMP_FOLDER}"))
            then
                    log debug "Deploy tarball has been created: ${PATH_TARGET_DEPLOY}/${FNAME}${KR}.tar.gz"
                    SUCCESS_FLAG=$TRUE
            else
                    log error "Could not create tarball with kernel image and device tree files"
                    SUCCESS_FLAG=$FALSE
            fi
    fi

}

It looks like targets other than Xavier and TX2 would be considered as Nano/TX1 (t21x). Do you confirm?

Thanks and best regards,
Pascal.

deploy.log

@l4es
Copy link
Author

l4es commented Jan 31, 2022

I would say that l4t_generate_soc_bup.sh needs to be executed with root permission :

sudo ./l4t_generate_soc_bup.sh t19x

Regards,
Pascal

@amarburg
Copy link

amarburg commented Feb 4, 2022

I can corroborate this, there are a couple of bugs:

In deploy.sh line 382:

	elif check_parameter $2 nx

"nx" isn't quoted. Not sure if this is actually consequential in sh.

Then in createDeployTarball() there's no branch in the if for the NX. I've got it working, I'll post a PR.

@l4es
Copy link
Author

l4es commented Feb 6, 2022

Hi @amarburg,
I also noticed about the unquoted nx case. I modified it in local as well. Even that, l4t_generate_soc_bup.sh still needs to be executed with root permission.

Best Regards,
Pascal.

@amarburg
Copy link

amarburg commented Feb 7, 2022

Interesting. I'm not running l4t_generate_soc_bup.sh as root.

@l4es
Copy link
Author

l4es commented Feb 8, 2022

Hi @amarburg ,
As per my observation, running l4t_generate_soc_bup.sh as root helps to generate bl_update_payload file as well as to update the dtb (if any change) correctly within the tarball without flashing it separately (by just running the ./install.sh script as in step 5 in the README).

@amarburg
Copy link

amarburg commented Feb 8, 2022

Hm. I wonder if I'm getting a silent failure when I don't run as root. I'll have to look.

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

2 participants