Chroot script to customize your rootfs interactively

Edit: while enter_chroot.sh still works, I recommend using tegrity-qemu instead at this point as it has more features and is smarter about how it handles mounts (see post below)

This is a duplicate from the Jetson Nano forum. I am posting it here because, while untested, the script will probably work on all Jetson rootfs’es.

Due to popular demand for the ability to make changes to a rootfs (such as installing software prior to first boot), I’m publishing a script to enter a chroot so that these sorts of changes can be made interactively. Many thanks to the Debian wiki.

Software can be compiled and/or installed. Apt and dpkg can be used to update the system or add and remove packages. Users can be created (and removed), though you may wish to only create system users this way (< uid 1000) unless modifying nvidia’s first boot process to account for this. Most things apart from gui apps, or those that rely on actual harware like the gpu can be tested.

All steps will happen prior to first boot so you can put the system in a desired state and still allow for first boot configuration. Nvidia’s first boot scripts can be disabled by removing their .service unit files from /etc/systemd/system

Many (but not all) of nvidia’s actual first boot scripts seem to be located in the /etc/systemd root should you wish to edit them to account for your changes rather than disable them. Many of the things they do are necessary to a proper first boot.

You will also likely wish to run apply_binaries.sh as outlined in the nvidia documentation before this if you extracted your rootfs from a tarball. Once a rootfs is created, you can flash it to sd card by using create-jetson-nano-sd-card-image.sh (or the appopriate procedure for a production module). Please see the Linux for Tegra documentation for details

Lastly, while the method used by the script is well tested and every effort has been made to ensure it runs perfectly, it will have bugs. Please report any issues you have with the script on github.

Edit: fixed links (copied wrong text accidentally)

1 Like

Quite useful! +1.

I’ve written something a bit more advanced in Python as part of a collection of scripts I’m working on. It’s smarter about how it handles mounts and supports more options.

$ tegrity-qemu --help
usage: tegrity-qemu [-h] [--command COMMAND [COMMAND ...]]
                    [--script SCRIPT [SCRIPT ...]] [--enter]
                    [--userspec USERSPEC] [--arch ARCH] [--qemu QEMU]
                    [-l LOG_FILE] [-v]
                    rootfs

utility to modify a rootfs using qemu and chroot

positional arguments:
  rootfs                path to the rootfs

optional arguments:
  -h, --help            show this help message and exit
  --command COMMAND [COMMAND ...]
                        run a command inside chroot (default: None)
  --script SCRIPT [SCRIPT ...]
                        run a script (with optional arguments) (default: None)
  --enter               run commands interactively in chroot (default: False)
  --userspec USERSPEC   USER:GROUP (ID or name) to use inside chroot (see
                        chroot manual for details) (default: None)
  --arch ARCH           architecture to use (to find qemu binary) (default:
                        aarch64)
  --qemu QEMU           path to custom qemu static binary to copy or bind
                        mount into the rootfs (default is the one found in
                        path using --arch) (default: None)
  -l LOG_FILE, --log-file LOG_FILE
                        where to store log file (default:
                        /home/mdegans/.tegrity/tegrity.log)
  -v, --verbose         prints DEBUG log level (logged anyway in --log-file)
                        (default: False)

I welcome testers as I haven’t had much of a chance to test it yet. Please report any issues.

Hi mdegans,

I’ve extracted (from tarballs) a Linux_for_Tegra folder with NVIDIA’s sample rootfs as described in L4T documentation and would like to try tegrity to modify my rootfs, however when I try to run install.py I’m experiencing the error:

$ ./install.py 
  File "./install.py", line 13
    logger.info(f"Installing {tegrity.__name__}")
                                               ^
SyntaxError: invalid syntax

I’ve tried ‘pip3 install logger’. Any ideas what I might be running into? Also, where should the tegrity folder be placed, relative to the Linux_for_Tegra ‘project’ directory?

Thanks for sharing the tools

What version of Linux are you running? Python 3?

Please provide results of these commands:

