[kernel] r11766 - in people/waldi/s390/sysconfig: . debian doc etc etc/sysconfig etc/sysconfig/hardware etc/sysconfig/network etc/sysconfig/scripts etc/sysconfig/scripts/common etc/sysconfig/scripts/hardware etc/sysconfig/scripts/network etc/udev man sbin usr usr/share usr/share/initramfs-tools usr/share/initramfs-tools/scripts usr/share/initramfs-tools/scripts/init-premount usr/share/sysconfig

Bastian Blank waldi at alioth.debian.org
Fri Jul 4 10:49:35 UTC 2008


Author: waldi
Date: Fri Jul  4 10:49:34 2008
New Revision: 11766

Log:
/people/waldi/s390/sysconfig: Import sysconfig package.


Added:
   people/waldi/s390/sysconfig/
   people/waldi/s390/sysconfig/debian/
   people/waldi/s390/sysconfig/debian/changelog
   people/waldi/s390/sysconfig/debian/compat
   people/waldi/s390/sysconfig/debian/control
   people/waldi/s390/sysconfig/debian/copyright
   people/waldi/s390/sysconfig/debian/rules   (contents, props changed)
   people/waldi/s390/sysconfig/debian/sysconfig-hardware.postinst
   people/waldi/s390/sysconfig/debian/sysconfig-hardware.postrm
   people/waldi/s390/sysconfig/doc/
   people/waldi/s390/sysconfig/etc/
   people/waldi/s390/sysconfig/etc/sysconfig/
   people/waldi/s390/sysconfig/etc/sysconfig/hardware/
   people/waldi/s390/sysconfig/etc/sysconfig/network/
   people/waldi/s390/sysconfig/etc/sysconfig/scripts/
   people/waldi/s390/sysconfig/etc/sysconfig/scripts/common/
   people/waldi/s390/sysconfig/etc/sysconfig/scripts/common/functions
   people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/
   people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/functions
   people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/hwdown   (contents, props changed)
   people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/hwdown-ccw   (contents, props changed)
   people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/hwdown-ccw-dasd   (contents, props changed)
   people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/hwdown-ccw-group   (contents, props changed)
   people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/hwdown-ccw-zfcp   (contents, props changed)
   people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/hwup   (contents, props changed)
   people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/hwup-ccw   (contents, props changed)
   people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/hwup-ccw-dasd   (contents, props changed)
   people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/hwup-ccw-group   (contents, props changed)
   people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/hwup-ccw-zfcp   (contents, props changed)
   people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/ifupdown-mapping   (contents, props changed)
   people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/udev-net   (contents, props changed)
   people/waldi/s390/sysconfig/etc/sysconfig/scripts/network/
   people/waldi/s390/sysconfig/etc/udev/
   people/waldi/s390/sysconfig/etc/udev/sysconfig-hardware.rules
   people/waldi/s390/sysconfig/man/
   people/waldi/s390/sysconfig/man/hwdown.8   (contents, props changed)
   people/waldi/s390/sysconfig/man/hwup.8
   people/waldi/s390/sysconfig/sbin/
   people/waldi/s390/sysconfig/sbin/hwdown   (contents, props changed)
   people/waldi/s390/sysconfig/sbin/hwup   (contents, props changed)
   people/waldi/s390/sysconfig/usr/
   people/waldi/s390/sysconfig/usr/share/
   people/waldi/s390/sysconfig/usr/share/initramfs-tools/
   people/waldi/s390/sysconfig/usr/share/initramfs-tools/scripts/
   people/waldi/s390/sysconfig/usr/share/initramfs-tools/scripts/init-premount/
   people/waldi/s390/sysconfig/usr/share/initramfs-tools/scripts/init-premount/sysconfig_hardware   (contents, props changed)
   people/waldi/s390/sysconfig/usr/share/sysconfig/
   people/waldi/s390/sysconfig/usr/share/sysconfig/chandev-convert   (contents, props changed)
   people/waldi/s390/sysconfig/usr/share/sysconfig/chandev.conf

Added: people/waldi/s390/sysconfig/debian/changelog
==============================================================================
--- (empty file)
+++ people/waldi/s390/sysconfig/debian/changelog	Fri Jul  4 10:49:34 2008
@@ -0,0 +1,33 @@
+sysconfig (0.0.5) unstable; urgency=medium
+
+  * Removed unused options code.
+  * Fix detection of fba dasds.
+
+ -- Bastian Blank <waldi at debian.org>  Mon, 12 Mar 2007 17:52:41 +0100
+
+sysconfig (0.0.4) unstable; urgency=low
+
+  * Support options for ctc and qeth devices.
+  * Support network interface renaming.
+
+ -- Bastian Blank <waldi at debian.org>  Thu, 22 Jun 2006 10:23:25 +0200
+
+sysconfig (0.0.3) unstable; urgency=low
+
+  * Load ccwgroup modules if necessary.
+  * Fix udev rules.
+
+ -- Bastian Blank <waldi at debian.org>  Sat, 29 Apr 2006 23:37:45 +0200
+
+sysconfig (0.0.2) unstable; urgency=low
+
+  * Add initramfs-tools script.
+
+ -- Bastian Blank <waldi at debian.org>  Thu, 30 Mar 2006 13:25:34 +0200
+
+sysconfig (0.0.1) unstable; urgency=low
+
+  * Initial release,
+
+ -- Bastian Blank <waldi at debian.org>  Mon, 30 Jan 2006 20:02:25 +0100
+

Added: people/waldi/s390/sysconfig/debian/compat
==============================================================================
--- (empty file)
+++ people/waldi/s390/sysconfig/debian/compat	Fri Jul  4 10:49:34 2008
@@ -0,0 +1 @@
+4

Added: people/waldi/s390/sysconfig/debian/control
==============================================================================
--- (empty file)
+++ people/waldi/s390/sysconfig/debian/control	Fri Jul  4 10:49:34 2008
@@ -0,0 +1,13 @@
+Source: sysconfig
+Section: admin
+Priority: optional
+Maintainer: Bastian Blank <waldi at debian.org>
+Build-Depends: debhelper (>= 4.0.0)
+Standards-Version: 3.6.2
+
+Package: sysconfig-hardware
+Architecture: s390
+Priority: standard
+Depends: ${misc:Depends}, udev
+Description: Hardware configuration
+ Hardware configuration for not autoconfigurable hardware devices.

Added: people/waldi/s390/sysconfig/debian/copyright
==============================================================================
--- (empty file)
+++ people/waldi/s390/sysconfig/debian/copyright	Fri Jul  4 10:49:34 2008
@@ -0,0 +1,23 @@
+This package was debianized by Bastian Blank <waldi at debian.org> on
+Fri, 27 Jan 2006 13:07:55 +0100.
+
+Copyright Holder: Bastian Blank <waldi at debian.org>
+
+License:
+
+   This package 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.
+
+   This package 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 package; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.

Added: people/waldi/s390/sysconfig/debian/rules
==============================================================================
--- (empty file)
+++ people/waldi/s390/sysconfig/debian/rules	Fri Jul  4 10:49:34 2008
@@ -0,0 +1,61 @@
+#!/usr/bin/make -f
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+DEB_BUILD_ARCH  ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
+
+build:
+
+clean:
+	dh_testdir
+	dh_testroot
+	dh_clean 
+
+install:
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs
+
+	$(MAKE) -f debian/rules install-sysconfig-hardware-arch-$(DEB_BUILD_ARCH)
+
+install-sysconfig-hardware-%: export DH_OPTIONS = -psysconfig-hardware
+
+install-sysconfig-hardware-arch-s390: install-sysconfig-hardware-common
+	dh_install etc/sysconfig/scripts/hardware/*-ccw* etc/sysconfig/scripts/hardware
+	dh_install usr/share/initramfs-tools
+
+install-sysconfig-hardware-arch-%:
+
+install-sysconfig-hardware-common:
+	dh_installdirs etc/sysconfig/hardware
+	dh_install etc/sysconfig/scripts/common
+	dh_install etc/sysconfig/scripts/hardware/functions
+	dh_install etc/sysconfig/scripts/hardware/hw* etc/sysconfig/scripts/hardware
+	dh_install etc/sysconfig/scripts/hardware/ifupdown-mapping
+	dh_install etc/sysconfig/scripts/hardware/udev* etc/sysconfig/scripts/hardware
+	dh_install etc/udev
+	dh_installman man/hw*.8
+	dh_install sbin/hw* sbin
+
+binary-indep: install
+
+binary-arch: install
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs -s
+	dh_installdocs -s
+	dh_installexamples -s
+	dh_installman -s
+	dh_link -s
+	dh_strip -s
+	dh_compress -s
+	dh_fixperms -s
+	dh_installdeb -s
+	dh_gencontrol -s
+	dh_md5sums -s
+	dh_builddeb -s
+
+binary: binary-arch binary-indep
+.PHONY: build clean binary-indep binary-arch binary install

Added: people/waldi/s390/sysconfig/debian/sysconfig-hardware.postinst
==============================================================================
--- (empty file)
+++ people/waldi/s390/sysconfig/debian/sysconfig-hardware.postinst	Fri Jul  4 10:49:34 2008
@@ -0,0 +1,23 @@
+#! /bin/sh
+
+set -e
+
+case "$1" in
+    configure)
+        if [ -z "$2" ]; then
+            ln -sf ../sysconfig-hardware.rules /etc/udev/rules.d/z60_sysconfig-hardware.rules
+        fi
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+#DEBHELPER#
+
+exit 0

Added: people/waldi/s390/sysconfig/debian/sysconfig-hardware.postrm
==============================================================================
--- (empty file)
+++ people/waldi/s390/sysconfig/debian/sysconfig-hardware.postrm	Fri Jul  4 10:49:34 2008
@@ -0,0 +1,21 @@
+#! /bin/sh
+
+set -e  
+
+case "$1" in
+    purge)      
+        [ -L /etc/udev/rules.d/z60_sysconfig-hardware.rules ] && rm -f /etc/udev/rules.d/z60_sysconfig-hardware.rules
+    ;;
+
+    remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+    ;;  
+        
+    *)
+        echo "postrm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+#DEBHELPER#
+
+exit 0

Added: people/waldi/s390/sysconfig/etc/sysconfig/scripts/common/functions
==============================================================================
--- (empty file)
+++ people/waldi/s390/sysconfig/etc/sysconfig/scripts/common/functions	Fri Jul  4 10:49:34 2008
@@ -0,0 +1,72 @@
+# Copyright (c) 2002-2003 SuSE Linux AG Nuernberg, Germany.
+# All rights reserved.
+#
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# Authors: Michal Svec <msvec at suse.cz>
+#          Mads Martin Joergensen <mmj at suse.de>
+#
+
+#####################################################################
+# Returnvalues
+#
+# I don't know currently, if all this returnvalues are necessary. Probably some
+# of them will be removed. The values 0-7 should be very similar to the LSB
+# return values for init scripts
+R_SUCCESS=0        # interface has been set up
+R_ERROR=1          # any unspecified error
+R_USAGE=2          # wrong usage
+R_NOTIMPL=3        # feature not implemented
+R_NOTALLOWED=4     # insufficient privilege
+R_NODEV=7          # the given interface does not exist
+R_NOTCONFIGURED=5  # the bootmode does not match the current mode
+R_INACTIVE=5       # the interface is not up and it should not
+R_NOTRUNNING=7     # the interface is not up but it should be up
+
+R_NOCONFIG=9       # we could not find a matching configuration file
+R_INTERNAL=$R_ERROR      # internal error, e.g. no config or missing scripts
+
+PATH=/sbin:/usr/sbin:/bin:/usr/bin:${SYSCONFIG}/scripts/common
+
+error () {
+	warning "$@"
+	exit $R_ERROR
+}
+
+warning () {
+	test "$DEBUG" = "yes" && echo -e "$SCRIPTNAME $*" >&2 && return
+	test -z "$*" && return
+	echo -e "$*" >&2
+}
+
+message () {
+	test "$DEBUG" = "yes" && echo -e "$SCRIPTNAME $*" && return
+	test "$BE_QUIET" = "yes" && return
+	test -z "$*" && return
+	echo -e "$*"
+}
+
+message_n () {
+	test "$DEBUG" = "yes" && echo -en "$SCRIPTNAME $*" && return
+	test "$BE_QUIET" = "yes" && test "$DEBUG" != "yes" && return
+	echo -en "$*"
+}
+
+debug () {
+	test "$DEBUG" != "yes" && return
+	test -z "$*" && return
+	echo -e "$SCRIPTNAME [DEBUG] $*"
+}
+

Added: people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/functions
==============================================================================
--- (empty file)
+++ people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/functions	Fri Jul  4 10:49:34 2008
@@ -0,0 +1,72 @@
+init () {
+  SCRIPTNAME=${0##*/}
+  COMMAND=${SCRIPTNAME%%-*}
+
+  . ${SYSCONFIG}/scripts/common/functions
+
+  PATH="$PATH:${SYSCONFIG}/scripts/hardware"
+
+  MODE=manual
+
+  while getopts ":AD:h" OPT; do
+    case "$OPT" in
+      A)
+      MODE=auto
+      ;;
+      D)
+      DEVPATH="$OPTARG"
+      ;;
+      h)
+      usage
+      exit $R_SUCCESS
+      ;;
+      :)
+      echo "$SCRIPTNAME: option requires an argument -- $OPTARG" >&2
+      echo "Try: \`$SCRIPTNAME -h' for mor information." >&2
+      exit $R_USAGE
+      ;;
+      ?)
+      echo "$SCRIPTNAME: illegal option -- $OPTARG" >&2
+      echo "Try: \`$SCRIPTNAME -h' for mor information." >&2
+      exit $R_USAGE
+    esac
+  done
+
+  SYSFS=${SYSFS:-/sys}
+
+  cd ${SYSCONFIG}/hardware
+}
+
+check_bus () {
+  if [ "$1" == "ccwgroup" ]; then
+    exit 0
+  fi
+}
+
+check_config () {
+  if ! [ -e "config-$1-$2" ]; then
+    if [ "$MODE" != auto ]; then
+      warning "Can't find config-$1-$2!"
+    fi
+    exit $R_NOCONFIG
+  fi
+}
+
+check_devpath () {
+  [ -e $SYSFS${DEVPATH:=$1} ] || exit $R_ERROR
+}
+
+read_config () {
+  local READ_CONFIG="config-$1-$2"
+  if [ "$CONFIG" != $READ_CONFIG ]; then
+    CONFIG=$READ_CONFIG
+    check_config $1 $2
+    . $CONFIG
+  fi
+}
+
+if [ -z $SCRIPTNAME ]; then
+  init "$@"
+  shift $(($OPTIND - 1))
+fi
+

