WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: busybox timeout patch but it has an option  (Read 4153 times)

Offline Roberto A. Foglietta

  • Full Member
  • ***
  • Posts: 212
    • personal home page
busybox timeout patch but it has an option
« on: August 20, 2021, 05:39:57 PM »
Hi all,

 I saw this patch for busybox

http://tinycorelinux.net/12.x/x86/release/src/busybox/busybox-1.27.1-wget-make-default-timeout-configurable.patch

 and I wish to understand why this patch is needed when the timeout is configurable by the -T option?

 The same result could be obtained with an alias wget="wget -T 10"

Code: [Select]
BusyBox v1.33.1 (2021-08-20 18:38:15 CEST) multi-call binary.

Usage: wget [-cqS] [--spider] [-O FILE] [-o LOGFILE] [--header 'HEADER: VALUE'] [-Y on/off]
[--no-check-certificate] [-P DIR] [-U AGENT] [-T SEC] URL...

Retrieve files via HTTP or FTP

-T SEC Network read timeout is SEC seconds

 Thank you, R-
« Last Edit: August 20, 2021, 05:54:15 PM by Roberto A. Foglietta »

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: busybox timeout patch but it has an option
« Reply #1 on: August 20, 2021, 08:04:29 PM »
Hi Roberto A. Foglietta
It appears to be a way of setting the default timeout using the  menuconfig  script instead of altering the source
code directly. The 900 second default was deemed too long. Here are a couple of old posts that refer to the issue:
http://forum.tinycorelinux.net/index.php/topic,16152.0.html
http://forum.tinycorelinux.net/index.php/topic,16913.0.html

Offline Roberto A. Foglietta

  • Full Member
  • ***
  • Posts: 212
    • personal home page
Re: busybox timeout patch but it has an option
« Reply #2 on: August 20, 2021, 11:23:05 PM »
Hi Roberto A. Foglietta
It appears to be a way of setting the default timeout using the  menuconfig  script instead of altering the source
code directly. The 900 second default was deemed too long. Here are a couple of old posts that refer to the issue:
http://forum.tinycorelinux.net/index.php/topic,16152.0.html
http://forum.tinycorelinux.net/index.php/topic,16913.0.html

It is ok but why do not use -T option? The -T 10 sets the timeout to 10 seconds without any changes in busybox.
In the script the option could explicitly used while for the user the option could be delivered with an alias.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10957
Re: busybox timeout patch but it has an option
« Reply #3 on: August 20, 2021, 11:35:27 PM »
Because you have to set it in every script?

Sane default vs extra effort.
The only barriers that can stop you are the ones you create yourself.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10957
Re: busybox timeout patch but it has an option
« Reply #4 on: August 20, 2021, 11:41:02 PM »
Also, Roberto, I have to say by now that what you're doing is not helpful. You're wasting both our and busybox maintainers' time by trying to submit patches that were not intended to be submitted, etc., and passing comments that you only half understand. Please stop.
The only barriers that can stop you are the ones you create yourself.

Offline Roberto A. Foglietta

  • Full Member
  • ***
  • Posts: 212
    • personal home page
Re: busybox timeout patch but it has an option
« Reply #5 on: August 21, 2021, 12:46:57 AM »
Sane default vs extra effort.

TC is just using an alias and wget in only one place so no extra effort is required (included apply any patch) but using properly an option that probably were not existing at the time the patch has been developed. Try this for see what I mean:

Code: [Select]
tc@box:~$ sudo grep -rn wget /etc

Also, Roberto, I have to say by now that what you're doing is not helpful.

I am doing two important things: 1. I am learning and 2. I am revising TC Linux.

Both are important for the project also: 1. without learning should not be any useful contribution and 2. it is an open source project and for this reason revision by 3rd party is not an option.

Probably you feel not be comfortable in being questioned. It is ok. Nobody like it but I am not judging your work/skills but the choices that have been done in time and might not be updated with the current situation. This seems a good example.


« Last Edit: August 21, 2021, 12:54:53 AM by Roberto A. Foglietta »

Offline nick65go

  • Hero Member
  • *****
  • Posts: 799
Re: busybox timeout patch but it has an option
« Reply #6 on: August 21, 2021, 05:13:16 AM »
Wow, this is becoming interesting: past decisions about tinycore, an open-source project.
Searching the forum, instead of a wiki is inconvenient; mostly if some info could be outdated, or frankly missing.
Maybe a sticky forum subject can be made about critical info in tc project;
- about compression type (gip, or xz), what data-set from tcz was measured, with link to past forum posts?
- about why squashfs is better than unionfs. I belive it, others must be convinced.
- an attached list with what is tc home-made scripts, versus busybox defaults; for example correcting a wget bug, or a dc bug etc. Or kernel patch because squashfs module bug, etc

Personally I am pleased with what TC offers right now, for free. And the info about few decisions in designing TC are already published (like pristine state at any reboot etc). But they are scattered in many places (FAQ, wiki, forum). And not all decisions are publicly available or explained.

IMHO: It will be waste of time, resources and effort to fork TC, just because few missing explanations. Few sticky links about TC decisions will avoid a lot of frictions, repetitive questions about the same subjects.

