Posts by jim_p

    My little "it's something" script! I know it lacks a lot compared to yours, but it is all I can do.

    Bash
    #!/bin/bash
    source /etc/os-release
    echo You are on $VERSION for $LIBREELEC_ARCH
    read -p 'Date ' thedate
    read -p 'Commit ' thecommit
    echo Downloading image $thedate-$thecommit
    wget --spider https://test.libreelec.tv/11.0/$LIBREELEC_PROJECT/$LIBREELEC_DEVICE/LibreELEC-$LIBREELEC_ARCH-11.0-nightly-$thedate-$thecommit.img.gz
    #mv *.img.gz .update/

    If anyone wants to test it, please uncomment the line with mv and remove the --spider option from wget. They are the script's "safety pins".

    Now that v0.10 is missing in action, I tried to create a much much simpler script that would just download the latest available nightly in the .update folder. And since my scripting abilities are weak, I decided to provide the commit name by hand, i.e. the script will ask the user to enter it manually.

    But I am having issues getting the date part. On my end, new nightlies (99% of the time) have yesterday's date, e.g. right now its 20220719 on my end and the latest nightly is from 20220718.

    Getting that date on my pc is easy peasy

    Code
    $ date --date=yesterday +%Y%m%d
    20220718

    But on le, where date is part of busybox, the above is not doable, although it supposedly supports the --date parameter!

    Code
    # date --date=yesterday +%Y%m%d
    date: invalid date 'yesterday'
    
    # date --help
    BusyBox v1.32.1 (2022-07-18 22:30:02 UTC) multi-call binary.
    
    Usage: date [OPTIONS] [+FMT] [TIME]
    ...
    -d,--date TIME  Display TIME, not 'now'
    ...

    There is a workaround for it that simply gets today's date output from %s and substracts 84600 seconds so as to get yesterday's date. This is the only documented solution I have found, which does get it right when using seconds, but I can not get it to output the date as I said above!

    Code
    # date -D %s -d $(( $(date +%s) - 86400 ))
    Mon Jul 18 09:02:11 EEST 2022
    
    # date -D %Y%m%d -d $(( $(date +%s) - 86400 ))
    date: invalid date '1658124175'

    In case anyone has any idea, I am getting this message when running a new script.

    Code
    Error Contents: No module named html
    Traceback stuff with the failed lines
    ImportError: No module named html

    Which addon may have such a library?

    ---edit

    Nvm, it is a lib that comes with python3 and I tried to execute the script on python2 (on le 9), thus the error.

    I need to stop doing stuff before 8am :P

    I want to scrub everything and start fresh (on x64, probably for le 10 nightly) and I know that libreelec's backup option practically backs up the entire /storage/.kodi folder and some stuff from here and there, e.g. stuff in the /storage/.cache folder.

    I think it does not back up stuff that do not belong to the above, e.g. files (that get_nightly and some scripts of mine) that I have under /storage or the forementioned change for the boot parameters. Am I right?

    So, the above aroused my curiosity and I tried it... with youtube (plugin.video.youtube). According to the instructions on kodi's wiki,

    - I made the service.autoexec folder and inside it

    - I made the autoexec.xml file exactly as described on the wiki

    - I made the autoexec.py file like so

    Code
    import xbmc
    xbmc.executebuiltin('RunAddon(plugin.video.youtube)')

    Proof of the above

    Code
    letest:~/.kodi/addons # ls service.autoexec/
    autoexec.py   autoexec.xml

    But I failed at step 1.4 which says about enabling the autoexec addon because there is no autoexec addon listed in there!

    I also tried enabling it with

    Code
    kodi-send --action="EnableAddon(service.autoexec)"

    If it helps, running

    Code
    kodi-send --action="RunAddon(plugin.video.youtube)"

    does spawn youtube. There is nothing related to autoexec in the log.

    ---edit

    I need a new pair of glasses :P The right file name for the xml is addon.xml not autoexec.xml!

    I renamed it and now it works as it should.

    The reason you removed the gist is because I complained about missing versions on test3? I just pointed it out as an issue, because it does not get the latest image available but the latest image on test3! And right now it just has the downgrade option on my end

    Code
    *** script version: 0.10
    your Platform is:       RPi2.arm
    running nightly from:   20220711
    and has Git Hash:       f682eb5
    Version:                20220711-f682eb5
    *** the following images are currently available on the download server:
    *** No updates today ***
    * Downgrade (to the previous Image):    LibreELEC-RPi2.arm-11.0-nightly                                              -20220710-6050346.img.gz


    Proof to what I said above for the new image that is missing from test3. It is 7am here (4am gmt + 3 hours for eest), the image for 20220712 is on the test server (picture) but not on test3 (code tags)

    Code
    $ curl -s https://test3.libreelec.tv/json/11.0/RPi/ | grep 220712
    (no output)
    $ curl -s https://test3.libreelec.tv/json/11.0/RPi/ | grep 220711
    { "name":"LibreELEC-RPi2.arm-11.0-nightly-20220711-f682eb5.img.gz", "type":"file", "mtime":"Mon, 11 Jul 2022 22:54:55 GMT", "size":128323490 },
    { "name":"LibreELEC-RPi2.arm-11.0-nightly-20220711-f682eb5.img.gz.sha256", "type":"file", "mtime":"Mon, 11 Jul 2022 22:54:55 GMT", "size":122 },
    { "name":"LibreELEC-RPi4.arm-11.0-nightly-20220711-f682eb5.img.gz", "type":"file", "mtime":"Tue, 12 Jul 2022 00:23:27 GMT", "size":130271421 },
    { "name":"LibreELEC-RPi4.arm-11.0-nightly-20220711-f682eb5.img.gz.sha256", "type":"file", "mtime":"Tue, 12 Jul 2022 00:23:27 GMT", "size":122 }

    Why did you remove the gist? ;(

    The f682eb5 build was listed under test.libreelec.tv this morning. It is not listed now. Actually, there is no le 11 image anywhere in there right now and I have no idea why. Right now, ff682eb5 is listed in test3.libreelec.tv, so I assume some movement or maintenance is going on right now.

    Maybe the recent images are first given from test and when they get 2 days old they are moved to test3. This means test contains only 2 recent images for each system, while test3 acts as an archive that contains images from ~1 month ago.

    Is it just me or did wget lose its progress bar in 0.10? I remember it had a progress bar there....

    Code
    downloading:    LibreELEC-RPi2.arm-11.0-nightly-20220710-6050346.img.gz
    
    wait ...
    
    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
    Dload  Upload   Total   Spent    Left  Speed
    68  122M   68 83.2M    0     0  1083k      0  0:01:55  0:01:18  0:00:37  611k

    ---edit

    As seen above, the script did not download the latest build, which for today is 20220711-f682eb5 (according to test.libreelec.tv), but the previous one, which was already installed. It is because it now uses the test3 part of the server and that is the latest build that is hosted there, so I did the update by hand today. I may return to 0.08... if I find it :P

    ---re-edit

    I just noticed that the above text in the quote tags is curl's output and not wget's :P

    I need to stop updating my machines at 7am, right after waking up :D

    Please tell me that the following does not happen only on my end!

    As I have said in a previous thread I opened, I want to add some boot parameters to the kernel so as to check what happens on boot. And today I decided to add them to le 9.2.8.4 on the mxq. But there is no cmdline.txt under the flash folder! In fact, only the system image file is in there.

    Code
    # ls /flash/
    SYSTEM      lost+found

    Is this correct? If so, how can I add some boot parameters to it?

    Setting static ip on the wireless did not help. After a 2-3 of days with no issues, it failed to connect and I had to use ethernet again. This is what was happening all those days with dhcp, so no surprise there.

    However, I checked my router's log and the mac address of the rpi is nowhere in there. This means not that it tries to connect and fails, but that it does not even try to connect!

    Is this gist of 0.10 yours? If so, tell me to remove mine completely.

    Code
    https://gist.github.com/eldersixpack13/1636d17a3303260fb4ab57b6f147f795

    I also have a suggestion for getting the info (platform etc) from /etc/os-release.

    ---edit

    You can skip that cat and grep stuff on lines 102 to 105 if you source the file and echo its variables like so

    Code
    # cat params.sh
    #!/bin/sh
    source /etc/os-release
    echo $LIBREELEC_ARCH
    echo $VERSION
    
    # sh params.sh
    RPi2.arm
    nightly-20220709-6050346