-
Notifications
You must be signed in to change notification settings - Fork 41
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
Builder refactor with Python and the ability to layer builds #23
Conversation
@shuhaowu, thank you! Let us know if you need any help! |
Thanks! I should be good. Hopefully at some point this week I'll have a bit of time to finalize this. |
49a4f6d
to
5228d13
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LanderU @carlossvg This PR is ready to review. I also updated the description of this PR to link to the docs, as well as document what's deferred to a future PR.
I'm testing the image right now (dding to an SD card takes a bit of time... 🕐). It should work, and I'll report back either way.
"focal-rt-galactic", | ||
]) | ||
|
||
b.build() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to convert this script into a proper command line app. However, it's not that urgent and it will take a bit more time. I would like to get this merged first so we can iterate on other things that needs to be done.
shutil.copy( | ||
"/etc/resolv.conf", | ||
os.path.join(self.chroot_path, "etc", "resolv.conf") | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not 100% certain if this works on Ubuntu. (I'm testing my builder primarily on Ubuntu for now). I think it should because the container is setup via systemd-nspawn
but it is not in an network namespace.
# TODO: same as qemu_user_static_path. This should be specified via | ||
# command-line arguments as opposed to build configuration. | ||
# Uncomment this if you want to pause the builder after a particular stage to | ||
# debug/experiment. | ||
# pause_after = cleanup_chroot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once we have a command line tool, this and qemu_user_static_path
will move out of here.
@@ -0,0 +1,3 @@ | |||
#!/bin/bash | |||
|
|||
# At this point in time, the rootfs at CHROOT_PATH should be fully setup and usable as a cross compile toolchain sysroot. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a place holder file for now
The image works after testing. |
@shuhaowu This is great work, thanks a lot! I just have a couple of suggestions for the follow-up PRs:
|
@shuhaowu BTW, I tested the image and all is working for me. LGTM |
5228d13
to
c43bcda
Compare
output_filename = ubuntu-20.04.4-rt-ros2-arm64+raspi.img | ||
|
||
[env] | ||
ROS_DISTRO = galactic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can cause an error if you already source a ROS 2 ws, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only used for the builder script. It's not for the image. That said, we do have this script which probably should be updated.
This is a port of the bash script to Python, with the added ability to overlay multiple directories on top of each other.
Since this is a relatively large PR that reworks the repo. I've updated the docs significantly with the design as well as a detailed usage guide (to customize the image builder). Please read it first as it will hopefully make reviewing the rest of the code a lot easier.
Stuff I don't want to do now but will do in future PRs as they're not super urgent:
qemu-user-static
andpause_after
configurations into the command line tool.