wiki:opkg

Opkg

opkg is the package manager used in SHR. The upstream source code can be found  here. Read the tipps and tricks section below for some tweaks.

Tipps and Tricks

Install one package at a time

opkg upgrade will download all .ipkg files into /tmp (which is stored in RAM on the Freerunner). For large upgrades the RAM will therefore already be full before it starts upgrading. A convenient trick to just install one package at a time, by calling opkg for every package is:

  opkg update
  for i in $(opkg list_upgradable | sed 's/\([^ ]*\).*/\1/') ); do opkg upgrade $i; done

Caveat: above can have dangerous consequences. It is possible that opkg and its libraries will not upgrade at same time, therefore breaking opkg and leaving you stranded without means of upgrading/downgrading further packages

It is also recommended to  create a swap file (TODO: create page on shr wiki, describing this) to avoid running out of RAM while upgrading.

Prevent suspend while upgrading

It can be annoying to have the device suspend automatically while upgrading. It can help to call opkg like this to request the CPU Resource and therefore prevent suspending:

  fsoraw -f -r CPU -- opkg

You can even make this permanent by adding this line to /etc/profile

  alias opkg='fsoraw -f -r CPU -- opkg'

Whenever you call 'opkg' now, it will automatically request the CPU resource. This will only fail if fsodeviced was upgraded and restarted as the CPU resource won't be there anymore...