-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Cloud-Init support #797
base: arm64
Are you sure you want to change the base?
Cloud-Init support #797
Conversation
5beff17
to
228c27a
Compare
install -v -m 755 files/cloud-init-custom.deb "${ROOTFS_DIR}/tmp/cloud-init.deb" | ||
|
||
on_chroot << EOF | ||
SUDO_USER="${FIRST_USER_NAME}" dpkg -i /tmp/cloud-init.deb || true |
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 won't be relevant when we update the package in our repo, so this is just a general heads up. Instead of using dpkg -i
and following it up with apt
, you could use apt-get install -y /tmp/cloud-init.deb
directly and that will resolve dependencies and install the relevant packages in one step. The trick is that apt-get assumes that you're giving it package names unless it detects that you're giving it a path. I'm guessing it's checking for the presence of a /
character, so if the file is in the current directory you'd use ./file.deb
.
You could probably even just put '/tmp/cloud-init.deb' in 02-packages
, but I haven't tried that, so I'm not sure.
As is, using || true
means you ignore potential legitimate errors. Also, we normally nudge people towards apt
rather than apt-get
because it's more user friendly and handles some things automatically which apt-get
doesn't, but in non-interactive scripts such as this one, apt-get
is still the way to go. In other words, apt-get
for scripting and apt
otherwise.
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.
Okay, thanks for explaining. I'll update this for the current state.
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 tried it and when using apt-get install -y /tmp/cloud-init.deb
I got a message Note: using cloud-init instead of /tmp/cloud-init.deb
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'm guessing the package was updated without bumping the version number? We normally add +rpt1
to the version string to signify that it contains our patches.
9e020cc
to
b0c0f7c
Compare
Ref to required PR before merge: canonical/cloud-init#5827
|
Signed-off-by: paulober <[email protected]>
Signed-off-by: paulober <[email protected]>
Signed-off-by: paulober <[email protected]>
This PR adds basic cloud-init support to Raspberry Pi OS.