many: drop ubuntu-core-snapd-units package, use release.OnClassic instead #1684

Merged
merged 4 commits into from Aug 26, 2016

Conversation

Projects
None yet
4 participants
Collaborator

mvo5 commented Aug 16, 2016

Merge the "dangerous" systemd services back into the main snapd
package. Instead of an extra package the code will simpliy check
for release.OnClassic() for dangerous bits like "booted" or when
enabling the first ethernet.

This allows us to run the same firstboot seed.yaml population on
a classic system on first-boot (or first-install of snapd) which
allows us to pre-install ubuntu-core to avoid the extra download
on the first snap install.

Drop ubuntu-core-snapd-units package, use release.OnClassic instead
Merge the "dangerous" systemd services back into the main snapd
package. Instead of an extra package the code will simpliy check
for release.OnClassic() for dangerous bits like "booted" or when
enabling the first ethernet.

This allows us to run the same firstboot seed.yaml population on
a classic system on first-boot (or first-install of snapd) which
allows us to pre-install ubuntu-core to avoid the extra download
on the first snap install.
overlord/boot/firstboot.go
+ if !release.OnClassic {
+ if err := firstbootEnableFirstEther(); err != nil {
+ logger.Noticef("Failed to bring up ethernet: %s", err)
+ }
}
// snappy will be in a very unhappy state if this happens,
@zyga

zyga Aug 16, 2016

Contributor

Do you want to skip the whole FirstBoot() code or do you really want to run populateStateFromInstalled()?

@mvo5

mvo5 Aug 16, 2016

Collaborator

Yes, by allowing this we can have firstboot seeds in classic as well. This allows us to e.g. preinstall ubuntu-core or other snaps in classic systems.

@chenhan1218

chenhan1218 Aug 17, 2016

May I ask an irrelative question to this pull request?
Is there any reason that the system need to enable first ether on firstboot?

I trace the code and found it is not fatal error if enable failed. But system with ethernet not connecting to cable will stuck in dhclient for several minutes at first boot up. (I have leveraged series 16 ubuntu-core image)

Contributor

zyga commented Aug 16, 2016

Overall I love the change. It will simplify packaging and avoid potential disaster in case someone makes a mistake in packaging in the future. I have one question above but otherwise +1

@@ -46,6 +47,11 @@ func (x *cmdBooted) Execute(args []string) error {
return ErrExtraArgs
}
+ if release.OnClassic {
+ fmt.Fprintf(Stdout, "Ignoring 'booted' on classic")
@niemeyer

niemeyer Aug 24, 2016

Contributor

The change looks fine as it's just moving code around, but this still feels like legacy that should go away. We have snapd itself running on boot, and we have a state that is empty / not present to tell us when we did run or not. All of this external "first boot" logic feels unnecessary by now, given that.

Still, feel free to merge it and we can fix that later.

@mvo5

mvo5 Aug 26, 2016

Collaborator

Thanks, yeah, we need to fix this. I created a trello card under "technical debt" to ensure it stays on the radar.

@niemeyer niemeyer added the Reviewed label Aug 24, 2016

@niemeyer niemeyer merged commit d85e7de into snapcore:master Aug 26, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment