[fixed] ALERT! Important For Beta Participants - All CF Users Please Read

Black Hole

May contain traces of nut
This applies specifically to CF users with the beta version of ir, but all beta programme participants should be aware. You can tell if you are a potential beta programme participant by whether you have installed the opkg-beta package (see WebIF >> Package Management >> Installed). You can tell if you are actually participating in the beta programme by whether any packages in your package list shows in red with a "β" suffix.

For more information about beta participation, see here: https://hummy.tv/forum/threads/beta-participation.7785/

1. If you have the beta 1.20 version of ir installed, running fix-flash-packages to repair "disabled" packages following a crash will remove the ir package (whether it needed to or not) and not replace it (because the correct version is no longer available).

2. If you remove the opkg-beta package in the näive belief this will allow the non-beta version of ir to be substituted, fix-flash-packages will now be unable to find the correct version of any* beta package (including, potentially, webif), and end up removing those beta packages without replacing them.
Two of us have done this and ended up rebuilding our CFs from scratch (not including firmware update, of course). The only packages actually affected by this are ir and webif, and measures set out below can recover the situation without a complete rebuild.

* fix-flash-packages operates on the subset of packages which completely or partially install to flash memory rather than HDD. It is only that subset which is referred to here.

The reasons for this problem are a coincidence of several factors: the first is that an update to the beta ir was unsuccessful and removed, but actually it should have been reverted and updated. Sadly, God (@af123) doesn't seem to be around to fix things.

The second is that it has been mooted for some time that there is no longer any need to disable Flash packages on crash (as a protective measure), and it should be made at least a user option to turn off, but has never been implemented.

A third has not been mentioned before this episode: fix-flash-packages needs to be more intelligent in what it does - at the time it was written (and for entirely understandable reasons) it was a blunt instrument and has remained so.

What You Can Do About It

The following has been updated in the light of further consideration and other contributions below.

Unfortunately, I no longer have a test subject on which to trial remedies. However, on the basis of contributions from @/df and @MymsMan I recommend the following:

1. Do not summarily uninstall package opkg-beta. To do so requires preparation in the form of force-downgrading any installed beta packages affected by fix-flash-packages (ie ir and webif) to their non-beta versions, see 3 below.

2. To circumvent the actual problem without uninstalling opkg-beta, it is only necessary to download and install the latest version of the beta ir package which currently exists in the repo. On the command line (see * below):
Code:
cd /mod/tmp
wget -U '' http://hpkg.tv/hdrfoxt2/beta/ir_1.19_mipsel.opk
opkg install ir_1.19_mipsel.opk
Important: In the above command, the two ticks following "wget -U" are literally two separate ' characters, not a speech mark ".

Having downloaded 1.19 (the wget command above) it will not be necessary to do so again should you need to reinstall it again - it's there in /mod/tmp (unless you deleted it):
Code:
cd /mod/tmp
opkg install ir_1.19_mipsel.opk

Subsequent checks for available updates might report ir version 1.20 - that is erroneous, and a symptom of the problem.

3. Only if you wish to uninstall opkg-beta, or if you have knackered your WebIF by uninstalling opkg-beta and then running fix-flash-packages:

It is not necessary to uninstall opkg-beta, but if you wish to do so (or have already done so!) instructions for force-downgrading ir and webif are here:
To do this you need to download the pre-beta version (wget) package file and install the package file (opgk --force-downgrade) - the --force-depends may or may not be needed but wont hurt.
You can download to any writable directory, I suggest /mod/tmp
On the command line (see * below):
Code:
cd /mod/tmp
wget -U '' http://hpkg.tv/hdrfoxt2/base/webif_1.4.8-8_mipsel.opk
opkg --force-downgrade --force-depends install webif_1.4.8-8_mipsel.opk
wget -U '' http://hpkg.tv/hdrfoxt2/base/ir_1.17_mipsel.opk
opkg --force-downgrade --force-depends install ir_1.17_mipsel.opk
Important: In the above commands, the two ticks following "wget -U" are literally two separate ' characters, not a speech mark.

From there, if you wish, reinstall opkg-beta and reinstate any beta packages except ir. The beta package database still thinks the latest beta ir is 1.20, which is not available, so to install the beta 1.19 version of ir proceed as per 2 (above).

Please report success or failure if you have to do any of these.

