webos-homebrew-channel: webOS <4.5 doesn't run startup.sh, hence no SSH or Telnet

I had a working version of Homebrew until I decided to upgrade to 05.50 system software, now webOS 4.4.2 (from 05.40).

The initial symptoms after upgrading are that SSH server is not working, Telnet is not working and also PicCap doesn’t auto-start - but I still have elevated privileges.

After some debugging, it looks like that the autostart service registered by Homebrew is not being called; hence no startup.sh called.

I built a companion app that tries to call the autostart service via LunaBus; once installed, you can see that the first call to the autostart services fails because of a LunaBus error - but trying again it works.

image

Our assumption is that probably the service doesn’t get registered in time or there are some overloads of the LunaBus at startup.

The error we get from LunaBus is this: https://github.com/webosose/luna-service2/blob/master/src/libluna-service2/transport.c#L239


Most likely, this new method of using previewMetadata in the appinfo.json doesn’t work on webOS 4+, and the startup method was working in the previous firmware because of the presence of /etc/wam/plugins/conf.sh that called our script in the $EXTRA_CONF path:

EXTRA_CONF=/mnt/lg/cmn_data/wam/extra_conf.sh

if test -f $EXTRA_CONF; then
    source $EXTRA_CONF;
fi

That has now been removed from the 4.4 firmware.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 2
  • Comments: 36 (16 by maintainers)

Commits related to this issue

Most upvoted comments

hi there!

I think I found a way:

luna-send -f -n 1 -m org.webosbrew.hbchannel.service luna://com.webos.service.activitymanager/create '{
 "activity": {
  "name": "org.webosbrew.hbchannel.service.autostart",
  "description": "who cares",
  "type": {
   "foreground": true,
   "persist": true, 
   "continuous": true
  },
  "trigger": {
   "method": "luna://com.webos.bootManager/getBootStatus",
   "params": {
    "subscribe": true
   },
   "where": {
    "prop": [
     "signals",
     "core-boot-done"
    ],
    "op": "=",
    "val": true
   }
  },
  "callback": {
   "method": "luna://org.webosbrew.hbchannel.service/autostart",
   "params": {}
  }
 },
 "replace": true,
 "start": true
}'

I haven’t tested this on 4.4. I would be glad to receive any feedback!

As a workaround for anyone that uses the LG integration within Home Assistant: I created a script that executes the command suggested by @kopiro, which can be used in an automation (e.g. on TV start):

alias: Enable app autostart on rooted LG TV
sequence:
  - service: webostv.command
    data:
      entity_id: media_player.lg_tv
      command: system.notifications/createAlert
      payload:
        message: Executing HB Channel autostart...
        modal: false
        buttons:
          - label: OK
            focus: true
            buttonType: ok
            onClick: luna://org.webosbrew.hbchannel.service/autostart
            params: {}
        type: confirm
        isSysReq: true
  - delay:
      hours: 0
      minutes: 0
      seconds: 2
      milliseconds: 0
    alias: Delay for Button click to close the alert toast
  - service: webostv.button
    data:
      entity_id: media_player.lg_tv
      button: ENTER
mode: single
icon: mdi:television-ambient-light

My workaround also uses Home Assistant but with a custom component: https://github.com/panic175/webosbrew-autostart-helper

I haven’t tested this on 4.4. I would be glad to receive any feedback!

I would like to thank you for your solution as it worked like a charm, after reboot everything that is supposed to auto start runs as it should, including hyperhdr and picap… WebOS V-4.4-x. thanks a lot dude! TV model from 2019 updated to last webOS available for its gen 😃

I haven’t tested this on 4.4. I would be glad to receive any feedback!

@kitsuned, I have a C8 on 4.4.2, and this solved the issue for me as well. startup.sh is now running, and the autostart of PicCap and HyperHDR are both working now.

hi there!

I think I found a way:

luna-send -f -n 1 -a org.webosbrew.hbchannel.service luna://com.webos.service.activitymanager/create '{
......
}'

I haven’t tested this on 4.4. I would be glad to receive any feedback!

On my webOS TV (version 4.4.2), this above worked perfectly, I could finally disable my HomeAssistant automation 😄