This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "IPFire 3.x development tree".
The branch, master has been updated via 61a300fb2aecd9f9c3b3e07dbe2421229edbb04f (commit) via 9b6f6f2ef960a1225d84dcae863c7d2856b2d359 (commit) via f9c42abb985b3fad4ab520ccb67ed4355c7cdc72 (commit) via 1f5cf5b78178a3bd27d629cef2f8fc3342bff144 (commit) via beff0d6364a42fc11e9d7cf5008b2a5e03942261 (commit) via c6bacbab2b269a1944d95368a62d6f775152e530 (commit) via f3025cdaa7b34ae7722c036e697e76f94fea7456 (commit) via 3a3b2392682c6a826674269dc71404fa654a0c2f (commit) via d988b4c7be2259968d645403c353aaad00d06106 (commit) via ba23c237f7a4bcfc5ae3278d7708b14aa9dfb2c7 (commit) via 71b719752d7e8fd944f13bf8f6b3864146029aa7 (commit) via 66e7ef9a0c69bcce77df578111b44e24ab7d44b2 (commit) via 7feb32c679953a30ce1a2297067ad8dcc7f39998 (commit) via 681da9ee0354fb632d2a4fb54b570ea057d12cca (commit) via 1034db5fbcde84a16e17a928934b49f6df1412b4 (commit) via d161da6c7cea5ea5bcb7ecfd582b1fb3759e7c2c (commit) via 7b91a09faad71dcbe78d3f2e045af2fd42c8a583 (commit) from 70e0de8a9270a556435ea5af9aedfed0db853ff4 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit 61a300fb2aecd9f9c3b3e07dbe2421229edbb04f Merge: ba23c23 9b6f6f2 Author: Michael Tremer michael.tremer@ipfire.org Date: Tue Jul 27 13:48:59 2010 +0200
Merge commit '9b6f6f2ef960a1225d84dcae863c7d2856b2d359'
commit 9b6f6f2ef960a1225d84dcae863c7d2856b2d359 Author: Michael Tremer michael.tremer@ipfire.org Date: Mon Jul 26 11:28:07 2010 +0200
pdns-recursor: Remove compilation optimization.
pdns_recursor will SEGV when compiled with gcc 4.5.0 and -O2.
commit f9c42abb985b3fad4ab520ccb67ed4355c7cdc72 Merge: f3025cd 1f5cf5b Author: Michael Tremer michael.tremer@ipfire.org Date: Sun Jul 25 17:27:49 2010 +0200
Merge branch 'master' of ssh://git.ipfire.org/pub/git/people/ms/ipfire-3.x into next
commit 1f5cf5b78178a3bd27d629cef2f8fc3342bff144 Author: Michael Tremer michael.tremer@ipfire.org Date: Sun Jul 25 14:59:05 2010 +0200
network: Some code cleanup.
commit beff0d6364a42fc11e9d7cf5008b2a5e03942261 Merge: c6bacba d988b4c Author: Michael Tremer michael.tremer@ipfire.org Date: Sun Jul 25 14:18:14 2010 +0200
Merge branch 'master' of ssh://git.ipfire.org/pub/git/people/ms/ipfire-3.x into next
commit c6bacbab2b269a1944d95368a62d6f775152e530 Author: Michael Tremer michael.tremer@ipfire.org Date: Sun Jul 25 14:17:13 2010 +0200
network: Experimental support for wireless access points.
commit f3025cdaa7b34ae7722c036e697e76f94fea7456 Author: Michael Tremer michael.tremer@ipfire.org Date: Sat Jul 24 23:14:33 2010 +0200
toolchain: Bump version to 5.
commit 3a3b2392682c6a826674269dc71404fa654a0c2f Author: Michael Tremer michael.tremer@ipfire.org Date: Sat Jul 24 23:14:06 2010 +0200
gettext: Do not run testsuite which doesn't work in toolchain.
commit d988b4c7be2259968d645403c353aaad00d06106 Author: Michael Tremer michael.tremer@ipfire.org Date: Sat Jul 24 14:26:13 2010 +0200
toolchain: Add patch for building gcc-4.5.0 with mprf >= 3.0.0.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44455
commit ba23c237f7a4bcfc5ae3278d7708b14aa9dfb2c7 Author: Michael Tremer michael.tremer@ipfire.org Date: Sat Jul 24 14:23:11 2010 +0200
toolchain: Add patch for building gcc-4.5.0 with mprf >= 3.0.0.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44455
commit 71b719752d7e8fd944f13bf8f6b3864146029aa7 Author: Michael Tremer michael.tremer@ipfire.org Date: Sat Jul 24 00:38:07 2010 +0200
network: STP: Make protocol version configureable.
commit 66e7ef9a0c69bcce77df578111b44e24ab7d44b2 Author: Michael Tremer michael.tremer@ipfire.org Date: Fri Jul 23 15:31:11 2010 +0200
network: Remove deprecated functions.
commit 7feb32c679953a30ce1a2297067ad8dcc7f39998 Author: Michael Tremer michael.tremer@ipfire.org Date: Fri Jul 23 15:10:58 2010 +0200
network: Automatically create all ethernet ports.
commit 681da9ee0354fb632d2a4fb54b570ea057d12cca Author: Michael Tremer michael.tremer@ipfire.org Date: Fri Jul 23 13:40:27 2010 +0200
network: Do initial configuration once at boot time.
commit 1034db5fbcde84a16e17a928934b49f6df1412b4 Author: Michael Tremer michael.tremer@ipfire.org Date: Thu Jul 22 20:20:47 2010 +0200
Fix bash startup files.
commit d161da6c7cea5ea5bcb7ecfd582b1fb3759e7c2c Author: Michael Tremer michael.tremer@ipfire.org Date: Wed Jul 21 20:30:31 2010 +0200
network: ipv4-static: Apply gateway settings.
commit 7b91a09faad71dcbe78d3f2e045af2fd42c8a583 Author: Michael Tremer michael.tremer@ipfire.org Date: Wed Jul 21 17:45:51 2010 +0200
network: Init ppp when running network.
-----------------------------------------------------------------------
Summary of changes: config/naoki.conf | 2 +- pkgs/core/bash/bashrc | 93 +++++- pkgs/core/bash/dot_bash_profile | 35 +-- pkgs/core/bash/dot_bashrc | 18 +- pkgs/core/bash/profile | 104 ++++---- pkgs/core/bash/profile.d/extrapaths.sh | 15 - pkgs/core/bash/profile.d/lang.sh | 90 ++++++ pkgs/core/bash/profile.d/umask.sh | 6 - pkgs/core/coreutils/coreutils.nm | 6 +- pkgs/core/coreutils/profile.d/colorls.sh | 40 +++ pkgs/core/coreutils/profile.d/dircolors.sh | 9 - pkgs/core/network/network-init.init | 8 + pkgs/core/network/network.init | 2 +- pkgs/core/network/src/functions | 3 - pkgs/core/network/src/functions.cli | 12 +- pkgs/core/network/src/functions.constants | 2 +- pkgs/core/network/src/functions.device | 70 +---- pkgs/core/network/src/functions.ethernet | 33 ++- pkgs/core/network/src/functions.events | 19 ++ pkgs/core/network/src/functions.logging | 19 ++ pkgs/core/network/src/functions.ports | 54 ++++- pkgs/core/network/src/functions.ppp | 4 +- pkgs/core/network/src/functions.stp | 45 +++ pkgs/core/network/src/functions.util | 29 ++ pkgs/core/network/src/functions.virtual | 36 +-- pkgs/core/network/src/functions.wireless | 296 ++++++++++++++++++++ pkgs/core/network/src/functions.zone | 14 + pkgs/core/network/src/hooks/ports/virtual | 4 +- .../src/hooks/ports/{virtual => wireless-ap} | 107 +++++-- pkgs/core/network/src/hooks/zones/bridge | 13 +- .../src/hooks/zones/bridge.configs/ipv4-static | 8 +- .../zones/bridge.ports/{bonding => wireless-ap} | 0 pkgs/core/network/src/network | 4 + pkgs/core/pdns-recursor/pdns-recursor.nm | 4 + .../patches/gcc-4.5.0-gmp-mpfr-build-fix-1.patch | 26 ++ .../patches/gcc-4.5.0-gmp-mpfr-build-fix-1.patch | 26 ++ pkgs/toolchain/gettext/gettext.nm | 2 + 37 files changed, 980 insertions(+), 278 deletions(-) delete mode 100644 pkgs/core/bash/profile.d/extrapaths.sh create mode 100644 pkgs/core/bash/profile.d/lang.sh delete mode 100644 pkgs/core/bash/profile.d/umask.sh create mode 100644 pkgs/core/coreutils/profile.d/colorls.sh delete mode 100644 pkgs/core/coreutils/profile.d/dircolors.sh create mode 100644 pkgs/core/network/network-init.init create mode 100644 pkgs/core/network/src/functions.wireless copy pkgs/core/network/src/hooks/ports/{virtual => wireless-ap} (63%) copy pkgs/core/network/src/hooks/zones/bridge.ports/{bonding => wireless-ap} (100%) create mode 100644 pkgs/toolchain/gcc-static/patches/gcc-4.5.0-gmp-mpfr-build-fix-1.patch create mode 100644 pkgs/toolchain/gcc/patches/gcc-4.5.0-gmp-mpfr-build-fix-1.patch
Difference in files: diff --git a/config/naoki.conf b/config/naoki.conf index 9cadfdf..d55e14b 100644 --- a/config/naoki.conf +++ b/config/naoki.conf @@ -24,7 +24,7 @@ slogan = "Gluttony" [toolchain]
; Counter of toolchain version -version = 4 +version = 5
[sources] diff --git a/pkgs/core/bash/bashrc b/pkgs/core/bash/bashrc index 88c3aa2..5afd453 100644 --- a/pkgs/core/bash/bashrc +++ b/pkgs/core/bash/bashrc @@ -1,22 +1,85 @@ -# Begin /etc/bashrc +# /etc/bashrc
-# System wide aliases and functions. +# System wide functions and aliases +# Environment stuff goes in /etc/profile
-# System wide environment variables and startup programs should go into -# /etc/profile. Personal environment variables and startup programs -# should go into ~/.bash_profile. Personal aliases and functions should -# go into ~/.bashrc +# It's NOT good idea to change this file unless you know what you +# are doing. Much better way is to create custom.sh shell script in +# /etc/profile.d/ to make custom changes to environment. This will +# prevent need for merging in future updates.
-# Provides a colored /bin/ls command. Used in conjunction with code in -# /etc/profile. +# By default, we want this to get set. +# Even for non-interactive, non-login shells. +# Current threshold for system reserved uid/gids is 200 +# You could check uidgid reservation validity in +# /usr/share/doc/setup-*/uidgid file +if [ $UID -gt 199 ] && [ "`id -gn`" = "`id -un`" ]; then + umask 002 +else + umask 022 +fi
-alias ls='ls --color=auto' +# are we an interactive shell? +if [ "$PS1" ]; then + case $TERM in + xterm*) + if [ -e /etc/sysconfig/bash-prompt-xterm ]; then + PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm + else + PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}"; echo -ne "\007"' + fi + ;; + screen) + if [ -e /etc/sysconfig/bash-prompt-screen ]; then + PROMPT_COMMAND=/etc/sysconfig/bash-prompt-screen + else + PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}"; echo -ne "\033\"' + fi + ;; + *) + [ -e /etc/sysconfig/bash-prompt-default ] && PROMPT_COMMAND=/etc/sysconfig/bash-prompt-default + ;; + esac + # Turn on checkwinsize + shopt -s checkwinsize + [ "$PS1" = "\s-\v\$ " ] && PS1="[\u@\h \W]\$ " + # You might want to have e.g. tty in prompt (e.g. more virtual machines) + # and console windows + # If you want to do so, just add e.g. + # if [ "$PS1" ]; then + # PS1="[\u@\h:\l \W]\$ " + # fi + # to your custom modification shell script in /etc/profile.d/ directory +fi
-# Provides prompt for non-login shells, specifically shells started -# in the X environment. [Review the LFS archive thread titled -# PS1 Environment Variable for a great case study behind this script -# addendum.] +if ! shopt -q login_shell ; then # We're not a login shell + # Need to redefine pathmunge, it get's undefined at the end of /etc/profile + pathmunge () { + case ":${PATH}:" in + *:"$1":*) + ;; + *) + if [ "$2" = "after" ] ; then + PATH=$PATH:$1 + else + PATH=$1:$PATH + fi + esac + }
-export PS1="\033[0m[\033[1;33m\u\033[1;37m@\033[1;32m]\h \033[1;31m\w\033[0m]\$ " + # Only display echos from profile.d scripts if we are no login shell + # and interactive - otherwise just process them to set envvars + for i in /etc/profile.d/*.sh; do + if [ -r "$i" ]; then + if [ "$PS1" ]; then + . $i + else + . $i >/dev/null 2>&1 + fi + fi + done
-# End /etc/bashrc + unset i + unset pathmunge +fi +# vim:ts=4:sw=4 diff --git a/pkgs/core/bash/dot_bash_profile b/pkgs/core/bash/dot_bash_profile index 8201233..3dc099a 100644 --- a/pkgs/core/bash/dot_bash_profile +++ b/pkgs/core/bash/dot_bash_profile @@ -1,33 +1,12 @@ -# Begin ~/.bash_profile +# .bash_profile
-# Personal environment variables and startup programs. - -# Personal aliases and functions should go in ~/.bashrc. System wide -# environment variables and startup programs are in /etc/profile. -# System wide aliases and functions are in /etc/bashrc. - -append () { - # First remove the directory - local IFS=':' - local NEWPATH - for DIR in $PATH; do - if [ "$DIR" != "$1" ]; then - NEWPATH=${NEWPATH:+$NEWPATH:}$DIR - fi - done - - # Then append the directory - export PATH=$NEWPATH:$1 -} - -if [ -f "$HOME/.bashrc" ] ; then - source $HOME/.bashrc +# Get the aliases and functions +if [ -f ~/.bashrc ]; then + . ~/.bashrc fi
-if [ -d "$HOME/bin" ] ; then - append $HOME/bin -fi +# User specific environment and startup programs
-unset append +PATH=$PATH:$HOME/bin
-# End ~/.bash_profile +export PATH diff --git a/pkgs/core/bash/dot_bashrc b/pkgs/core/bash/dot_bashrc index d89eefd..6e6d1e1 100644 --- a/pkgs/core/bash/dot_bashrc +++ b/pkgs/core/bash/dot_bashrc @@ -1,14 +1,12 @@ -# Begin ~/.bashrc +# .bashrc
-# Personal aliases and functions. +# User specific aliases and functions
-# Personal environment variables and startup programs should go in -# ~/.bash_profile. System wide environment variables and startup -# programs are in /etc/profile. System wide aliases and functions are -# in /etc/bashrc. +alias rm='rm -i' +alias cp='cp -i' +alias mv='mv -i'
-if [ -f "/etc/bashrc" ] ; then - source /etc/bashrc +# Source global definitions +if [ -f /etc/bashrc ]; then + . /etc/bashrc fi - -# End ~/.bashrc diff --git a/pkgs/core/bash/profile b/pkgs/core/bash/profile index 70ff901..d3a2bbc 100644 --- a/pkgs/core/bash/profile +++ b/pkgs/core/bash/profile @@ -1,62 +1,68 @@ -# Begin /etc/profile - -# System wide environment variables and startup programs. - -# System wide aliases and functions should go in /etc/bashrc. Personal -# environment variables and startup programs should go into -# ~/.bash_profile. Personal aliases and functions should go into -# ~/.bashrc. - -# Functions to help us manage paths. Second argument is the name of the -# path variable to be modified (default: PATH) -pathremove () { - local IFS=':' - local NEWPATH - local DIR - local PATHVARIABLE=${2:-PATH} - for DIR in ${!PATHVARIABLE} ; do - if [ "$DIR" != "$1" ] ; then - NEWPATH=${NEWPATH:+$NEWPATH:}$DIR - fi - done - export $PATHVARIABLE="$NEWPATH" -} +# /etc/profile
-pathprepend () { - pathremove $1 $2 - local PATHVARIABLE=${2:-PATH} - export $PATHVARIABLE="$1${!PATHVARIABLE:+:${!PATHVARIABLE}}" -} +# System wide environment and startup programs, for login setup +# Functions and aliases go in /etc/bashrc + +# It's NOT good idea to change this file unless you know what you +# are doing. Much better way is to create custom.sh shell script in +# /etc/profile.d/ to make custom changes to environment. This will +# prevent need for merging in future updates.
-pathappend () { - pathremove $1 $2 - local PATHVARIABLE=${2:-PATH} - export $PATHVARIABLE="${!PATHVARIABLE:+${!PATHVARIABLE}:}$1" +pathmunge () { + case ":${PATH}:" in + *:"$1":*) + ;; + *) + if [ "$2" = "after" ] ; then + PATH=$PATH:$1 + else + PATH=$1:$PATH + fi + esac }
-# Set the initial path -export PATH=/bin:/usr/bin +if [ -x /usr/bin/id ]; then + if [ -z "$EUID" ]; then + # ksh workaround + EUID=`id -u` + UID=`id -ru` + fi + USER="`id -un`" + LOGNAME=$USER + MAIL="/var/spool/mail/$USER" +fi
-if [ $EUID -eq 0 ] ; then - pathappend /sbin:/usr/sbin - unset HISTFILE +# Path manipulation +if [ "$EUID" = "0" ]; then + pathmunge /sbin + pathmunge /usr/sbin + pathmunge /usr/local/sbin +else + pathmunge /usr/local/sbin after + pathmunge /usr/sbin after + pathmunge /sbin after fi
-# Setup some environment variables. -export HISTSIZE=1000 -export HISTIGNORE="&:[bf]g:exit" +HOSTNAME=`/bin/hostname 2>/dev/null` +HISTSIZE=1000 +if [ "$HISTCONTROL" = "ignorespace" ] ; then + export HISTCONTROL=ignoreboth +else + export HISTCONTROL=ignoredups +fi
-export PS1="[\u@\h \w]\$ " -#export PS1='\u@\h:\w$ ' +export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL
-for script in /etc/profile.d/*.sh ; do - if [ -r $script ] ; then - . $script +for i in /etc/profile.d/*.sh ; do + if [ -r "$i" ]; then + if [ "$PS1" ]; then + . $i + else + . $i >/dev/null 2>&1 fi + fi done
-# Now to clean up -unset pathremove pathprepend pathappend - -# End /etc/profile +unset i +unset pathmunge diff --git a/pkgs/core/bash/profile.d/extrapaths.sh b/pkgs/core/bash/profile.d/extrapaths.sh deleted file mode 100644 index bb8f720..0000000 --- a/pkgs/core/bash/profile.d/extrapaths.sh +++ /dev/null @@ -1,15 +0,0 @@ -if [ -d /usr/local/bin ]; then - pathprepend /usr/local/bin -fi -if [ -d /usr/local/sbin -a $EUID -eq 0 ]; then - pathprepend /usr/local/sbin -fi -for directory in $(find /opt/*/bin -type d 2>/dev/null); do - pathappend $directory -done -if [ -d ~/bin ]; then - pathprepend ~/bin -fi -#if [ $EUID -gt 99 ]; then -# pathappend . -#fi diff --git a/pkgs/core/bash/profile.d/lang.sh b/pkgs/core/bash/profile.d/lang.sh new file mode 100644 index 0000000..5be62ad --- /dev/null +++ b/pkgs/core/bash/profile.d/lang.sh @@ -0,0 +1,90 @@ +# /etc/profile.d/lang.sh - set i18n stuff + +sourced=0 + +if [ -n "$LANG" ]; then + saved_lang="$LANG" + [ -f "$HOME/.i18n" ] && . "$HOME/.i18n" && sourced=1 + LANG="$saved_lang" + unset saved_lang +else + for langfile in /etc/sysconfig/i18n "$HOME/.i18n" ; do + [ -f $langfile ] && . $langfile && sourced=1 + done +fi + +if [ "$sourced" = 1 ]; then + [ -n "$LANG" ] && export LANG || unset LANG + [ -n "$LC_ADDRESS" ] && export LC_ADDRESS || unset LC_ADDRESS + [ -n "$LC_CTYPE" ] && export LC_CTYPE || unset LC_CTYPE + [ -n "$LC_COLLATE" ] && export LC_COLLATE || unset LC_COLLATE + [ -n "$LC_IDENTIFICATION" ] && export LC_IDENTIFICATION || unset LC_IDENTIFICATION + [ -n "$LC_MEASUREMENT" ] && export LC_MEASUREMENT || unset LC_MEASUREMENT + [ -n "$LC_MESSAGES" ] && export LC_MESSAGES || unset LC_MESSAGES + [ -n "$LC_MONETARY" ] && export LC_MONETARY || unset LC_MONETARY + [ -n "$LC_NAME" ] && export LC_NAME || unset LC_NAME + [ -n "$LC_NUMERIC" ] && export LC_NUMERIC || unset LC_NUMERIC + [ -n "$LC_PAPER" ] && export LC_PAPER || unset LC_PAPER + [ -n "$LC_TELEPHONE" ] && export LC_TELEPHONE || unset LC_TELEPHONE + [ -n "$LC_TIME" ] && export LC_TIME || unset LC_TIME + if [ -n "$LC_ALL" ]; then + if [ "$LC_ALL" != "$LANG" ]; then + export LC_ALL + else + unset LC_ALL + fi + else + unset LC_ALL + fi + [ -n "$LANGUAGE" ] && export LANGUAGE || unset LANGUAGE + [ -n "$LINGUAS" ] && export LINGUAS || unset LINGUAS + [ -n "$_XKB_CHARSET" ] && export _XKB_CHARSET || unset _XKB_CHARSET + + consoletype=$CONSOLETYPE + if [ -z "$consoletype" ]; then + consoletype=$(/sbin/consoletype stdout) + fi + + if [ -n "$LANG" ]; then + case $LANG in + *.utf8*|*.UTF-8*) + if [ "$TERM" = "linux" ]; then + if [ "$consoletype" = "vt" ]; then + case $LANG in + ja*) LANG=en_US.UTF-8 ;; + ko*) LANG=en_US.UTF-8 ;; + si*) LANG=en_US.UTF-8 ;; + zh*) LANG=en_US.UTF-8 ;; + ar*) LANG=en_US.UTF-8 ;; + fa*) LANG=en_US.UTF-8 ;; + he*) LANG=en_US.UTF-8 ;; + en_IN*) ;; + *_IN*) LANG=en_US.UTF-8 ;; + esac + fi + fi + ;; + *) + if [ "$TERM" = "linux" ]; then + if [ "$consoletype" = "vt" ]; then + case $LANG in + ja*) LANG=en_US ;; + ko*) LANG=en_US ;; + si*) LANG=en_US ;; + zh*) LANG=en_US ;; + ar*) LANG=en_US ;; + fa*) LANG=en_US ;; + he*) LANG=en_US ;; + en_IN*) ;; + *_IN*) LANG=en_US ;; + esac + fi + fi + ;; + esac + fi + + unset SYSFONTACM SYSFONT consoletype +fi +unset sourced +unset langfile diff --git a/pkgs/core/bash/profile.d/umask.sh b/pkgs/core/bash/profile.d/umask.sh deleted file mode 100644 index 9a3f824..0000000 --- a/pkgs/core/bash/profile.d/umask.sh +++ /dev/null @@ -1,6 +0,0 @@ -# By default we want the umask to get set. -if [ "$(id -gn)" = "$(id -un)" -a $EUID -gt 99 ] ; then - umask 002 -else - umask 022 -fi diff --git a/pkgs/core/coreutils/coreutils.nm b/pkgs/core/coreutils/coreutils.nm index c71a6f1..bc642d2 100644 --- a/pkgs/core/coreutils/coreutils.nm +++ b/pkgs/core/coreutils/coreutils.nm @@ -71,7 +71,7 @@ define STAGE_INSTALL_CMDS
cd $(DIR_APP) && install -m 4755 src/su $(BUILDROOT)/bin
- # Dump /etc/dircolors. - dircolors -p > $(BUILDROOT)/etc/dircolors - cp -vf $(DIR_SOURCE)/profile.d/dircolors.sh $(BUILDROOT)/etc/profile.d + # Dump /etc/DIR_COLORS + dircolors -p > $(BUILDROOT)/etc/DIR_COLORS + cp -vf $(DIR_SOURCE)/profile.d/* $(BUILDROOT)/etc/profile.d/ endef diff --git a/pkgs/core/coreutils/profile.d/colorls.sh b/pkgs/core/coreutils/profile.d/colorls.sh new file mode 100644 index 0000000..dc5c223 --- /dev/null +++ b/pkgs/core/coreutils/profile.d/colorls.sh @@ -0,0 +1,40 @@ +# color-ls initialization + +#when USER_LS_COLORS defined do not override user LS_COLORS, but use them. +if [ -z "$USER_LS_COLORS" ]; then + + alias ll='ls -l' 2>/dev/null + alias l.='ls -d .*' 2>/dev/null + + + # Skip the rest for noninteractive shells. + [ -z "$PS1" ] && return + + COLORS= + + for colors in "$HOME/.dir_colors.$TERM" "$HOME/.dircolors.$TERM" \ + "$HOME/.dir_colors" "$HOME/.dircolors"; do + [ -e "$colors" ] && COLORS="$colors" && break + done + + [ -z "$COLORS" ] && [ -e "/etc/DIR_COLORS.256color" ] && \ + [ "x`tty -s && tput colors 2>/dev/null`" = "x256" ] && \ + COLORS="/etc/DIR_COLORS.256color" + + if [ -z "$COLORS" ]; then + for colors in "/etc/DIR_COLORS.$TERM" "/etc/DIR_COLORS" ; do + [ -e "$colors" ] && COLORS="$colors" && break + done + fi + + # Existence of $COLORS already checked above. + [ -n "$COLORS" ] || return + + eval "`dircolors --sh "$COLORS" 2>/dev/null`" + [ -z "$LS_COLORS" ] && return + grep -qi "^COLOR.*none" $COLORS >/dev/null 2>/dev/null && return +fi + +alias ll='ls -l --color=auto' 2>/dev/null +alias l.='ls -d .* --color=auto' 2>/dev/null +alias ls='ls --color=auto' 2>/dev/null diff --git a/pkgs/core/coreutils/profile.d/dircolors.sh b/pkgs/core/coreutils/profile.d/dircolors.sh deleted file mode 100644 index 873d91b..0000000 --- a/pkgs/core/coreutils/profile.d/dircolors.sh +++ /dev/null @@ -1,9 +0,0 @@ -# Setup for /bin/ls to support color, the alias is in /etc/bashrc. -if [ -f "/etc/dircolors" ] ; then - eval $(dircolors -b /etc/dircolors) - - if [ -f "$HOME/.dircolors" ] ; then - eval $(dircolors -b $HOME/.dircolors) - fi -fi -alias ls='ls --color=auto' diff --git a/pkgs/core/network/network-init.init b/pkgs/core/network/network-init.init new file mode 100644 index 0000000..a44b96e --- /dev/null +++ b/pkgs/core/network/network-init.init @@ -0,0 +1,8 @@ +description "Control the networking" +author "IPFire Team" + +start on stopped mountfs + +pre-start script + network init +end script diff --git a/pkgs/core/network/network.init b/pkgs/core/network/network.init index 3320067..817f8b0 100644 --- a/pkgs/core/network/network.init +++ b/pkgs/core/network/network.init @@ -1,7 +1,7 @@ description "Control the networking" author "IPFire Team"
-start on stopped mountfs +start on started network-init stop on starting shutdown or starting reboot
pre-start script diff --git a/pkgs/core/network/src/functions b/pkgs/core/network/src/functions index 89a4ed0..befdd14 100644 --- a/pkgs/core/network/src/functions +++ b/pkgs/core/network/src/functions @@ -41,6 +41,3 @@ case "${COLOURS}" in ;; esac
-if [ "$(basename ${0})" = "network" ]; then - init_run -fi diff --git a/pkgs/core/network/src/functions.cli b/pkgs/core/network/src/functions.cli index 9339a7b..aa0bddf 100644 --- a/pkgs/core/network/src/functions.cli +++ b/pkgs/core/network/src/functions.cli @@ -348,7 +348,8 @@ function cli_reset() { port_remove ${port} done
- # XXX recreate ethernet ports + # Re-run the initialization functions + init_run
exit ${EXIT_OK} } @@ -505,3 +506,12 @@ function cli_yesno() {
return ${EXIT_ERROR} } + +function cli_get_key() { + local key="${1%%=*}" + echo "${key/--/}" +} + +function cli_get_val() { + echo "${1##*=}" +} diff --git a/pkgs/core/network/src/functions.constants b/pkgs/core/network/src/functions.constants index 75ad577..4dd9198 100644 --- a/pkgs/core/network/src/functions.constants +++ b/pkgs/core/network/src/functions.constants @@ -43,7 +43,7 @@ DB_CONNECTION_FILE="${LOG_DIR}/connections.db" EXIT_OK=0 EXIT_ERROR=1 EXIT_CONF_ERROR=2 -EXIT_ERROR_ASSERT=3 # XXX needs check +EXIT_ERROR_ASSERT=3
STATUS_UP=0 STATUS_DOWN=1 diff --git a/pkgs/core/network/src/functions.device b/pkgs/core/network/src/functions.device index 70346c4..40e8eb4 100644 --- a/pkgs/core/network/src/functions.device +++ b/pkgs/core/network/src/functions.device @@ -121,12 +121,6 @@ function device_has_virtuals() { grep -q "${1}$" /proc/net/vlan/config }
-function device_is_vlan() { # XXX Compat function - log DEBUG "Deprecated function device_is_vlan() was used." - - device_is_virtual $@ -} - # Check if the device is a ppp device function device_is_ppp() { local device=${1} @@ -166,7 +160,7 @@ function device_is_real() { function device_get_type() { local device=$(devicify ${1})
- if device_is_vlan ${device}; then + if device_is_virtual ${device}; then echo "vlan"
elif device_is_bonding ${device}; then @@ -247,32 +241,17 @@ function device_set_address() { }
function device_get() { - local from_config - - while [ $# -gt 0 ]; do - case "${1}" in - --from-config) - from_config=1 - ;; - --no-config) - from_config=0 - ;; - esac - shift - done - + local device local devices
- if [ "${from_config}" != "0" ]; then - devices="${devices} $(device_config_list)" - fi + for device in ${SYS_CLASS_NET}/*; do + device=$(basename ${device})
- if [ "${from_config}" != "1" ]; then - local device - for device in ${SYS_CLASS_NET}/*; do - devices="${devices} $(basename ${device})" - done - fi + # bonding_masters is no device + [ "${device}" = "bonding_masters" ] && continue + + devices="${devices} ${device}" + done
echo ${devices} return ${EXIT_OK} @@ -313,31 +292,6 @@ function device_is_used() { return ${EXIT_ERROR} }
-# XXX to be removed I think -function device_get_free() { - local destination=${1} - - # Replace + by a valid number - if grep -q "+$" <<<${destination}; then - local number=0 - destination=$(sed -e "s/+//" <<<$destination) - while [ "${number}" -le "100" ]; do - if ! device_exists "${destination}${number}"; then - destination="${destination}${number}" - break - fi - number=$(($number + 1)) - done - fi - echo "${destination}" -} - -function device_rename() { - warning_log "Called deprecated function 'device_rename'" - - device_set_name $@ -} - function device_hash() { local device=${1}
@@ -351,7 +305,7 @@ function device_hash() { # Give the device a new name function device_set_name() { local source=$1 - local destination=$(device_get_free ${2}) + local destination=${2}
# Check if devices exists if ! device_exists ${source} || device_exists ${destination}; then @@ -393,7 +347,7 @@ function device_set_parent_up() { local parent
if device_is_virtual ${device}; then - parent=$(device_virtual_get_parent ${device}) + parent=$(virtual_get_parent ${device})
device_is_up ${parent} && return ${EXIT_OK}
@@ -429,7 +383,7 @@ function device_set_parent_down() { local parent
if device_is_virtual ${device}; then - parent=$(device_virtual_get_parent ${device}) + parent=$(virtual_get_parent ${device})
device_is_up ${parent} || return ${EXIT_OK}
diff --git a/pkgs/core/network/src/functions.ethernet b/pkgs/core/network/src/functions.ethernet index f0bfbc0..71cd5ad 100644 --- a/pkgs/core/network/src/functions.ethernet +++ b/pkgs/core/network/src/functions.ethernet @@ -1,15 +1,20 @@ #!/bin/bash -# XXX header missing - -function ethernet_device_print() { - local device=${1} - - printf "${DEVICE_PRINT_LINE1}" "Address:" "$(device_get_address ${device})" - printf "${DEVICE_PRINT_LINE1}" "MTU:" "$(device_get_mtu ${device})" -} - -function real_device_print() { - warning_log "Deprecated function called: real_device_print" - - ethernet_device_print $@ -} +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2010 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/. # +# # +############################################################################### diff --git a/pkgs/core/network/src/functions.events b/pkgs/core/network/src/functions.events index 7ba44e8..895f801 100644 --- a/pkgs/core/network/src/functions.events +++ b/pkgs/core/network/src/functions.events @@ -1,4 +1,23 @@ #!/bin/bash +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2010 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/. # +# # +###############################################################################
function event_emit() { local event=${1} diff --git a/pkgs/core/network/src/functions.logging b/pkgs/core/network/src/functions.logging index db5c8ef..e909a74 100644 --- a/pkgs/core/network/src/functions.logging +++ b/pkgs/core/network/src/functions.logging @@ -1,4 +1,23 @@ #!/bin/bash +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2010 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/. # +# # +###############################################################################
LOG_FACILITY="network" LOG_LEVEL="DEBUG" diff --git a/pkgs/core/network/src/functions.ports b/pkgs/core/network/src/functions.ports index d0d7dee..feecaa2 100644 --- a/pkgs/core/network/src/functions.ports +++ b/pkgs/core/network/src/functions.ports @@ -1,5 +1,23 @@ #!/bin/bash -# XXX header missing +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2010 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/. # +# # +###############################################################################
function port_dir() { echo "${CONFIG_DIR}/ports" @@ -142,3 +160,37 @@ function ports_get() { fi done } + +# This function automatically creates the real ethernet devices +# that do not exists in the configuration. +# Saves some work for the administrator. +function ports_init() { + local device + for device in $(devices_get_all); do + if device_is_real ${device}; then + if ! port_exists ${device}; then + port_create ethernet ${device} + fi + fi + done +} + +init_register ports_init + +function port_find_free() { + local pattern=${1} + + assert isset pattern + + local port + local i=0 + + while [ ${i} -lt 99 ]; do + port=${pattern//N/${i}} + if ! port_exists ${port} && ! device_exists ${port}; then + echo "${port}" + break + fi + i=$(( ${i} + 1 )) + done +} diff --git a/pkgs/core/network/src/functions.ppp b/pkgs/core/network/src/functions.ppp index c1c5dae..c10e7e7 100644 --- a/pkgs/core/network/src/functions.ppp +++ b/pkgs/core/network/src/functions.ppp @@ -23,6 +23,8 @@ function ppp_init() { mkdir -p /var/run/ppp 2>/dev/null }
+init_register ppp_init + function ppp_common_ip_pre_up() { local zone=${1} shift @@ -104,8 +106,6 @@ function ppp_accounting() { }
function pppd_exec() { - ppp_init - log DEBUG "Running pppd with parameters '$@'."
pppd $@ > /dev/null diff --git a/pkgs/core/network/src/functions.stp b/pkgs/core/network/src/functions.stp index 3474f09..a85138f 100644 --- a/pkgs/core/network/src/functions.stp +++ b/pkgs/core/network/src/functions.stp @@ -19,6 +19,15 @@ # # ###############################################################################
+function stp_init() { + module_load stp + + assert binary_exists brctl + assert binary_exists rstpctl +} + +init_register stp_init + # XXX Very slow thing, caching? function __rstpctl_cmd() { local command=$@ @@ -251,3 +260,39 @@ function __stp_wrapper() {
__${proto_version}_${func} $@ } + +function stp_mode() { + : # XXX wanted +} + +function stp_enable() { + local bridge=${1} + + assert isset bridge + assert zone_exists ${bridge} + + brctl stp ${bridge} on + + local mode=$(zone_config_get ${bridge} STP_MODE) + + case "${mode}" in + stp) + rstpctl setforcevers ${bridge} slow + ;; + rstp) + rstpctl setforcevers ${bridge} normal + ;; + *) + error_log "Unknown protocol version: ${mode}." + ;; + esac +} + +function stp_disable() { + local bridge=${1} + + assert isset bridge + assert zone_exists ${bridge} + + brctl stp ${bridge} off +} diff --git a/pkgs/core/network/src/functions.util b/pkgs/core/network/src/functions.util index 1163634..104316f 100644 --- a/pkgs/core/network/src/functions.util +++ b/pkgs/core/network/src/functions.util @@ -376,3 +376,32 @@ function module_load() { modprobe ${module} fi } + +function binary_exists() { + local binary=${1} + + if [ -n "$(type -p ${binary})" ]; then + return ${EXIT_OK} + fi + + return ${EXIT_ERROR} +} + +function process_kill() { + local process=${1} + + if ! isinteger process; then + process=$(pidof ${process}) + fi + + local pid + local sig + for pid in ${process}; do + for sig in 15 9; do + [ -d "/proc/${pid}" ] || break + + kill -${sig} ${pid} + sleep 1 + done + done +} diff --git a/pkgs/core/network/src/functions.virtual b/pkgs/core/network/src/functions.virtual index 9d35e4e..b9d0335 100644 --- a/pkgs/core/network/src/functions.virtual +++ b/pkgs/core/network/src/functions.virtual @@ -21,15 +21,21 @@
function virtual_init() { module_load 8021q -}
-init_register virtual_init + ebtables-restore <<EOF +*filter +:INPUT ACCEPT +:FORWARD ACCEPT +:OUTPUT ACCEPT
-function device_create_virtual() { - log WARN "Called deprecated function device_create_virtual" - device_virtual_create $@ +*broute +:BROUTING ACCEPT +-A BROUTING -p 802_1Q -j DROP +EOF }
+init_register virtual_init + function virtual_create() { local port=$(devicify ${1}) local vid=${2} @@ -170,23 +176,3 @@ function virtual_get_by_parent_and_vid() {
return ${EXIT_ERROR} } - -function device_virtual_create() { - log WARN "Called deprecated function device_virtual_create" - virtual_create $@ -} - -function device_virtual_remove() { - log WARN "Called deprecated function device_virtual_remove" - virtual_remove $@ -} - -function device_virtual_get_parent() { - log WARN "Called deprecated function device_virtual_get_parent" - virtual_get_parent $@ -} - -function device_virtual_get_by_parent_and_vid() { - log WARN "Called deprecated function device_virtual_get_by_parent_and_vid" - virtual_get_by_parent_and_vid $@ -} diff --git a/pkgs/core/network/src/functions.wireless b/pkgs/core/network/src/functions.wireless new file mode 100644 index 0000000..07a2ee0 --- /dev/null +++ b/pkgs/core/network/src/functions.wireless @@ -0,0 +1,296 @@ +#!/bin/bash +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2010 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/. # +# # +############################################################################### + +PHY_DIR="/sys/class/ieee80211" + +function phy_dir() { + local phy=${1} + + echo "${PHY_DIR}/${phy}" +} + +function phy_exists() { + local phy=${1} + + [ -d "$(phy_dir ${phy})" ] +} + +function phy_list() { + local phy + for phy in $(phy_dir)/*; do + phy=$(basename ${phy}) + echo "${phy}" + done +} + +function phy_get() { + local info=${1} + + local phy + + if listmatch ${info} $(phy_list); then + phy="${info}" + elif device_exists ${info}; then + info=$(device_get_address ${info}) + fi + + if [ -z "${phy}" ] && mac_is_valid ${info}; then + local i + for i in $(phy_list); do + if [ "${info}" = "$(phy_get_address ${i})" ]; then + phy=${i} + break + fi + done + fi + + if [ -z "${phy}" ]; then + return ${EXIT_ERROR} + fi + + echo "${phy}" + return ${EXIT_OK} +} + +function phy_get_address() { + local phy=${1} + + assert isset phy + + cat $(phy_dir ${phy})/macaddress 2>/dev/null +} + +function wireless_create() { + local device=${1} + local phy=$(phy_get ${2}) + local type=${3} + local mac=${4} + + assert isset device + assert isset phy + assert isset type + + isset mac || mac=$(mac_generate) + + assert phy_exists ${phy} + assert isoneof type managed __ap + + iw phy ${phy} interface add ${device} type ${type} + + if device_exists ${device}; then + device_set_address ${device} ${mac} + fi + + device_set_up ${device} +} + +function wireless_remove() { + local device=${1} + + assert device_exists ${device} + + device_set_down ${device} + + iw dev ${device} del +} + +function wireless_set_channel() { + local device=${1} + local channel=${2} + + assert isset device + assert device_exists ${device} + assert isset channel + + iw dev ${device} set channel ${channel} $@ +} + +function hostapd_init() { + mkdir -p $(hostapd_config_dir) +} + +init_register hostapd_init + +function hostapd_config_dir() { + local device=${1} + + echo "${RUN_DIR}/hostapd/${device}" +} + +function hostapd_config_write() { + local device=${1} + shift + + assert device_exists ${device} + + local broadcast_ssid + local channel + local country_code + local mode + local ssid + + while [ $# -gt 0 ]; do + case "${1}" in + --broadcast-ssid=*) + broadcast_ssid=${1#--broadcast-ssid=} + ;; + --channel=*) + channel=${1#--channel=} + ;; + --country-code=*) + country_code=${1#--country-code=} + ;; + --mode=*) + mode=${1#--mode=} + ;; + --ssid=*) + ssid=${1#--ssid=} + ;; + *) + warning_log "Ignoring unknown argument '${1}'." + ;; + esac + shift + done + + assert isset broadcast_ssid + assert isbool broadcast_ssid + + assert isset channel + assert isinteger channel + + assert isset country_code + assert isset mode + assert isset ssid + + local ignore_broadcast_ssid + if enabled broadcast_ssid; then + ignore_broadcast_ssid="0" + else + ignore_broadcast_ssid="1" + fi + + cat <<EOF +### Hostapd configuration for ${device} + +# Interface configuration +driver=nl80211 +interface=${device} + +# Wireless configuration +channel=${channel} +country_code=${country_code} +hw_mode=${mode} +ignore_broadcast_ssid=${ignore_broadcast_ssid} +ssid=${ssid} + +# Logging options +logger_syslog=-1 +logger_syslog_level=2 +logger_stdout=-1 +logger_stdout_level=2 + +# Dump file +dump_file=$(hostapd_config_dir ${device}/dump + +ctrl_interface=/var/run/hostapd +ctrl_interface_group=0 +EOF + + return ${EXIT_OK} +} + +function hostapd_start() { + local device=${1} + shift + + assert isset device + + local config_dir=$(hostapd_config_dir ${device}) + mkdir -p ${config_dir} + + local config_file=${config_dir}/config + hostapd_config_write ${device} $@ > ${config_file} + + hostapd -dd -B -P ${config_dir}/pid ${config_file} + local ret=$? + + case "${ret}" in + 0) + log DEBUG "Hostapd was successfully started for '${device}'." + return ${EXIT_OK} + ;; + 1) + error_log "Could not start hostapd properly for '${device}'." + + error_log "Configuration file dump:" + local line + while read line; do + error_log " ${line}" + done < ${config_file} + + return ${EXIT_ERROR} + ;; + esac +} + +function hostapd_stop() { + local device=${1} + + assert isset device + + local pid=$(hostapd_get_pid ${device}) + + if isset pid; then + process_kill ${pid} + else + warning_log "Could not find pid file for hostapd process running for ${device}." + fi + + rm -rf $(hostapd_config_dir ${device}) +} + +function hostapd_get_pid() { + local device=${1} + + assert isset device + + local pid_file="$(hostapd_config_dir ${device})/pid" + + [ -e "${pid_file}" ] || return ${EXIT_ERROR} + + cat ${pid_file} 2>/dev/null + return ${EXIT_OK} +} + +function hostapd_is_running() { + local device=${1} + + assert isset device + + local pid=$(hostapd_get_pid ${device}) + + if isset pid && [ -d "/proc/${pid}" ]; then + return ${EXIT_OK} + fi + + return ${EXIT_ERROR} +} diff --git a/pkgs/core/network/src/functions.zone b/pkgs/core/network/src/functions.zone index 770ce99..8df8c40 100644 --- a/pkgs/core/network/src/functions.zone +++ b/pkgs/core/network/src/functions.zone @@ -643,3 +643,17 @@ function zone_config_set() { zone_config_write ${zone} ) } + +function zone_config_get() { + local zone=${1} + local key=${2} + + assert isset zone + assert isset key + + ( + zone_config_read ${zone} + + echo "${!key}" + ) +} diff --git a/pkgs/core/network/src/hooks/ports/virtual b/pkgs/core/network/src/hooks/ports/virtual index 4c35ebc..10f0b80 100755 --- a/pkgs/core/network/src/hooks/ports/virtual +++ b/pkgs/core/network/src/hooks/ports/virtual @@ -103,7 +103,7 @@ function _up() { config_read $(port_file ${port})
if ! device_exists ${port}; then - device_virtual_create ${DEVICE} ${DEVICE_VID} ${DEVICE_MAC} + virtual_create ${DEVICE} ${DEVICE_VID} ${DEVICE_MAC} fi
exit ${EXIT_OK} @@ -120,7 +120,7 @@ function _down() { exit ${EXIT_OK} fi
- device_virtual_remove ${port} + virtual_remove ${port}
exit ${EXIT_OK} } diff --git a/pkgs/core/network/src/hooks/ports/wireless-ap b/pkgs/core/network/src/hooks/ports/wireless-ap new file mode 100755 index 0000000..4340a75 --- /dev/null +++ b/pkgs/core/network/src/hooks/ports/wireless-ap @@ -0,0 +1,201 @@ +#!/bin/bash +############################################################################### +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2010 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/. # +# # +############################################################################### + +. /lib/network/header-port + +DEVICE_PATTERN="wifiN" + +HOOK_SETTINGS="HOOK ADDRESS BROADCAST_SSID COUNTRY_CODE MODE PHY SSID" + +ADDRESS=$(mac_generate) +BROADCAST_SSID=on +CHANNEL=1 +COUNTRY_CODE="US" +MODE="g" +SSID= + +function _check() { + assert isset ADDRESS + assert ismac ADDRESS + assert isset BROADCAST_SSID + assert isbool BROADCAST_SSID + assert isset CHANNEL + assert isset COUNTRY_CODE + assert isset MODE + assert isoneof MODE b g + assert isset PHY + assert ismac PHY + assert isset SSID +} + +function _create() { + while [ $# -gt 0 ]; do + case "${1}" in + --broadcast-ssid=*) + BROADCAST_SSID=$(cli_get_val ${1}) + ;; + --channel=*) + CHANNEL=$(cli_get_val ${1}) + ;; + --country-code=*) + COUNTRY_CODE=$(cli_get_val ${1}) + ;; + --mac=*) + ADDRESS=$(cli_get_val ${1}) + ;; + --mode=*) + MODE=$(cli_get_val ${1}) + ;; + --phy=*) + PHY=$(cli_get_val ${1}) + ;; + --ssid=*) + SSID=$(cli_get_val ${1}) + ;; + *) + warning "Ignoring unknown argument '${1}'" + ;; + esac + shift + done + + # Save address of phy do identify it again + PHY=$(phy_get ${PHY}) + PHY=$(phy_get_address ${PHY}) + + local port=$(port_find_free ${DEVICE_PATTERN}) + assert isset port + + config_write $(port_file ${port}) ${HOOK_SETTINGS} + + exit ${EXIT_OK} +} + +function _edit() { + local port=${1} + shift + + assert isset port + + config_read $(port_file ${port}) + + while [ $# -gt 0 ]; do + case "${1}" in + --broadcast-ssid=*) + BROADCAST_SSID=$(cli_get_val ${1}) + ;; + --channel=*) + CHANNEL=$(cli_get_val ${1}) + ;; + --country-code=*) + COUNTRY_CODE=$(cli_get_val ${1}) + ;; + --ssid=*) + SSID=$(cli_get_val ${1}) + ;; + --mode=*) + MODE=$(cli_get_val ${1}) + ;; + *) + warning "Unknown argument '${1}'" + ;; + esac + shift + done + + config_write $(port_file ${port}) ${HOOK_SETTINGS} + + exit ${EXIT_OK} +} + +function _up() { + local port=${1} + + assert isset port + + config_read $(port_file ${port}) + + if ! device_exists ${port}; then + wireless_create ${port} ${PHY} __ap ${ADDRESS} + fi + + if ! hostapd_is_running ${port}; then + hostapd_start ${port} \ + --broadcast-ssid="${BROADCAST_SSID}" \ + --channel="${CHANNEL}" \ + --country-code="${COUNTRY_CODE}" \ + --mode="${MODE}" \ + --ssid="${SSID}" + + local ret=$? + + if [ ${ret} -eq ${EXIT_ERROR} ]; then + error_log "Could not start '${port}' because hostapd crashed previously." + ( _down ${port} ) + exit ${EXIT_ERROR} + fi + fi + + exit ${EXIT_OK} +} + +function _down() { + local port=${1} + + assert isset port + + config_read $(port_file ${port}) + + if ! device_exists ${port}; then + exit ${EXIT_OK} + fi + + hostapd_stop ${port} + wireless_remove ${port} + + exit ${EXIT_OK} +} + +function _status() { + local zone=${1} + local port=${2} + +config_read $(zone_dir ${zone})/${port} + + local device=$(devicify ${DEVICE_MAC}) + + printf " %-10s - " "${device}" + if ! device_is_up ${device}; then + echo -ne "${COLOUR_DOWN} DOWN ${COLOUR_NORMAL}" + else + local state=$(stp_port_state ${zone} ${device}) + local colour="COLOUR_STP_${state}" + printf "${!colour}%10s${COLOUR_NORMAL}" ${state} + fi + + echo -n " - DSR: $(stp_port_designated_root ${zone} ${device})" + echo -n " - Cost: $(stp_port_pathcost ${zone} ${device})" + echo + + exit ${EXIT_OK} +} + +run $@ diff --git a/pkgs/core/network/src/hooks/zones/bridge b/pkgs/core/network/src/hooks/zones/bridge index a09f755..701d3ab 100755 --- a/pkgs/core/network/src/hooks/zones/bridge +++ b/pkgs/core/network/src/hooks/zones/bridge @@ -21,13 +21,14 @@
. /lib/network/header-zone
-HOOK_SETTINGS="HOOK STP STP_FORWARD_DELAY STP_HELLO STP_MAXAGE STP_PRIORITY" -HOOK_SETTINGS="${HOOK_SETTINGS} MAC MTU" +HOOK_SETTINGS="HOOK STP STP_FORWARD_DELAY STP_HELLO STP_MAXAGE STP_MODE" +HOOK_SETTINGS="${HOOK_SETTINGS} STP_PRIORITY MAC MTU"
# Default values MAC=$(mac_generate) MTU=1500 STP="on" +STP_MODE="rstp" STP_FORWARD_DELAY=0 STP_HELLO=2 STP_MAXAGE=20 @@ -36,6 +37,7 @@ STP_PRIORITY=512 # XXX check out better value function _check() { assert ismac MAC assert isbool STP + assert isoneof STP_MODE stp rstp assert isinteger STP_HELLO assert isinteger STP_FORWARD_DELAY assert isinteger STP_PRIORITY @@ -48,6 +50,9 @@ function _parse_cmdline() { --stp=*) STP=${1#--stp=} ;; + --stp-mode=*) + STP_MODE=${1#--stp-mode=} + ;; --stp-hello=*) STP_HELLO=${1#--stp-hello=} ;; @@ -86,7 +91,7 @@ function _up() {
# Enable STP if enabled STP; then - brctl stp ${zone} on + stp_enable ${zone}
if [ -n "${STP_FORWARD_DELAY}" ]; then brctl setfd ${zone} ${STP_FORWARD_DELAY} @@ -104,7 +109,7 @@ function _up() { brctl setbridgeprio ${zone} ${STP_PRIORITY} fi else - brctl stp ${zone} off + stp_disable ${zone} fi
device_set_up ${zone} diff --git a/pkgs/core/network/src/hooks/zones/bridge.configs/ipv4-static b/pkgs/core/network/src/hooks/zones/bridge.configs/ipv4-static index 9ea7288..f1fc2d6 100755 --- a/pkgs/core/network/src/hooks/zones/bridge.configs/ipv4-static +++ b/pkgs/core/network/src/hooks/zones/bridge.configs/ipv4-static @@ -84,7 +84,13 @@ function _up() { fi
if zone_is_nonlocal ${zone} && [ -n "${GATEWAY}" ]; then - : # XXX to be done + # Save configuration + red_db_set ${zone} type "${HOOK}" + red_db_set ${zone} local-ip-address ${ADDRESS}/${PREFIX} + red_db_set ${zone} remote-ip-address ${GATEWAY} + + red_db_set ${zone} active 1 + red_routing_update ${zone} fi
exit ${EXIT_OK} diff --git a/pkgs/core/network/src/hooks/zones/bridge.ports/wireless-ap b/pkgs/core/network/src/hooks/zones/bridge.ports/wireless-ap new file mode 120000 index 0000000..3857774 --- /dev/null +++ b/pkgs/core/network/src/hooks/zones/bridge.ports/wireless-ap @@ -0,0 +1 @@ +ethernet \ No newline at end of file diff --git a/pkgs/core/network/src/network b/pkgs/core/network/src/network index d4a75b8..2309848 100755 --- a/pkgs/core/network/src/network +++ b/pkgs/core/network/src/network @@ -38,6 +38,10 @@ done
# Process the given action case "${action}" in + init) + init_run + ;; + config|port|device|zone|start|stop|restart|status|reset) cli_${action} $@ ;; diff --git a/pkgs/core/pdns-recursor/pdns-recursor.nm b/pkgs/core/pdns-recursor/pdns-recursor.nm index af072c7..6b7c32d 100644 --- a/pkgs/core/pdns-recursor/pdns-recursor.nm +++ b/pkgs/core/pdns-recursor/pdns-recursor.nm @@ -43,6 +43,10 @@ endef
PKG_TARBALL = $(THISAPP).tar.bz2
+# XXX pdns-recursors likes to segfault when compiled with normal +# CFLAGS. So we do it with -O0 +CFLAGS := $(subst -O2,-O0,$(CFLAGS)) + define STAGE_BUILD cd $(DIR_APP) && LUA=1 LUA_CPPFLAGS_CONFIG= LUA_LIBS_CONFIG=-llua \ make OPTFLAGS="$(CFLAGS)" #$(PARALLELISMFLAGS) diff --git a/pkgs/toolchain/gcc-static/patches/gcc-4.5.0-gmp-mpfr-build-fix-1.patch b/pkgs/toolchain/gcc-static/patches/gcc-4.5.0-gmp-mpfr-build-fix-1.patch new file mode 100644 index 0000000..f2e91dc --- /dev/null +++ b/pkgs/toolchain/gcc-static/patches/gcc-4.5.0-gmp-mpfr-build-fix-1.patch @@ -0,0 +1,26 @@ +Index: gcc/configure +=================================================================== +--- gcc/configure (revision 162481) ++++ gcc/configure (revision 162482) +@@ -5478,7 +5478,7 @@ + if test "x$with_gmp$with_gmp_include$with_gmp_lib" = x && test -d ${srcdir}/gmp; then + gmplibs='-L$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir $gmplibs" + gmpinc='-I$$r/$(HOST_SUBDIR)/gmp -I$$s/gmp '"$gmpinc" +- extra_mpfr_configure_flags='--with-gmp-build=$$r/$(HOST_SUBDIR)/gmp' ++ extra_mpfr_configure_flags='--with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-gmp-lib=$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir" + extra_mpc_gmp_configure_flags='--with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-gmp-lib=$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir" + # Do not test the gmp version. Assume that it is sufficient, since + # it is in the source tree, and the library has not been built yet +Index: gcc/configure.ac +=================================================================== +--- gcc/configure.ac (revision 162481) ++++ gcc/configure.ac (revision 162482) +@@ -1354,7 +1354,7 @@ + if test "x$with_gmp$with_gmp_include$with_gmp_lib" = x && test -d ${srcdir}/gmp; then + gmplibs='-L$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir $gmplibs" + gmpinc='-I$$r/$(HOST_SUBDIR)/gmp -I$$s/gmp '"$gmpinc" +- extra_mpfr_configure_flags='--with-gmp-build=$$r/$(HOST_SUBDIR)/gmp' ++ extra_mpfr_configure_flags='--with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-gmp-lib=$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir" + extra_mpc_gmp_configure_flags='--with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-gmp-lib=$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir" + # Do not test the gmp version. Assume that it is sufficient, since + # it is in the source tree, and the library has not been built yet diff --git a/pkgs/toolchain/gcc/patches/gcc-4.5.0-gmp-mpfr-build-fix-1.patch b/pkgs/toolchain/gcc/patches/gcc-4.5.0-gmp-mpfr-build-fix-1.patch new file mode 100644 index 0000000..f2e91dc --- /dev/null +++ b/pkgs/toolchain/gcc/patches/gcc-4.5.0-gmp-mpfr-build-fix-1.patch @@ -0,0 +1,26 @@ +Index: gcc/configure +=================================================================== +--- gcc/configure (revision 162481) ++++ gcc/configure (revision 162482) +@@ -5478,7 +5478,7 @@ + if test "x$with_gmp$with_gmp_include$with_gmp_lib" = x && test -d ${srcdir}/gmp; then + gmplibs='-L$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir $gmplibs" + gmpinc='-I$$r/$(HOST_SUBDIR)/gmp -I$$s/gmp '"$gmpinc" +- extra_mpfr_configure_flags='--with-gmp-build=$$r/$(HOST_SUBDIR)/gmp' ++ extra_mpfr_configure_flags='--with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-gmp-lib=$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir" + extra_mpc_gmp_configure_flags='--with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-gmp-lib=$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir" + # Do not test the gmp version. Assume that it is sufficient, since + # it is in the source tree, and the library has not been built yet +Index: gcc/configure.ac +=================================================================== +--- gcc/configure.ac (revision 162481) ++++ gcc/configure.ac (revision 162482) +@@ -1354,7 +1354,7 @@ + if test "x$with_gmp$with_gmp_include$with_gmp_lib" = x && test -d ${srcdir}/gmp; then + gmplibs='-L$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir $gmplibs" + gmpinc='-I$$r/$(HOST_SUBDIR)/gmp -I$$s/gmp '"$gmpinc" +- extra_mpfr_configure_flags='--with-gmp-build=$$r/$(HOST_SUBDIR)/gmp' ++ extra_mpfr_configure_flags='--with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-gmp-lib=$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir" + extra_mpc_gmp_configure_flags='--with-gmp-include=$$r/$(HOST_SUBDIR)/gmp --with-gmp-lib=$$r/$(HOST_SUBDIR)/gmp/'"$lt_cv_objdir" + # Do not test the gmp version. Assume that it is sufficient, since + # it is in the source tree, and the library has not been built yet diff --git a/pkgs/toolchain/gettext/gettext.nm b/pkgs/toolchain/gettext/gettext.nm index 5d3caa9..689cbdc 100644 --- a/pkgs/toolchain/gettext/gettext.nm +++ b/pkgs/toolchain/gettext/gettext.nm @@ -13,6 +13,8 @@ define STAGE_BUILD cd $(DIR_APP)/gettext-tools && make -C src msgfmt endef
+STAGE_TEST = # Do nothing + define STAGE_INSTALL cd $(DIR_APP)/gettext-tools && cp -v src/msgfmt $(TOOLS_DIR)/bin endef
hooks/post-receive -- IPFire 3.x development tree