Relevant discussion in other threads:

* Command line: Obtain a command prompt by using a Telnet client (eg PuTTY) to access the HDR-FOX's IP address, or (if you have the webshell package installed) using a regular web browser via WebIF >> Diagnostics >> Command Line. If prompted for a PIN, the default PIN for the HDR-FOX is "0000" (but is user-customisable in the menus). If presented with a menu, option "cli" results in a plain command prompt. For more information see https://wiki.hummy.tv/wiki/Telnet.
 
Last edited:
To remove the opkg-beta you need to manually downgrade all of the installed beta packages that are affected by fix-flash-packages , currently that is webif and ir
To do this you need to download the pre-beta version (wget) package file and install the package file (opgk --force-downgrade) - the --force-depends may or may not be needed but wont hurt.
You can download to any writable directory, I suggest /mod/tmp
cd /mod/tmp
wget -U '' http://hpkg.tv/hdrfoxt2/base/webif_1.4.8-8_mipsel.opk
opkg --force-downgrade --force-depends install webif_1.4.8-8_mipsel.opk
wget -U '' http://hpkg.tv/hdrfoxt2/base/ir_1.17_mipsel.opk
opkg --force-downgrade --force-depends install ir_1.17_mipsel.opk

To carry on using the beta webif after a fix-flash-packages you just need to download and reinstall the 1.19 version of ir from the beta repository
wget -U '' http://hpkg.tv/hdrfoxt2/beta/ir_1.19_mipsel.opk
opkg install ir_1.19_mipsel.opk
You don't need to repeat the wget if you have another crash and repeat fix-flash-packages
A normal package upgrade may complain about not finding ir 1.20 but wont remove the current version
 
Last edited:
Just to clarify for anyone retyping (like an animal), the -U option is 2 single quotes, ie empty user-agent header, needed to bypass some restriction in the hpkg.tv web server; this may not be so obvious as when it's in a [code]...[/code] block.

TBH I thought the original post provided a sufficient work-around, pending the return of our Great Leader.
 
TBH I thought the original post provided a sufficient work-around, pending the return of @our Great Leader.
It isn't obvious to me that's a solution, and in any case I felt the problem wasn't sufficiently up in lights (hence this thread, and somebody agrees because it's been pinned).

Be very kind and re-expound, in easy steps, here.
 
It occurs to me there could be a local cache of installation files for all installed packages, automatically updated at the time a package is installed, which would thus be available for reinstallation regardless of the availability of the relevant file in the repo (or, indeed, the repo itself should an Internet connection not be available or the repo is down). This is particularly relevant to installed packages affected by fix-flash-packages.
 
It occurs to me there could be a local cache of installation files for all installed packages, automatically updated at the time a package is installed, which would thus be available for reinstallation regardless of the availability of the relevant file in the repo (or, indeed, the repo itself should an Internet connection not be available or the repo is down). This is particularly relevant to installed packages affected by fix-flash-packages.
It could but opkg was probably designed and implemented in the days when disk space was measured in (low) megabytes rather than terabytes
 
The instructions seem OK as a whole, including #2. Basically, if you have the beta ir installed, keep the package file around so that you can install it by hand if it gets clobbered.
It occurs to me there could be a local cache of installation files for all installed packages, automatically updated at the time a package is installed ...
What's stored by default is the contents of the CONTROL part of the package (in /mod/var/opkg/info).

