Tiny Core Base > TCB Q&A Forum

Understanding tc: Why is “mount on boot” not super fast?

<< < (5/8) > >>

yvs:

--- Quote from: Rich on August 26, 2024, 10:35:11 AM ---Hi CentralWare

--- Quote from: CentralWare on August 26, 2024, 09:23:52 AM --- ... I'd imagine this doesn't operate as expected on every extension, ...
--- End quote ---
It doesn't work for every extension.

--- End quote ---
I suppose that tips suggesting extensions containing some program (or might be even with a prompt to download/install them) can be done by shell hooks on user side (most of shells have some not_found hook).
Those handy tips are often used in many other distributions.

Something like

--- Code: ---tc@tc-x86_64:~$ cc
cc found in 'gcc'

tc@tc-x86_64:~$ as
as found in 'binutils'

tc@tc-x86_64:~$ yacc
yacc found in 'bison'

tc@tc-x86_64:~$ locate
locate found in 'findutils'

tc@tc-x86_64:~$ hmm   
hmm: not found

--- End code ---

The only thing that makes it a bit annoying it's manual support and update a list of those binaries because lack of centralized db/lists of packaged files (it's several shell lines but anyway it can easy forget to update those lists locally by end-user) and possible difference in naming of the same extensions among TCL for different architectures

Stefann:
Note… in response to my own original question:
Understanding tc: Why is “mount on boot” not super fast?
Where my initial objective was mostly “understanding”, not necessarily “solving”.
(For reason I intend to use this OS for 15+ year, I like to understand it)

I had a bit of a brainwave….
Mounting is probably reasonably fast,
But the full compressed archive will probably need a read

That would mean that the “on boot” startup time would be  proportional to the disk space of that all “on demand” .tcz files take.

And this is where I probably went wrong in very initial assumption:
- a normal mount just mounts from a location one can find in an instant
- this mounting of a compressed archive probably requires disk operation to read the full archive file.

In weekend I will see which package has a large footprint and see what happens if I exclude it from boot.
My thought is triggered because I notice the “disk activity” led showing lots of action during boot. That is not mounting…. That is reading.


Rich:
Hi Stefann

--- Quote from: Stefann on August 29, 2024, 12:38:40 AM --- ... My thought is triggered because I notice the “disk activity” led showing lots of action during boot. That is not mounting…. That is reading.
--- End quote ---
The disk activity is likely from all of the links being created from
the filesystem to the files in each extension.

curaga:
@yvs: Personally that really annoys me on Ubuntu and others. When I make a typo, that hook causes significant delay, with cold caches the first time is several seconds.

yvs:

--- Quote from: curaga on August 29, 2024, 02:21:14 AM ---@yvs: Personally that really annoys me on Ubuntu and others. When I make a typo, that hook causes significant delay, with cold caches the first time is several seconds.

--- End quote ---
agree I usually disable it and use `apt-file search` when it's needed, it's slow there maybe because of enormous number of packages and files in that, or probably some compression to keep that info, I haven't dig into it.
In case of not so big number of TC extensions it doesn't look slow to become annoying, for example for the first time not installed gcc:

--- Code: ---tc@tc-x86_64:~$ time gcc
gcc found in 'gcc'
                                                                               
real    0m0.009s
user    0m0.004s
sys     0m0.005s


--- End code ---

it's in case of a simple bash hook (not tried busybox ash compiled with CONFIG_ASH_BASH_NOT_FOUND_HOOK yet)

--- Code: ---# it can be boosted a bit using filelist on ramfs and pregrepping before sed

EXT_BIN_LIST="/etc/sysconfig/tcedir/not_found.aux"

function command_not_found_handle() {
  test -f "$EXT_BIN_LIST" && {
    bin="$1"; shift
    exts="$(sed -n "s,^\(.*\)[ ]\+.*/$bin/.*,\1,p" <"$EXT_BIN_LIST")"
    test -n "$exts" && echo "$bin found in '$exts'" || echo "$bin: not found"
  }
  return 127
}

--- End code ---

and simple text format like

--- Code: ---% grep '^gcc' /etc/sysconfig/tcedir/not_found.aux
gcc /c++/cc/cpp/g++/gcc/gcc-ar/gcc-nm/gcc-ranlib/gcov/gcov-dump/gcov-tool/lto-dump/x86_64-pc-linux-gnu-c++/x86_64-pc-linux-gnu-g++/x86_64-pc-linux-gnu-gcc/x86_64-pc-linux-gnu-gcc-13.2.0/x86_64-pc-linux-gnu-gcc-ar/x86_64-pc-linux-gnu-gcc-nm/x86_64-pc-linux-gnu-gcc-ranlib/

--- End code ---

Anyway command_not_found_handle() can be set/unset by user, it's always good to have options

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version