mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-28 11:43:25 +02:00
Remove tons of code from the buildscripts that was not used anymore.
This commit is contained in:
@@ -10,24 +10,6 @@ Optional
|
|||||||
If you want to use it, do it before build step
|
If you want to use it, do it before build step
|
||||||
|
|
||||||
Maintainer / advanced commands
|
Maintainer / advanced commands
|
||||||
changelog : Loads the latest changelog from SVN.
|
|
||||||
check : Test if packages files are still available for download
|
|
||||||
This is faster on http URL with --spider, but still slow on ftp
|
|
||||||
because of real load.
|
|
||||||
checkclean : Erase all check mark on cache directory to be able to check
|
|
||||||
another time
|
|
||||||
dist : Mainly produce a diff from previous version to track wich
|
|
||||||
files have been changed
|
|
||||||
make : Does a complete compile with fetching source packages.
|
|
||||||
pxe : <start|stop|reload>
|
|
||||||
Starts, stops or reloads a small tftp daemon for pxe boot.
|
|
||||||
toolchain : Create our own toolchain package to save 20% of build time.
|
toolchain : Create our own toolchain package to save 20% of build time.
|
||||||
shell : Enter a shell inside the chroot, used to tune lfs script
|
shell : Enter a shell inside the chroot, used to tune lfs script
|
||||||
and / or during kernel upgrade to rebuild a new .config
|
and / or during kernel upgrade to rebuild a new .config
|
||||||
svn : <update|diff|commit|dist>
|
|
||||||
update <rev> : Loads the latest source files from svn or if <rev> is given
|
|
||||||
it loads this revision.
|
|
||||||
diff : Mainly produce a diff from previous version to track wich
|
|
||||||
files have been changed
|
|
||||||
commit : Applies your changes to the svn.
|
|
||||||
dist <rev> : Tar the source code from revision.
|
|
||||||
|
|||||||
@@ -37,12 +37,6 @@ URL_IPFIRE = http://source.ipfire.org/source-2.x
|
|||||||
URL_TOOLCHAIN = http://source.ipfire.org/toolchains
|
URL_TOOLCHAIN = http://source.ipfire.org/toolchains
|
||||||
URL_SOURCE = source.ipfire.org:/pub/source/source-2.x
|
URL_SOURCE = source.ipfire.org:/pub/source/source-2.x
|
||||||
|
|
||||||
# Default compiler optimizations.
|
|
||||||
#
|
|
||||||
FLAGS_OPT = -O2
|
|
||||||
FLAGS_CPU = -mcpu=$(MACHINE)
|
|
||||||
FLAGS_ARCH = -march=$(MACHINE)
|
|
||||||
|
|
||||||
# Don't change this; it will be overridden by other makefiles where necessary.
|
# Don't change this; it will be overridden by other makefiles where necessary.
|
||||||
#
|
#
|
||||||
ROOT =
|
ROOT =
|
||||||
|
|||||||
122
make.sh
122
make.sh
@@ -1026,54 +1026,6 @@ othersrc)
|
|||||||
fi
|
fi
|
||||||
stdumount
|
stdumount
|
||||||
;;
|
;;
|
||||||
git)
|
|
||||||
case "$2" in
|
|
||||||
update|up)
|
|
||||||
## REMOVES ALL UNCOMMITTED CHANGES!
|
|
||||||
[ "$3" == "--force" ] && git checkout -f
|
|
||||||
git pull
|
|
||||||
;;
|
|
||||||
commit|ci)
|
|
||||||
shift 2
|
|
||||||
git commit $*
|
|
||||||
|
|
||||||
[ "$?" -eq "0" ] || exiterror "git commit $* failed."
|
|
||||||
|
|
||||||
echo -e "${BOLD}Do you want to push, too? [y/N]${NORMAL}"
|
|
||||||
read
|
|
||||||
[ -z $REPLY ] && exit 0
|
|
||||||
for i in y Y j J; do
|
|
||||||
if [ "$i" == "$REPLY" ]; then
|
|
||||||
$0 git push
|
|
||||||
exit $?
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
exiterror "\"$REPLY\" is not a valid answer."
|
|
||||||
;;
|
|
||||||
dist)
|
|
||||||
git archive HEAD | gzip -9 > ${SNAME}-${VERSION}.tar.gz
|
|
||||||
;;
|
|
||||||
diff|di)
|
|
||||||
echo -ne "Make a local diff to last revision"
|
|
||||||
git diff HEAD > ipfire-diff-$(date +'%Y-%m-%d-%H:%M').diff
|
|
||||||
evaluate 1
|
|
||||||
echo "Diff was successfully saved to ipfire-diff-$(date +'%Y-%m-%d-%H:%M').diff"
|
|
||||||
git diff --stat
|
|
||||||
;;
|
|
||||||
push)
|
|
||||||
[ -z $GIT_USER ] && exiterror "You have to setup GIT_USER first."
|
|
||||||
GIT_URL="ssh://${GIT_USER}@git.ipfire.org/pub/git/ipfire-2.x"
|
|
||||||
|
|
||||||
git push ${GIT_URL} $3
|
|
||||||
;;
|
|
||||||
log)
|
|
||||||
[ -z $GIT_TAG ] || LAST_TAG=$GIT_TAG
|
|
||||||
[ -z $LAST_TAG ] || EXT="$LAST_TAG..HEAD"
|
|
||||||
|
|
||||||
git log -n 500 --no-merges --pretty=medium --shortstat $EXT > $BASEDIR/doc/ChangeLog
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
uploadsrc)
|
uploadsrc)
|
||||||
PWD=`pwd`
|
PWD=`pwd`
|
||||||
if [ -z $IPFIRE_USER ]; then
|
if [ -z $IPFIRE_USER ]; then
|
||||||
@@ -1095,83 +1047,9 @@ uploadsrc)
|
|||||||
cd $PWD
|
cd $PWD
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
batch)
|
|
||||||
if [ "$2" = "--background" ]; then
|
|
||||||
batch_script
|
|
||||||
exit $?
|
|
||||||
fi
|
|
||||||
if [ `screen -ls | grep -q ipfire` ]; then
|
|
||||||
echo "Build is already running, sorry!"
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
if [ "$2" = "--rebuild" ]; then
|
|
||||||
export IPFIRE_REBUILD=1
|
|
||||||
echo "REBUILD!"
|
|
||||||
else
|
|
||||||
export IPFIRE_REBUILD=0
|
|
||||||
fi
|
|
||||||
echo -en "${BOLD}***IPFire-Batch-Build is starting...${NORMAL}"
|
|
||||||
screen -dmS ipfire $0 batch --background
|
|
||||||
evaluate 1
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
watch)
|
|
||||||
watch_screen
|
|
||||||
;;
|
|
||||||
pxe)
|
|
||||||
case "$2" in
|
|
||||||
start)
|
|
||||||
start_tftpd
|
|
||||||
;;
|
|
||||||
stop)
|
|
||||||
stop_tftpd
|
|
||||||
;;
|
|
||||||
reload|restart)
|
|
||||||
reload_tftpd
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
lang)
|
lang)
|
||||||
update_langs
|
update_langs
|
||||||
;;
|
;;
|
||||||
"")
|
|
||||||
clear
|
|
||||||
select name in "Exit" "IPFIRE: Downloadsrc" "IPFIRE: Build (silent)" "IPFIRE: Watch Build" "IPFIRE: Batch" "IPFIRE: Clean" "LOG: Tail" "Help"
|
|
||||||
do
|
|
||||||
case $name in
|
|
||||||
"IPFIRE: Downloadsrc")
|
|
||||||
$0 downloadsrc
|
|
||||||
;;
|
|
||||||
"IPFIRE: Build (silent)")
|
|
||||||
$0 build-silent
|
|
||||||
;;
|
|
||||||
"IPFIRE: Watch Build")
|
|
||||||
$0 watch
|
|
||||||
;;
|
|
||||||
"IPFIRE: Batch")
|
|
||||||
$0 batch
|
|
||||||
;;
|
|
||||||
"IPFIRE: Clean")
|
|
||||||
$0 clean
|
|
||||||
;;
|
|
||||||
"Help")
|
|
||||||
echo "Usage: $0 {build|changelog|clean|gettoolchain|downloadsrc|shell|sync|toolchain}"
|
|
||||||
cat doc/make.sh-usage
|
|
||||||
;;
|
|
||||||
"LOG: Tail")
|
|
||||||
tail -f log/_*
|
|
||||||
;;
|
|
||||||
"Exit")
|
|
||||||
break
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
config)
|
|
||||||
make_config
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
echo "Usage: $0 {build|changelog|clean|gettoolchain|downloadsrc|shell|sync|toolchain}"
|
echo "Usage: $0 {build|changelog|clean|gettoolchain|downloadsrc|shell|sync|toolchain}"
|
||||||
cat doc/make.sh-usage
|
cat doc/make.sh-usage
|
||||||
|
|||||||
@@ -509,247 +509,6 @@ installmake() {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
update_logs() {
|
|
||||||
tar cfz log/ipfire-logs-`date +'%Y-%m-%d-%H:%M'`.tgz log/_build.*
|
|
||||||
rm -f log/_build.*
|
|
||||||
}
|
|
||||||
|
|
||||||
batch_script() {
|
|
||||||
echo -ne "${BOLD}***This is our auto buildscript! Have fun...${NORMAL}\n"
|
|
||||||
update_logs
|
|
||||||
evaluate 1
|
|
||||||
|
|
||||||
if [ "$IPFIRE_REBUILD" -eq "0" ]; then
|
|
||||||
export IPFIRE_START_TIME=`date`
|
|
||||||
|
|
||||||
$0 clean
|
|
||||||
evaluate 1
|
|
||||||
|
|
||||||
$0 git update --force
|
|
||||||
evaluate 1 mail_me UPDATE
|
|
||||||
|
|
||||||
echo "### EXPORT SOURCES"
|
|
||||||
$0 git dist
|
|
||||||
evaluate 1 mail_me DIST
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "### RUNNING BUILD"
|
|
||||||
$0 build
|
|
||||||
evaluate 1 mail_me ERROR
|
|
||||||
|
|
||||||
echo "### UPLOADING ISO"
|
|
||||||
$0 upload iso
|
|
||||||
evaluate 1 mail_me ISO
|
|
||||||
|
|
||||||
echo -ne "### UPLOADING PAKS"
|
|
||||||
$0 upload paks
|
|
||||||
evaluate 1 mail_me PAKS
|
|
||||||
|
|
||||||
echo -ne "${BOLD}***SUCCESS!${NORMAL}"
|
|
||||||
mail_me success
|
|
||||||
exit 0
|
|
||||||
}
|
|
||||||
|
|
||||||
watch_screen() {
|
|
||||||
echo -e "${BOLD}Exit with Ctrl+A, Ctrl+D.${NORMAL}"
|
|
||||||
sleep 0.5
|
|
||||||
screen -x ipfire
|
|
||||||
}
|
|
||||||
|
|
||||||
mail_me() {
|
|
||||||
echo "From: $MAIL_FROM" > /tmp/ipfire_mail_body.$$
|
|
||||||
echo "To: $MAIL_TO" >> /tmp/ipfire_mail_body.$$
|
|
||||||
case "$1" in
|
|
||||||
success)
|
|
||||||
cat <<END >> /tmp/ipfire_mail_body.$$
|
|
||||||
Subject: SUCCESS: IPFIRE-BUILD on `hostname`
|
|
||||||
Building IPFire on `hostname` was successfull!
|
|
||||||
You can find the ISO on your ftp server if you told the script where it is.
|
|
||||||
|
|
||||||
Statistics:
|
|
||||||
-----------
|
|
||||||
Started: $IPFIRE_START_TIME
|
|
||||||
Finished: `date`
|
|
||||||
|
|
||||||
Best Regards
|
|
||||||
Your IPFire-Build-Script
|
|
||||||
|
|
||||||
END
|
|
||||||
echo -ne "${BOLD}***Sending success message${NORMAL}"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
cat <<END >> /tmp/ipfire_mail_body.$$
|
|
||||||
Subject: ERROR $1: IPFIRE-BUILD on `hostname`
|
|
||||||
When I was building IPFire on `hostname`, I have found an ERROR with name $1!
|
|
||||||
Here you can see the logs and detect the reason for this error.
|
|
||||||
|
|
||||||
Best Regards
|
|
||||||
Your IPFire-Build-Script
|
|
||||||
|
|
||||||
|
|
||||||
Here is a summary... The full logs are in the attachment.
|
|
||||||
---------------------------------------------------------
|
|
||||||
|
|
||||||
`tail log/_*`
|
|
||||||
END
|
|
||||||
echo -ne "${BOLD}***Sending error message${NORMAL}"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
sleep 15
|
|
||||||
python tools/sendEmail < /tmp/ipfire_mail_body.$$
|
|
||||||
if [ "$?" -eq "0" ]; then
|
|
||||||
beautify message DONE
|
|
||||||
else
|
|
||||||
beautify message FAIL
|
|
||||||
fi
|
|
||||||
rm -f /tmp/ipfire_mail_body.$$
|
|
||||||
}
|
|
||||||
|
|
||||||
make_config() {
|
|
||||||
clear
|
|
||||||
echo -e "${BOLD}***This will create your configuration...${NORMAL}"
|
|
||||||
echo -ne "***If your are ready press <ENTER>!"
|
|
||||||
read
|
|
||||||
clear
|
|
||||||
echo -ne "***The buildscript will create a full iso image.\n"
|
|
||||||
echo -ne "***If you want to skip any package please enter its name here seperated with space.\n"
|
|
||||||
echo -ne "Actually in the list are: $SKIP_PACKAGE_LIST\n"
|
|
||||||
echo -ne "Do you want to change this? (y/N) "
|
|
||||||
read YESNO
|
|
||||||
if [ "$YESNO" == "y" ]; then
|
|
||||||
echo -ne "Please type: "
|
|
||||||
read SKIP_PACKAGE_LIST
|
|
||||||
echo -ne "You entered: $SKIP_PACKAGE_LIST\n"
|
|
||||||
fi
|
|
||||||
|
|
||||||
clear
|
|
||||||
echo -ne "***When you have compiled successfully, there is the possibility\n"
|
|
||||||
echo -ne "***to upload the iso image to a ftp server.\n"
|
|
||||||
echo -ne "***If the url is empty there will be no upload.\n"
|
|
||||||
echo -ne "Actually there is: $FTP_ISO_URL\n"
|
|
||||||
echo -ne "Do you want to change this? (y/N) "
|
|
||||||
read YESNO
|
|
||||||
if [ "$YESNO" == "y" ]; then
|
|
||||||
echo -ne "Please type the url: "
|
|
||||||
read FTP_ISO_URL
|
|
||||||
echo -ne "Please type the path: "
|
|
||||||
read FTP_ISO_PATH
|
|
||||||
echo -ne "Please type the username: "
|
|
||||||
read FTP_ISO_USER
|
|
||||||
echo -ne "Please type the password (hidden): "
|
|
||||||
read -s FTP_ISO_PASS
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
clear
|
|
||||||
echo -ne "***When you add some new software you can easyly\n"
|
|
||||||
echo -ne "***upload the source code to our repository server.\n"
|
|
||||||
echo -ne "***If the url is empty there will be no upload.\n"
|
|
||||||
echo -ne "Actually there is: $FTP_CACHE_URL\n"
|
|
||||||
echo -ne "Do you want to change this? (y/N) "
|
|
||||||
read YESNO
|
|
||||||
if [ "$YESNO" == "y" ]; then
|
|
||||||
echo -ne "Please type the url: "
|
|
||||||
read FTP_CACHE_URL
|
|
||||||
echo -ne "Please type the path: "
|
|
||||||
read FTP_CACHE_PATH
|
|
||||||
echo -ne "Please type the username: "
|
|
||||||
read FTP_CACHE_USER
|
|
||||||
echo -ne "Please type the password (hidden): "
|
|
||||||
read -s FTP_CACHE_PASS
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
clear
|
|
||||||
echo -ne "***If there are some important messages you\n"
|
|
||||||
echo -ne "***can get a notification mail.\n"
|
|
||||||
echo -ne "***Please type one ore more email adresses (seperated by comma).\n"
|
|
||||||
echo -ne "Actually there is: $MAIL_TO\n"
|
|
||||||
echo -ne "Do you want to change this? (y/N) "
|
|
||||||
read YESNO
|
|
||||||
if [ "$YESNO" == "y" ]; then
|
|
||||||
echo -ne "Please type: "
|
|
||||||
read MAIL_TO
|
|
||||||
echo -ne "You should enter a mail server to login...\n"
|
|
||||||
echo -ne "Please type the url: "
|
|
||||||
read MAIL_SERVER
|
|
||||||
echo -ne "Please type where the email is from: "
|
|
||||||
read MAIL_FROM
|
|
||||||
echo -ne "Please type the username: "
|
|
||||||
read MAIL_USER
|
|
||||||
echo -ne "Please type the password (hidden): "
|
|
||||||
read -s MAIL_PASS
|
|
||||||
|
|
||||||
fi
|
|
||||||
echo -ne "\n${BOLD}***Saving...${NORMAL}"
|
|
||||||
cat <<END > $BASEDIR/.config
|
|
||||||
### iso server
|
|
||||||
FTP_ISO_URL=$FTP_ISO_URL
|
|
||||||
FTP_ISO_PATH=$FTP_ISO_PATH
|
|
||||||
FTP_ISO_USER=$FTP_ISO_USER
|
|
||||||
FTP_ISO_PASS=$FTP_ISO_PASS
|
|
||||||
### cache server
|
|
||||||
FTP_CACHE_URL=$FTP_CACHE_URL
|
|
||||||
FTP_CACHE_PATH=$FTP_CACHE_PATH
|
|
||||||
FTP_CACHE_USER=$FTP_CACHE_USER
|
|
||||||
FTP_CACHE_PASS=$FTP_CACHE_PASS
|
|
||||||
### mail reports
|
|
||||||
MAIL_TO="$MAIL_TO"
|
|
||||||
MAIL_FROM=$MAIL_FROM
|
|
||||||
MAIL_SERVER=$MAIL_SERVER
|
|
||||||
MAIL_USER=$MAIL_USER
|
|
||||||
MAIL_PASS=$MAIL_PASS
|
|
||||||
### misc
|
|
||||||
SKIP_PACKAGE_LIST="$SKIP_PACKAGE_LIST"
|
|
||||||
END
|
|
||||||
beautify message DONE
|
|
||||||
}
|
|
||||||
|
|
||||||
compile_tftpd() {
|
|
||||||
mkdir $BASEDIR/tmp
|
|
||||||
tar xvfz $BASEDIR/cache/tftp-hpa-0.42.tar.gz -C $BASEDIR/tmp
|
|
||||||
cd $BASEDIR/tmp/tftp-hpa-*
|
|
||||||
./configure --prefix=/ipfire/trunk/tools/ \
|
|
||||||
--sbindir=/ipfire/trunk/tools/ --disable-nls
|
|
||||||
make
|
|
||||||
install -c tftpd/tftpd $BASEDIR/tools/in.tftpd
|
|
||||||
cd -
|
|
||||||
rm -rf $BASEDIR/tmp/tftp-hpa-*
|
|
||||||
}
|
|
||||||
|
|
||||||
start_tftpd() {
|
|
||||||
if [ ! -e $BASEDIR/tools/in.tftpd ]; then
|
|
||||||
compile_tftpd
|
|
||||||
fi
|
|
||||||
reload_tftpd
|
|
||||||
if [ "$?" == "0" ]; then
|
|
||||||
$BASEDIR/tools/in.tftpd -l -s $BASEDIR/tftpboot
|
|
||||||
beautify message DONE
|
|
||||||
else
|
|
||||||
echo -en "You don not have a pxe boot image in your base directory.\nPlease compile first."
|
|
||||||
beautify message FAIL
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
stop_tftpd() {
|
|
||||||
echo -n "Stopping TFTPD..."
|
|
||||||
killall in.tftpd >/dev/null 2>&1
|
|
||||||
sleep 3
|
|
||||||
killall -9 in.tftp >/dev/null 2>&1
|
|
||||||
beautify message DONE
|
|
||||||
}
|
|
||||||
|
|
||||||
reload_tftpd() {
|
|
||||||
if [ -e $BASEDIR/ipfire-$VERSION.$MACHINE-pxe.tgz ]; then
|
|
||||||
mkdir -p $BASEDIR/tftpboot
|
|
||||||
tar xfz $BASEDIR/ipfire-$VERSION.$MACHINE-pxe.tgz -C $BASEDIR/tftpboot
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
|
|
||||||
update_langs() {
|
update_langs() {
|
||||||
echo -ne "Checking the translations for missing or obsolete strings..."
|
echo -ne "Checking the translations for missing or obsolete strings..."
|
||||||
chmod 755 $BASEDIR/tools/{check_strings.pl,sort_strings.pl,check_langs.sh}
|
chmod 755 $BASEDIR/tools/{check_strings.pl,sort_strings.pl,check_langs.sh}
|
||||||
|
|||||||
@@ -1,37 +0,0 @@
|
|||||||
#!/usr/bin/python
|
|
||||||
|
|
||||||
import smtplib
|
|
||||||
|
|
||||||
fromaddr = "From: ipfire01@ipfire.org"
|
|
||||||
toaddrs = "To: entwickler@ipfire.org"
|
|
||||||
#password = "<password>"
|
|
||||||
|
|
||||||
msg = ""
|
|
||||||
subject = ""
|
|
||||||
header = ""
|
|
||||||
body = ""
|
|
||||||
|
|
||||||
while 1:
|
|
||||||
try:
|
|
||||||
line = raw_input()
|
|
||||||
except EOFError:
|
|
||||||
break
|
|
||||||
if line.startswith("From: "):
|
|
||||||
fromaddr = line
|
|
||||||
elif line.startswith("To: "):
|
|
||||||
toaddrs = line
|
|
||||||
elif line.startswith("Subject: "):
|
|
||||||
subject = line
|
|
||||||
else:
|
|
||||||
body = body + line + "\r\n"
|
|
||||||
|
|
||||||
for i in fromaddr, toaddrs, subject:
|
|
||||||
header = header + i + "\r\n"
|
|
||||||
|
|
||||||
msg = header + "\r\n" + body # An empty line to finish the header + add the body
|
|
||||||
|
|
||||||
server = smtplib.SMTP('mail01.tremer.info')
|
|
||||||
#server.set_debuglevel(1)
|
|
||||||
#server.login(fromaddr, password)
|
|
||||||
server.sendmail(fromaddr, toaddrs, msg)
|
|
||||||
server.quit()
|
|
||||||
Reference in New Issue
Block a user