opkg is supposed to support a local package cache, let's say /mod/var/opkg/cache, by means of the option --cache. It should be possible to set this as a default by adding a line to the configuration file /etc/opkg/opkg.conf, but that file is read-only unless made writable thanks to the magic of mount --bind. An easy way to arrange this is to install opkg-beta; then if you don't actually want beta packages I assume you can avoid them by commenting out the relevant line that was placed in the now writable configuration file (# src/gz beta http://hpkg.tv/hdrfoxt2/beta) and running opkg update.

Something like this (ie, I haven't tested the whole thing) should set up and populate the cache:
Code:
cache=/mod/var/opkg/cache
conf=/etc/opkg/opkg.conf

get_opkg_option() { # conf_file var
    grep -vE '^[[:space:]]*#' "$1" |
        sed -rn "/option[[:space:]]+${2}[[:space:]]/ {s/[[:space:]]*option[[:space:]]+${2}[[:space:]]+//;t ok;b;:ok;p;q;}"
}

# check for cache setting and apply if missing
storage=$(get_opkg_option "$conf" cache)
if [ -n "$storage" ]; then
    cache="$storage"
else
    echo "option cache ${cache}" >> "$conf"
fi

# refresh the cache with all currently installed packages
mkdir -p "$cache" || exit
opkg list-installed | while read -r pkg _; do 
    ( # run an explicit subshell as we are going to set variables for each pkg
    cd "$cache"
    # transform a line like var: val into var=val and execute it
    eval $(opkg status $pkg | sed -rn "/^[[:alnum:]_]+:/ {s/: ?/='/;s/$/'/;p;}")
    # no field identifies the repo: search them in reverse order
    grep -E '^[[:space:]]*src(/gz)?[[:space:]]' "$conf" | sort -r | while read -r _ type repo _; do
        # assume any existing file is valid
        if [ "$type" = local ]; then 
            # assume "local" should be cached (?)
            url="${Package}_${Version}_${Architecture}.opk"
            # /bin/cp doesn't have -n  == --no-clobber
            [ -e "$url" ] || cp -p "${repo#file://}/${url}" .
        else
            url="${repo}/${Package}_${Version}_${Architecture}.opk"
            wget -U '' --method=HEAD "${url}" &&
                wget -U '' --no-clobber  "${url}"
        fi &&  break
    done 
    )
done
 
Last edited:
Please report success or failure if you have to do any of these.

I am experiencing a problem when trying to follow 2. To circumvent the actual problem without uninstalling opkg-beta

I have Webshell installed so tried initially via Web-IF.

I began by changing WebIF Advanced Settings to disable the Telnet menu when selecting Command within Diagnostics (probably should be obvious to anyone dabbling in beta-packages but not to me so maybe worth mentioning). After a reboot and despite the changed setting the Telnet menu is still loaded when I hit Command. I made several attempts and once managed to get to a proper Command prompt after a reboot (using the Diagnostics reboot option - it has since reverted to bringing up the Telnet menu).

Entering the second line of /df's instruction sequence produced an error so I tried again via a Putty session. The result seems identical - here is a transcript:

Humax HDR-Fox T2 (HDR2) 1.03.12/3.13

HDR2# cd /mod/tmp
HDR2# wget -U '' http://hpkg.tv/hdrfoxt2/base/ir_1.19_mipsel.opk
--2020-09-16 17:09:29-- http://hpkg.tv/hdrfoxt2/base/ir_1.19_mipsel.opk
Resolving hpkg.tv... 2a00:5600:1600::50, 89.248.55.75
Connecting to hpkg.tv|2a00:5600:1600::50|:80... failed: Address family not suppo rted by protocol.
Connecting to hpkg.tv|89.248.55.75|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2020-09-16 17:09:29 ERROR 404: Not Found.


Any thoughts welcome!
 
I began by changing WebIF Advanced Settings to disable the Telnet menu when selecting Command within Diagnostics (probably should be obvious to anyone dabbling in beta-packages but not to me so maybe worth mentioning). After a reboot and despite the changed setting the Telnet menu is still loaded when I hit Command. I made several attempts and once managed to get to a proper Command prompt after a reboot (using the Diagnostics reboot option - it has since reverted to bringing up the Telnet menu).
That's irrelevant, because from the Telnet menu the menu option "cli" gets you to the raw command line. The "disable" setting only applies to an actual Telnet session, not a webshell session.

That's my fault - an error in transcribing. If you look back at the original source it said:
Code:
wget -U '' http://hpkg.tv/hdrfoxt2/beta/ir_1.19_mipsel.opk
opkg install ir_1.19_mipsel.opk
# or, reverting beta,
wget -U '' http://hpkg.tv/hdrfoxt2/base/ir_1.17_mipsel.opk
opkg install ir_1.17_mipsel.opk
...in other words ...beta... for the beta package version (1.19) and ...base... for the non-beta version (1.17). Apologies, now corrected in post 1.
 
Last edited:
The nature of the current and, we hope, temporary, problem is that the beta package list thinks there is an ir-1.20, whereas the latest actual package file is ir_1.19_mipsel.opk, apparently resulting from an interrupted workflow.
 
Back
Top