Merge branch 'master' of git://git.ipfire.org/ipfire-2.x

This commit is contained in:
Michael Tremer
2008-10-02 16:34:27 +00:00
38 changed files with 439 additions and 176 deletions

View File

@@ -76,6 +76,9 @@ elsif ($ARGV[0] eq 'addonbackup') {
elsif ($ARGV[0] =~ /ipf$/ ) {
system("rm /var/ipfire/backup/$ARGV[0]");
}
elsif ($ARGV[0] =~ /iso$/ ) {
system("rm /var/tmp/backupiso/$ARGV[0]");
}
elsif ($ARGV[0] eq '') {
printf "No argument given, please use <include><exclude><cli>\n"
}

View File

@@ -22,7 +22,7 @@ HOME=/
# Make some nice graphs
*/5 * * * * /usr/local/bin/makegraphs >/dev/null
01 * * * * /etc/init.d/collectd backup >/dev/null
* 05 * * * /etc/init.d/tmpfs backup >/dev/null
# Force update the dynamic dns registration once a week
# Force update even if IP has not changed once a month if 'minimize update' selected in GUI
@@ -37,7 +37,7 @@ HOME=/
find /var/log/logwatch/ -ctime +${LOGWATCH_KEEP=56} -exec rm -f '{}' ';'
# hddshutdown
02 * * * * /usr/local/bin/hddshutdown >/dev/null
*/30 * * * * /usr/local/bin/hddshutdown >/dev/null
# connection-scheduler
*/5 * * * * /usr/local/bin/connscheduler timer > /dev/null

View File

@@ -8,7 +8,7 @@ DEVICE4 /var FSTYPE defaults 1 1
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
devpts /dev/pts devpts gid=4,mode=620 0 0
shm /dev/shm tmpfs defaults,size=25% 0 0
none /tmp tmpfs defaults,size=128M 0 0
none /var/log/rrd tmpfs defaults,size=64M 0 0
none /var/lock tmpfs defaults,size=32M 0 0
none /var/lock tmpfs defaults,size=16M 0 0
none /var/run tmpfs defaults,size=16M 0 0

View File

@@ -34,8 +34,3 @@ title IPFire (all storage drivers)
kernel /vmlinuz-KVER-ipfire root=ROOT rootdelay=10 panic=10 MOUNT
initrd /ipfirerd-KVER-emergency.img
savedefault 5
title IPFire - experimental kernel-2.6.25.17 - no ipsec (vesafb 640x480)
root (hd0,0)
kernel /vmlinuz-2.6.25.17-ipfire root=ROOT rootdelay=10 panic=10 vga=785 MOUNT
initrd /ipfirerd-2.6.25.17.img
savedefault 6

View File

@@ -164,3 +164,7 @@ etc/sysconfig/firewall.local
etc/sysconfig/modules
etc/sysconfig/rc
etc/sysconfig/rc.local
etc/rc.d/init.d/tmpfs
etc/rc.d/rc0.d/K85tmpfs
etc/rc.d/rc3.d/S01tmpfs
etc/rc.d/rc6.d/K85tmpfs

View File

@@ -1,3 +0,0 @@
#lib/modules/2.6.16/kernel/net/ipv4/netfilter/ipt_ipp2p.ko
#lib/iptables/libipt_ipp2p.so # doesnt work with kernel 2.6.23.17
#lib/modules/2.6.16-smp/kernel/net/ipv4/netfilter/ipt_ipp2p.ko

View File

@@ -16,7 +16,7 @@ usr/lib/libsensors.so.4.0.2
#usr/man/man8/isadump.8
#usr/man/man8/isaset.8
#usr/man/man8/pwmconfig.8
#usr/local/man/man8/sensors-detect.8
#usr/man/man8/sensors-detect.8
usr/sbin/fancontrol
usr/sbin/isadump
usr/sbin/isaset

View File

@@ -617,7 +617,7 @@ usr/bin/vim
#usr/share/vim/vim70/syntax/blank.vim
#usr/share/vim/vim70/syntax/bst.vim
#usr/share/vim/vim70/syntax/btm.vim
#usr/share/vim/vim70/syntax/c.vim
usr/share/vim/vim70/syntax/c.vim
#usr/share/vim/vim70/syntax/calendar.vim
#usr/share/vim/vim70/syntax/catalog.vim
#usr/share/vim/vim70/syntax/cdl.vim
@@ -667,7 +667,7 @@ usr/bin/vim
#usr/share/vim/vim70/syntax/desktop.vim
#usr/share/vim/vim70/syntax/dictconf.vim
#usr/share/vim/vim70/syntax/dictdconf.vim
#usr/share/vim/vim70/syntax/diff.vim
usr/share/vim/vim70/syntax/diff.vim
#usr/share/vim/vim70/syntax/dircolors.vim
#usr/share/vim/vim70/syntax/diva.vim
#usr/share/vim/vim70/syntax/django.vim
@@ -712,7 +712,7 @@ usr/bin/vim
#usr/share/vim/vim70/syntax/forth.vim
#usr/share/vim/vim70/syntax/fortran.vim
#usr/share/vim/vim70/syntax/foxpro.vim
#usr/share/vim/vim70/syntax/fstab.vim
usr/share/vim/vim70/syntax/fstab.vim
#usr/share/vim/vim70/syntax/fvwm.vim
#usr/share/vim/vim70/syntax/fvwm2m4.vim
#usr/share/vim/vim70/syntax/gdb.vim
@@ -838,7 +838,7 @@ usr/bin/vim
#usr/share/vim/vim70/syntax/ncf.vim
#usr/share/vim/vim70/syntax/netrc.vim
#usr/share/vim/vim70/syntax/netrw.vim
#usr/share/vim/vim70/syntax/nosyntax.vim
usr/share/vim/vim70/syntax/nosyntax.vim
#usr/share/vim/vim70/syntax/nqc.vim
#usr/share/vim/vim70/syntax/nroff.vim
#usr/share/vim/vim70/syntax/nsis.vim
@@ -856,7 +856,7 @@ usr/bin/vim
#usr/share/vim/vim70/syntax/passwd.vim
#usr/share/vim/vim70/syntax/pcap.vim
#usr/share/vim/vim70/syntax/pccts.vim
#usr/share/vim/vim70/syntax/perl.vim
usr/share/vim/vim70/syntax/perl.vim
#usr/share/vim/vim70/syntax/pf.vim
#usr/share/vim/vim70/syntax/pfmain.vim
#usr/share/vim/vim70/syntax/php.vim
@@ -886,7 +886,7 @@ usr/bin/vim
#usr/share/vim/vim70/syntax/ptcap.vim
#usr/share/vim/vim70/syntax/purifylog.vim
#usr/share/vim/vim70/syntax/pyrex.vim
#usr/share/vim/vim70/syntax/python.vim
usr/share/vim/vim70/syntax/python.vim
#usr/share/vim/vim70/syntax/qf.vim
#usr/share/vim/vim70/syntax/quake.vim
#usr/share/vim/vim70/syntax/r.vim
@@ -927,7 +927,7 @@ usr/bin/vim
#usr/share/vim/vim70/syntax/sgml.vim
#usr/share/vim/vim70/syntax/sgmldecl.vim
#usr/share/vim/vim70/syntax/sgmllnx.vim
#usr/share/vim/vim70/syntax/sh.vim
usr/share/vim/vim70/syntax/sh.vim
#usr/share/vim/vim70/syntax/sicad.vim
#usr/share/vim/vim70/syntax/sieve.vim
#usr/share/vim/vim70/syntax/simula.vim
@@ -973,12 +973,12 @@ usr/bin/vim
#usr/share/vim/vim70/syntax/st.vim
#usr/share/vim/vim70/syntax/stata.vim
#usr/share/vim/vim70/syntax/stp.vim
#usr/share/vim/vim70/syntax/strace.vim
usr/share/vim/vim70/syntax/strace.vim
#usr/share/vim/vim70/syntax/sudoers.vim
#usr/share/vim/vim70/syntax/svn.vim
#usr/share/vim/vim70/syntax/syncolor.vim
#usr/share/vim/vim70/syntax/synload.vim
#usr/share/vim/vim70/syntax/syntax.vim
usr/share/vim/vim70/syntax/synload.vim
usr/share/vim/vim70/syntax/syntax.vim
#usr/share/vim/vim70/syntax/sysctl.vim
#usr/share/vim/vim70/syntax/tads.vim
#usr/share/vim/vim70/syntax/tags.vim

View File

@@ -4,4 +4,3 @@ etc/vnstat.conf
usr/bin/vnstat
#usr/share/man/man1/vnstat.1
#var/lib/vnstat
var/log/vnstat

View File

@@ -3,12 +3,16 @@ etc/init.d/mISDN
etc/modprobe.d/blacklist
usr/bin/bc
usr/bin/dc
etc/fstab
etc/ppp/dialer
etc/rc.d/init.d/checkfstab
etc/rc.d/rcsysinit.d/S19checkfstab
etc/rc.d/init.d/dhcp
etc/rc.d/init.d/tmpfs
etc/rc.d/rc0.d/K85tmpfs
etc/rc.d/rc3.d/S01tmpfs
etc/rc.d/rc6.d/K85tmpfs
etc/rc.d/init.d/dnsmasq
etc/rc.d/init.d/sysklogd
etc/rc.d/init.d/network
etc/rc.d/init.d/networking/any
etc/rc.d/init.d/networking/red
@@ -21,6 +25,8 @@ usr/local/bin/getiptstate
usr/local/bin/makegraphs
usr/local/bin/squidctrl
usr/local/bin/setddns.pl
srv/web/ipfire/cgi-bin/backup.cgi
srv/web/ipfire/cgi-bin/ovpnmain.cgi
srv/web/ipfire/cgi-bin/credits.cgi
srv/web/ipfire/cgi-bin/speed.cgi
srv/web/ipfire/cgi-bin/traffic.cgi
@@ -36,6 +42,7 @@ srv/web/ipfire/cgi-bin/media.cgi
srv/web/ipfire/cgi-bin/memory.cgi
srv/web/ipfire/cgi-bin/ids.cgi
srv/web/ipfire/cgi-bin/ddns.cgi
var/ipfire/backup/bin/backup.pl
var/ipfire/sensors/
var/ipfire/graphs.pl
var/ipfire/firebuild
@@ -46,5 +53,6 @@ var/ipfire/updatexlrator/bin/
usr/sbin/updxlrator
var/ipfire/langs
usr/local/bin/qosd
usr/local/bin/backupiso
usr/bin/mkisofs
usr/bin/cdrecord

View File

@@ -1 +0,0 @@
../../common/linux25

View File

@@ -38,10 +38,10 @@ echo Update IPFire $OLDVERSION to $NEWVERSION
echo
#
# check if we the backup file already exist
if [ -e /var/ipfire/backup/update_$OLDVERSION-$NEWVERSION.tar.bz2 ]; then
if [ -e /var/ipfire/backup/update_$OLDVERSION-$NEWVERSION.tar.gz ]; then
echo Moving backup to backup-old ...
mv -f /var/ipfire/backup/update_$OLDVERSION-$NEWVERSION.tar.bz2 \
/var/ipfire/backup/update_$OLDVERSION-$NEWVERSION-old.tar.bz2
mv -f /var/ipfire/backup/update_$OLDVERSION-$NEWVERSION.tar.gz \
/var/ipfire/backup/update_$OLDVERSION-$NEWVERSION-old.tar.gz
fi
echo First we made a backup of all files that was inside of the
echo update archive. This may take a while ...
@@ -52,6 +52,7 @@ echo var/spool/cron/root.orig >> /opt/pakfire/tmp/ROOTFILES
echo etc/udev/rules.d/30-persistent-network.rules >> /opt/pakfire/tmp/ROOTFILES
echo etc/sysconfig/lm_sensors >> /opt/pakfire/tmp/ROOTFILES
echo var/log/rrd >> /opt/pakfire/tmp/ROOTFILES
echo var/log/vnstat >> /opt/pakfire/tmp/ROOTFILES
echo var/updatexlerator >> /opt/pakfire/tmp/ROOTFILES
echo lib/iptables >> /opt/pakfire/tmp/ROOTFILES
echo lib/modules >> /opt/pakfire/tmp/ROOTFILES
@@ -62,7 +63,7 @@ echo srv/web/ipfire/cgi-bin/traffics.cgi >> /opt/pakfire/tmp/ROOTFILES
echo srv/web/ipfire/cgi-bin/graphs.cgi >> /opt/pakfire/tmp/ROOTFILES
echo srv/web/ipfire/cgi-bin/qosgraph.cgi >> /opt/pakfire/tmp/ROOTFILES
#
tar cjvf /var/ipfire/backup/update_$OLDVERSION-$NEWVERSION.tar.bz2 \
tar czvf /var/ipfire/backup/update_$OLDVERSION-$NEWVERSION.tar.gz \
-T /opt/pakfire/tmp/ROOTFILES --exclude='#*' -C / > /dev/null 2>&1
echo
echo Update IPfire to $NEWVERSION ...
@@ -144,7 +145,6 @@ fi
fi
mkinitcpio -k $KVER-ipfire -g /boot/ipfirerd-$KVER.img
#mkinitcpio -k $KVER-ipfire-smp -g /boot/ipfirerd-$KVER-smp.img
mkinitcpio -k 2.6.25.17-ipfire -g /boot/ipfirerd-2.6.25.17.img
#
# ReInstall grub
#
@@ -153,10 +153,10 @@ grub-install --no-floppy ${ROOT::`expr length $ROOT`-1}
# Update fstab
#
grep -v "tmpfs" /etc/fstab > /tmp/fstab.tmp
echo shm /dev/shm tmpfs defaults,size=25% 0 0 >> /tmp/fstab.tmp
echo none /tmp tmpfs defaults,size=128M 0 0 >> /tmp/fstab.tmp
echo none /var/log/rrd tmpfs defaults,size=64M 0 0 >> /tmp/fstab.tmp
echo none /var/lock tmpfs defaults,size=32M 0 0 >> /tmp/fstab.tmp
echo "none /tmp tmpfs defaults,size=128M 0 0" >> /tmp/fstab.tmp
echo "none /var/log/rrd tmpfs defaults,size=64M 0 0" >> /tmp/fstab.tmp
echo "none /var/lock tmpfs defaults,size=16M 0 0" >> /tmp/fstab.tmp
echo "none /var/run tmpfs defaults,size=16M 0 0" >> /tmp/fstab.tmp
mv /tmp/fstab.tmp /etc/fstab
#
# Change version of Pakfire.conf
@@ -171,9 +171,11 @@ echo \\n running on \\s \\r \\m >> /etc/issue
#
# Update crontab
#
grep -v "ipacsum" /var/spool/cron/root.orig > /tmp/root.orig.tmp
grep -v "ipacsum" /var/spool/cron/root.orig | grep -v "hddshutdown" > /tmp/root.orig.tmp
echo "# Backup collectd files" >> /tmp/root.orig.tmp
echo "01 * * * * /etc/init.d/collectd backup >/dev/null" >> /tmp/root.orig.tmp
echo "* 05 * * * /etc/init.d/tmpfs backup >/dev/null" >> /tmp/root.orig.tmp
echo "# hddshutdown" >> /tmp/root.orig.tmp
echo "*/30 * * * * /usr/local/bin/hddshutdown >/dev/null" >> /tmp/root.orig.tmp
mv /tmp/root.orig.tmp /var/spool/cron/root.orig
chmod 600 /var/spool/cron/root.orig
chown root:cron /var/spool/cron/root.orig
@@ -189,6 +191,12 @@ perl -e "require '/var/ipfire/lang.pl'; &Lang::BuildCacheLang"
perl /var/ipfire/qos/bin/migrate.pl
/var/ipfire/updatexlrator/bin/convert
#
# Move vnstat database to /var/log/rrd
#
mkdir -p /var/log/rrd.bak/vnstat
cp /var/log/vnstat /var/log/rrd.bak/vnstat
mv /var/log/vnstat /var/log/rrd/vnstat
#
# Delete old lm-sensor modullist...
#
rm -rf /etc/sysconfig/lm_sensors

View File

@@ -9,7 +9,7 @@
- To test the memory in your system type: 04memtest <ENTER>07.
- To install in unattended mode, type: 04unattended <ENTER>07.

View File

@@ -11,6 +11,9 @@ LABEL novga
LABEL dma
KERNEL vmlinuz
APPEND initrd=instroot root=/dev/ram0 ramdisk_size=16384 vga=791 splash=silent ro
LABEL unattended
KERNEL vmlinuz
APPEND ide=nodma initrd=instroot root=/dev/ram0 ramdisk_size=16384 vga=791 splash=silent unattended ro
LABEL memtest
KERNEL memtest
APPEND -

View File

@@ -10,4 +10,3 @@ GREEN_NETADDRESS=192.168.180.0
GREEN_BROADCAST=192.168.180.255
ROOT_PASSWORD=ipfire
ADMIN_PASSWORD=ipfire
RESTORE_FILE=

View File

@@ -88,7 +88,7 @@ CONFIG_TAR=y
CONFIG_FEATURE_TAR_BZIP2=y
# CONFIG_FEATURE_TAR_LZMA is not set
# CONFIG_FEATURE_TAR_FROM is not set
# CONFIG_FEATURE_TAR_GZIP is not set
CONFIG_FEATURE_TAR_GZIP=y
# CONFIG_FEATURE_TAR_COMPRESS is not set
CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY=y
CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y

View File

@@ -180,7 +180,7 @@
* linux-atm-2.4.1
* linux-libc-headers-2.6.12.0
* linuxigd-0.95
* lm_sensors-3.0.2
* lm_sensors-3.0.3
* logrotate-3.7.1
* logwatch-7.3.6
* lsof-4.78

View File

@@ -56,6 +56,8 @@ system("/usr/local/bin/backupctrl makedirs >/dev/null 2>&1 ") unless ( -e '/var/
############################################################################################################################
############################################## System calls ohne Http Header ###############################################
# Replace slashes from filename
$cgiparams{'FILE'} =~ s/\///;
if ( $cgiparams{'ACTION'} eq "download" )
{
@@ -66,6 +68,15 @@ if ( $cgiparams{'ACTION'} eq "download" )
print @fileholder;
exit (0);
}
if ( $cgiparams{'ACTION'} eq "downloadiso" )
{
open(DLFILE, "</var/tmp/backupiso/$cgiparams{'FILE'}") or die "Unable to open $cgiparams{'FILE'}: $!";
my @fileholder = <DLFILE>;
print "Content-Type:application/x-download\n";
print "Content-Disposition:attachment;filename=$cgiparams{'FILE'}\n\n";
print @fileholder;
exit (0);
}
if ( $cgiparams{'ACTION'} eq "downloadaddon" )
{
open(DLFILE, "</var/ipfire/backup/addons/backup/$cgiparams{'FILE'}") or die "Unable to open $cgiparams{'FILE'}: $!";
@@ -140,6 +151,7 @@ if ( $message ne "" ){
}
my @backups = `cd /var/ipfire/backup/ && ls *.ipf 2>/dev/null`;
my @backupisos = `cd /var/tmp/backupiso/ && ls *.iso 2>/dev/null`;
&Header::openbox('100%', 'center', $Lang::tr{'backup'});
@@ -182,6 +194,15 @@ $Size = sprintf("%02d", $Size);
print "<tr><td align='center'>$Lang::tr{'backup from'} $_ $Lang::tr{'size'} $Size KB</td><td width='5'><form method='post' action='$ENV{'SCRIPT_NAME'}'><input type='hidden' name='ACTION' value='download' /><input type='hidden' name='FILE' value='$_' /><input type='image' alt='$Lang::tr{'download'}' title='$Lang::tr{'download'}' src='/images/package-x-generic.png' /></form></td>";
print "<td width='5'><form method='post' action='$ENV{'SCRIPT_NAME'}'><input type='hidden' name='ACTION' value='delete' /><input type='hidden' name='FILE' value='$_' /><input type='image' alt='$Lang::tr{'delete'}' title='$Lang::tr{'delete'}' src='/images/user-trash.png' /></form></td></tr>";
}
foreach (@backupisos){
chomp($_);
my $Datei = "/var/tmp/backupiso/".$_;
my @Info = stat($Datei);
my $Size = $Info[7] / 1024;
$Size = sprintf("%02d", $Size);
print "<tr><td align='center'>$Lang::tr{'backup from'} $_ $Lang::tr{'size'} $Size KB</td><td width='5'><form method='post' action='$ENV{'SCRIPT_NAME'}'><input type='hidden' name='ACTION' value='downloadiso' /><input type='hidden' name='FILE' value='$_' /><input type='image' alt='$Lang::tr{'download'}' title='$Lang::tr{'download'}' src='/images/package-x-generic.png' /></form></td>";
print "<td width='5'><form method='post' action='$ENV{'SCRIPT_NAME'}'><input type='hidden' name='ACTION' value='delete' /><input type='hidden' name='FILE' value='$_' /><input type='image' alt='$Lang::tr{'delete'}' title='$Lang::tr{'delete'}' src='/images/user-trash.png' /></form></td></tr>";
}
print <<END
</table>
END

View File

@@ -61,7 +61,6 @@ $(TARGET) :
# make new dependencies
depmod -a -F /boot/System.map-$(KVER)-ipfire $(KVER)-ipfire
#depmod -a -F /boot/System.map-$(KVER)-ipfire-smp $(KVER)-ipfire-smp
depmod -a -F /boot/System.map-2.6.25.17-ipfire 2.6.25.17-ipfire
cp -a /lib/modules/$(KVER)-ipfire/ /install/initrd/lib/modules/

View File

@@ -129,6 +129,9 @@ $(TARGET) :
ln -sf ../init.d/beep /etc/rc.d/rc0.d/K99beep
ln -sf ../init.d/beep /etc/rc.d/rc3.d/S99beep
ln -sf ../init.d/beep /etc/rc.d/rc6.d/K99beep
ln -sf ../init.d/tmpfs /etc/rc.d/rc0.d/K85tmpfs
ln -sf ../init.d/tmpfs /etc/rc.d/rc3.d/S01tmpfs
ln -sf ../init.d/tmpfs /etc/rc.d/rc6.d/K85tmpfs
ln -sf ../init.d/mountkernfs /etc/rc.d/rcsysinit.d/S00mountkernfs
ln -sf ../init.d/modules /etc/rc.d/rcsysinit.d/S05modules

View File

@@ -42,6 +42,9 @@ else
TARGET = $(DIR_INFO)/linux-$(VER)
endif
PROG = linux25
PAK_VER = 1
DEPS = ""
###############################################################################
# Top-level Rules
@@ -75,6 +78,8 @@ download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
dist:
@$(PAK)
###############################################################################
# Downloading, checking, md5sum
###############################################################################

View File

@@ -24,7 +24,7 @@
include Config
VER = 3.0.2
VER = 3.0.3
THISAPP = lm_sensors-$(VER)
DL_FILE = $(THISAPP).tar.bz2
@@ -40,7 +40,7 @@ objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
$(DL_FILE)_MD5 = 5b210ba9cc01f00161c438fd618484e5
$(DL_FILE)_MD5 = e88b236228ac2a50821217015b8fd0fa
install : $(TARGET)

View File

@@ -32,7 +32,7 @@ DL_FROM = $(URL_IPFIRE)
DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
PROG = qemu
PAK_VER = 2
PAK_VER = 3
DEPS = "sdl"

View File

@@ -76,7 +76,6 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
cd $(DIR_APP) && make $(MAKETUNING) LOCAL_CONFIGURE_OPTIONS="--enable-readline=yes"
cd $(DIR_APP) && make install
sed -i 's|eth0|green0|g' /etc/vnstat.conf
sed -i 's|/var/lib/vnstat|/var/log/vnstat|g' /etc/vnstat.conf
-mkdir -p /var/log/vnstat
sed -i 's|/var/lib/vnstat|/var/log/rrd/vnstat|g' /etc/vnstat.conf
@rm -rf $(DIR_APP)
@$(POSTBUILD)

View File

@@ -24,12 +24,6 @@ case "$1" in
fi
fi
if [ ! -e $RRDLOG.bak/ ]; then
mkdir $RRDLOG.bak/
fi
/etc/init.d/collectd restore
boot_mesg -n "Loading Sensor Modules..."
for modul in `cat /etc/sysconfig/lm_sensors | grep '^MODULE_' | cut -d"=" -s -f2`; do
modprobe $modul > /dev/null 2>&1;
@@ -47,7 +41,10 @@ case "$1" in
evaluate_retval
;;
stop)
/etc/init.d/collectd backup
# Save the ramdisk at manual stop but not at shutdown
if [ "$(basename $0)" == "collectd" ]; then
/etc/init.d/tmpfs backup
fi
boot_mesg "Stopping Collection daemon..."
killproc /usr/sbin/collectd
evaluate_retval
@@ -57,17 +54,6 @@ case "$1" in
sleep 1
${0} start
;;
backup)
boot_mesg "Save rrd files from ramd..."
cp -pR $RRDLOG/* $RRDLOG.bak/
evaluate_retval
;;
restore)
if [ -e $RRDLOG.bak ];then
boot_mesg "Copying rrd files to ramd..."
cp -pR $RRDLOG.bak/* $RRDLOG/
fi
;;
status)
statusproc /usr/sbin/collectd
;;

View File

@@ -17,13 +17,19 @@
case "${1}" in
start)
boot_mesg "Starting kernel log daemon..."
loadproc klogd
boot_mesg "Starting system log daemon..."
loadproc syslogd -m 0
boot_mesg "Starting kernel log daemon..."
loadproc klogd
boot_mesg "Saving Bootlog..."
if [ -e /var/log/bootlog ]; then
mv -f /var/log/bootlog /var/log/bootlog.old
fi
dmesg -c > /var/log/bootlog
evaluate_retval
;;
stop)
boot_mesg "Stopping kernel log daemon..."
killproc klogd

View File

@@ -0,0 +1,43 @@
#!/bin/sh
# Begin $rc_base/init.d/tmpfs
. /etc/sysconfig/rc
. $rc_functions
eval $(/usr/local/bin/readhash /var/ipfire/main/settings)
if [ "$RRDLOG" = '' ]; then
RRDLOG=/var/log/rrd
fi
case "$1" in
start)
$0 restore
if [ ! -e $RRDLOG.bak/vnstat ]; then
mkdir -p $RRDLOG.bak/vnstat
fi
;;
stop)
$0 backup
;;
backup)
boot_mesg "Save ramdisk..."
cp -pR $RRDLOG/* $RRDLOG.bak/
evaluate_retval
;;
restore)
if [ -e $RRDLOG.bak ];then
boot_mesg "Restore ramdisk..."
cp -pR $RRDLOG.bak/* $RRDLOG/
fi
;;
*)
echo "Usage: $0 {start|stop|backup}"
exit 1
;;
esac
# End $rc_base/init.d/tmpfs

View File

@@ -455,10 +455,6 @@ int main(int argc, char *argv[])
KERNEL_VERSION);
mysystem(commandstring);
*/
snprintf(commandstring, STRING_SIZE,
"/bin/touch /harddisk/lib/modules/2.6.25.17-ipfire/modules.dep");
mysystem(commandstring);
/* Rename uname */
rename ("/harddisk/bin/uname.bak", "/harddisk/bin/uname");
@@ -532,9 +528,6 @@ int main(int argc, char *argv[])
/* snprintf(commandstring, STRING_SIZE, "/sbin/chroot /harddisk /sbin/mkinitcpio -g /boot/ipfirerd-%s-smp.img -k %s-ipfire-smp", KERNEL_VERSION, KERNEL_VERSION );
runcommandwithstatus(commandstring, ctr[TR_BUILDING_INITRD]);
*/
snprintf(commandstring, STRING_SIZE, "/sbin/chroot /harddisk /sbin/mkinitcpio -g /boot/ipfirerd-2.6.25.17.img -k 2.6.25.17-ipfire");
runcommandwithstatus(commandstring, ctr[TR_BUILDING_INITRD]);
sprintf(string, "root=%s3", hdparams.devnode_part_run);
@@ -553,8 +546,9 @@ int main(int argc, char *argv[])
/* Copy restore file from cdrom */
if (unattended && (strlen(restore_file) > 0)) {
fprintf(flog, "unattended: Copy restore file\n");
snprintf(commandstring, STRING_SIZE,
snprintf(commandstring, STRING_SIZE,
"cp /cdrom/%s /harddisk/var/ipfire/backup", restore_file);
mysystem(commandstring);
}
mysystem("umount /cdrom");

View File

@@ -150,7 +150,7 @@ int unattended_setup(struct keyvalue *unattendedkv) {
if (strlen(restore_file) > 0) {
fprintf(flog, "unattended: Restoring Backup\n");
snprintf(commandstring, STRING_SIZE,
"cd /harddisk && /bin/tar -xvz --preserve -f /harddisk/var/ipfire/%s", restore_file);
"cd /harddisk && /bin/tar -xvzp -f /harddisk/var/ipfire/backup/%s", restore_file);
if (mysystem(commandstring)) {
errorbox("unattended: ERROR restoring backup");
}

View File

@@ -0,0 +1,62 @@
#!/bin/bash
############################################################################
# #
# This file is part of the IPFire Firewall. #
# #
# IPFire is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
# IPFire is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with IPFire; if not, write to the Free Software #
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
# #
# Copyright (C) 2007 IPFire-Team <info@ipfire.org>. #
# #
############################################################################
#
. /opt/pakfire/lib/functions.sh
extract_files
#
KVER=2.6.25.17
ROOT=`grep "root=" /boot/grub/grub.conf | cut -d"=" -f2 | cut -d" " -f1 | tail -n 1`
MOUNT=`grep "kernel" /boot/grub/grub.conf | tail -n 1`
# Nur den letzten Parameter verwenden
echo $MOUNT > /dev/null
MOUNT=$_
ENTRY=`grep "savedefault" /boot/grub/grub.conf | tail -n 1`
# Nur den letzten Parameter verwenden
echo $ENTRY > /dev/null
let ENTRY=$_+1
#
# backup grub.conf
#
cp /boot/grub/grub.conf /boot/grub/grub-backup-$KVER.conf
#
# Add new Entry to grub.conf
#
echo "" >> /boot/grub/grub.conf
echo "title IPFire alternative Kernel:$KVER" >> /boot/grub/grub.conf
echo " root (hd0,0)" >> /boot/grub/grub.conf
echo " kernel /vmlinuz-$KVER-ipfire root=$ROOT rootdelay=10 panic=10 $MOUNT" >> /boot/grub/grub.conf
echo " initrd /ipfirerd-$KVER.img" >> /boot/grub/grub.conf
echo " savedefault $ENTRY" >> /boot/grub/grub.conf
#
# Made initramdisk
#
mkinitcpio -k $KVER-ipfire -g /boot/ipfirerd-$KVER.img
#
# ReInstall grub
#
grub-install --no-floppy ${ROOT::`expr length $ROOT`-1}
#
# Create new module depency
#
depmod -a $KVER-ipfire

View File

@@ -0,0 +1,26 @@
#!/bin/bash
############################################################################
# #
# This file is part of the IPFire Firewall. #
# #
# IPFire is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
# IPFire is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with IPFire; if not, write to the Free Software #
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
# #
# Copyright (C) 2007 IPFire-Team <info@ipfire.org>. #
# #
############################################################################
#
. /opt/pakfire/lib/functions.sh
remove_files
mv -f /boot/grub/grub-backup-2.6.25.17.conf /boot/grub/grub.conf

View File

@@ -0,0 +1,26 @@
#!/bin/bash
############################################################################
# #
# This file is part of the IPFire Firewall. #
# #
# IPFire is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
# IPFire is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with IPFire; if not, write to the Free Software #
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
# #
# Copyright (C) 2007 IPFire-Team <info@ipfire.org>. #
# #
############################################################################
#
. /opt/pakfire/lib/functions.sh
./uninstall.sh
./install.sh

28
src/paks/qemu/install.sh Normal file
View File

@@ -0,0 +1,28 @@
#!/bin/bash
############################################################################
# #
# This file is part of the IPFire Firewall. #
# #
# IPFire is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
# IPFire is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with IPFire; if not, write to the Free Software #
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
# #
# Copyright (C) 2007 IPFire-Team <info@ipfire.org>. #
# #
############################################################################
#
. /opt/pakfire/lib/functions.sh
extract_files
restore_backup ${NAME}
echo shm /dev/shm tmpfs defaults,size=256M 0 0 >> /etc/fstab
start_service --background ${NAME}

View File

@@ -0,0 +1,29 @@
#!/bin/bash
############################################################################
# #
# This file is part of the IPFire Firewall. #
# #
# IPFire is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
# IPFire is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with IPFire; if not, write to the Free Software #
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
# #
# Copyright (C) 2007 IPFire-Team <info@ipfire.org>. #
# #
############################################################################
#
. /opt/pakfire/lib/functions.sh
stop_service ${NAME}
grep -v "/dev/shm" /etc/fstab > /tmp/fstab.tmp
mv /tmp/fstab.tmp /etc/fstab
make_backup ${NAME}
remove_files

26
src/paks/qemu/update.sh Normal file
View File

@@ -0,0 +1,26 @@
#!/bin/bash
############################################################################
# #
# This file is part of the IPFire Firewall. #
# #
# IPFire is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
# IPFire is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with IPFire; if not, write to the Free Software #
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
# #
# Copyright (C) 2007 IPFire-Team <info@ipfire.org>. #
# #
############################################################################
#
. /opt/pakfire/lib/functions.sh
./uninstall.sh
./install.sh

View File

@@ -3,7 +3,7 @@
# FIXME: edit this lines before release
#URL=http://download.ipfire.org/iso/
#ISO=ipfire-2.3-beta4.i586-full.iso
URL=http://www.rowie.at/ipfire/builds/v2.3test/Beta3/20080929-6uhr/
URL=http://www.rowie.at/ipfire/builds/v2.3test/Beta3/20081001-17uhr/
ISO=ipfire-2.3-test.i586-full.iso
if [ -z "$1" ]; then
@@ -19,10 +19,10 @@ cd /var/tmp/backupiso
echo "Fetching ${URL}${ISO}"
wget --quiet -c ${URL}${ISO}
echo "Fetching ${URL}md5sums.txt"
wget --quiet -O md5sums.txt ${URL}md5sums.txt
wget --quiet -O ${ISO}.md5 ${URL}${ISO}.md5
echo "Checking md5 of ${ISO}"
cat md5sums.txt | grep iso | tr '\r' '\n' | md5sum --status -c
md5sum --status -c ${ISO}.md5
RETVAR="$?"
if [ $RETVAR -eq 0 -o $RETVAR -eq 24 ]
then
@@ -40,7 +40,7 @@ cp -pr backupiso.tmp.${TS} backupiso.${TS}
umount backupiso.tmp.${TS}
rm -r backupiso.tmp.${TS}
echo "RESTORE=${TS}.ipf" >> backupiso.${TS}/boot/unattended.conf
echo "RESTORE_FILE=${TS}.ipf" >> backupiso.${TS}/boot/unattended.conf
cp /var/ipfire/backup/${TS}.ipf backupiso.${TS}
echo "Running mkisofs"

View File

@@ -1,26 +1,24 @@
#!/usr/bin/perl
############################################################################
# #
# This file is part of the IPCop Firewall. #
# #
# IPCop is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
# IPCop is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with IPCop; if not, write to the Free Software #
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
# #
# Copyright (C) 2004-01-19 Mark Wormgoor <mark@wormgoor.com>. #
# #
############################################################################
###############################################################################
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2008 Michael Tremer & Christian Schmidt #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program. If not, see <http://www.gnu.org/licenses/>. #
# #
###############################################################################
use strict;
#use warnings;
@@ -40,97 +38,94 @@ my %mainsettings = ();
&General::readhash("${General::swroot}/main/settings", \%mainsettings);
&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
sub updatehdddata
{
my $disk = $_[0];
my $standby;
my @array = split(/\//,$disk);
sub updatehdddata{
my $disk = $_[0];
my $standby;
my @array = split(/\//,$disk);
if ( ! -e "$mainsettings{'RRDLOG'}/hddshutdown-".$array[$#array].".rrd"){
# database did not exist -> create
RRDs::create ("$mainsettings{'RRDLOG'}/hddshutdown-".$array[$#array].".rrd", "--step=300",
"DS:standby:GAUGE:600:0:1",
"RRA:AVERAGE:0.5:1:576",
"RRA:AVERAGE:0.5:6:672",
"RRA:AVERAGE:0.5:24:732",
"RRA:AVERAGE:0.5:144:1460");
$ERROR = RRDs::error;
print "Error in RRD::create for hddshutdown-".$array[$#array].": $ERROR\n" if $ERROR;
}
if ( ! -e "$mainsettings{'RRDLOG'}/hddshutdown-".$array[$#array].".rrd"){
# database did not exist -> create
RRDs::create ("$mainsettings{'RRDLOG'}/hddshutdown-".$array[$#array].".rrd", "--step=300",
"DS:standby:GAUGE:600:0:1",
"RRA:AVERAGE:0.5:1:576",
"RRA:AVERAGE:0.5:6:672",
"RRA:AVERAGE:0.5:24:732",
"RRA:AVERAGE:0.5:144:1460");
$ERROR = RRDs::error;
print "Error in RRD::create for hddshutdown-".$array[$#array].": $ERROR\n" if $ERROR;
}
if (-e "/tmp/hddshutdown-".$array[$#array]) {$standby = 1;}
else {$standby = 0;}
if (-e "/tmp/hddshutdown-".$array[$#array]) {$standby = 1;}
else {$standby = 0;}
RRDs::update ("$mainsettings{'RRDLOG'}/hddshutdown-".$array[$#array].".rrd", "-t", "standby", "N:$standby");
$ERROR = RRDs::error;
print "Error in RRD::update for hddshutdown-".$array[$#array].": $ERROR\n" if $ERROR;
RRDs::update ("$mainsettings{'RRDLOG'}/hddshutdown-".$array[$#array].".rrd", "-t", "standby", "N:$standby");
$ERROR = RRDs::error;
print "Error in RRD::update for hddshutdown-".$array[$#array].": $ERROR\n" if $ERROR;
if ( ! -e "$mainsettings{'RRDLOG'}/hddtemp-".$array[$#array].".rrd"){
# database did not exist -> create
RRDs::create ("$mainsettings{'RRDLOG'}/hddtemp-".$array[$#array].".rrd", "--step=300",
"DS:temperature:GAUGE:600:0:100",
"RRA:AVERAGE:0.5:1:576",
"RRA:AVERAGE:0.5:6:672",
"RRA:AVERAGE:0.5:24:732",
"RRA:AVERAGE:0.5:144:1460");
$ERROR = RRDs::error;
print "Error in RRD::create for hdd-".$array[$#array].": $ERROR\n" if $ERROR;
}
if ( ! -e "$mainsettings{'RRDLOG'}/hddtemp-".$array[$#array].".rrd"){
# database did not exist -> create
RRDs::create ("$mainsettings{'RRDLOG'}/hddtemp-".$array[$#array].".rrd", "--step=300",
"DS:temperature:GAUGE:600:0:100",
"RRA:AVERAGE:0.5:1:576",
"RRA:AVERAGE:0.5:6:672",
"RRA:AVERAGE:0.5:24:732",
"RRA:AVERAGE:0.5:144:1460");
$ERROR = RRDs::error;
print "Error in RRD::create for hdd-".$array[$#array].": $ERROR\n" if $ERROR;
}
# Temperaturlesen w<>rde die Platte aufwecken!!!
if (!$standby){
$temp = 0;
my $smart_output = '';
system("$path_smartctl -iHA -d ata /dev/$disk > /var/log/smartctl_out_hddtemp-$disk");
if ( -e "/var/log/smartctl_out_hddtemp-".$array[$#array] ){
my $hdd_output = `cat /var/log/smartctl_out_hddtemp-$array[$#array] | grep Temperature_`;
my @t = split(/\s+/,$hdd_output);
$temp = $t[9];
}else{$temp = 0;}
print "Temperature for ".$array[$#array]."->".$temp."<-\n";
# Nur ins RDD wenn nicht 0 (sonst klappt die min Anzeige nicht)
if ($temp){
RRDs::update ("$mainsettings{'RRDLOG'}/hddtemp-".$array[$#array].".rrd", "-t", "temperature", "N:$temp");
$ERROR = RRDs::error;
print "Error in RRD::update for hdd-".$array[$#array].": $ERROR\n" if $ERROR;
}
}
# Temperaturlesen w<>rde die Platte aufwecken!!!
if (!$standby){
$temp = 0;
my $smart_output = '';
system("$path_smartctl -iHA -d ata /dev/$disk > /tmp/smartctl_out_hddtemp-$disk");
if ( -e "/tmp/smartctl_out_hddtemp-".$array[$#array] ){
my $hdd_output = `cat /tmp/smartctl_out_hddtemp-$array[$#array] | grep Temperature_`;
my @t = split(/\s+/,$hdd_output);
$temp = $t[9];
}else{$temp = 0;}
print "Temperature for ".$array[$#array]."->".$temp."<-\n";
# Nur ins RDD wenn nicht 0 (sonst klappt die min Anzeige nicht)
if ($temp){
RRDs::update ("$mainsettings{'RRDLOG'}/hddtemp-".$array[$#array].".rrd", "-t", "temperature", "N:$temp");
$ERROR = RRDs::error;
print "Error in RRD::update for hdd-".$array[$#array].": $ERROR\n" if $ERROR;
}
}
}
## Update ipac logs
#system ('/usr/sbin/fetchipac');
## Update vnstat
system ('/usr/bin/vnstat -u');
my @disks = `kudzu -qps -c HD | grep device: | cut -d" " -f2 | sort | uniq`;
system("unlink /tmp/hddstatus && touch /tmp/hddstatus");
foreach (@disks){
my $disk = $_;
chomp $disk;
print "Working on disk ".$disk.".\n";
my $disk = $_;
chomp $disk;
print "Working on disk ".$disk.".\n";
my $status = "";
my $diskstats = "";
my $newdiskstats = "";
my @array = split(/\//,$disk);
my $status = "";
my $diskstats = "";
my $newdiskstats = "";
my @array = split(/\//,$disk);
$diskstats = `cat /tmp/hddstats-$array[$#array]`;
chomp $diskstats;
my $newdiskstats = `/usr/bin/iostat -d -t $disk | tail -2 | head -1 | awk '{ print \$5","\$6}'`;
chomp $newdiskstats;
my $status = `hdparm -C /dev/$disk | tail -1 | cut -d: -f2`;
chomp $status;
$diskstats = `cat /tmp/hddstats-$array[$#array]`;
chomp $diskstats;
my $newdiskstats = `/usr/bin/iostat -d -t $disk | tail -2 | head -1 | awk '{ print \$5","\$6}'`;
chomp $newdiskstats;
my $status = `hdparm -C /dev/$disk | tail -1 | cut -d: -f2`;
chomp $status;
if ($status !~/standby/ || $diskstats ne $newdiskstats){
if (-e "/tmp/hddshutdown-".$array[$#array]){system("unlink /tmp/hddshutdown-".$array[$#array]);}
}
if ($status !~/standby/ || $diskstats ne $newdiskstats){
if (-e "/tmp/hddshutdown-".$array[$#array]){system("unlink /tmp/hddshutdown-".$array[$#array]);}
}
if (-e "/tmp/hddshutdown-".$array[$#array]){$status = " standby\n";}
else{$status = " active\n";}
if (-e "/tmp/hddshutdown-".$array[$#array]){$status = " standby\n";}
else{$status = " active\n";}
open(DATEI, ">>/tmp/hddstatus") || die "Datei nicht gefunden";
print DATEI $disk."-".$status;
close(DATEI);
open(DATEI, ">>/tmp/hddstatus") || die "Datei nicht gefunden";
print DATEI $disk."-".$status;
close(DATEI);
updatehdddata($disk);
updatehdddata($disk);
}