uname -a
/usr/bin/python3 --version

Only Ubuntu 18.04 and Python 3.6 are supported (same as SDK Manager). Logging is a built in python module and shouldn’t be pip installed. For security reasons, the package has no external dependencies on pypi.

The error seems to be caused by the kind of string formatting (f strings) which is only available in Python 3.6+

ah thanks, yes it does look like the python 3 version, I’m on python 3.5, ubuntu 16.04

tbf SDK manager still claims to support 16.04 . NVIDIA SDK Manager | NVIDIA Developer .

need to figure out how to build/install >= python 3.6, PPA for 3.6 has been disabled by maintainer, I can build it but need to decide how/if to replace existing python install or learn how to setup docker or some such

You are right. I didn’t realize Nvidia was still supporting the old LTS. I would recommend upgrading to 18.04, but if you can’t, Python 3.6 is in the universe repository for 16.04.

You might consider trying:

sudo add-apt-repository universe 
sudo apt-get install python3.6

seems i have ‘universe’ already enabled but python3.6 is still not found. i suppose it’s disabled for 16.04

I would recommend removing the suggestion to try ‘sudo apt-get purge --autoremove python3’ in case anyone else tries it and wonders why there’s no taskbar/menu after rebooting (I needed to use ctrl-alt-f2 to open a shell and run ‘sudo apt-get install --reinstall ubuntu-desktop’ to get my desktop back)

i should probably look into a docker or chroot type solution. or like you suggest upgrade

You are right about removing that. I thought about it at dinner and haeded directly back to this thread. Sorry about that. I wasn’t thinking.

So, both the bash and Python versions would probably work in some sort of container, but I haven’t specifically tested it.

I will consider adding a Dockerfile and/or Vagrantfile to avoid this sort of thing in the future. Sorry again about the bad advice.

Hi mdegans,

I’ve installed ubuntu18.04 and am able to successfully use ‘tegrity-qemu --enter’. Now I’m trying to get 'tegrity-qemu --command ’ or ‘tegrity-qemu --script’ to work but running into some errors I don’t understand. Here’s the command line output for trying the ‘–command’ option:

