Skip to content
  • Stefano Babic's avatar
    swupdate: improve systemd config · 135d46bc
    Stefano Babic authored
    
    
    For most projects starting swupdate requires some logic implemented
    in shell scripts. Therefore swupdate is now started by a shell script
    if systemd is enabled in DISTRO_FEATURES.
    
    The new swupdate startup script sources code snippets located in
    /usr/lib/swupdate/conf.d and in /etc/swupdate/conf.d. The snippets are
    executed in alphabetical order. The idea is that files in /usr are added
    at build time and files in /etc might be added or modified at run-time.
    If two scripts, one in /etc and one in /usr have the same file name, the
    script in /usr gets skipped completely. This allows to disable code in
    /usr, which is probably mounted ro, at runtime.
    
    Code snippets are automatically generated at build-time, depending on
    the configuration created by swupdate's menuconfig. But code snippets
    may be created manually and added via bbappend to the
    /usr/lib/swupdate/conf.d folder as well.
    
    All modes (file, webserver, webclient) of swupdate are supported.
    Different variables might be defined by the code snippets added to the
    named folders:
    - SWUPDATE_ARGS
    - SWUPDATE_WEBSERVER_ARGS
    - SWUPDATE_DOWNLOAD_ARGS
    
    Finally swupdate gets started by a line similar to:
    
      exec /usr/bin/swupdate $SWUPDATE_ARGS \
                             -w "$SWUPDATE_WEBSERVER_ARGS" \
                             -u "$SWUPDATE_DOWNLOAD_ARGS"
    
    The default set of configuraton and service files is now installed by
    the "make install" target of the swupdate Makefile. The service files
    which are not used for the latest git version of swupdate are moved
    to swupdate-2019.04 folder.
    
    Fixes in do_install
    - This changes the filenames of the tools binaries for several reasons:
      - Binaries should not be named "client" or "progress"
        (also not accepted by Debian upstream)
      - Inconsistent with names referred in the service files
    - The swupdate_tools.inc file gets merged into swupdate.inc file. By
      removing the tools file some bugs are fixed:
      - The tools binaries were installed twice.
      - do_compile from swupdate.inc was over written resulting in wired
        behavior
      - swupdate-progress.service file was part of swupdate package were
        the corresponding swupdate-progress binary was part of the tools
        package.
    
    Improve package splitting
    - New packages are: swupdate-client, swupdate-progress, swupdate-usb,
      swupdate-tools-hawkbit.
    - Additionally swupdate-sd, swupdate-sv, swupdate-usb-sd and
      swupdate-progress-sd have been introduced. The purpose of the -sd
      and -sv packages is to provide the systemd service files or the
      sysv init scripts. Splitting the init scripts and service files is
      very atypical for Yocto, but it offers the flexibility to build a
      second minimal rescue image with sysv, just capable to run swupdate,
      out of the same DISTRO.
      By default (if not changed by a bbappend file) the rdepends are
      set e.g. from swupdate-usb to swupdate-sd, if systemd is enabled.
    - The swupdate-tools package is an empty meta package now. It provides
      backward compatibility for setups installing swupdate-tools. It
      depends on swupdate-client, swupdate-progress, swupdate-usb,
      swupdate-tools-hawkbit packages.
    
    Remove the INSANE_SKIP_${PN} = "ldflags". Seems obsolete.
    
    Signed-off-by: default avatarAdrian Freihofer <adrian.freihofer@siemens.com>
    Signed-off-by: default avatarStefano Babic <sbabic@denx.de>
    135d46bc