Added: people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/hwdown
==============================================================================
--- (empty file)
+++ people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/hwdown	Fri Jul  4 10:49:34 2008
@@ -0,0 +1 @@
+link hwup
\ No newline at end of file

Added: people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/hwdown-ccw
==============================================================================
--- (empty file)
+++ people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/hwdown-ccw	Fri Jul  4 10:49:34 2008
@@ -0,0 +1 @@
+link hwup-ccw
\ No newline at end of file

Added: people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/hwdown-ccw-dasd
==============================================================================
--- (empty file)
+++ people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/hwdown-ccw-dasd	Fri Jul  4 10:49:34 2008
@@ -0,0 +1,19 @@
+#!/bin/bash
+set -e
+
+usage () {
+  echo "Usage: $SCRIPTNAME [OPTION]... ID"
+}
+
+. ${SYSCONFIG:=/etc/sysconfig}/scripts/hardware/functions
+
+ID=$1
+
+check_bus ccw
+check_devpath /bus/ccw/devices/$ID
+read_config ccw $ID
+
+message_n "Deconfiguring device $ID: "
+echo 0 > $SYSFS$DEVPATH/online
+message "ok."
+

Added: people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/hwdown-ccw-group
==============================================================================
--- (empty file)
+++ people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/hwdown-ccw-group	Fri Jul  4 10:49:34 2008
@@ -0,0 +1,33 @@
+#!/bin/bash
+set -e
+
+usage () {
+  echo "Usage: $SCRIPTNAME [OPTION]... ID DEVPATH NAME DRIVER"
+}
+
+. ${SYSCONFIG:=/etc/sysconfig}/scripts/hardware/functions
+
+ID=$1
+NAME=$2
+DRIVER=$3
+
+check_bus ccw
+check_devpath /bus/ccw/devices/$ID
+read_config ccw $ID
+
+CCWGROUP_ID=$CCWGROUP_CHANS
+
+ccw=/bus/ccw/drivers/$NAME
+ccwgroup=/bus/ccwgroup/drivers/$DRIVER
+
+message_n "Deconfiguring group ${CCWGROUP_ID}: "
+if [ ! -d $SYSFS$ccwgroup/$CCWGROUP_ID ]; then
+  message "not configured."
+  exit 0
+fi
+
+echo 0 > $SYSFS$ccwgroup/$CCWGROUP_ID/online
+echo 1 > $SYSFS$ccwgroup/$CCWGROUP_ID/ungroup
+message "ok."
+exit 0
+

Added: people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/hwdown-ccw-zfcp
==============================================================================
--- (empty file)
+++ people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/hwdown-ccw-zfcp	Fri Jul  4 10:49:34 2008
@@ -0,0 +1,19 @@
+#!/bin/bash
+set -e
+
+usage () {
+  echo "Usage: $SCRIPTNAME [OPTION]... ID"
+}
+
+. ${SYSCONFIG:=/etc/sysconfig}/scripts/hardware/functions
+
+ID=$1
+
+check_bus ccw
+check_devpath /bus/ccw/devices/$ID
+read_config ccw $ID
+
+message_n "Deconfiguring device $ID: "
+echo 0 > $SYSFS$DEVPATH/online
+message "ok."
+

Added: people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/hwup
==============================================================================
--- (empty file)
+++ people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/hwup	Fri Jul  4 10:49:34 2008
@@ -0,0 +1,37 @@
+#!/bin/bash
+set -e
+
+usage () {
+  echo "Usage: $SCRIPTNAME [OPTION]... BUS ID"
+}
+
+. ${SYSCONFIG:=/etc/sysconfig}/scripts/hardware/functions
+
+BUS=$1
+ID=$2
+
+check_bus $BUS
+check_devpath /bus/$BUS/devices/$ID
+read_config $BUS $ID
+
+case "${STARTMODE:-auto}:$MODE" in
+  auto:auto|*:auto-override)
+  # Start auto devices in auto and override mode.
+  ;;
+  *:auto)
+  # Don't display any message if device is not auto in auto mode.
+  exit 0
+  ;;
+  auto:manual|manual:manual)
+  # Start manual devices in manual mode.
+  ;;
+  off:manual)
+  message "$SCRIPTNAME: used configuration has STARTMODE=$STARTMODE."
+  exit 0;
+  ;;
+  *)
+  message "$SCRIPTNAME: unknown STARTMODE=$STARTMODE."
+  exit $R_ERROR
+esac
+
+source $COMMAND-$BUS $ID $DEVPATH

