Bug 9199

Summary: [meta-swupd] Enable updating of configuration files in swupd-client
Product: [Build System, Metadata & Runtime] Other YP Layers Reporter: Joshua Lock <joshuagloe>
Component: meta-swupdAssignee: Joshua Lock <joshuagloe>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: patrick.ohly, poky.bs.watcher, poky.watcher
Version: 2.1   
Target Milestone: 2.2 M1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Attachments:
Description Flags
Bare minimum patch to have swupd-client pay attention to files in /etc none

Description Joshua Lock 2016-03-02 14:23:41 UTC
We have a patch to ensure that swupd-server writes information about configuration files to the generated Manifests, we need a similar patch to swupd-client so that it doesn't ignore configuration files it finds in the manifests.
Comment 1 Joshua Lock 2016-03-02 17:10:56 UTC
We have various files that are generated, or modified, at first boot. i.e. in my minimal distro + systemd the following files all fail a swupd verify after initial boot:

/etc/ld.so.cache
/etc/group-
/etc/gshadow
/etc/mtab
/etc.machine-id

I wonder what the best way to enhance swupd client for the stateful use-case is.
Comment 2 Joshua Lock 2016-04-14 13:12:37 UTC
Created attachment 3125 [details]
Bare minimum patch to have swupd-client pay attention to files in /etc

Attached is a tiny patch which changes swupd-client to process files in /etc (developed against v2.x), this fails to consider the boot-time generated/modified files.

Most likely the correct solution is to modify swupd-server to be aware of these files and not include them in the manifest.
Comment 3 Patrick Ohly 2016-04-15 10:31:58 UTC
I ported that patch to current meta-swupd and currently have everything working in Ostro OS. Test build here:

https://github.com/ostroproject/ostro-os/pull/58

The basic approach is that the rootfs must not contain anything in /etc which later gets modified on the device. IMHO this depends a lot on the distro; I wouldn't expect meta-swupd to get involved in that area.
Comment 4 Joshua Lock 2016-04-17 21:23:03 UTC
(In reply to comment #3)
> I ported that patch to current meta-swupd and currently have everything
> working in Ostro OS. Test build here:
> 
> https://github.com/ostroproject/ostro-os/pull/58

Patch has been applied to meta-swupd master, thanks.
 
> The basic approach is that the rootfs must not contain anything in /etc
> which later gets modified on the device. IMHO this depends a lot on the
> distro; I wouldn't expect meta-swupd to get involved in that area.

Agreed, it does depend a lot on the distro. I plan to at least update the Guide to discuss this.
Comment 5 Joshua Lock 2016-04-18 12:46:38 UTC
I've also applied a similar patch to the 3.x version of the recipes in meta-swupd master. Marking this bug as resolved.