Broken opkg/gpkg --tmp-dir option

If your problem doesn't fall into one of the other categories, report it here.

Moderator: Moderators

Post Reply
Cthulhu
Posts: 2
Joined: Sat Jul 06, 2024 12:33 am

Broken opkg/gpkg --tmp-dir option

Post by Cthulhu »

Running version 1.14, I needed to install gcc to an USB stick, but kept running into an out of memory failure caused by downloading the package (which is too large for my RAM specs) into /tmp.
The --tmp-dir/-t option, which can solve this issue, is unfortunately broken and does nothing.

Assign the option's argument to key "tmp-dir": /blob/ae547ce5113ce1c6e260112bcdcab9f41e3e7ab8/package/gpkg/src/gpkg.c#L177
Reference the option's argument from key "tmp_dir" (always NULL as nothing assigns to this key): /blob/ae547ce5113ce1c6e260112bcdcab9f41e3e7ab8/package/gpkg/src/gpkg.c#L29
(can't post links, just prefix these paths with the project's GitHub repository)

Because of the difference in key names, tmp_root always points to "/tmp".

First I considered creating symlinks in /tmp, but found that the create_tmp_dir function appends a rand() suffix to the dir name.
A solution that worked for me was to patch gpkg's binary, changing the static storage duration constant from "tmp_dir" to "tmp-dir".

Note that default opkg.conf lacks /releases/22.03.5/targets/ath79/generic/packages which is required for libstdcpp6 (gcc package depends on libstdcpp6). /etc/opkg/distfeeds.conf has it, but this file is not actually used by gpkg.

Lantis
Moderator
Posts: 6851
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Broken opkg/gpkg --tmp-dir option

Post by Lantis »

Thanks for the report, I’ll take care of it.
You did all the hard work! If you have the skills you definitely could have submitted a pull request for me to accept :) but I’m also happy to take clear bug reports (such as this) and work with them.

If you want to add the <target>/<subtarget>/packages repository you can do so as you would add any other additional repo.
The reason it is not added by default is that it is full of kmods which will be incompatible with the Gargoyle kernel (different kernel magic string). It just tends to add confusion for users who don’t know any better.
Gargoyle includes the “kernel specific” repository which is the equivalent.
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

Cthulhu
Posts: 2
Joined: Sat Jul 06, 2024 12:33 am

Re: Broken opkg/gpkg --tmp-dir option

Post by Cthulhu »

Lantis wrote:
Sat Jul 06, 2024 2:42 am
If you have the skills you definitely could have submitted a pull request for me to accept :) but I’m also happy to take clear bug reports (such as this) and work with them.
Currently, I do not have a proper environment to compile, deploy and test OpenWrt builds and I would rather not submit PRs without compiling and testing them first. Also, I do not have a GitHub account, in case this is the only medium in which PRs are merged.
Making a forum post describing the problem and its solution to people who can trivially compile, deploy and commit felt good enough.
Lantis wrote:
Sat Jul 06, 2024 2:42 am
If you want to add the <target>/<subtarget>/packages repository you can do so as you would add any other additional repo.
The reason it is not added by default is that it is full of kmods which will be incompatible with the Gargoyle kernel (different kernel magic string). It just tends to add confusion for users who don’t know any better.
Gargoyle includes the “kernel specific” repository which is the equivalent.
Right, that's what I did, but figured it's worth a mention that some popular packages won't install with the default feeds, at least for ath79.

Lantis
Moderator
Posts: 6851
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Broken opkg/gpkg --tmp-dir option

Post by Lantis »

http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

Post Reply