Accepting request 417350 from Base:System

1

OBS-URL: https://build.opensuse.org/request/show/417350
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/hdparm?expand=0&rev=68
This commit is contained in:
Dominique Leuenberger 2016-08-12 13:37:37 +00:00 committed by Git OBS Bridge
commit d36eab8f84
5 changed files with 11 additions and 126 deletions

View File

@ -1,2 +0,0 @@
# start idedma script for each added IDE device
ACTION=="add", SUBSYSTEM=="block", KERNEL=="hd*[!0-9]", RUN+="/usr/lib/udev/idedma.sh $env{DEVNAME}"

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Thu Aug 4 13:44:34 UTC 2016 - kstreitova@suse.com
- remove 56-idedma.rules and idedma.sh as none of these scripts
have any function whatsoever. They rely on the obsolete IDE
drivers [bsc#991898]
- remove /etc/sysconfig/ide file [bsc#922659]
-------------------------------------------------------------------
Mon Jun 22 12:17:05 UTC 2015 - kstreitova@suse.com

View File

@ -1,7 +1,7 @@
#
# spec file for package hdparm
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -16,8 +16,6 @@
#
%{!?_udevdir: %global _udevdir %(pkg-config --variable=udevdir udev) }
%{!?_udevrulesdir: %global _udevrulesdir %(pkg-config --variable=udevdir udev)/rules.d }
Name: hdparm
Version: 9.48
Release: 0
@ -26,16 +24,13 @@ License: SUSE-Permissive
Group: Hardware/Other
Url: http://sourceforge.net/projects/hdparm/
Source: http://downloads.sf.net/hdparm/%{name}-%{version}.tar.gz
Source1: 56-idedma.rules
Source2: sysconfig.ide
Source3: udev.idedma.sh
Patch1: hdparm-nostrip.patch
Patch2: hdparm-wiper-warn.patch
Patch3: hdparm-leak-fix.patch
Patch4: hdparm-9.43-fix-bashisms.patch
BuildRequires: pkgconfig
BuildRequires: pkgconfig(udev)
Requires(post): %fillup_prereq coreutils
Requires(post): coreutils
Provides: base:/sbin/hdparm
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -59,11 +54,6 @@ mkdir -p "%{buildroot}%{_mandir}/man8"
install -d "%{buildroot}/%{_sbindir}"
%make_install binprefix="%{_prefix}"
mv contrib/README contrib/README.contrib
install -d "%{buildroot}/%{_udevrulesdir}"
install -m 644 %{SOURCE1} "%{buildroot}/%{_udevrulesdir}"
install -d "%{buildroot}%{_localstatedir}/adm/fillup-templates"
install -m 644 %{SOURCE2} "%{buildroot}%{_localstatedir}/adm/fillup-templates"
install -m 755 %{SOURCE3} "%{buildroot}/%{_udevdir}/idedma.sh"
install -d "%{buildroot}%{_libexecdir}/hdparm"
install -m 755 contrib/idectl "%{buildroot}%{_libexecdir}/hdparm"
install -m 755 contrib/ultrabayd "%{buildroot}%{_libexecdir}/hdparm"
@ -74,49 +64,16 @@ ln -sf %{_sbindir}/wiper.sh "%{buildroot}/sbin"
ln -sf %{_sbindir}/hdparm "%{buildroot}/sbin"
#EndUsrMerge
%post
if [ -f etc/sysconfig/hardware ] ; then
mv etc/sysconfig/hardware etc/sysconfig/ide
fi
%{remove_and_set -n ide DEVICES_FORCE_IDE_DMA_ON DEVICES_FORCE_IDE_DMA_OFF}
%{fillup_only -n ide}
# new settings
NEW_DMA=""
# convert old settings
if [ "$DEVICES_FORCE_IDE_DMA_ON" != "" -a "$DEVICES_FORCE_IDE_DMA_ON" != "no" ] ; then
for dev in $DEVICES_FORCE_IDE_DMA_ON; do
NEW_DMA="${NEW_DMA:+$NEW_DMA }/dev/$dev:on"
done
fi
if [ "$DEVICES_FORCE_IDE_DMA_OFF" != "" -a "$DEVICES_FORCE_IDE_DMA_OFF" != "no" ] ; then
for dev in $DEVICES_FORCE_IDE_DMA_OFF; do
NEW_DMA="${NEW_DMA:+$NEW_DMA }/dev/$dev:off"
done
fi
# update sysconfig file
if [ "$NEW_DMA" != "" ] ; then
echo "Updating etc/sysconfig/ide"
# remove old values, update new variable
sed -e "s|^DEVICES_FORCE_IDE_DMA=\"\\(.*\\)\"|DEVICES_FORCE_IDE_DMA=\"$NEW_DMA \\1\"|" \
etc/sysconfig/ide > etc/sysconfig/ide.new \
&& mv etc/sysconfig/ide.new etc/sysconfig/ide
rm -f etc/sysconfig/ide.new
fi
%{?udev_rules_update:%udev_rules_update}
%files
%defattr(-,root,root)
%doc Changelog README.acoustic contrib/README.contrib README.wiper
%{_mandir}/man8/hdparm.8.gz
%{_mandir}/man8/hdparm.8%{ext_man}
#UsrMerge
/sbin/hdparm
/sbin/wiper.sh
#EndUserMerge
%{_sbindir}/hdparm
%{_sbindir}/wiper.sh
%{_udevdir}/idedma.sh
%{_udevrulesdir}/56-idedma.rules
%{_libexecdir}/hdparm
%{_localstatedir}/adm/fillup-templates/sysconfig.ide
%changelog

View File

@ -1,12 +0,0 @@
## Path: Hardware/IDE
## Description: IDE device settings
## Type: string
## Default: ""
#
# Force DMA mode for selected device. Use pairs <device>:<dma_mode> separated
# by space - dma_mode can be "on" (enable default DMA mode), "off" (disable DMA
# mode) or any mode supported by hdparm (e.g. "mdma2", "udma5", ...)
# Example: "/dev/hdc:off /dev/hdd:udma2"
#
DEVICES_FORCE_IDE_DMA=""

View File

@ -1,66 +0,0 @@
#! /bin/sh
# Copyright (c) 2005 SUSE LINUX Products GmbH, Nuernberg, Germany
#
# Author: Ladislav Slezak <lslezak@suse.cz>
#
# System script for enabling/disabling IDE DMA mode
#
# The script takes the first command line parameter and sets the configured DMA
# mode up. If the device is not configured in DEVICES_FORCE_IDE_DMA variable DMA
# status is not changed.
#
HDPARM=/usr/sbin/hdparm
test -x $HDPARM || exit 5
# read values from sysconfig
. /etc/sysconfig/ide
if [ "$DEVICES_FORCE_IDE_DMA" = "" -o $1 = "" ] ; then
exit 0;
fi
OLDIFS=$IFS
for dev in $DEVICES_FORCE_IDE_DMA ; do
# Get device and DMA mode
MODE=""
DEVICE=""
OPTIONS=""
FIRST=0
# The setting e.g. "/dev/hda:69:-c1:-m16:-u1:-W1:-A1" should be
# expanded as "hdparm -d 1 -X 69 -c1 -m16 -u1 -W1 -A1 /dev/hda"
IFS=":"
for d in $dev ; do
case $FIRST in
0) DEVICE=$d ;;
1) MODE=$d ;;
*) OPTIONS="$OPTIONS$d:"
esac
FIRST=$((FIRST + 1))
done
unset d
if [ "$DEVICE" = "$1" ] ; then
echo "$DEVICE: setting up IDE DMA mode $MODE"
# Set DMA mode by hdparm utility
if [ -z "$MODE" ] ; then
echo "Missing DMA mode for device $DEVICE"
elif [ $MODE = "off" ] ; then
$HDPARM -d 0 "$DEVICE"
elif [ $MODE = "on" ] ; then
$HDPARM -d 1 "$DEVICE"
else
$HDPARM -d 1 -X "$MODE" ${OPTIONS:+$OPTIONS} "$DEVICE"
fi
fi
# Reset Internal Field Separator for the outer loop
IFS=$OLDIFS
done
unset dev