Merge lp://qastaging/~sergiusens/snappy/frameworkPath into lp://qastaging/~snappy-dev/snappy/snappy-moved-to-github

Proposed by Sergio Schvezov
Status: Work in progress
Proposed branch: lp://qastaging/~sergiusens/snappy/frameworkPath
Merge into: lp://qastaging/~snappy-dev/snappy/snappy-moved-to-github
Diff against target: 235 lines (+73/-36)
6 files modified
debian/ubuntu-snappy.dirs (+1/-0)
snappy/click_test.go (+24/-12)
snappy/dirs.go (+31/-8)
snappy/parts.go (+3/-0)
snappy/purge.go (+13/-11)
snappy/snapp.go (+1/-5)
To merge this branch: bzr merge lp://qastaging/~sergiusens/snappy/frameworkPath
Reviewer Review Type Date Requested Status
Leo Arias (community) Needs Fixing
Federico Gimenez (community) continuous-integration Approve
Jamie Strandboge (community) Needs Information
Michael Vogt (community) Approve
Snappy Tarmac continuous-integration Pending
Review via email: mp+260202@code.qastaging.launchpad.net

Commit message

Use /frameworks for framework snaps

Description of the change

Notice that this requires security/apparmor work.

To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote :

Thanks, this looks good.

review: Approve
Revision history for this message
Michael Vogt (mvo) wrote :

Does more need to change for this to land, i.e. do we need apparmor changes in lock-step?

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

On Wed, May 27, 2015 at 06:40:01AM -0000, Michael Vogt wrote:
> Does more need to change for this to land, i.e. do we need apparmor changes in lock-step?

Not sure if in lockstep, but the apparmor changes would need to land
before this, reason for adding jdstrand as a reviewer.

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

I've not looked at the code changes, but this states that it needs apparmor work. What is needed, adjustments to handle /frameworks instead of just /apps? If so, I think this should be sufficient in click-apparmor's click.py:

=== modified file 'src/apparmor/click.py'
--- src/apparmor/click.py 2015-04-15 21:32:33 +0000
+++ src/apparmor/click.py 2015-05-27 19:56:41 +0000
@@ -542,7 +542,7 @@
     # snappy hardcodes these and doing this allows snappy images to not require
     # click
     if os.path.exists("/usr/bin/snappy"):
- return "{%s}" % ",".join(["/apps", "/oem"])
+ return "{%s}" % ",".join(["/apps", "/oem", "/frameworks"])

     from gi.repository import Click

review: Needs Information
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Oh, and I *hate* 'if os.path.exists("/usr/bin/snappy")' - is there a better way to determine if this is an actual snappy system?

472. By Sergio Schvezov

trunkpdate

473. By Sergio Schvezov

adding /frameworks to 'dirs'

474. By Sergio Schvezov

Adding /oem and /frameworks to purge list

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

> I've not looked at the code changes, but this states that it needs apparmor
> work. What is needed, adjustments to handle /frameworks instead of just /apps?
> If so, I think this should be sufficient in click-apparmor's click.py:
>
> === modified file 'src/apparmor/click.py'
> --- src/apparmor/click.py 2015-04-15 21:32:33 +0000
> +++ src/apparmor/click.py 2015-05-27 19:56:41 +0000
> @@ -542,7 +542,7 @@
> # snappy hardcodes these and doing this allows snappy images to not
> require
> # click
> if os.path.exists("/usr/bin/snappy"):
> - return "{%s}" % ",".join(["/apps", "/oem"])
> + return "{%s}" % ",".join(["/apps", "/oem", "/frameworks"])
>
> from gi.repository import Click

With this installation works fine but the profile symlinks are wrong:

(amd64)ubuntu@localhost:~$ ls /var/lib/apparmor/snappy/profiles/ -l
total 0
lrwxrwxrwx 1 root ubuntu 36 Jun 3 19:10 webdm_snappyd_0.8 -> /apps/webdm/0.8/meta/snappyd.profile

that's a broken link; who creates the symlink these days? Snappy or apparmor?

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

snappy creates the symlink in /var/lib/apparmor/clicks, and apparmor creates the profile in /var/lib/apparmor/profiles based on the symlink.

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Oh, webdm uses aa-profile-hook, not aa-clickapparmor. In that case, snappy creates the symlink in /var/lib/apparmor/snappy/profiles, then apparmor (aa-profilehook) creates the profile in /var/lib/apparmor/profiles.

(Gosh it will be nice to get this cleaned up)

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

ah, stale files, actually no link is being created.

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

ugh, this was related to the bug Chipaca mentioned and is ready for review here: https://code.launchpad.net/~chipaca/snappy/mangle/+merge/260934

When applying https://code.launchpad.net/~sergiusens/click-apparmor/snappyFameworksDir/+merge/261032 we should be good.

Revision history for this message
John Lenton (chipaca) wrote :

You've resurrected agreerator, which points to a bad merge; fix that.

Please also consider changing targetDirForType() to a method of type. This is more work, because you'd have to add something like SetRootDir to pkg, and call it from snappy's SetRootDir, so only do it if you're feeling fancy.

I suspect this is going to conflict with some of the branches i've had up for review for a few days now... sigh.

Revision history for this message
Federico Gimenez (fgimenez) wrote :

PASSED: Continuous integration, rev:474
http://10.55.60.183:8080/job/snappy-rolling-ci/28/
Executed test runs:

Click here to trigger a rebuild:
http://10.55.60.183:8080/job/snappy-rolling-ci/28/rebuild

review: Approve (continuous-integration)
Revision history for this message
Leo Arias (elopio) wrote :

this has a conflict with trunk.

review: Needs Fixing

Unmerged revisions

474. By Sergio Schvezov

Adding /oem and /frameworks to purge list

473. By Sergio Schvezov

adding /frameworks to 'dirs'

472. By Sergio Schvezov

trunkpdate

471. By Sergio Schvezov

Use /frameworks for framework snaps

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches