Closed techdragon closed 6 years ago
further investigation shows the easiest fix is to make a change in the builder after installing cloud-init.
@techdragon Which error messages do you get? What is not working as expected?
We should try it without that reconfiguring, probably this is also done by cloud-init I'll reopen this issue to track progress.
@firecyberice There is no error unless you undertake an action in cloud-init scripts that will require Debian to interact with the package lock. Most commonly, upgrading the packages will pull down a timezone package update, which requires the system to run the timezone reconfiguration via dpkg which fails due to the first boot script running in parallel with the cloud-init.
@StefanScherer I was inclined to suggest this fix in the downstream hypriot image which adopted cloud-init. However one possible method for fixing this in the root image would be adopting cloud-init and converting the first-boot script task over to cloud-init.
Maybe we do not need the firstboot script.
/var/lib/cloud/scripts/ can contain per-boot, per-instance and per-once directories where boot scripts can be added and will be executed according to the directory. I don't see a reason a special firstboot script should be, when it can be done in a better way with cloud-init
@neta540 👍 thats exactly the sort of thing I was investigating and was referring to when I suggested to @StefanScherer that the firstboot scripts could be converted over to cloud-init.
Also it will help removing that ugly symbolic link, I truly hate having symbolic links on git repositories such as this. It lets them be cloned only on filesystems that support symbolic links. When making a Docker repository you'd want to make it as multiplatform as possible, to make it build-able in any Docker compatible machine... To have it working correctly on Windows machines for instance, you'd need to create that link manually with ln -s on the chroot script, also set file permissions correctly in the build.sh / chroot script accordingly.. another option is to use systemctl enable to create that link for you.
Thanks @neta540 for the hint with the symlink. I first thought, which symlink, but you're right. Seems a good plan to get rid of the firstboot script.
I'm trying to remove firstboot in HypriotOS 1.8.0. Will be tracked in https://github.com/hypriot/image-builder-rpi/issues/225
Reopening, still WIP https://github.com/hypriot/image-builder-rpi/pull/227
Will be fixed in HypriotOS 1.8.0, PR merged.
reconfiguring the openssh server during the first boot scripts driven by the first boot service, conflicts with the execution of any package install in cloud-init that wants to use debconf.
Firstboot and cloud-init need to operate sequentially not in parallel.