Tiny Core Linux
Tiny Core Base => TCB Q&A Forum => Topic started by: SvOlli on April 14, 2010, 05:37:53 PM
-
Hello!
I've hacked together a little script that sets the proxy server environment variables by setting boot options. The question is, should it be included in the TinyCore base or should I create an extension for it?
#!/bin/sh
. /etc/init.d/tc-functions
profile="/etc/profile.d/proxy.sh"
proxy="$(getbootparam proxy)"
http_proxy="$(getbootparam http_proxy)"
https_proxy="$(getbootparam https_proxy)"
ftp_proxy="$(getbootparam ftp_proxy)"
if [ -n "${proxy}" ]; then
[ -z "${http_proxy}" ] && http_proxy="${proxy}"
[ -z "${https_proxy}" ] && https_proxy="${proxy}"
[ -z "${ftp_proxy}" ] && ftp_proxy="${proxy}"
fi
rm -f ${profile}
[ -n "${http_proxy}" ] && echo "export http_proxy='${http_proxy}'" >>${profile}
[ -n "${https_proxy}" ] && echo "export https_proxy='${https_proxy}'" >>${profile}
[ -n "${ftp_proxy}" ] && echo "export ftp_proxy='${ftp_proxy}'" >>${profile}
I've hacked up this one, because it's the only way I can think of setting the proxy when booting via PXE/TFTP.
-
Put it in bootlocal.sh in the backup to your nfs tce directory.
-
That won't work, because I'm not using nfs, just the "tftplist=..." boot parameter.
-
You may be able to specify multiple initrd files, or add another extension to the tftpboot list.
-
Yes, that's meant about in the first place: I already have it as an extension, but it's a 4k .tcz for a 622 bytes file.
So back to my initial question: should I release this extension or wouldn't it be wiser to put that functionality into tc-config?
-
I have similar concerns. To add non-standard port support to the "httplist=" boot all I need is to switch these 3 lines (3 better ones are welcome) in the get_app function of tc-config:
SERVER=$(echo $2 | awk -F: '$2~/[0-9]+/ {print $1FS$2} !($2~/[0-9]+/) {print $1}')
FILE=$(echo $2 | awk -F: '$2~/[0-9]+/ {print $3} !($2~/[0-9]+/) { print $2 }')
OPTS=$(echo $2 | awk -F: '$2~/[0-9]+/ {print $4} !($2~/[0-9]+/) { print $3 }')
about 100 bytes (just guessing), but to put them in as secondary initrds or extensions doesn't feel tiny enough to me. Not to mention the changes required to all the pxelinux.cfg menus.
nfs is better if it is available to you as an option. (wiki already has good write-ups on nfs)
a little feedback on the future plans for this script would aleviate anxiety :)
-
How about adding 'port=xxxx' to the options?
Ex:
httplist=openvz:TCL/nfs.list:port=8000,no-ping
I had planned on possibly adding options as needed when I wrote the nfs/tftp/http code.
-
yes port= option would be extra great for me !!
Not sure if it will help Svolli though. Might need to move this thread cause we're getting away from topic. It had occured to me to combine nfs/tftp/http into a single boot param like maybe "net-preload_tce=". And then parse the server type, port, file name etc. out of a standard url. Like...
"net-preload_tce=http://tincore_server:8085/dir_name/filelistname:no-ping"
it would add a lot of complexity to a base script though; and I have not had much success getting busy-box awk to be "readable". Looks like there is a new busy-box in 211rc2, maybe I'll go play with that.
Thanx ! & sorry to be slow in response, I having network hardware woes.
-
One option is not sufficient.
I use TFTP to load the NFS drivers to then use NFS for the tce directory.
A patch has been submitted to allow httplist=host:port/path/to/list.
-
Patch accepted and will be included starting with v2.11rc3.
-
Thanx mucho!