Added: people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/hwup-ccw
==============================================================================
--- (empty file)
+++ people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/hwup-ccw	Fri Jul  4 10:49:34 2008
@@ -0,0 +1,74 @@
+#!/bin/bash
+set -e
+
+usage () {
+  echo "Usage: $SCRIPTNAME [OPTION]... ID"
+}
+
+. ${SYSCONFIG:=/etc/sysconfig}/scripts/hardware/functions
+
+ID=$1
+
+check_bus ccw
+check_devpath /bus/ccw/devices/$ID
+check_config ccw $ID
+
+read cutype < $SYSFS$DEVPATH/cutype
+read devtype < $SYSFS$DEVPATH/devtype
+
+case "$cutype" in
+  1731/01|1731/05)
+  name="qeth"
+  driver="qeth"
+  ;;
+  1731/03)
+  case "$devtype" in
+    1732/03|1732/04)
+    name="zfcp"
+    ;;
+  esac
+  ;;
+  3088/01)
+  error "p390 not supported"
+  ;;
+  3088/08|3088/1f)
+  name="cu3088"
+  driver="ctc"
+  ;;
+  3088/1e)
+  error "ficon not supported"
+  ;;
+  3088/60)
+  error "lcs not supported"
+  ;;
+  3480/*|3490/*)
+  error "tape not supported"
+  ;;
+  3990/*|2105/*|9343/*|2107/*|1750/*)
+  name="dasd-eckd"
+  ;;
+  6310/*)
+  name="dasd-fba"
+  ;;
+  3880/*)
+  case "$devtype" in
+    3370/*)
+    name="dasd-fba"
+    ;;
+    3390/*)
+    name="dasd-eckd"
+    ;;
+  esac
+  ;;
+esac
+
+[ -z "$name" ] && error "Invalid device type (cu ${cutype} dev ${devtype}"
+
+if [ "$name" = cu3088 ] || [ "$name" = qeth ]; then
+  source $COMMAND-ccw-group "$ID" "$name" "$driver"
+elif [ "$name" = zfcp ]; then
+  source $COMMAND-ccw-zfcp "$ID"
+elif [ "$name" = dasd-eckd ] || [ "$name" = dasd-fba ]; then
+  source $COMMAND-ccw-dasd "$ID"
+fi
+

Added: people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/hwup-ccw-dasd
==============================================================================
--- (empty file)
+++ people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/hwup-ccw-dasd	Fri Jul  4 10:49:34 2008
@@ -0,0 +1,24 @@
+#!/bin/bash
+set -e
+
+usage () {
+  echo "Usage: $SCRIPTNAME [OPTION]... ID"
+}
+
+. ${SYSCONFIG:=/etc/sysconfig}/scripts/hardware/functions
+
+ID=$1
+
+check_bus ccw
+check_devpath /bus/ccw/devices/$ID
+read_config ccw $ID
+
+message_n "Configuring device $ID: "
+read _online < $SYSFS$DEVPATH/online
+if test "$_online" -eq "1" ; then
+  message "already online."
+else
+  echo 1 > $SYSFS$DEVPATH/online
+  message "ok. "
+fi
+

Added: people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/hwup-ccw-group
==============================================================================
--- (empty file)
+++ people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/hwup-ccw-group	Fri Jul  4 10:49:34 2008
@@ -0,0 +1,93 @@
+#!/bin/bash
+set -e
+
+usage () {
+  echo "Usage: $SCRIPTNAME [OPTION]... ID NAME DRIVER"
+}
+
+. ${SYSCONFIG:=/etc/sysconfig}/scripts/hardware/functions
+
+ID=$1
+NAME=$2
+DRIVER=$3
+
+check_bus ccw
+check_devpath /bus/ccw/devices/$ID
+read_config ccw $ID
+
+CCWGROUP_ID=$CCWGROUP_CHANS
+
+ccw=/bus/ccw/drivers/$NAME
+ccwgroup=/bus/ccwgroup/drivers/$DRIVER
+
+message_n "Configuring device $ID: "
+if test -d "$SYSFS$ccwgroup/$CCWGROUP_ID" ; then
+  message_n "already configured. "
+else
+  [ -d $SYSFS/modules/$DRIVER ] || modprobe $DRIVER
+
+  # Check whether all channels for this device are accessible
+  num=0
+  for id in "${CCWGROUP_CHANS[@]}"; do
+    if ! [ -d "$SYSFS${ccw}/${id}" ]; then
+      list=
+      break;
+    fi
+    list="${list:+${list},}${id}"
+  done
+
+  # Configure the channel group
+  # Note that the non-existence of channels is not a failure;
+  # if we were called during start-up it might well be that
+  # not all channels are available yet.
+  if test -z "$list" ; then
+    message "not (yet) available!"
+    exit 0
+  else
+    echo $list > $SYSFS$ccwgroup/group
+    message_n "ok. "
+  fi
+fi
+
+read _online < $SYSFS$ccwgroup/$CCWGROUP_ID/online
+if test "$_online" -eq "1" ; then
+  message "already online."
+  exit 0
+fi
+
+write_option () {
+  option="$1"
+  shift
+  found=
+  for i in "$@"; do
+    [ "$option" = "$i" ] && found=1
+  done
+  if test $found; then
+    message_n "($option) "
+    echo 1 > $SYSFS$ccwgroup/$CCWGROUP_ID/$option
+  else
+    echo 0 > $SYSFS$ccwgroup/$CCWGROUP_ID/$option
+  fi
+}
+
+write_setting () {
+  if [ "$2" ]; then
+    message_n "($1 $2) "
+    echo "$2" > $SYSFS$ccwgroup/$CCWGROUP_ID/$1
+  fi
+}
+
+if [ "$DRIVER" = ctc ]; then
+  write_setting "buffer" "$CTC_BUFFER"
+  write_setting "protocol" "$CTC_PROTOCOL"
+elif [ "$DRIVER" = qeth ]; then
+  write_setting "portname" "$QETH_PORTNAME"
+  write_setting "portno" "$QETH_PORTNO"
+  write_option "fake_broadcast" "${QETH_OPTIONS[@]}"
+  write_option "fake_ll" "${QETH_OPTIONS[@]}"
+  write_option "layer2" "${QETH_OPTIONS[@]}"
+fi
+
+echo 1 > $SYSFS$ccwgroup/$CCWGROUP_ID/online
+message "ok."
+

Added: people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/hwup-ccw-zfcp
==============================================================================
--- (empty file)
+++ people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/hwup-ccw-zfcp	Fri Jul  4 10:49:34 2008
@@ -0,0 +1,40 @@
+#!/bin/bash
+set -e
+
+usage () {
+  echo "Usage: $SCRIPTNAME [OPTION]... ID"
+}
+
+. ${SYSCONFIG:=/etc/sysconfig}/scripts/hardware/functions
+
+ID=$1
+
+check_bus ccw
+check_devpath /bus/ccw/devices/$ID
+read_config ccw $ID
+
+message_n "Configuring device $ID: "
+read _online < $SYSFS$DEVPATH/online
+if [ "$_online" -ne "1" ]; then
+  echo 1 > $SYSFS$DEVPATH/online
+  message_n "online. "
+else
+  message_n "already online. "
+fi
+
+for _zfcp_dev in "${ZFCP_DEVICES[@]}"; do
+  _zfcp_wwpn=$(echo $_zfcp_dev | sed -e 's,:.*,,')
+  _zfcp_lun=$(echo $_zfcp_dev | sed -e 's,.*:,,')
+
+  if [ ! -d "$SYSFS$DEVPATH/$_zfcp_wwpn" ]; then
+    message_n "wwpn $_zfcp_wwpn "
+    echo "$_zfcp_wwpn" > $SYSFS$DEVPATH/port_add
+  fi
+  if [ ! -d "$SYSFS$DEVPATH/$_zfcp_wwpn/$_zfcp_lun" ] ; then
+    message_n "device $_zfcp_wwpn:$_zfcp_lun "
+    echo "$_zfcp_lun" > $SYSFS$DEVPATH/$_zfcp_wwpn/unit_add
+  fi
+done
+
+message "ok."
+

Added: people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/ifupdown-mapping
==============================================================================
--- (empty file)
+++ people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/ifupdown-mapping	Fri Jul  4 10:49:34 2008
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+IFACE="$1"
+
+[ -d /sys/class/net/$IFACE/ ] || exit 1
+
+ID=$(readlink /sys/class/net/$IFACE/device | sed -e 's,.*/,,')
+BUS=$(readlink /sys/class/net/$IFACE/device/bus | sed -e 's,.*/,,')
+
+[ $BUS = "ccwgroup" ] && BUS=ccw
+
+echo "$BUS-$ID"

