General TC > Programming & Scripting - Unofficial
Script to download extensions+dependencies on other Linux distros
Rich:
This is my attempt to try to ease a situation that comes up on a regular basis:
I can't get the extension(s) I need because I can't get my wireless connection up.
After downloading the script make it executable:
--- Code: ---sudo chmod 777 FetchExt.sh
--- End code ---
Adjust these 3 variables in the script to match your requirements:
--- Code: ---# Repository to download from
ADDR="http://repo.tinycorelinux.net"
# Tinycore version
TC="10.x"
# Processor architecture, current options are x86 x86_64 armv6 armv7
ARCH="x86"
--- End code ---
Place the script in its own directory to keep all downloads in one place. To run it, go to that directory and:
--- Code: ---./FetchExt.sh ExtensionName
--- End code ---
Note the leading dot and slash. They are required because the directory is not in your systems PATH.
This should run on any Linux machine that has an Internet connection. I tried to avoid any Tinycore specific references and kept
command options as simple as possible. Dependencies are resolved by reducing the .tree file to a sorted list of unique entries.
Files are downloaded to the directory you are in when you invoke the script.
I think the script is fairly well documented if you want to see what's going on. Comments and criticism are welcomed.
FetchExt.sh ExtensionName without the .tcz will download the extension+dependencies including .dep and .md5 files
FetchExt.sh info will download a list of available extensions and attempt to display it using the less command in a separate terminal.
If that fails, just open info.lst with your favorite file viewer.
This is what the ./Log.txt file it generates looks like:
--- Code: ---Mon Jul 8 00:55:48 UTC 2019
Processing http://repo.tinycorelinux.net/10.x/x86/tcz/wifi.tcz.tree
libiw.tcz downloaded.
libiw.tcz.md5.txt downloaded.
libnl.tcz downloaded.
libnl.tcz.md5.txt downloaded.
ncursesw.tcz downloaded.
ncursesw.tcz.md5.txt downloaded.
openssl.tcz downloaded.
openssl.tcz.md5.txt downloaded.
readline.tcz downloaded.
readline.tcz.md5.txt downloaded.
readline.tcz.dep downloaded.
wifi.tcz downloaded.
wifi.tcz.md5.txt downloaded.
wifi.tcz.dep downloaded.
wireless-4.19.10-tinycore.tcz downloaded.
wireless-4.19.10-tinycore.tcz.md5.txt downloaded.
wireless_tools.tcz downloaded.
wireless_tools.tcz.md5.txt downloaded.
wireless_tools.tcz.dep downloaded.
wpa_supplicant.tcz downloaded.
wpa_supplicant.tcz.md5.txt downloaded.
wpa_supplicant.tcz.dep downloaded.
Mon Jul 8 15:06:48 UTC 2019
Processing http://repo.tinycorelinux.net/10.x/x86/tcz/wireless-rtl8822be-4.19.10-tinycore.tcz.tree
firmware-rtlwifi.tcz downloaded.
firmware-rtlwifi.tcz.md5.txt downloaded.
wireless-4.19.10-tinycore.tcz already downloaded.
wireless-rtl8822be-4.19.10-tinycore.tcz downloaded.
wireless-rtl8822be-4.19.10-tinycore.tcz.md5.txt downloaded.
wireless-rtl8822be-4.19.10-tinycore.tcz.dep downloaded.
--- End code ---
The line after each timestamp is what you add to your onboot.lst file, in this case wireless-rtl8822be-4.19.10-tinycore.tcz
and wifi,tcz.
Then copy *.tcz* from your download directory to your tce/optional directory.
The script is attached for downloading.
The current version of the script can be found here:
http://forum.tinycorelinux.net/index.php/topic,23034.msg164745.html#msg164745
[EDIT]: Updated attachment. Rich
[EDIT]: Added some clarification to my post. Rich
[EDIT]: Old version of attachment removed. Rich
doctoranonymous:
Sorry, very noobish of me, but I have no clue how to run the script. My internet-able computer is running Kali Linux (which I also don't know how to use properly), and I tried navigating through CLI to various folders, specifically, where "FetchExt.sh" is located, and I tried just commandline execute of "FetchExt.sh ExtensionName", and I tried "nano FetchExt.sh" and I guess maybe I forgot to sudo some of these? I can try that next.
But maybe I am supposed to do something else with the file? How do I download TC.tcz, using FetchExt.sh ?
Rich:
Hi doctoranonymous
The first thing you need to do after downloading the script is to make it executable. Go to the folder with the script and execute:
--- Code: ---sudo chmod 777 FetchExt.sh
--- End code ---
To fetch nano for example:
--- Code: ---./FetchExt.sh nano
--- End code ---
Note the leading dot and slash. I recommend placing FetchExt.sh in its own directory and running it there. This way you don't
clutter up one of your other directories with extensions.
doctoranonymous:
Several things, Rich. Thank you for being awesome; (a) helpful, (b) prompt reply, (c) not condescending or elitist. I have noticed a lot of really bad info on the internet, not because it is wrong, but because it tells and shows HOW to do a thing right, but explains nothing about the WHY of the HOW.
You are being a good teacher here, hence "moderator" status. Now, I have probably used the chmod command in ten or twenty other "recipes" and still don't know quite what it does. I have probably even read the man pages, but I think, if this works (I haven't tried it yet), I will forever remember "chmod" as "That instruction that makes a bash shell script, ".sh", executable". Now, the "777" is a bit more opaque and abstruse, and, quite frankly arbitrary? But I can't argue; I am a biologist, and our science probably looks crazy to you guys, and your science, too!
OK one last thing (that will probably make you pull your hair out, and whisper-muttering-yelling "NOOBIE!"), is Tannenbaum. Not, tis the season, "Oh Tannenbaum", but Arthur Tanenbaum, Minix, and Linux. I have been reading his Minix book, because I want to know about what Linus knew when he invented the stuff we are hacking away, diligently, daily, upon. And so, the file system structure (ambiguous terms here? yes. one meaning is e.g. minix, ext4, FAT, and another , meaning is the "Unix tree", or "directory structure"? I sometimes wish I was better with the distinctions and finer minutiae of "programmer-speak"?). So, I was thinking about directories and those "holdover", "standard-folders", from the standard UNIX type OSes, and how, I am a silly windows freak (until 2016), so I just make a folder, anywhere, when I want one. In theory, this is incorrect for Linux? Or perhaps, just a "cluttery" type attitude?
I read somewhere that certain of these "standard folders", in a Linux system could be placed in different partition, and personal files kept there, so that, if wiping and installing a new OS, these personal "work files" will be retained in the new OS? Now the Tiny core "extensions" seem like a similar idea; (1) keep a clean boot, (2) don't mix up the superfluous with the essential, etc. ( I still "sort of" read the tiny core book... bad student sometimes.).
So, as per your instructions, and my predilection for clutter, I will make a FetchedExts directory, in root (though in truth, I am sometimes perplexed that "/" is root and "/root/" is root? Oh well, I guess we can't all make sense, all the time, and computer programmers are no exception to this rule?)
"Keep a clean boot, be careful not to clutter root, you don't need a Kali TAIL, to onion-out the plain suits"~Adapted/stolen from B. Dylan, by yours truly, just now ...
doctoranonymous:
OK, I get this :
root@localhost:/FetchedExts# ./FetchExt.sh TC
./FetchExt.sh: 53: [: 8: unexpected operator
http://repo.tinycorelinux.net/10.x/x86/tcz/TC.tcz.tree not found.
root@localhost:/FetchedExts# ./FetchExt.sh nano
./FetchExt.sh: 107: [: 0: unexpected operator
nano.tcz: OK
./FetchExt.sh: 107: [: 8: unexpected operator
ncurses5.tcz: OK
synopsis: seems to have fetched nano, but not TC? I will try ( flailing? in vain?) to troubleshoot it?
Navigation
[0] Message Index
[#] Next page
Go to full version