From 4590fb37eb19d431e1a14f7823c84725e24c7cc9ba56da5524ea232a5b0696d1 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Sun, 25 Feb 2007 22:22:45 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/dmraid?expand=0&rev=2 --- boot.dmraid | 59 ++++++++++++++++++++++++++++++++++++++++++++++++ dmraid.changes | 5 ++++ dmraid.spec | 23 ++++++++++++++++--- sysconfig.dmraid | 26 +++++++++++++++++++++ 4 files changed, 110 insertions(+), 3 deletions(-) create mode 100644 boot.dmraid create mode 100644 sysconfig.dmraid diff --git a/boot.dmraid b/boot.dmraid new file mode 100644 index 0000000..5eec4be --- /dev/null +++ b/boot.dmraid @@ -0,0 +1,59 @@ +#! /bin/sh +# +# Copyright (c) 2007 SuSE GmbH Nuernberg, Germany. All rights reserved. +# +# /etc/init.d/boot.dmraid +# +### BEGIN INIT INFO +# Provides: boot.dmraid +# Required-Start: boot.device-mapper boot.udev boot.rootfsck +# Should-Start: boot.multipath boot.md boot.scsidev +# Default-Start: B +# Default-Stop: +# Description: start dmraid +### END INIT INFO + +. /etc/rc.status +. /etc/sysconfig/dmraid + +DMRAID=/sbin/dmraid +test -x $DMRAID || { echo "dmraid not installed"; + if [ "$1" = "stop" ]; then exit 0; + else exit 5; fi; } + +# udev interaction +if [ -x /sbin/udevsettle ]; then + [ -z "$DMRAID_DEVICE_TIMEOUT" ] && DMRAID_DEVICE_TIMEOUT=60 +else + DMRAID_DEVICE_TIMEOUT=0 +fi + +rc_reset + +case "$1" in + start) + # Waiting for udev to settle + if [ "$DMRAID_DEVICE_TIMEOUT" -gt 0 ] ; then + echo "Waiting for udev to settle..." + /sbin/udevsettle --timeout=$DMRAID_DEVICE_TIMEOUT + fi + echo "Activating dmraid..." + $DMRAID -ay $DMRAID_START_OPTIONS + + rc_status -v -r + ;; + stop) + $DMRAID -an $DMRAID_STOP_OPTIONS + rc_status -v + ;; + status) + rc_failed 4 + rc_status -v + ;; + *) + echo "Usage: $0 {start|stop|status}" + exit 1 + ;; +esac + +rc_exit diff --git a/dmraid.changes b/dmraid.changes index e0339e5..4cd276c 100644 --- a/dmraid.changes +++ b/dmraid.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Feb 20 14:44:36 CET 2007 - mkoenig@suse.de + +- provide boot script [#230708] + ------------------------------------------------------------------- Mon Dec 11 10:48:21 CET 2006 - mkoenig@suse.de diff --git a/dmraid.spec b/dmraid.spec index 2e4ed3d..a6ba19b 100644 --- a/dmraid.spec +++ b/dmraid.spec @@ -1,7 +1,7 @@ # # spec file for package dmraid (Version 1.0.0.rc13) # -# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine # package are under the same license as the package itself. # @@ -18,8 +18,10 @@ Group: System/Base Autoreqprov: on Summary: A Device-Mapper Software RAID Support Tool Version: 1.0.0.rc13 -Release: 10 +Release: 18 Source: ftp://people.redhat.com/heinzm/sw/dmraid/src/dmraid-%{version}.tar.bz2 +Source1: sysconfig.dmraid +Source2: boot.dmraid Patch0: dmraid_fixup_paths3.diff Patch1: dmraid-add_uuid.patch Patch2: dmraid_fixup_nvidia.diff @@ -28,6 +30,7 @@ Patch4: dmraid-1.0.0.rc13-geometry.patch Patch5: dmraid-1.0.0.rc13-jm_termination.patch Patch6: dmraid-1.0.0.rc13-fix_macro.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build +PreReq: %fillup_prereq %description This software discovers, activates, deactivates, and displays @@ -86,6 +89,16 @@ export CFLAGS="$RPM_OPT_FLAGS" make install DESTDIR=$RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT/usr/include/dmraid rm $RPM_BUILD_ROOT%{_libdir}/libdmraid.a +mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates +install -m644 %{SOURCE1} $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.dmraid +mkdir -p $RPM_BUILD_ROOT/etc/init.d +install -m744 %{SOURCE2} $RPM_BUILD_ROOT/etc/init.d/boot.dmraid + +%post +%{fillup_only} + +%postun +%{insserv_cleanup} %clean [ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] \ @@ -97,8 +110,12 @@ rm $RPM_BUILD_ROOT%{_libdir}/libdmraid.a /sbin/dmraid %{_mandir}/man8/* %doc LICENSE LICENSE_GPL LICENSE_LGPL README TODO doc/* +/var/adm/fillup-templates/sysconfig.dmraid +/etc/init.d/boot.dmraid -%changelog -n dmraid +%changelog +* Tue Feb 20 2007 - mkoenig@suse.de +- provide boot script [#230708] * Mon Dec 11 2006 - mkoenig@suse.de - fix jm name string termination problem [#223843] patch: dmraid-1.0.0.rc13-jm_termination.patch diff --git a/sysconfig.dmraid b/sysconfig.dmraid new file mode 100644 index 0000000..f6973ab --- /dev/null +++ b/sysconfig.dmraid @@ -0,0 +1,26 @@ +## Path: System/File systems/dmraid +## Description: dmraid configuration +# +## Type: integer(0:) +## Default: 60 +# +# Timeout for udev device detection. This is the upper limit which the +# boot script will wait for udev to finish hotplug event processing. +# If not all devices are detected during boot this value should be +# increased. Setting this to '0' disables waiting for udev. +# +DMRAID_DEVICE_TIMEOUT="60" + +## Type: string +## Default: "" +# +# Commandline options for dmraid on start +# +DMRAID_START_OPTIONS="" + +## Type: string +## Default: "" +# +# Commandline options for dmraid on stop +# +DMRAID_STOP_OPTIONS=""