Added: people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/udev-net
==============================================================================
--- (empty file)
+++ people/waldi/s390/sysconfig/etc/sysconfig/scripts/hardware/udev-net	Fri Jul  4 10:49:34 2008
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+usage () {
+  echo "Usage: $SCRIPTNAME [OPTION]... DEVPATH"
+}
+
+. ${SYSCONFIG:=/etc/sysconfig}/scripts/hardware/functions
+
+DEVPATH=$1
+ID=$(echo /sys/$DEVPATH | sed -e 's,.*/,,')
+BUS=$(readlink /sys/$DEVPATH/bus | sed -e 's,.*/,,')
+
+[ $BUS = "ccwgroup" ] && BUS=ccw
+
+read_config $BUS $ID
+
+if [ "$INTERFACE_NAME" ]; then
+  echo "INTERFACE_NAME='$INTERFACE_NAME'"
+fi
+

Added: people/waldi/s390/sysconfig/etc/udev/sysconfig-hardware.rules
==============================================================================
--- (empty file)
+++ people/waldi/s390/sysconfig/etc/udev/sysconfig-hardware.rules	Fri Jul  4 10:49:34 2008
@@ -0,0 +1,4 @@
+SUBSYSTEM=="ccw", WAIT_FOR_SYSFS="online"
+RUN+="/sbin/hwup -A -D $DEVPATH $env{SUBSYSTEM} %b"
+SUBSYSTEM=="net", IMPORT{program}="/etc/sysconfig/scripts/hardware/udev-net $env{PHYSDEVPATH}"
+ACTION=="add", SUBSYSTEM=="net", ENV{INTERFACE_NAME}=="?*", NAME="$env{INTERFACE_NAME}"