PS: for example, the right decison to re-write the recursive dependency building routine, from shell-scripts to awk language, starting from TC ver. 5+. Or waitforX in C language, etc. What impact had on X startup, or tcz loading, in seconds, and for which CPU was measured, etc. Just info, that someone with time to test/waste can check it.
« Last Edit: August 21, 2021, 05:24:28 AM by nick65go »

Offline Roberto A. Foglietta

  • Full Member
  • ***
  • Posts: 212
    • personal home page
Re: busybox timeout patch but it has an option
« Reply #7 on: August 21, 2021, 07:46:56 AM »
IMHO: It will be waste of time, resources and effort to fork TC, just because few missing explanations. Few sticky links about TC decisions will avoid a lot of frictions, repetitive questions about the same subjects.

I am not forking the TinyCore. I am working to towards developing a way to easily customize TinyCore.

However there is some choices that should be challenged: the busybox.suid vs busybox single file, first of all. IMHO, it make sense give it a try and see how it works by now. What was not viable in the past could have became viable by now.

The TCZ folder still exists in place of TCE just because using an ISO the TCE folder is ignored but it is a thing that I should investigate and understand. However, for the USB image exists the tcz2tce.sh that convert the TCZ in TCE. Unfortunately, this conversion might arise some problems when I use meta-packages. Meta-packages should loaded before all in such a way the other packages found the dependencies satisfied. Obviously, this happens only when meta-packages are mixed with original tcz but it happens. I should to check how X-full works. It is a meta package, AFAIK.


Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: busybox timeout patch but it has an option
« Reply #8 on: August 21, 2021, 08:01:36 AM »
Hi Roberto A. Foglietta
... It is ok but why do not use -T option? The -T 10 sets the timeout to 10 seconds without any changes in busybox. ...
Because the purpose of  -T  is to override the default timeout, not to fix what seems like an unreasonably long
(15 minutes) default timeout. The point of having defaults is to provide reasonable values for options you do
not specify.

TC is just using an alias and wget in only one place
 ----- Snip -----
 Try this for see what I mean:

Code: [Select]
tc@box:~$ sudo grep -rn wget /etc ----- Snip -----
Excellent point. Now you try this (GNU grep):
Code: [Select]
sudo grep -I wget /usr/bin/*I got 11 results. Doing the same for  /usr/local/bin/  returned 17 results from inxi.

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: busybox timeout patch but it has an option
« Reply #9 on: August 21, 2021, 08:14:40 AM »
Hi Roberto A. Foglietta
... The TCZ folder still exists in place of TCE just because using an ISO the TCE folder is ignored ...
Tinycore uses a  cde  boot code and a  cde  directory when running from read only media. A  tce  directory is
considered writable.
« Last Edit: August 21, 2021, 11:20:59 AM by Rich »

Offline nick65go

  • Hero Member
  • *****
  • Posts: 799
Re: busybox timeout patch but it has an option
« Reply #10 on: August 21, 2021, 09:49:32 AM »
... The TCZ folder still exists in place of TCE just because using an ISO the TCE folder is ignored ...
did you try an ISO with BOTH boot parameters cde and tce=sda# etc ? it will load tcz from cde folder (RO) AND from tce folder (RW), if I remember correctly.
« Last Edit: August 21, 2021, 09:52:15 AM by nick65go »

Offline Roberto A. Foglietta

  • Full Member
  • ***
  • Posts: 212
    • personal home page
Re: busybox timeout patch but it has an option
« Reply #11 on: August 21, 2021, 09:53:24 AM »
... The TCZ folder still exists in place of TCE just because using an ISO the TCE folder is ignored ...
Tinycore uses a  cde  boot code and a  cde  directory when running from read only media. A  tce  directory is
considered writable.

Is cde folder organised like tce as structure/files inside? Thank you, R-

Offline nick65go

  • Hero Member
  • *****
  • Posts: 799
Re: busybox timeout patch but it has an option
« Reply #12 on: August 21, 2021, 09:59:15 AM »
"Is cde folder organized like tce as structure/files inside?" - > grab a TC iso and see.
Yes, it has *.tcz and *.md5, a list *.lst to load them, but not *.dep; maybe you should read the start/initial scripts, to understand the logic. enjoy it.
« Last Edit: August 21, 2021, 10:04:10 AM by nick65go »

Offline nick65go

  • Hero Member
  • *****
  • Posts: 799
Re: busybox timeout patch but it has an option
« Reply #13 on: August 21, 2021, 11:22:03 AM »
@roberto: if you look inside script /usr/bin/tce-setup, you will see that function process_CD() calls process () "$CDELIST";
the same process() that load the normal tcz (from tce).

So technically "normal" SDA/tce/optional/*tcz are loaded and after that those from the USB/cde/optional/*tcz.
One caveat: if you put (in your custom ISO) in folder /cde/optional only the tcz, then the recursive dependency of dependency creation will need ALL of the dep files in /cde/optional already. Or else just have a big complete /cde/option/onboot.lst with all tcz need (without any *.dep)
« Last Edit: August 21, 2021, 11:27:03 AM by nick65go »

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: busybox timeout patch but it has an option
« Reply #14 on: August 21, 2021, 11:22:26 AM »
Hi Roberto A. Foglietta
The only difference between a  cde  and  tce  folder is the name and whether it is writable.