General TC > Programming & Scripting - Unofficial

Script to download extensions+dependencies on other Linux distros

<< < (11/12) > >>

CNK:

--- Quote from: GNUser on May 17, 2025, 06:42:10 AM ---
--- Quote from: CNK on May 17, 2025, 02:46:54 AM ---But the script could still try looking in likely places such as "../../vmlinuz" or "../../boot/vmlinuz" for it, which might work for common TC installations.

--- End quote ---
I think the main reason  FetchExt.sh  is so useful is that it can run on any machine, whether or not TCL is present anywhere on that machine.

--- End quote ---

Yes that's the situation I'm talking about!

Somehow nobody's understanding me, so I'll try a more complete example:

--- Code: ---$ mount /mnt/sdb1
$ cd /mnt/sdb1/tce/optional
$ file ../../vmlinuz64
../../vmlinuz64: Linux kernel x86 boot executable bzImage, version 6.6.8-tinycore64 (tc@box) #666 , RO-rootFS, swap_dev=0x5, Normal VGA
$ ~/bin/FetchExt.sh input-joystick-KERNEL

--- End code ---

FetchExt.sh, running on any machine, could now use "file" to work out the TC kernel version of the system that will use the downloaded extensions.

"file" != "uname": its output is unrelated to the system it's running on, "file" can tell you the version of any kernel binary file (vmlinuz). You just need to find the location of that file for the TC installation that's going to use the extensions that FetchExt.sh is downloading - likely close to the tce/optional directory (though not always).

Rich:
Hi CNK

--- Quote from: CNK on May 17, 2025, 11:13:47 AM --- ... FetchExt.sh, running on any machine, could now use "file" to work out the TC kernel version of the system that will use the downloaded extensions. ...
--- End quote ---
Let me put it another way. I'm not interested in trying to figure out
all of the different places vmlinuz might be stashed, or how some
users might decide to rename vmlinuz. This script is also designed
to support piCore. If I'm not mistaken, it gets packaged with multiple
kernels.

The current method is, in my opinion, fairly bulletproof.
There is no guesswork on version numbers, you get them all. tce-load
will load the correct one and ignore the rest. That guarantees it won't
fail due to incorrect module versions.

I'm putting the final touches on the new version now. I will post again
when it is ready for testing.

Rich:
Hi GNUser
Wanna play?
I've attached the updated Fetch.sh.
The current version of ShowErrors.sh is also attached to keep them in the same post.
The posted versions in reply#33 will eventually be deleted.

These are the changes to Fetch.sh:

--- Code: ---# Version 0.6 May 17, 2025
# Added SanitizeExtName() to support Filename-KERNEL from command line.
# Added CheckArgs() to enforce ARCH and TC restrictions.
# Changed armv* to arm* in BuildVersionsList() so it also detects armhf.
# Simplified RefreshInfoList().
# Updated help message to include $Version, $ARCH, $TC, and note about
#     valid values for ARCH based on TC version.
--- End code ---

This is the revised help message:

--- Code: ---FetchExt.sh Version 0.6 May 17, 2025

Usage:

        FetchExt.sh ExtensionName ExtensionName ExtensionName
                                Fetches the extension(s) and its dependencies.
                                ExtensionName is case sensitive.
                                Including  .tcz  is optional.

        FetchExt.sh info        Fetches the list of available extensions in the
                                listed repository and displays it using less in
                                a new terminal.

        FetchExt.sh Log Displays the Log.txt file (if it exists) using less
                                in a new terminal.

        Please see the User variables section of this script for
        setting the version and architecture you will download for.
        Current settings are  TC=15.x    ARCH=x86

        Note about ARCH:
        Up to TC14,  options are  x86  x86_64  armv6  armv7  armv7l  aarch64
        TC15 and up, options are  x86  x86_64  armhf  aarch64
--- End code ---

CNK:

--- Quote from: Rich on May 17, 2025, 09:42:18 PM ---
--- Quote from: CNK on May 17, 2025, 11:13:47 AM --- ... FetchExt.sh, running on any machine, could now use "file" to work out the TC kernel version of the system that will use the downloaded extensions. ...
--- End quote ---
Let me put it another way. I'm not interested in trying to figure out
all of the different places vmlinuz might be stashed, or how some
users might decide to rename vmlinuz. This script is also designed
to support piCore. If I'm not mistaken, it gets packaged with multiple
kernels.

--- End quote ---

OK, that's fine. Just a suggestion since it's something I'd like in order to minimise downloads and storage. But I'll just modify it to do that myself.

GNUser:
Hi Rich. I tested the new version of  FetchExt.sh  and it works exactly as advertised. This script has become so awesome it hurts. Thank you very much. At this point I cannot think of any way of making this script any better.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version