Skip to content

merge trunk/l2 into main#115

Merged
alexhulbert merged 116 commits intomainfrom
trunk/l2-merge-main
Mar 19, 2026
Merged

merge trunk/l2 into main#115
alexhulbert merged 116 commits intomainfrom
trunk/l2-merge-main

Conversation

@0x416e746f6e
Copy link
Member

@0x416e746f6e 0x416e746f6e commented Mar 16, 2026

this PR merges l2 images scripts into main, namely: op-rbuilder + simulator

additional notable changes:

  • feat: dev images get pre-created debian user with deterministic 1000:1000 uid/gid
  • feat: build script generates image\s manifest.md listing major components that went into the image and their versions
  • fix: VMs under gcp profile get their hostname assigned from instance metadata on boot
  • fix: use GCP metadata service for DNS resolution (l2 images only) so that internal DNS would work
  • fix: enable systemd-user-sessions.service so that non-root users could login (dev images only)
  • chore: bumb max size of GCP images to 1Gb

0x416e746f6e and others added 30 commits November 4, 2025 17:12
Prior to this commit, env_wrapper's 'setup_lima' command would only work for Linux
because it uses the 'nproc' and 'free' shell commands, which do not exist on Mac.
Now, the script detects the platform and uses the appropriate shell commands
…mands

fix: fix setup_lima when run on a mac
(move snippets around to the right places)
@0x416e746f6e 0x416e746f6e changed the title wip: merge trunk/l2 into main merge trunk/l2 into main Mar 17, 2026
Copy link
Member

@alexhulbert alexhulbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have some questions about a few things, I also made a PR with some additional changes at #121

Comment on lines +27 to +43

# Create users and groups
mkosi-chroot groupadd -g 1000 debian || true
mkosi-chroot useradd -u 1000 -g debian -m -s /bin/bash debian || true

cat <<EOF > "$BUILDROOT/etc/sudoers.d/debian"
debian ALL=(ALL) NOPASSWD:ALL
EOF
mkosi-chroot chmod 0440 /etc/sudoers.d/debian

mkosi-chroot mkdir -p /home/debian/.ssh
mkosi-chroot chmod 0750 /home/debian/.ssh
mkosi-chroot chown debian:debian /home/debian/.ssh

mkosi-chroot touch /home/debian/.ssh/authorized_keys
mkosi-chroot chmod 0600 /home/debian/.ssh/authorized_keys
mkosi-chroot chown debian:debian /home/debian/.ssh/authorized_keys
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you elaborate on the purpose of this change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we run dev images in actual infra (not just in quemu).

this means that having serial console enabled by default w/o any authentication is not acceptable.

allowing root logins is also not acceptable.

still, we need to be able to login to (non-prod) instances for debug purposes.

hence the need for a non-root user with pre-seeded authorised ssh keys to allow limited set of users to login.

this diff enables that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i see the point of disabling the serial console on staging images and locking the images down to a predefined set of authorized keys, but if the debian user has full NOPASSWD sudo privileges, why is that any better than just allowing root login?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

debian user has full NOPASSWD sudo privileges, why is that any better than just allowing root login?

marginally better in the sense that they hit for root account most of time, not debian.

but I get your point: so, what would you suggest as an improvement?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since password-based auth and serial console are pretty sketchy, i think we should disable them and go all in on a root authorized_keys file, similar to how we did it in yocto, like so:

  • disable serial console by default but allow it to be enabled with SERIAL_CONSOLE=true or smth in the make command
  • have either a .gitignored authorized keys file in the devtools folder, or an env var like Yocto did, or both for convenience in both automated and local dev scenarios

does that satisfy all your use cases?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, that's probably way out of scope of this PR.

here I just need a non-root user to be available on the VM so that I could inject ssh keys there

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#124

Made a simpler version of what I described above that accounts for the issues you explained.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think #124 should aim main as base, not trunk/l2-merge-main. the scope of this PR is already big as it is.

not to mention that perhaps more eyes will be needed on #124 than just mine, while I would like to merge the present PR already.

@0x416e746f6e 0x416e746f6e force-pushed the trunk/l2-merge-main branch 3 times, most recently from 7d04009 to 8d429a4 Compare March 18, 2026 11:27
Copy link
Member

@alexhulbert alexhulbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@alexhulbert alexhulbert merged commit 9613080 into main Mar 19, 2026
@alexhulbert alexhulbert deleted the trunk/l2-merge-main branch March 19, 2026 15:28
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

Successfully merging this pull request may close these issues.

6 participants