How do you add config files - "file" can't find it's configuration files?

Dave Chiluk dave.chiluk at canonical.com
Fri Sep 16 03:35:29 UTC 2016


So I clearly what's going on here is that file has /etc/magic hardcoded
in it's c-code.  Unfortunately it's not being installed there.

Certainly hard-coded path names in C code, is not new.  How are people
snapping up similar C programs with hard-coded pathnames?

Thanks,
Dave.


Some people have mentioned that they've had to mod

On 09/15/2016 04:10 PM, Dave Chiluk wrote:
> Hey guys, I'm trying to snap up file.  I thought it would be simple. 
> This is what I have for my snapcraft.yaml.
> 
> 
> vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
> name: file  # the name of the snap
> version: 0  # the version of the snap
> summary: Unix file utility  # 79 char long summary
> description: Unix file utility  # a longer description for the snap
> confinement: devmode  # use "strict" to enforce system access only via
> declared interfaces
> 
> apps:
>     file:
>         command: usr/bin/file
> 
> parts:
>     file:  # Replace with a part name of your liking
>         # Get more information about plugins by running
>         # snapcraft help plugins
>         # and more information about the available plugins
>         # by running
>         # snapcraft list-plugins
>         plugin: nil
>         stage-packages:
>           - file
>           - libmagic1
>         filesets:
>           libmagic1:
>             - etc/magic*
>             - usr/*
>           file:
>             - usr/bin/file
>         snap:
>           - $libmagic1
>           - $file
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> However when I go to run file out of my snap I get
> "
> chiluk at localhost:~$ file /home/chiluk/file_0_amd64.snap
> /etc/magic, 0: Warning: using regular magic file `/usr/share/misc/magic'
> file: could not find any valid magic files!
> "
> 
> Both of these files are included with my snap, but not being found when
> running "file /home/chiluk/  Feel free to post links to
> documentation/examples as searches for ubuntu snapcraft add config file
> have been useless.  I'm mostly trying to understand / learn so simply
> fixing this yaml is not what I'm looking for.
> 
> Also once file is capable of finding it's configs, how do you make them
> customizable such that root could modify them?
> 
> Thanks,
> Dave.
> 
> 





More information about the Snapcraft mailing list