Custom postinstall/hook script executed as part of install

Is there an official way to run a custom postinstall script as part of the flash process?

I Believe at flash time I have access to the unit via IP-over-USB via the RFC1918 192.168.55.1 address. I see that the flash.sh script basically ssh’s to do the actual install packages. I suppose I could emulate the same.

But I’d kinda like the flash program to have this hook feature too - basically I give it a file that it will run at the end on the target for me to do any custom postinstall.

Does that make sense?

hello alex.sack,

may I have more details about what’s the additional package you would like to port-install.
BTW, you may refer to elinux page for creating a custom rootfs, and BSP Customization for customization.
thanks

Jerry, that is complete overkill though (spawning a whole new rootfs image for a package install). I want to be able to simply run my own postinstall script as part of the flash.sh process (NVidia already does that to install packages as part of Jetson - not sure why we can’t have a hook script as well?).

hello alex.sack,

I’m still curious about what’s the additional packages you would like to port-install.
how about modify the default script files (for example, $HOME/.bashrc) to execute your commands while init.
thanks

Yeah that is basically what I’m going to be doing - run an init script on the first boot up that installs stuff and self-destructs on success.

But why not allow for instance in sdkmanager a custom postinstall script. NVidia does this anyway as part of installing Jetpack, right?

To be more specific, why not add in sdkmanager the ability to execute a custom postinstall script that you supply on the host which it then uses to scp over and execute similar to how you install various packages now?

Hi alex,

There is no plan to support this feature in SDK Manager. However, you may use a workaround to solve the problem. SDK Manager puts most of the installation steps into a json file, if you installed JetPack 4.2 on your machine, by default, the json file can be found at ~/.nvsdkm/dist/sdkml3_jetpack_l4t_42.json or ~/Downloads/nvidia/sdkm_downloads/sdkml3_jetpack_l4t_42.json. You can modify the ~/Downloads/nvidia/sdkm_downloads/sdkml3_jetpack_l4t_42.json file, add your own installation steps in it, then use the modified json file to install. Please see detailed steps below.

  1. Make sure there is exactly one sdkml3_*json file in ~/Downloads/nvidia/sdkm_downloads directory.
  2. Modify this sdkml3_*json file, add your own postinstall script into existing components.
  3. Start SDK Manager, at the log in screen, click the 3rd tab “OFFLINE from local folder”.
  4. Click “START” button.
  5. Select the Target Hardware you have, then install.

Thank you Edward. Believe it or not, that’s exactly the avenue I was exploring here:

https://devtalk.nvidia.com/default/topic/1055338/jetson-tx2/where-do-the-local-debian-repositories-during-post-install-come-from-/

Great minds and all that…

Alex, you almost got the trick by yourself ;)
Can we close the https://devtalk.nvidia.com/default/topic/1055338/jetson-tx2/where-do-the-local-debian-repositories-during-post-install-come-from-/ now?

I did get it by myself! :-p! I closed the other thread.