Added: people/waldi/s390/sysconfig/man/hwdown.8
==============================================================================
--- (empty file)
+++ people/waldi/s390/sysconfig/man/hwdown.8	Fri Jul  4 10:49:34 2008
@@ -0,0 +1 @@
+link hwup.8
\ No newline at end of file

Added: people/waldi/s390/sysconfig/man/hwup.8
==============================================================================
--- (empty file)
+++ people/waldi/s390/sysconfig/man/hwup.8	Fri Jul  4 10:49:34 2008
@@ -0,0 +1,12 @@
+.TH HWUP "8" "January 2006" "sysconfig" "Hardware configuration"
+.SH NAME
+hwup \- Configure a hardware device
+.br
+hwdown \- Deconfigure a hardware device
+.SH SYNOPSIS
+.B hw{up,down}
+[\fIOPTION\fR]... \fIBUS ID \fR[\fIDEVPATH\fR]
+.SH DESCRIPTION
+.TP
+\fB\-A\fR
+Automatic mode, used by udev

Added: people/waldi/s390/sysconfig/sbin/hwdown
==============================================================================
--- (empty file)
+++ people/waldi/s390/sysconfig/sbin/hwdown	Fri Jul  4 10:49:34 2008
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec /etc/sysconfig/scripts/hardware/hwdown "$@"

Added: people/waldi/s390/sysconfig/sbin/hwup
==============================================================================
--- (empty file)
+++ people/waldi/s390/sysconfig/sbin/hwup	Fri Jul  4 10:49:34 2008
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec /etc/sysconfig/scripts/hardware/hwup "$@"

