Re: [ptxdist] [PATCH 18/20] opkg: move opkg-database to a read-only location

2019-06-11 Thread Michael Olbrich
On Wed, Jun 05, 2019 at 02:54:19PM +0200, Juergen Borleis wrote:
> The directory tree in '/var/lib' might not be persistent and thus,
> not in sync with the root filesystem. In this case it's required
> to store the opkg database at a location which has a fixed
> relation to the root filesystem's content it describes.
> 
> This change moves the opkg's database to a read-only location in
> '/usr/share/opkg', which is then always in sync with the root
> filesystem's content.
> 
> This changed opkg configuration works since commit
>a691341deb33077b9d5ede5fe349ee6b3fb99be1
>  "ptxd_make_image_extract_xpkg_files: use ptxd_get_alternative to find 
> opkg.conf"
> 
> Signed-off-by: Juergen Borleis 
> ---
>  doc/daily_work.inc | 3 +--
>  projectroot/etc/opkg/opkg.conf | 7 ++-
>  2 files changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/doc/daily_work.inc b/doc/daily_work.inc
> index 470c14f93..58cf69f49 100644
> --- a/doc/daily_work.inc
> +++ b/doc/daily_work.inc
> @@ -1426,8 +1426,7 @@ This is a very simple and optimistic approach and works 
> for surprisingly many us
>  cases. But some applications expect a writable ``/var/lib`` and will fail due
>  to this setup. Using an additional RAM disk for ``/var/lib`` might not help 
> in
>  this use case, because it will bury all build-time generated data already 
> present
> -in this directory tree (``opkg`` package information for example or other
> -packages pre-defined configuration files).
> +in this directory tree (package pre-defined configuration files for example).

I've applied this patch without the documentation changes. Please add it to
the volatile /var patch.
I've also applied several other patches that don't add a StateDirectory or
similar. Please rebase the rest.

Michael

>  
>  Overlay RAM Disk
>  
> diff --git a/projectroot/etc/opkg/opkg.conf b/projectroot/etc/opkg/opkg.conf
> index 3ba17115b..67a64838f 100644
> --- a/projectroot/etc/opkg/opkg.conf
> +++ b/projectroot/etc/opkg/opkg.conf
> @@ -6,7 +6,12 @@
>  @SRC@
>  
>  dest root/
> -option   lock_file /var/lock/opkg.lock
> +option   lock_file /run/lock/opkg.lock
> +
> +# move away the ipkg database from the default "/var/lib/opkg" to a r/o 
> location
> +option lists_dir /usr/share/opkg/lists
> +option status_file /usr/share/opkg/status
> +option info_dir /usr/share/opkg/info
>  
>  arch @ARCH@  10
>  arch all 1
> -- 
> 2.20.1
> 
> 
> ___
> ptxdist mailing list
> ptxdist@pengutronix.de

-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

___
ptxdist mailing list
ptxdist@pengutronix.de

Re: [ptxdist] [PATCH 04/20] conman: adapt package's '/var/lib' requirements

2019-06-11 Thread Michael Olbrich
On Wed, Jun 05, 2019 at 02:54:05PM +0200, Juergen Borleis wrote:
> Signed-off-by: Juergen Borleis 
> ---
>  projectroot/usr/lib/systemd/system/connman-ignore.service | 1 +
>  projectroot/usr/lib/systemd/system/connman.service| 1 +
>  rules/connman.in  | 3 ++-
>  rules/connman.make| 1 +
>  4 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/projectroot/usr/lib/systemd/system/connman-ignore.service 
> b/projectroot/usr/lib/systemd/system/connman-ignore.service
> index b31df07fb..df52faaed 100644
> --- a/projectroot/usr/lib/systemd/system/connman-ignore.service
> +++ b/projectroot/usr/lib/systemd/system/connman-ignore.service
> @@ -7,6 +7,7 @@ ConditionPathExists=!/run/connman-ignore
>  Type=oneshot
>  RemainAfterExit=yes
>  ExecStart=/usr/lib/systemd/connman-ignore
> +StateDirectory=conman

I've dropped this patch and others that set StateDirectory= (and other
directories like it) from my test queue.
The problem ist that without the volatile /var the services fail to start
with 9p in qemu or nfsroot:
Systemd tries to change the permission of the directory and abort startup
because this fails on a read-only rootfs.

Michael

>  
>  [Install]
>  WantedBy=connman.service
> diff --git a/projectroot/usr/lib/systemd/system/connman.service 
> b/projectroot/usr/lib/systemd/system/connman.service
> index 4353276b5..c7fc639d6 100644
> --- a/projectroot/usr/lib/systemd/system/connman.service
> +++ b/projectroot/usr/lib/systemd/system/connman.service
> @@ -10,6 +10,7 @@ Restart=on-failure
>  EnvironmentFile=-/run/connman-ignore
>  ExecStart=/usr/sbin/connmand -n $CONNMAN_IGNORE_OPTS
>  StandardOutput=null
> +StateDirectory=conman
>  
>  [Install]
>  WantedBy=multi-user.target
> diff --git a/rules/connman.in b/rules/connman.in
> index 9d4b1dbd3..3c2eb11a0 100644
> --- a/rules/connman.in
> +++ b/rules/connman.in
> @@ -13,7 +13,8 @@ menuconfig CONNMAN
>   select DBUS_PYTHON  if CONNMAN_TESTS && RUNTIME
>   select WPA_SUPPLICANT   if CONNMAN_WIFI && RUNTIME
>   select WPA_SUPPLICANT_CTRL_IFACE_DBUS   if CONNMAN_WIFI
> - select BUSYBOX_START_STOP_DAEMONif CONNMAN_STARTSCRIPT
> + select BUSYBOX_START_STOP_DAEMONif CONNMAN_STARTSCRIPT && 
> RUNTIME
> + select ROOTFS_VAR_LIB   if RUNTIME
>   prompt "connman   "
>   help
> The Connection Manager project provides a daemon for
> diff --git a/rules/connman.make b/rules/connman.make
> index 2f671f7d4..313098d1c 100644
> --- a/rules/connman.make
> +++ b/rules/connman.make
> @@ -167,6 +167,7 @@ ifdef PTXCONF_CONNMAN_POLKIT
>  endif
>  
>  ## ship settings which enable wired interfaces per default
> + @$(call install_copy, connman, 0, 0, 0755, /var/lib/connman)
>   @$(call install_alternative, connman, 0, 0, 0600, \
>   /var/lib/connman/settings)
>  
> -- 
> 2.20.1
> 
> 
> ___
> ptxdist mailing list
> ptxdist@pengutronix.de

-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

___
ptxdist mailing list
ptxdist@pengutronix.de