Tiny Core Linux

General TC => Programming & Scripting - Unofficial => Topic started by: jls on November 21, 2009, 04:11:28 PM

Title: microcore update
Post by: jls on November 21, 2009, 04:11:28 PM
Code: [Select]
#!/bin/sh
#updates microcore placing bzimage and  microcore.gz in the tce dir
# version 0.5
#argument: -r (release) -c (release candidate)
#jls_legalize (unsenepopiu@tin.it)

. /etc/init.d/tc-functions
PROG_NAME=$(basename $0)

abort(){
echo "Usage: $PROG_NAME [ -r -c ]"
echo "-r for release -c for release candidate"
exit 2
}

case $1 in
-r) FTPDIR="release/distribution_files" ;;
-c) FTPDIR="release_candidates/distribution_files" ;;
*) abort ;;
esac
[ -s /opt/.tcrc ] || exit 1
MIRROR="$(awk '/Mirror/ {print $2}' /opt/.tcrc)"
cd `cat /opt/.tce_dir`
busybox wget ftp://${MIRROR}/${FTPDIR}/bzImage -O bzImage
busybox wget ftp://${MIRROR}/${FTPDIR}/bzImage.md5.txt -O bzImage.md5.txt
busybox md5sum -cs bzImage.md5.txt
if [ $? != 0 ]; then
echo "md5 doesn't match"
exit 1
fi
busybox wget ftp://${MIRROR}/${FTPDIR}/microcore.gz -O microcore.gz
busybox wget ftp://${MIRROR}/${FTPDIR}/microcore.gz.md5.txt -O microcore.gz.md5.txt
busybox md5sum -cs microcore.gz.md5.txt
if [ $? != 0 ]; then
echo "md5 doesn't match"
exit 1
fi
echo "Done!"
exit 0
Title: Re: microcore update
Post by: jls on November 27, 2009, 07:03:35 AM
microcore and the kernel have to be in the tce dir