Added: people/waldi/s390/sysconfig/usr/share/initramfs-tools/scripts/init-premount/sysconfig_hardware
==============================================================================
--- (empty file)
+++ people/waldi/s390/sysconfig/usr/share/initramfs-tools/scripts/init-premount/sysconfig_hardware	Fri Jul  4 10:49:34 2008
@@ -0,0 +1,89 @@
+#!/bin/sh
+
+case $1 in
+  prereqs)
+  echo "udev" 
+  exit 0
+  ;;
+esac
+
+case $ROOT in
+  /dev/disk/by-path/*)
+  enable="${ROOT#/dev/disk/by-path/}"
+  ;;
+esac
+
+for x in $(cat /proc/cmdline); do
+  case $x in
+    enable=*)
+    enable="$enable ${x#enable=}"
+    ;;
+  esac
+done
+
+SYSFS=/sys
+
+for dev in $enable; do
+  OLDIFS="$IFS"
+  IFS="-"
+  set -- $dev
+  IFS="$OLDIFS"
+
+  [ "$1" = ccw ] || exit 0
+
+  ID="$2"
+  DEVPATH="/bus/ccw/devices/$ID"
+
+  read cutype < $SYSFS$DEVPATH/cutype
+  read devtype < $SYSFS$DEVPATH/devtype
+
+  case "$cutype" in
+    1731/03)
+    case "$devtype" in
+      1732/03|1732/04)
+      name="zfcp"
+      ;;
+    esac
+    ;;
+    3990/*|2105/*|9343/*|2107/*|1750/*)
+    name="dasd-eckd"
+    ;;
+    6310/*)
+    name="dasd-fba"
+    ;;
+    3880/*)
+    case "$devtype" in
+      3370/*)
+      name="dasd-fba"
+      ;;
+      3390/*)
+      name="dasd-eckd"
+      ;;
+    esac
+    ;;
+  esac
+
+  if [ -z "$name" ]; then
+    echo "Invalid device type (cu ${cutype} dev ${devtype}"
+    exit 1
+  fi
+
+  read _online < $SYSFS$DEVPATH/online
+  if [ "$_online" -ne "1" ]; then
+    echo 1 > $SYSFS$DEVPATH/online
+  fi
+
+  if [ "$name" = zfcp ]; then
+    _zfcp_dev="$4"
+    _zfcp_wwpn=$(echo $_zfcp_dev | sed -e 's,:.*,,')
+    _zfcp_lun=$(echo $_zfcp_dev | sed -e 's,.*:,,')
+
+    if [ ! -d "$SYSFS$DEVPATH/$_zfcp_wwpn" ]; then
+      echo "$_zfcp_wwpn" > $SYSFS$DEVPATH/port_add
+    fi
+    if [ ! -d "$SYSFS$DEVPATH/$_zfcp_wwpn/$_zfcp_lun" ] ; then
+      echo "$_zfcp_lun" > $SYSFS$DEVPATH/$_zfcp_wwpn/unit_add
+    fi
+  fi
+done
+

Added: people/waldi/s390/sysconfig/usr/share/sysconfig/chandev-convert
==============================================================================
--- (empty file)
+++ people/waldi/s390/sysconfig/usr/share/sysconfig/chandev-convert	Fri Jul  4 10:49:34 2008
@@ -0,0 +1,85 @@
+#!/bin/bash
+
+SCRIPTNAME=${0##*/}
+
+CHANDEV_CONF=/etc/chandev.conf
+OUTPUT_DIR=
+
+while getopts ":c:ho:" OPT; do
+  case "$OPT" in
+    c)
+    CHANDEV_CONF="$OPTARG"
+    ;;
+    h)
+    usage
+    exit $R_SUCCESS
+    ;;
+    o)
+    OUTPUT_DIR="$OPTARG"
+    ;;
+    :)
+    echo "$SCRIPTNAME: option requires an argument -- $OPTARG" >&2
+    echo "Try: \`$SCRIPTNAME -h' for mor information." >&2
+    exit $R_USAGE
+    ;;
+    ?)
+    echo "$SCRIPTNAME: illegal option -- $OPTARG" >&2
+    echo "Try: \`$SCRIPTNAME -h' for mor information." >&2
+    exit $R_USAGE
+  esac
+done
+
+fix_dev () {
+  dev=$(echo $1 | tr "[A-F]" "[a-f]")
+  dev=0.0.${dev#0x}
+  echo $dev
+}
+
+orig_IFS="$IFS"
+
+devices=()
+params=()
+
+while read in; do
+  [ -z "$in" ] && continue
+  [ "${in#\#}" != "$in" ] && continue
+  IFS=,
+  set -- $in
+  IFS="$orig_IFS"
+  echo got input: $@
+  if [ "$1" = "auto" -o "$1" = "noauto" ]; then
+    true
+  elif [ "$1" = "add_parms" ]; then
+    true
+  elif [ "${1#ctc}" != "$1" ]; then
+    read_dev=$2
+    write_dev=$3
+    protocol=$6
+    echo got ctc: $read_dev $write_dev, protocol: $protocol
+    devices+=("ctc $read_dev $write_dev $protocol")
+  elif [ "${1#qeth}" != "$1" ]; then
+    read_dev=$2
+    write_dev=$3
+    data_dev=$4
+    port=$6
+    echo got qeth: $read_dev $write_dev $data_dev, port: $port
+    devices+=("qeth $read_dev $write_dev $data_dev $port")
+  else
+    echo "$SCRIPTNAME: got unparsable input -- $in" >&2
+    exit 1
+  fi
+done < $CHANDEV_CONF
+
+for dev in "${devices[@]}"; do
+  set -- $dev
+  if [ "$1" = ctc ]; then
+    config="config-$(fix_dev $2)"
+    dev="($(fix_dev $2) $(fix_dev $3))"
+    protocol=$4
+    echo $config:
+    echo "CCWGROUP_CHANS=$dev"
+    [ "$4" ] && echo "CTC_PROTOCOL=$protocol"
+  elif [ "$1" = qeth ]; then
+    true
+  fi
+done

Added: people/waldi/s390/sysconfig/usr/share/sysconfig/chandev.conf
==============================================================================
--- (empty file)
+++ people/waldi/s390/sysconfig/usr/share/sysconfig/chandev.conf	Fri Jul  4 10:49:34 2008
@@ -0,0 +1,10 @@
+noauto
+ctc0,0x0300,0x0301
+ctc0,0x0300,0x0301,0,0,1
+qeth0,0x0300,0x0301,0x0302
+qeth1,0x9000,0x9001,0x9002
+qeth2,0x1000,0x1001,0x1002
+#qeth2,0xA000,0xA001,0xA002
+qeth0,0xFE00,0xFE01,0xFE02
+add_parms,0x10,0x0300,0x0302,portname:FE030300,primary_router
+add_parms,0x10,0x1000,0x1002,portname:FE001000,primary_router



More information about the Kernel-svn-changes mailing list