sergiusens / snapcraft-preload

Use smart preloading in your snaps to avoid hard coded parts that would fail security.
12 stars 20 forks source link

mkdir fails in launcher after prepending snapcraft-preload #28

Open brlin-tw opened 5 years ago

brlin-tw commented 5 years ago
$ snap run --shell hello-snapcrafters
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

$ eval "$(head --lines=-1 $SNAP/command-hello-snapcrafters.wrapper)"
$ mkdir --parents /home/buo-ren/snap/hello-snapcrafters/common/.local/lib/locale
$ snapcraft-preload mkdir --parents /home/buo-ren/snap/hello-snapcrafters/common/.local/lib/locale
mkdir: cannot create directory '/home/buo-ren/snap/hello-snapcrafters': Read-only file system
brlin-tw commented 5 years ago

The changes made to the recipe:

@@ -100,6 +100,7 @@ apps:
     # NOTE: The right angle bracket at the beginning of the value of the `command` keyword starts a YAML folded style block scalar, refer the following spec document for more info: http://yaml.org/spec/1.2/spec.html#id2796251
     command: >
       bin/hello-launch
+      "${SNAP}"/bin/snapcraft-preload
       "${SNAP}"/bin/locales-launch
       "${SNAP}"/bin/hello-snapcrafters

@@ -142,6 +143,8 @@ parts:

   locales-launch:

+  snapcraft-preload:
+
   hello:
     after:
     - assets
@@ -159,8 +162,8 @@ parts:

     plugin: autotools
     configflags:
-    - --datarootdir=/snap/$SNAPCRAFT_PROJECT_NAME/current/share
+    #- --datarootdir=/snap/$SNAPCRAFT_PROJECT_NAME/current/share
     - --program-suffix=-snapcrafters

-    organize:
-      snap/$SNAPCRAFT_PROJECT_NAME/current: /
+    #organize:
+      #snap/$SNAPCRAFT_PROJECT_NAME/current: /