$ sudo tegrity-qemu /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/ --command "apt install iperf3" --log-file ./teg.log
Mounting /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/sys
Mounting /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/proc
Mounting /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/dev
Mounting /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/dev/pts
Mounting /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/run/resolvconf/resolv.conf
Mounting /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/tmp
QemuRunner had error. Cleaning up.
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/tegrity/qemu.py", line 278, in main
    runner.run_cmd(command)
  File "/usr/local/lib/python3.6/dist-packages/tegrity/qemu.py", line 249, in run_cmd
    return tegrity.utils.run(command, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/tegrity/firstboot.py", line 167, in _run_one
    return subprocess.run(*args, **kwargs)
  File "/usr/lib/python3.6/subprocess.py", line 423, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib/python3.6/subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.6/subprocess.py", line 1364, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'apt install iperf3': 'apt install iperf3'
Unmounting: /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/tmp
Unmounting: /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/run/resolvconf/resolv.conf
Unmounting: /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/dev/pts
Unmounting: /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/dev
Unmounting: /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/proc
Unmounting: /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/sys
Traceback (most recent call last):
  File "/usr/local/bin/tegrity-qemu", line 11, in <module>
    load_entry_point('tegrity==0.0.3', 'console_scripts', 'tegrity-qemu')()
  File "/usr/local/lib/python3.6/dist-packages/tegrity/qemu.py", line 317, in cli_main
    main(**tegrity.cli.cli_common(ap))
  File "/usr/local/lib/python3.6/dist-packages/tegrity/qemu.py", line 278, in main
    runner.run_cmd(command)
  File "/usr/local/lib/python3.6/dist-packages/tegrity/qemu.py", line 249, in run_cmd
    return tegrity.utils.run(command, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/tegrity/firstboot.py", line 167, in _run_one
    return subprocess.run(*args, **kwargs)
  File "/usr/lib/python3.6/subprocess.py", line 423, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib/python3.6/subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.6/subprocess.py", line 1364, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'apt install iperf3': 'apt install iperf3'

and here’s the log file:

2020-01-27 18:10:51,872::DEBUG::utils::copying /usr/bin/qemu-aarch64-static to /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/usr/bin/qemu-aarch64-static
2020-01-27 18:10:51,875::INFO::tegrity.utils::Mounting /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/sys
2020-01-27 18:10:51,876::DEBUG::utils::running: mount -t sysfs -o nodev,noexec,nosuid,relatime,ro sysfs /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/sys
2020-01-27 18:10:51,881::INFO::tegrity.utils::Mounting /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/proc
2020-01-27 18:10:51,882::DEBUG::utils::running: mount -t proc -o nodev,noexec,nosuid,relatime,ro proc /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/proc
2020-01-27 18:10:51,888::INFO::tegrity.utils::Mounting /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/dev
2020-01-27 18:10:51,889::DEBUG::utils::running: mount -o bind,ro /dev /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/dev
2020-01-27 18:10:51,892::INFO::tegrity.utils::Mounting /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/dev/pts
2020-01-27 18:10:51,893::DEBUG::utils::running: mount -t devpts -o gid=5,mode=620,noexec,nosuid,ptmxmode=000,relatime,rw devpts /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/dev/pts
2020-01-27 18:10:51,899::INFO::tegrity.utils::Mounting /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/run/resolvconf/resolv.conf
2020-01-27 18:10:51,899::DEBUG::utils::running: mount -o bind,ro /etc/resolv.conf /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/run/resolvconf/resolv.conf
2020-01-27 18:10:51,905::INFO::tegrity.utils::Mounting /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/tmp
2020-01-27 18:10:51,906::DEBUG::utils::running: mount -t tmpfs tmpfs /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/tmp
2020-01-27 18:10:51,912::DEBUG::utils::running: apt install iperf3
2020-01-27 18:10:51,915::ERROR::tegrity.qemu::QemuRunner had error. Cleaning up.
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/tegrity/qemu.py", line 278, in main
    runner.run_cmd(command)
  File "/usr/local/lib/python3.6/dist-packages/tegrity/qemu.py", line 249, in run_cmd
    return tegrity.utils.run(command, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/tegrity/firstboot.py", line 167, in _run_one
    return subprocess.run(*args, **kwargs)
  File "/usr/lib/python3.6/subprocess.py", line 423, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib/python3.6/subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.6/subprocess.py", line 1364, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'apt install iperf3': 'apt install iperf3'
2020-01-27 18:10:51,917::DEBUG::utils::removing /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/usr/bin/qemu-aarch64-static
2020-01-27 18:10:51,918::INFO::tegrity.utils::Unmounting: /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/tmp
2020-01-27 18:10:51,918::DEBUG::utils::running: umount /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/tmp
2020-01-27 18:10:51,944::INFO::tegrity.utils::Unmounting: /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/run/resolvconf/resolv.conf
2020-01-27 18:10:51,945::DEBUG::utils::running: umount /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/run/resolvconf/resolv.conf
2020-01-27 18:10:51,972::INFO::tegrity.utils::Unmounting: /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/dev/pts
2020-01-27 18:10:51,973::DEBUG::utils::running: umount /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/dev/pts
2020-01-27 18:10:52,009::INFO::tegrity.utils::Unmounting: /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/dev
2020-01-27 18:10:52,009::DEBUG::utils::running: umount /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/dev
2020-01-27 18:10:52,029::INFO::tegrity.utils::Unmounting: /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/proc
2020-01-27 18:10:52,031::DEBUG::utils::running: umount /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/proc
2020-01-27 18:10:52,049::INFO::tegrity.utils::Unmounting: /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/sys
2020-01-27 18:10:52,049::DEBUG::utils::running: umount /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/sys

and another example (running --script)

$ sudo tegrity-qemu /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/ --script /home/phahn/JetPack_4.3_Nano/tegrity-qemu-install.sh --log-file ./teg.log
Mounting /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/sys
Mounting /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/proc
Mounting /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/dev
Mounting /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/dev/pts
Mounting /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/run/resolvconf/resolv.conf
Mounting /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/tmp
QemuRunner had error. Cleaning up.
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/tegrity/qemu.py", line 280, in main
    runner.run_script(*script)
  File "/usr/local/lib/python3.6/dist-packages/tegrity/qemu.py", line 255, in run_script
    tegrity.utils.copy(script, dest)
  File "/usr/local/lib/python3.6/dist-packages/tegrity/firstboot.py", line 143, in _copy
    return shutil.copy(src, dest, **kwargs)
  File "/usr/lib/python3.6/shutil.py", line 245, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib/python3.6/shutil.py", line 104, in copyfile
    raise SameFileError("{!r} and {!r} are the same file".format(src, dst))
shutil.SameFileError: '/home/phahn/JetPack_4.3_Nano/tegrity-qemu-install.sh' and '/home/phahn/JetPack_4.3_Nano/tegrity-qemu-install.sh' are the same file
Unmounting: /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/tmp
Unmounting: /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/run/resolvconf/resolv.conf
Unmounting: /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/dev/pts
Unmounting: /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/dev
Unmounting: /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/proc
Unmounting: /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/sys
Traceback (most recent call last):
  File "/usr/local/bin/tegrity-qemu", line 11, in <module>
    load_entry_point('tegrity==0.0.3', 'console_scripts', 'tegrity-qemu')()
  File "/usr/local/lib/python3.6/dist-packages/tegrity/qemu.py", line 317, in cli_main
    main(**tegrity.cli.cli_common(ap))
  File "/usr/local/lib/python3.6/dist-packages/tegrity/qemu.py", line 280, in main
    runner.run_script(*script)
  File "/usr/local/lib/python3.6/dist-packages/tegrity/qemu.py", line 255, in run_script
    tegrity.utils.copy(script, dest)
  File "/usr/local/lib/python3.6/dist-packages/tegrity/firstboot.py", line 143, in _copy
    return shutil.copy(src, dest, **kwargs)
  File "/usr/lib/python3.6/shutil.py", line 245, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib/python3.6/shutil.py", line 104, in copyfile
    raise SameFileError("{!r} and {!r} are the same file".format(src, dst))
shutil.SameFileError: '/home/phahn/JetPack_4.3_Nano/tegrity-qemu-install.sh' and '/home/phahn/JetPack_4.3_Nano/tegrity-qemu-install.sh' are the same file

and the log file from this:

2020-01-27 18:17:01,641::DEBUG::utils::copying /usr/bin/qemu-aarch64-static to /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/usr/bin/qemu-aarch64-static
2020-01-27 18:17:01,644::INFO::tegrity.utils::Mounting /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/sys
2020-01-27 18:17:01,644::DEBUG::utils::running: mount -t sysfs -o nodev,noexec,nosuid,relatime,ro sysfs /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/sys
2020-01-27 18:17:01,648::INFO::tegrity.utils::Mounting /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/proc
2020-01-27 18:17:01,648::DEBUG::utils::running: mount -t proc -o nodev,noexec,nosuid,relatime,ro proc /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/proc
2020-01-27 18:17:01,652::INFO::tegrity.utils::Mounting /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/dev
2020-01-27 18:17:01,652::DEBUG::utils::running: mount -o bind,ro /dev /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/dev
2020-01-27 18:17:01,654::INFO::tegrity.utils::Mounting /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/dev/pts
2020-01-27 18:17:01,655::DEBUG::utils::running: mount -t devpts -o gid=5,mode=620,noexec,nosuid,ptmxmode=000,relatime,rw devpts /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/dev/pts
2020-01-27 18:17:01,661::INFO::tegrity.utils::Mounting /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/run/resolvconf/resolv.conf
2020-01-27 18:17:01,661::DEBUG::utils::running: mount -o bind,ro /etc/resolv.conf /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/run/resolvconf/resolv.conf
2020-01-27 18:17:01,664::INFO::tegrity.utils::Mounting /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/tmp
2020-01-27 18:17:01,664::DEBUG::utils::running: mount -t tmpfs tmpfs /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/tmp
2020-01-27 18:17:01,670::DEBUG::utils::copying /home/phahn/JetPack_4.3_Nano/tegrity-qemu-install.sh to /home/phahn/JetPack_4.3_Nano/tegrity-qemu-install.sh
2020-01-27 18:17:01,670::ERROR::tegrity.qemu::QemuRunner had error. Cleaning up.
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/tegrity/qemu.py", line 280, in main
    runner.run_script(*script)
  File "/usr/local/lib/python3.6/dist-packages/tegrity/qemu.py", line 255, in run_script
    tegrity.utils.copy(script, dest)
  File "/usr/local/lib/python3.6/dist-packages/tegrity/firstboot.py", line 143, in _copy
    return shutil.copy(src, dest, **kwargs)
  File "/usr/lib/python3.6/shutil.py", line 245, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib/python3.6/shutil.py", line 104, in copyfile
    raise SameFileError("{!r} and {!r} are the same file".format(src, dst))
shutil.SameFileError: '/home/phahn/JetPack_4.3_Nano/tegrity-qemu-install.sh' and '/home/phahn/JetPack_4.3_Nano/tegrity-qemu-install.sh' are the same file
2020-01-27 18:17:01,672::DEBUG::utils::removing /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/usr/bin/qemu-aarch64-static
2020-01-27 18:17:01,673::INFO::tegrity.utils::Unmounting: /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/tmp
2020-01-27 18:17:01,673::DEBUG::utils::running: umount /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/tmp
2020-01-27 18:17:01,704::INFO::tegrity.utils::Unmounting: /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/run/resolvconf/resolv.conf
2020-01-27 18:17:01,705::DEBUG::utils::running: umount /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/run/resolvconf/resolv.conf
2020-01-27 18:17:01,733::INFO::tegrity.utils::Unmounting: /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/dev/pts
2020-01-27 18:17:01,734::DEBUG::utils::running: umount /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/dev/pts
2020-01-27 18:17:01,764::INFO::tegrity.utils::Unmounting: /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/dev
2020-01-27 18:17:01,765::DEBUG::utils::running: umount /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/dev
2020-01-27 18:17:01,784::INFO::tegrity.utils::Unmounting: /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/proc
2020-01-27 18:17:01,784::DEBUG::utils::running: umount /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/proc
2020-01-27 18:17:01,809::INFO::tegrity.utils::Unmounting: /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/sys
2020-01-27 18:17:01,809::DEBUG::utils::running: umount /home/phahn/JetPack_4.3_Nano/Linux_for_Tegra/rootfs/sys

Any idea what might be going wrong?

You did nothing wrong. In the rush to get it out the door before Christmas, I forgot to disable --script and --command which didn’t work at the time. --enter should work fine, however, so you can use that for the time being. If you want to run a script from inside the chroot, just copy it to the rootfs before you --enter it.

With the next release I am planning on adding more automated tests so it’ll be more stable. Thank you for testing, and thanks for the log output. By the next release these bugs should be fixed.

Hi @mdegans
When I use the chroot script to customize my rootfs, I found that I cannot docker pull images.
Also thanks for sharing the tools

You’re welcome. Anything that requires a daemon (service) like the Docker daemon, won’t be able to work, at least without starting the daemon manually (dockerd), but I kind of doubt that will work in the case of Docker. If you want to pre-populate /var/lib/docker you can copy those files directly from a live nano’s rootfs.

Thanks for your help, I try to pre-populate /var/lib/docker into rootfs directory, but I have some trouble on first boot.

@never.night.c

That looks unrelated to Docker. You might try making changes one by one until you find what breaks the boot. That’s one of the reasons earlier in the thread I suggested making an install script for your software and system setup (or using some package management).

1 Like