Skip to content

[bug] Install Issue non writeable /usr/sbin #233

@imadevel

Description

@imadevel

Hello,
I have a Teltonika RUTX08, the Problem is that the ipk file is not installable, the Problem is with the "postinst-pkg " inside the ipk file, it fails on the step 'ln -s /usr/sbin/openwisp-config ${IPKG_INSTROOT}/usr/sbin/openwisp_config' because the root filesystem is read only, the opkg installer actualy installs all files to /usr/local/ that is an overlay, and is writeable, also looking at the files there is at least one file that has hardcoded /usr/sbin calls

I have the following worarround, for me, but I know it is not a permanent solution

  1. Exract the .ipk: tar zxpvf openwisp-config_1.1.0-1_all.ipk
  2. Extract control file: tar zxpvf control.tar.gz
  3. Change postinst-pkg to
    #!/bin/sh
    sed "s%/usr/sbin/open%/usr/local/usr/sbin/open%" -i /etc/init.d/openwisp-config
    sed "s%/usr/sbin/open%/usr/local/usr/sbin/open%" -i /usr/local/usr/sbin/openwisp-config
  4. repack control filetar czpvf control.tar.gz conffiles control postinst postinst-pkg postrm prerm
  5. repack ipk file czpvf openwisp-config_1.1.0-1_all_ima_patched.ipk control.tar.gz data.tar.gz debian-binary

Well my solution seems to work, but I a don't think it is a good choice to rely on a writable /usr/sbin, the opkg package manager has no problem to install all instead in /usr/local/usr/sbin instead. Should the installer not be able to handle different paths?

The same problem applies to openwisp-monitoring where I added a a postinst-pkg file, with the following content
sed "s%/usr/sbin/open%/usr/local/usr/sbin/open%" -i /etc/init.d/openwisp-monitoring
sed "s%/usr/sbin/open%/usr/local/usr/sbin/open%" -i /usr/local/usr/sbin/openwisp-monitoring
sed "s%/usr/sbin/netjson%/usr/local/usr/sbin/netjson%" -i /usr/local/usr/sbin/openwisp-monitoring

I hope that this information is usefull, and that new packages in the future will handle different install path better and not reley on writeable /usr/sbin and hardcoded path to /usr/sbin

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions