So you can have your GoPiGo3 up on ROS2 in 1 hour:
Step1: Follow steps to create (headless) GoPiGo3 on Ubuntu 22.04 Server
Step2: Run script to install ROS2, GoPiGo3 ROS nodes, and helper scripts
Step3: Follow Test Plan -
Drive ROS2 GoPiGo via remote control from your keyboard
Inspect ROS2 topics
Publish ROS2 "command" topics to ROS2 GoPiGo3
(only GoPiGo3 and remote ssh shell on your desktop/laptop computer required - no ROS GUI)
I don’t know how to package the completed image - any tips?
You can look into my multi-booting threads where I described how to package things.
I haven’t created a “universal” script but it should be doable.
The big issue is that when you do create the image, you have to preserve all the attributes, including extended attributes and ownership, as well as preserving both soft and hard links.
It’s not difficult, but it’s not trivial.
There are several major steps:
Use something like ddrescue (gddrescue) to make a file that is an exact image of the system.2
Use a “shrinking” utility to reduce the image to the minimum size, removing all the unused part of the partition. Some utilities can set the “expand on boot” option too.
Open it using the system’s image mounter to verify that the image is valid.
Run it through something like gzip to compress the image to a more manageable size.
Thoroughly test the image by re-installing it to various media and run it to death. Insure that every test cycle begins with a full e2fsk on the unmounted image partitions before booting it for the first time.
Once you get that down pat, there are additional steps, like clearing the apt cache, clearing browser cache, cookies and history, system temp, secrets, saved passwords, command cache, network configs, (except for IPv6), and other things you specifically set for yourself that is nobody else’s business. This will also shrink your final image size.
Test your final image by installing it on various Raspberry Pi versions, running e2fsk over it, and beating the living out of it. Don’t forget to e2fsk the images.
There are imaging tools out there for Raspberry Pi images, some claim to automagically clean things up. It will just require some searching.
Right now all the systems here are occupied by the granddaughters this week while they are on their “fall” school holiday. Once that’s done I can help with this.
password robots1234 for both the ubuntu and pi users,
no GUI, no browser to worry about
network:
I think I can clean out /etc/netplan/50-cloud-init.yaml before shutdown, then
mount the SDcard and clean out the /boot/network-config SSID and password
Next user should be able to add their SSID and WiFi pswd to the /boot/network-config
to have the image connect (and re-write the /etc/netplan/50 file at first boot.
I found a Linux script tool PiShrink which purports to shrink the image - Hopefully it will work for a Raspberry Pi Ubuntu image.
If I can get this to work, it will cut the install time from 1 hr to 10 minutes.
In any event, you can verify if the image is valid by trying to mount it with archive mounter. You can install it from the repositories if you don’t have it.
Oh, blast. You don’t have a desktop so you will have to try to loop mount it.
Indeed you have. Hopefully all the “___ has been deprecated and will cease … “ takes as long to become real as the termination of Python 2 after it was first warned.
I saw so many warnings that I was astounded that my system even boots. I don’t have any automated tests to ensure my system even should be shrunk and unleashed.
It took a while, thinking about this … you reminded me of what I forgot about to prepare for imaging - remove the Dexter/gpg3_config.json file! My image, as is, would force 16 tick motors on an unsuspecting user.
The PiShrink log claims to have done all the removals that @jimrh mentioned giving me an image to test now.