code:
<?xml version="1.0" encoding="UTF-8"?>

<deviceinfo version="0.2">
    <device>
        <match key="volume.fstype" string="ntfs">
            <append key="volume.fstype.alternative" type="copy_property">volume.fstype</append>
            <merge key="volume.mount.ntfs.valid_options" type="copy_property">volume.mount.valid_options</merge>
            <merge key="volume.unmount.ntfs.valid_options" type="copy_property">volume.unmount.valid_options</merge>
            <merge key="volume.fstype" type="string">ntfs-3g</merge>
            <merge key="volume.mount.valid_options" type="strlist">ro</merge>
            <append key="volume.mount.valid_options" type="strlist">atime</append>
            <append key="volume.mount.valid_options" type="strlist">noatime</append>
            <append key="volume.mount.valid_options" type="strlist">relatime</append>
            <append key="volume.mount.valid_options" type="strlist">fake_rw</append>
            <append key="volume.mount.valid_options" type="strlist">no_def_opts</append>
            <append key="volume.mount.valid_options" type="strlist">default_permissions</append>
            <append key="volume.mount.valid_options" type="strlist">umask=</append>
            <append key="volume.mount.valid_options" type="strlist">fmask=</append>
            <append key="volume.mount.valid_options" type="strlist">dmask=</append>
            <append key="volume.mount.valid_options" type="strlist">uid=</append>
            <append key="volume.mount.valid_options" type="strlist">gid=</append>
            <append key="volume.mount.valid_options" type="strlist">show_sys_files</append>
            <append key="volume.mount.valid_options" type="strlist">silent</append>
            <append key="volume.mount.valid_options" type="strlist">force</append>
            <append key="volume.mount.valid_options" type="strlist">remove_hiberfile</append>
            <append key="volume.mount.valid_options" type="strlist">locale=</append>
            <append key="volume.mount.valid_options" type="strlist">streams_interface=</append>
            <append key="volume.mount.valid_options" type="strlist">debug</append>
            <append key="volume.mount.valid_options" type="strlist">no_detach</append>
            <append key="volume.mount.valid_options" type="strlist">sync</append>
            <append key="volume.mount.valid_options" type="strlist">dirsync</append>
            <append key="volume.mount.valid_options" type="strlist">nodiratime</append>
            <append key="volume.mount.valid_options" type="strlist">noexec</append>
            <append key="volume.mount.valid_options" type="strlist">quiet</append>
            <append key="volume.mount.valid_options" type="strlist">remount</append>
            <append key="volume.mount.valid_options" type="strlist">exec</append>
            <append key="volume.mount.valid_options" type="strlist">recover</append>
            <append key="volume.mount.valid_options" type="strlist">norecover</append>
            <merge key="volume.unmount.valid_options" type="strlist">lazy</merge>
            <merge key="volume.policy.mount_filesystem" type="string">ntfs-3g</merge>
        </match>
    </device>
</deviceinfo>


code:
diff -Naur ntfs-3g_ntfsprogs-2015.3.14.orig/ntfsprogs/Makefile.in ntfs-3g_ntfsprogs-2015.3.14/ntfsprogs/Makefile.in
--- ntfs-3g_ntfsprogs-2015.3.14.orig/ntfsprogs/Makefile.in	2015-03-14 16:10:28.000000000 +0200
+++ ntfs-3g_ntfsprogs-2015.3.14/ntfsprogs/Makefile.in	2015-05-06 10:22:31.563526903 +0300
@@ -1348,15 +1348,15 @@
 # mkfs.ntfs[.8] hard link

 @ENABLE_NTFSPROGS_TRUE@install-exec-hook:
-@ENABLE_NTFSPROGS_TRUE@	$(INSTALL) -d $(DESTDIR)/sbin
-@ENABLE_NTFSPROGS_TRUE@	$(LN_S) -f $(sbindir)/mkntfs $(DESTDIR)/sbin/mkfs.ntfs
+@ENABLE_NTFSPROGS_TRUE@	$(INSTALL) -d $(DESTDIR)/usr/bin
+@ENABLE_NTFSPROGS_TRUE@	$(LN_S) -f $(sbindir)/mkntfs $(DESTDIR)/usr/bin/mkfs.ntfs

 @ENABLE_NTFSPROGS_TRUE@install-data-hook:
 @ENABLE_NTFSPROGS_TRUE@	$(INSTALL) -d $(DESTDIR)$(man8dir)
 @ENABLE_NTFSPROGS_TRUE@	$(LN_S) -f mkntfs.8 $(DESTDIR)$(man8dir)/mkfs.ntfs.8

 @ENABLE_NTFSPROGS_TRUE@uninstall-local:
-@ENABLE_NTFSPROGS_TRUE@	$(RM) -f $(DESTDIR)/sbin/mkfs.ntfs
+@ENABLE_NTFSPROGS_TRUE@	$(RM) -f $(DESTDIR)/usr/bin/mkfs.ntfs
 @ENABLE_NTFSPROGS_TRUE@	$(RM) -f $(DESTDIR)$(man8dir)/mkfs.ntfs.8

 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff -Naur ntfs-3g_ntfsprogs-2015.3.14.orig/src/Makefile.in ntfs-3g_ntfsprogs-2015.3.14/src/Makefile.in
--- ntfs-3g_ntfsprogs-2015.3.14.orig/src/Makefile.in	2015-03-14 16:10:28.000000000 +0200
+++ ntfs-3g_ntfsprogs-2015.3.14/src/Makefile.in	2015-05-06 10:22:31.566526903 +0300
@@ -1040,9 +1040,9 @@
 @ENABLE_NTFS_3G_TRUE@@RUN_LDCONFIG_TRUE@	$(LDCONFIG)

 @ENABLE_MOUNT_HELPER_TRUE@@ENABLE_NTFS_3G_TRUE@install-exec-local:	install-rootbinPROGRAMS
-@ENABLE_MOUNT_HELPER_TRUE@@ENABLE_NTFS_3G_TRUE@	$(MKDIR_P) "$(DESTDIR)/sbin"
-@ENABLE_MOUNT_HELPER_TRUE@@ENABLE_NTFS_3G_TRUE@	$(LN_S) -f "$(rootbindir)/ntfs-3g" "$(DESTDIR)/sbin/mount.ntfs-3g"
-@ENABLE_MOUNT_HELPER_TRUE@@ENABLE_NTFS_3G_TRUE@	$(LN_S) -f "$(rootbindir)/lowntfs-3g" "$(DESTDIR)/sbin/mount.lowntfs-3g"
+@ENABLE_MOUNT_HELPER_TRUE@@ENABLE_NTFS_3G_TRUE@	$(MKDIR_P) "$(DESTDIR)/usr/bin"
+@ENABLE_MOUNT_HELPER_TRUE@@ENABLE_NTFS_3G_TRUE@	$(LN_S) -f "$(rootbindir)/ntfs-3g" "$(DESTDIR)/usr/bin/mount.ntfs-3g"
+@ENABLE_MOUNT_HELPER_TRUE@@ENABLE_NTFS_3G_TRUE@	$(LN_S) -f "$(rootbindir)/lowntfs-3g" "$(DESTDIR)/usr/bin/mount.lowntfs-3g"

 @ENABLE_NTFS_3G_TRUE@install-data-local:	install-man8
 @ENABLE_NTFS_3G_TRUE@	$(LN_S) -f ntfs-3g.8 "$(DESTDIR)$(man8dir)/mount.ntfs-3g.8"
@@ -1050,7 +1050,7 @@

 @ENABLE_NTFS_3G_TRUE@uninstall-local:
 @ENABLE_NTFS_3G_TRUE@	$(RM) -f "$(DESTDIR)$(man8dir)/mount.ntfs-3g.8"
-@ENABLE_MOUNT_HELPER_TRUE@@ENABLE_NTFS_3G_TRUE@	$(RM) -f "$(DESTDIR)/sbin/mount.ntfs-3g" "$(DESTDIR)/sbin/mount.lowntfs-3g"
+@ENABLE_MOUNT_HELPER_TRUE@@ENABLE_NTFS_3G_TRUE@	$(RM) -f "$(DESTDIR)/usr/bin/mount.ntfs-3g" "$(DESTDIR)/sbin/mount.lowntfs-3g"

 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.

repo_name: ayhanyalcinsoy/main


code:
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
    <Source>
        <Name>ntfs-3g</Name>
        <Homepage>http://www.tuxera.com/community/ntfs-3g-download</Homepage>
        <Packager>
            <Name>PisiLinux Community</Name>
            <Email>admins@pisilinux.org</Email>
        </Packager>
        <License>GPLv2+</License>
        <License>LGPLv2+</License>
        <IsA>library</IsA>
        <IsA>app:console</IsA>
        Userspace driver for NTFS read/write support
        <Description>ntfs-3g allows regular users read/write access to NTFS filesystems.</Description>
        <Archive sha1sum="160a836274c38d92e5c3a55256f404c8dd8f3cc1" type="targz">https://tuxera.com/opensource/ntfs-3g_ntfsprogs-2017.3.23.tgz</Archive>
        <BuildDependencies>
            <Dependency>fuse-devel</Dependency>
            <Dependency>libutil-linux-devel</Dependency>
        </BuildDependencies>

    </Source>

    <Package>
        <Name>ntfs-3g</Name>
        <RuntimeDependencies>
            <Dependency>fuse</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="executable">/bin</Path>
            <Path fileType="executable">/sbin</Path>
            <Path fileType="library">/lib</Path>
            <Path fileType="library">/usr/lib</Path>
            <Path fileType="header">/usr/include</Path>
            <Path fileType="library">/usr/lib/pkgconfig</Path>
            <Path fileType="data">/usr/share/hal/fdi</Path>
            <Path fileType="doc">/usr/share/doc/ntfs-3g</Path>
            <Path fileType="man">/usr/share/man/man8/mount*</Path>
            <Path fileType="man">/usr/share/man/man8/ntfs-3g*</Path>
        </Files>

    </Package>

    <Package>
        <Name>ntfsprogs</Name>
        <PartOf>hardware.disk</PartOf>
        Userspace tools for NTFS filesystems
        <Description>Userspace tools for NTFS filesystems. The goals of the Linux-NTFS project are to develop reliable and full-featured access to NTFS by the Linux kernel driver and to provide a wide collection of NTFS utilities.</Description>
        <RuntimeDependencies>
            <Dependency version="current">ntfs-3g</Dependency>
            <Dependency>fuse</Dependency>
            <Dependency>libutil-linux</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="executable">/sbin/mkfs.ntfs</Path>
            <Path fileType="executable">/usr/bin</Path>
            <Path fileType="executable">/usr/sbin</Path>
            <Path fileType="doc">/usr/share/doc/ntfsprogs</Path>
            <Path fileType="man">/usr/share/man/man8</Path>
        </Files>
    </Package>

    <History>
        <Update release="5">
            <Date>2017-09-20</Date>
            <Version>2017.3.23</Version>
            <Comment>Version bump.</Comment>
            <Name>Mustafa Cinasal</Name>
            <Email>muscnsl@gmail.com</Email>
        </Update>
        <Update release="4">
            <Date>2017-09-20</Date>
            <Version>2016.2.22</Version>
            <Comment>Version bump.</Comment>
            <Name>Ertuğrul Erata</Name>
            <Email>ertugrulerata@gmail.com</Email>
        </Update>
        <Update release="3">
            <Date>2016-06-27</Date>
            <Version>2016.2.22</Version>
            <Comment>Version Bump</Comment>
            <Name>Pisi Linux Community</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="2">
            <Date>2016-06-09</Date>
            <Version>2015.3.14</Version>
            <Comment>Release Bump</Comment>
            <Name>Pisi Linux Community</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="1">
            <Date>2016-01-30</Date>
            <Version>2015.3.14</Version>
            <Comment>First release</Comment>
            <Name>Ertuğrul Erata</Name>
            <Email>ertugrulerata@gmail.com</Email>
        </Update>
    </History>
</PISI>


code:
<?xml version="1.0" ?>
<PISI>
    <Source>
        <Name>ntfs-3g</Name>
        NTFS dosya sistemlerine okuma/yazma erişimi için bir sürücü
        <Description xml:lang="tr">ntfs-3g kullanıcıların NTFS biçimli disk bölümlerine hem okuma hem yazma erişimi yapabilmesine imkan veren bir sürücüdür.</Description>
    </Source>

    <Package>
        <Name>ntfsprogs</Name>
        NTFS dosya sistemi için kullanıcı araçları
        <Description xml:lang="tr">NTFS dosya sistemi için kullanıcı araçları içerir. Bu araçların amacı Linux çekirdeğine NTFS dosya sistemlerine güvenilir ve tam erişim sağlayacak NTFS araçlarını sağlamaktır.</Description>
    </Package>
</PISI>


code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU General Public License, version 3.
# See the file http://www.gnu.org/licenses/gpl.txt

from pisi.actionsapi import autotools
from pisi.actionsapi import pisitools
from pisi.actionsapi import libtools
from pisi.actionsapi import shelltools
from pisi.actionsapi import get

def setup():
    pisitools.flags.add("-Wno-unused-but-set-variable")
    autotools.autoreconf()
    autotools.autoconf()

    autotools.configure("--disable-static \
                         --disable-gcc-warnings")
    pisitools.dosed("libtool", " -shared ", " -Wl,-O1,--as-needed -shared ")
    pisitools.dosed("libtool", "^(runpath_var=)LD_RUN_PATH", "\\1DIE_RPATH_DIE")

def build():
    autotools.make("V=1")

def install():
    autotools.rawInstall("DESTDIR=%s" % get.installDIR())
    pisitools.dodoc("AUTHORS", "BUGS", "ChangeLog", "NEWS", "README", "THANKS", "TODO")
    pisitools.dodoc("doc/API", "doc/USER.jp", "doc/FAT")


code:
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
    <Source>
        <Name>parted</Name>
        <Homepage>http://www.gnu.org/software/parted</Homepage>
        <Packager>
            <Name>PisiLinux Community</Name>
            <Email>admins@pisilinux.org</Email>
        </Packager>
        <License>GPLv3+</License>
        <IsA>app:console</IsA>
        Create, destroy, resize, check, copy partitions and file systems
        <Description>The GNU Parted program allows you to create, destroy, resize, move, and copy hard disk partitions. Parted can be used for creating space for new operating systems, reorganizing disk usage, and copying data to new hard disks.</Description>
        <Archive sha1sum="78db6ca8dd6082c5367c8446bf6f7ae044091959" type="tarxz">http://ftp.gnu.org.ua/gnu/parted/parted-3.2.tar.xz</Archive>
        <BuildDependencies>
            <Dependency>libutil-linux-devel</Dependency>
            <Dependency>device-mapper-devel</Dependency>
            <Dependency>readline-devel</Dependency>
        </BuildDependencies>
        <Patches>

        </Patches>
    </Source>

    <Package>
        <Name>parted</Name>
        <RuntimeDependencies>
            <Dependency>libutil-linux</Dependency>
            <Dependency>ncurses</Dependency>
            <Dependency>device-mapper</Dependency>
            <Dependency>readline</Dependency>
            <Dependency>util-linux</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="library">/usr/lib</Path>
            <Path fileType="executable">/usr/sbin</Path>
            <Path fileType="doc">/usr/share/doc</Path>
            <Path fileType="info">/usr/share/info</Path>
            <Path fileType="data">/usr/share/locale</Path>
            <Path fileType="man">/usr/share/man</Path>
        </Files>
    </Package>

    <Package>
        <Name>parted-devel</Name>
        Development files for parted
        <RuntimeDependencies>
            <Dependency release="current">parted</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="header">/usr/include</Path>
            <Path fileType="data">/usr/lib/pkgconfig</Path>
        </Files>
    </Package>

    <History>
        <Update release="3">
            <Date>2017-03-21</Date>
            <Version>3.2</Version>
            <Comment>Rebuild for new toolchain.</Comment>
            <Name>Pisi Linux Community</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="2">
            <Date>2016-06-09</Date>
            <Version>3.2</Version>
            <Comment>Release Bump</Comment>
            <Name>Pisi Linux Community</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="1">
            <Date>2014-08-09</Date>
            <Version>3.2</Version>
            <Comment>First release</Comment>
            <Name>Serdar Soytetir</Name>
            <Email>kaptan@pisilinux.org</Email>
        </Update>
    </History>
</PISI>


code:
<?xml version="1.0" ?>
<PISI>
    <Source>
        <Name>parted</Name>
        GNU Parted disk bölümlerini oluşturmaya, silmeye, boyutlandırmaya, taşımaya ve kopyalamaya yarayan bir yazılımdır.
        Crée, supprime, modifie les dimensions, vérifie et copie partitions et systèmes de fichiers.
    </Source>

    <Package>
        <Name>parted-devel</Name>
        parted için geliştirme dosyaları
    </Package>
</PISI>


code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU General Public License, version 3.
# See the file http://www.gnu.org/licenses/gpl.txt

from pisi.actionsapi import autotools
from pisi.actionsapi import pisitools
from pisi.actionsapi import get

def setup():
    pisitools.flags.add("-std=gnu89")
    autotools.configure("--prefix=/usr --sbindir=/sbin")

def build():
    autotools.make()

def install():
    autotools.rawInstall("DESTDIR=%s" % get.installDIR())

    pisitools.dodoc("ChangeLog", "README")


code:
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
    <Source>
        <Name>reiserfsprogs</Name>
        <Homepage>http://www.kernel.org/</Homepage>
        <Packager>
            <Name>PisiLinux Community</Name>
            <Email>admins@pisilinux.org</Email>
        </Packager>
        <License>GPLv2</License>
        <IsA>app:console</IsA>
        <Summary>Tools to work with Reiserfs filesystems</Summary>
        <Description>Contains tools designed to create, modify and check Reiserfs filesystems.</Description>
        <!--<Archive sha1sum="bbeb832cbbd10701cc81a7a508308572095bf735" type="tarbz2">http://www.kernel.org/pub/linux/utils/fs/reiserfs/reiserfsprogs-3.6.21.tar.bz2</Archive>-->
        <Archive sha1sum="c42b82d66c6379e3b60a556e0a9eea0101ecbb53" type="tarxz">https://www.kernel.org/pub/linux/kernel/people/jeffm/reiserfsprogs/v3.6.27/reiserfsprogs-3.6.27.tar.xz</Archive>
        <BuildDependencies>
            <Dependency>libutil-linux-devel</Dependency>
            <Dependency>e2fsprogs-devel</Dependency>
            <Dependency>acl-devel</Dependency>
        </BuildDependencies>
    </Source>

    <Package>
        <Name>reiserfsprogs</Name>
        <RuntimeDependencies>
            <Dependency>e2fsprogs</Dependency>
            <Dependency>libutil-linux</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="executable">/sbin</Path>
            <Path fileType="library">/usr/lib</Path>
            <Path fileType="header">/usr/include</Path>
            <Path fileType="doc">/usr/share/doc</Path>
            <Path fileType="man">/usr/share/man</Path>
        </Files>
    </Package>

    <History>
        <Update release="5">
            <Date>2017-03-05</Date>
            <Version>3.6.27</Version>
            <Comment>Version bump</Comment>
            <Name>Mustafa Cinasal</Name>
            <Email>muscnsl@gmail.com</Email>
        </Update>
        <Update release="4">
            <Date>2017-03-05</Date>
            <Version>3.6.25</Version>
            <Comment>Rebuild</Comment>
            <Name>Stefan Gronewold(groni)</Name>
            <Email>groni@pisilinux.org</Email>
        </Update>
        <Update release="3">
            <Date>2017-01-28</Date>
            <Version>3.6.25</Version>
            <Comment>Version bump.</Comment>
            <Name>Stefan Gronewold(groni)</Name>
            <Email>groni@pisilinux.org</Email>
        </Update>
        <Update release="2">
            <Date>2016-06-09</Date>
            <Version>3.6.24</Version>
            <Comment>Release Bump</Comment>
            <Name>Pisi Linux Community</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="1">
            <Date>2014-12-13</Date>
            <Version>3.6.24</Version>
            <Comment>First release</Comment>
            <Name>Yusuf Aydemir</Name>
            <Email>yusuf.aydemir@pisilinux.org</Email>
        </Update>
    </History>
</PISI>


code:
<?xml version="1.0" ?>
<PISI>
    <Source>
        <Name>reiserfsprogs</Name>
        <Summary xml:lang="tr">Reiserfs dosya sistemleriyle çalışabilmek için gereken araçlar</Summary>
        <Description xml:lang="tr">Reiserfs dosya sistemleri oluşturmak, bu dosya sistemlerinde hata kontrolü yapmak, bu sistemlerin boyutlarını değiştirmek ve hata ayıklamak gibi görevler taşıyan araçlar.</Description>
    </Source>
</PISI>


code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU General Public License, version 3.
# See the file http://www.gnu.org/licenses/gpl.txt

from pisi.actionsapi import get
from pisi.actionsapi import autotools
from pisi.actionsapi import pisitools

def setup():
    autotools.configure("--enable-static=no")

    # Disable rpath
    pisitools.dosed("libtool", "^hardcode_libdir_flag_spec=.*", "hardcode_libdir_flag_spec=\"\"")
    pisitools.dosed("libtool", "^runpath_var=LD_RUN_PATH", "runpath_var=DIE_RPATH_DIE")

def build():
    autotools.make()

def install():
    autotools.rawInstall("DESTDIR=%s" % get.installDIR())

    pisitools.dodoc("examples/*.txt", "ChangeLog", "COVERAGE", "CREDITS", "README")


code:
#!/bin/bash
# Skript to rescan SCSI bus, using the
# scsi add-single-device mechanism
# (c) 1998--2008 Kurt Garloff <kurt@garloff.de>, GNU GPL v2 or later
# (c) 2006--2008 Hannes Reinecke, GNU GPL v2 or later
# $Id: rescan-scsi-bus.sh,v 1.29 2008/10/29 10:03:04 garloff Exp $

setcolor ()
{
  red="\e[0;31m"
  green="\e[0;32m"
  yellow="\e[0;33m"
  bold="\e[0;1m"
  norm="\e[0;0m"
}

unsetcolor ()
{
  red=""; green=""
  yellow=""; norm=""
}

# Return hosts. sysfs must be mounted
findhosts_26 ()
{
  hosts=
  if ! ls /sys/class/scsi_host/host* >/dev/null 2>&1; then
    echo "No SCSI host adapters found in sysfs"
    exit 1;
  fi
  for hostdir in /sys/class/scsi_host/host*; do
    hostno=${hostdir#/sys/class/scsi_host/host}
    if [ -f $hostdir/isp_name ] ; then
	hostname="qla2xxx"
    elif [ -f $hostdir/lpfc_drvr_version ] ; then
	hostname="lpfc"
    else
        hostname=`cat $hostdir/proc_name`
    fi
    hosts="$hosts $hostno"
    echo "Host adapter $hostno ($hostname) found."
  done
  hosts=`echo $hosts | sed 's/ /\n/g' | sort -n`
}

# Return hosts. /proc/scsi/HOSTADAPTER/? must exist
findhosts ()
{
  hosts=
  for driverdir in /proc/scsi/*; do
    driver=${driverdir#/proc/scsi/}
    if test $driver = scsi -o $driver = sg -o $driver = dummy -o $driver = device_info; then continue; fi
    for hostdir in $driverdir/*; do
      name=${hostdir#/proc/scsi/*/}
      if test $name = add_map -o $name = map -o $name = mod_parm; then continue; fi
      num=$name
      driverinfo=$driver
      if test -r $hostdir/status; then
	num=$(printf '%d\n' `sed -n 's/SCSI host number://p' $hostdir/status`)
	driverinfo="$driver:$name"
      fi
      hosts="$hosts $num"
      echo "Host adapter $num ($driverinfo) found."
    done
  done
}

# Get /proc/scsi/scsi info for device $host:$channel:$id:$lun
# Optional parameter: Number of lines after first (default = 2),
# result in SCSISTR, return code 1 means empty.
procscsiscsi ()
{
  if test -z "$1"; then LN=2; else LN=$1; fi
  CHANNEL=`printf "%02i" $channel`
  ID=`printf "%02i" $id`
  LUN=`printf "%02i" $lun`
  if [ -d /sys/class/scsi_device ]; then
      SCSIPATH="/sys/class/scsi_device/${host}:${channel}:${id}:${lun}"
      if [ -d  "$SCSIPATH" ] ; then
	  SCSISTR="Host: scsi${host} Channel: $CHANNEL Id: $ID Lun: $LUN"
	  if [ "$LN" -gt 0 ] ; then
	      IVEND=$(cat ${SCSIPATH}/device/vendor)
	      IPROD=$(cat ${SCSIPATH}/device/model)
	      IPREV=$(cat ${SCSIPATH}/device/rev)
	      SCSIDEV=$(printf '  Vendor: %-08s Model: %-16s Rev: %-4s' "$IVEND" "$IPROD" "$IPREV")
	      SCSISTR="$SCSISTR
$SCSIDEV"
	  fi
	  if [ "$LN" -gt 1 ] ; then
	      ILVL=$(cat ${SCSIPATH}/device/scsi_level)
	      type=$(cat ${SCSIPATH}/device/type)
	      case "$type" in
		  0) ITYPE="Direct-Access    " ;;
		  1) ITYPE="Sequential-Access" ;;
		  2) ITYPE="Printer          " ;;
		  3) ITYPE="Processor        " ;;
		  4) ITYPE="WORM             " ;;
		  5) ITYPE="CD-ROM           " ;;
		  6) ITYPE="Scanner          " ;;
		  7) ITYPE="Optical Device   " ;;
		  8) ITYPE="Medium Changer   " ;;
		  9) ITYPE="Communications   " ;;
		  10) ITYPE="Unknown          " ;;
		  11) ITYPE="Unknown          " ;;
		  12) ITYPE="RAID             " ;;
		  13) ITYPE="Enclosure        " ;;
		  14) ITYPE="Direct-Access-RBC" ;;
		  *) ITYPE="Unknown          " ;;
	      esac
	      SCSITMP=$(printf '  Type:   %-16s                ANSI SCSI revision: %02d' "$ITYPE" "$((ILVL - 1))")
	      SCSISTR="$SCSISTR
$SCSITMP"
	  fi

      else
	  return 1
      fi
  else
      grepstr="scsi$host Channel: $CHANNEL Id: $ID Lun: $LUN"
      SCSISTR=`cat /proc/scsi/scsi | grep -A$LN -e"$grepstr"`
  fi
  if test -z "$SCSISTR"; then return 1; else return 0; fi
}

# Find sg device with 2.6 sysfs support
sgdevice26 ()
{
  if test -e /sys/class/scsi_device/$host\:$channel\:$id\:$lun/device/generic; then
    SGDEV=`readlink /sys/class/scsi_device/$host\:$channel\:$id\:$lun/device/generic`
    SGDEV=`basename $SGDEV`
  else
    for SGDEV in /sys/class/scsi_generic/sg*; do
      DEV=`readlink $SGDEV/device`
      if test "${DEV##*/}" = "$host:$channel:$id:$lun"; then
	SGDEV=`basename $SGDEV`; return
      fi
    done
    SGDEV=""
  fi
}

# Find sg device with 2.4 report-devs extensions
sgdevice24 ()
{
  if procscsiscsi 3; then
    SGDEV=`echo "$SCSISTR" | grep 'Attached drivers:' | sed 's/^ *Attached drivers: \(sg[0-9]*\).*/\1/'`
  fi
}

# Find sg device that belongs to SCSI device $host $channel $id $lun
sgdevice ()
{
  SGDEV=
  if test -d /sys/class/scsi_device; then
    sgdevice26
  else
    DRV=`grep 'Attached drivers:' /proc/scsi/scsi 2>/dev/null`
    repdevstat=$((1-$?))
    if [ $repdevstat = 0 ]; then
      echo "scsi report-devs 1" >/proc/scsi/scsi
      DRV=`grep 'Attached drivers:' /proc/scsi/scsi 2>/dev/null`
      if [ $? = 1 ]; then return; fi
    fi
    if ! `echo $DRV | grep 'drivers: sg' >/dev/null`; then
      modprobe sg
    fi
    sgdevice24
    if [ $repdevstat = 0 ]; then
      echo "scsi report-devs 0" >/proc/scsi/scsi
    fi
  fi
}

# Test if SCSI device is still responding to commands
testonline ()
{
  : testonline
  if test ! -x /usr/bin/sg_turs; then return 0; fi
  sgdevice
  if test -z "$SGDEV"; then return 0; fi
  sg_turs /dev/$SGDEV >/dev/null 2>&1
  RC=$?
  # echo -e "\e[A\e[A\e[A${yellow}Test existence of $SGDEV = $RC ${norm} \n\n\n"
  if test $RC = 1; then return $RC; fi
  # OK, device online, compare INQUIRY string
  INQ=`sg_inq $sg_len_arg /dev/$SGDEV`
  IVEND=`echo "$INQ" | grep 'Vendor identification:' | sed 's/^[^:]*: \(.*\)$/\1/'`
  IPROD=`echo "$INQ" | grep 'Product identification:' | sed 's/^[^:]*: \(.*\)$/\1/'`
  IPREV=`echo "$INQ" | grep 'Product revision level:' | sed 's/^[^:]*: \(.*\)$/\1/'`
  STR=`printf "  Vendor: %-08s Model: %-16s Rev: %-4s" "$IVEND" "$IPROD" "$IPREV"`
  IPTYPE=`echo "$INQ" | sed -n 's/.* Device_type=\([0-9]*\) .*/\1/p'`
  IPQUAL=`echo "$INQ" | sed -n 's/ *PQual=\([0-9]*\)  Device.*/\1/p'`
  if [ "$IPQUAL" != 0 ] ; then
    echo -e "\e[A\e[A\e[A\e[A${red}$SGDEV changed: ${bold}\nLU not available (PQual $IPQUAL)${norm}\n\n\n"
    return 1
  fi

  procscsiscsi
  TMPSTR=`echo "$SCSISTR" | grep 'Vendor:'`
  if [ "$TMPSTR" != "$STR" ]; then
    echo -e "\e[A\e[A\e[A\e[A${red}$SGDEV changed: ${bold}\nfrom:${TMPSTR#* } \nto: $STR ${norm}\n\n\n"
    return 1
  fi
  TMPSTR=`echo "$SCSISTR" | sed -n 's/.*Type: *\(.*\) *ANSI.*/\1/p'`
  if [ $TMPSTR != $TYPE ] ; then
     echo -e "\e[A\e[A\e[A\e[A${red}$SGDEV changed: ${bold}\nfrom:${TMPSTR} \nto: $TYPE ${norm}\n\n\n"
     return 1
  fi
  return $RC
}

# Test if SCSI device $host $channen $id $lun exists
# Outputs description from /proc/scsi/scsi, returns SCSISTR
testexist ()
{
  : testexist
  SCSISTR=
  if procscsiscsi; then
    echo "$SCSISTR" | head -n1
    echo "$SCSISTR" | tail -n2 | pr -o4 -l1
  fi
}

# Returns the list of existing channels per host
chanlist ()
{
  local hcil
  local cil
  local chan
  local tmpchan

  for dev in /sys/class/scsi_device/${host}:* ; do
    hcil=${dev##*/}
    cil=${hcil#*:}
    chan=${cil%%:*}
    for tmpchan in $channelsearch ; do
      if test "$chan" -eq $tmpchan ; then
	chan=
      fi
    done
    if test -n "$chan" ; then
      channelsearch="$channelsearch $chan"
    fi
  done
}

# Returns the list of existing targets per host
idlist ()
{
  local hcil
  local cil
  local il
  local target
  local tmpid

  for dev in /sys/class/scsi_device/${host}:${channel}:* ; do
    hcil=${dev##*/}
    cil=${hcil#*:}
    il=${cil#*:}
    target=${il%%:*}
    for tmpid in $idsearch ; do
      if test "$target" -eq $tmpid ; then
	target=
      fi
    done
    if test -n "$target" ; then
      idsearch="$idsearch $target"
    fi
  done
}

# Returns the list of existing LUNs
getluns ()
{
  if test ! -x /usr/bin/sg_luns; then return; fi
  sgdevice
  if test -z "$SGDEV"; then return; fi
  sg_luns -d /dev/$SGDEV | sed -n 's/.*lun=\(.*\)/\1/p'
}

# Perform scan on a single lun
dolunscan()
{
  SCSISTR=
  devnr="$host $channel $id $lun"
  echo "Scanning for device $devnr ..."
  printf "${yellow}OLD: $norm"
  testexist
  : f $remove s $SCSISTR
  if test "$remove" -a "$SCSISTR"; then
    # Device exists: Test whether it's still online
    # (testonline returns 1 if it's gone or has changed)
    testonline
    if test $? = 1 -o ! -z "$forceremove"; then
      echo -en "\r\e[A\e[A\e[A${red}REM: "
      echo "$SCSISTR" | head -n1
      echo -e "${norm}\e[B\e[B"
      if test -e /sys/class/scsi_device/${host}:${channel}:${id}:${lun}/device; then
        echo 1 > /sys/class/scsi_device/${host}:${channel}:${id}:${lun}/device/delete
        # Try reading, should fail if device is gone
        echo "$channel $id $lun" > /sys/class/scsi_host/host${host}/scan
      else
        echo "scsi remove-single-device $devnr" > /proc/scsi/scsi
        # Try reading, should fail if device is gone
        echo "scsi add-single-device $devnr" > /proc/scsi/scsi
      fi
    fi
    if test $RC = 0 ; then
      if test -e /sys/class/scsi_device/${host}:${channel}:${id}:${lun}/device; then
        echo 1 > /sys/class/scsi_device/${host}:${channel}:${id}:${lun}/device/rescan
      fi
    fi

    printf "\r\x1b[A\x1b[A\x1b[A${yellow}OLD: $norm"
    testexist
    if test -z "$SCSISTR"; then
      printf "\r${red}DEL: $norm\r\n\n"
      let rmvd+=1;
    fi
  fi
  if test -z "$SCSISTR"; then
    # Device does not exist, try to add
    printf "\r${green}NEW: $norm"
    if test -e /sys/class/scsi_host/host${host}/scan; then
      echo "$channel $id $lun" > /sys/class/scsi_host/host${host}/scan 2> /dev/null
    else
      echo "scsi add-single-device $devnr" > /proc/scsi/scsi
    fi
    testexist
    if test -z "$SCSISTR"; then
      # Device not present
      printf "\r\x1b[A";
      # Optimization: if lun==0, stop here (only if in non-remove mode)
      if test $lun = 0 -a -z "$remove" -a $optscan = 1; then
        break;
      fi
    else
      let found+=1;
    fi
  fi
}

# Perform report lun scan
doreportlun()
{
  lun=0
  SCSISTR=
  devnr="$host $channel $id $lun"
  echo "Scanning for device $devnr ..."
  printf "${yellow}OLD: $norm"
  testexist
  if test -z "$SCSISTR"; then
    # Device does not exist, try to add
    printf "\r${green}NEW: $norm"
    if test -e /sys/class/scsi_host/host${host}/scan; then
      echo "$channel $id $lun" > /sys/class/scsi_host/host${host}/scan 2> /dev/null
    else
      echo "scsi add-single-device $devnr" > /proc/scsi/scsi
    fi
    testexist
    if test -z "$SCSISTR"; then
      # Device not present
      printf "\r\x1b[A";
      lunsearch=
      return
    fi
  fi
  lunsearch=`getluns`
  lunremove=
  # Check existing luns
  for dev in /sys/class/scsi_device/$host\:$channel\:$id\:*; do
    lun=${dev##*:}
    newsearch=
    oldsearch="$lunsearch"
    for tmplun in $lunsearch; do
      if test $tmplun -eq $lun ; then
	# Optimization: don't scan lun 0 again
	if [ $lun -ne 0 ]; then
	  dolunscan
	fi
      else
	newsearch="$newsearch $tmplun"
      fi
    done
    if [ "${#oldsearch}" = "${#newsearch}" ] ; then
	# Stale lun
	lunremove="$lunremove $lun"
    fi
    lunsearch="$newsearch"
  done
  # Add new ones and check stale ones
  for lun in $lunsearch $lunremove; do
    dolunscan
  done
}

# Perform search (scan $host)
dosearch ()
{
  if test -z "$channelsearch" ; then
    chanlist
  fi
  for channel in $channelsearch; do
    if test -z "$idsearch" ; then
      idlist
    fi
    for id in $idsearch; do
      if test -z "$lunsearch"; then
	doreportlun
      else
	for lun in $lunsearch; do
          dolunscan
        done
      fi
    done
  done
}

# main
if test @$1 = @--help -o @$1 = @-h -o @$1 = @-?; then
    echo "Usage: rescan-scsi-bus.sh [options] [host [host ...]]"
    echo "Options:"
    echo " -l      activates scanning for LUNs 0-7    [default: 0]"
    echo " -L NUM  activates scanning for LUNs 0--NUM [default: 0]"
    echo " -w      scan for target device IDs 0 .. 15 [default: 0-7]"
    echo " -c      enables scanning of channels 0 1   [default: 0]"
    echo " -r      enables removing of devices        [default: disabled]"
    echo " -i      issue a FibreChannel LIP reset     [default: disabled]"
    echo "--remove:        same as -r"
    echo "--issue-lip:     same as -i"
    echo "--forceremove:   Remove and readd every device (DANGEROUS)"
    echo "--nooptscan:     don't stop looking for LUNs is 0 is not found"
    echo "--color:         use coloured prefixes OLD/NEW/DEL"
    echo "--hosts=LIST:    Scan only host(s) in LIST"
    echo "--channels=LIST: Scan only channel(s) in LIST"
    echo "--ids=LIST:      Scan only target ID(s) in LIST"
    echo "--luns=LIST:     Scan only lun(s) in LIST"
    echo " Host numbers may thus be specified either directly on cmd line (deprecated) or"
    echo " or with the --hosts=LIST parameter (recommended)."
    echo "LIST: A[-B][,C[-D]]... is a comma separated list of single values and ranges"
    echo " (No spaces allowed.)"
    exit 0
fi

expandlist ()
{
    list=$1
    result=""
    first=${list%%,*}
    rest=${list#*,}
    while test ! -z "$first"; do
	beg=${first%%-*};
	if test "$beg" = "$first"; then
	    result="$result $beg";
    	else
    	    end=${first#*-}
	    result="$result `seq $beg $end`"
	fi
	test "$rest" = "$first" && rest=""
	first=${rest%%,*}
	rest=${rest#*,}
    done
    echo $result
}

if test ! -d /sys/class/scsi_host/ -a ! -d /proc/scsi/; then
  echo "Error: SCSI subsystem not active"
  exit 1
fi

# Make sure sg is there
modprobe sg >/dev/null 2>&1

sg_version=$(sg_inq -V 2>&1 | cut -d " " -f 3)
sg_version=${sg_version##0.}
if [ "$sg_version" -lt 70 ] ; then
    sg_len_arg="-36"
else
    sg_len_arg="--len=36"
fi

# defaults
unsetcolor
lunsearch=""
idsearch=`seq 0 7`
channelsearch="0"
remove=
forceremove=
optscan=1
if test -d /sys/class/scsi_host; then
  findhosts_26
else
  findhosts
fi

# Scan options
opt="$1"
while test ! -z "$opt" -a -z "${opt##-*}"; do
  opt=${opt#-}
  case "$opt" in
    l) lunsearch=`seq 0 7` ;;
    L) lunsearch=`seq 0 $2`; shift ;;
    w) idsearch=`seq 0 15` ;;
    c) channelsearch="0 1" ;;
    r) remove=1 ;;
    i) lipreset=1 ;;
    -remove)      remove=1 ;;
    -forceremove) remove=1; forceremove=1 ;;
    -hosts=*)     arg=${opt#-hosts=};   hosts=`expandlist $arg` ;;
    -channels=*)  arg=${opt#-channels=};channelsearch=`expandlist $arg` ;;
    -ids=*)   arg=${opt#-ids=};         idsearch=`expandlist $arg` ;;
    -luns=*)  arg=${opt#-luns=};        lunsearch=`expandlist $arg` ;;
    -color) setcolor ;;
    -nooptscan) optscan=0 ;;
    -issue-lip) lipreset=1 ;;
    *) echo "Unknown option -$opt !" ;;
  esac
  shift
  opt="$1"
done

# Hosts given ?
if test "@$1" != "@"; then
  hosts=$*;
fi

echo "Scanning SCSI subsystem for new devices"
test -z "$remove" || echo " and remove devices that have disappeared"
declare -i found=0
declare -i rmvd=0
for host in $hosts; do
  echo -n "Scanning host $host "
  if test -e /sys/class/fc_host/host$host ; then
    # It's pointless to do a target scan on FC
    if test -n "$lipreset" ; then
      echo 1 > /sys/class/fc_host/host$host/issue_lip 2> /dev/null;
      echo "- - -" > /sys/class/scsi_host/host$host/scan 2> /dev/null;
    fi
    channelsearch=""
    idsearch=""
  fi
  [ -n "$channelsearch" ] && echo -n "channels $channelsearch "
  echo -n "for "
  if [ -n "$idsearch" ] ; then
      echo -n " SCSI target IDs " $idsearch
  else
      echo -n " all SCSI target IDs"
  fi
  if [ -n "$lunsearch" ] ; then
      echo ", LUNs " $lunsearch
  else
      echo ", all LUNs"
  fi
  dosearch;
done
echo "$found new device(s) found.               "
echo "$rmvd device(s) removed.                 "


code:
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
    <Source>
        <Name>sg3_utils</Name>
        <Homepage>http://sg.danny.cz/sg/sg3_utils.html</Homepage>
        <Packager>
            <Name>PisiLinux Community</Name>
            <Email>admins@pisilinux.org</Email>
        </Packager>
        <License>GPLv2</License>
        <License>BSD</License>
        <IsA>app:console</IsA>
        <IsA>library</IsA>
        Utilities for devices that use SCSI command sets
        <Description>sg3_utils is a collection of Linux utilities for devices that use the SCSI command set. Includes utilities to copy data based on dd syntax and semantics, check INQUIRY data and VPD pages, check mode and log pages, spin up/down disks, do self tests and various other functions.</Description>
        <Archive sha1sum="235b2d4ebe506ba23fd7960ff9541830e72d305f" type="targz">https://github.com/hreinecke/sg3_utils/archive/v1.43.tar.gz</Archive>
    </Source>

    <Package>
        <Name>sg3_utils</Name>
        <Files>
            <Path fileType="executable">/usr/bin</Path>
            <Path fileType="library">/usr/lib</Path>
            <Path fileType="doc">/usr/share/doc</Path>
            <Path fileType="man">/usr/share/man</Path>
        </Files>
        <AdditionalFiles>
            <AdditionalFile owner="root" permission="0755" target="/usr/bin/rescan-scsi-bus.sh">rescan-scsi-bus.sh</AdditionalFile>
        </AdditionalFiles>
    </Package>

    <Package>
        <Name>sg3_utils-devel</Name>
        Development files for sg3_utils
        <RuntimeDependencies>
            <Dependency release="current">sg3_utils</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="header">/usr/include</Path>
        </Files>
    </Package>

    <History>
        <Update release="4">
            <Date>2018-01-03</Date>
            <Version>1.43</Version>
            <Comment>Version bump</Comment>
            <Name>Mustafa Cinasal</Name>
            <Email>muscnsl@gmail.com</Email>
        </Update>
        <Update release="3">
            <Date>2017-01-28</Date>
            <Version>1.42</Version>
            <Comment>Version bump.</Comment>
            <Name>Stefan Gronewold(groni)</Name>
            <Email>groni@pisilinux.org</Email>
        </Update>
        <Update release="2">
            <Date>2016-06-09</Date>
            <Version>1.41</Version>
            <Comment>Release Bump</Comment>
            <Name>Pisi Linux Community</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="1">
            <Date>2015-08-19</Date>
            <Version>1.41</Version>
            <Comment>First release</Comment>
            <Name>Ertuğrul Erata</Name>
            <Email>ertugrulerata@gmail.com</Email>
        </Update>
    </History>
</PISI>


code:
<?xml version="1.0" ?>
<PISI>
    <Source>
        <Name>sg3_utils</Name>
        SCSI komut setini kullanan aygıtlar için araçlar
        <Description xml:lang="tr">sg3_utils SCSI komut setini kullanan aygıtlar için çeşitli araçlar sunar.</Description>
    </Source>

    <Package>
        <Name>sg3_utils-devel</Name>
        sg3_utils için geliştirme dosyaları
    </Package>
</PISI>


code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU General Public License, version 3.
# See the file http://www.gnu.org/licenses/gpl.txt

from pisi.actionsapi import shelltools
from pisi.actionsapi import pisitools
from pisi.actionsapi import autotools
from pisi.actionsapi import get

def setup():
    shelltools.touch("ChangeLog")
    autotools.autoreconf("-fi")
    autotools.configure("--prefix=/usr \
              --sbindir=/usr/bin \
              --sysconfdir=/etc \
              --with-drivedbdir \
              --with-libcap-ng=yes \
              --with-smartdscriptdir=/usr/share/smartmontools \
              --with-smartdplugindir=/usr/share/smartmontools/smartd_warning.d \
            --with-systemdsystemunitdir=no")

def build():
    autotools.make("CXXFLAGS='%s -fpie'" % get.CXXFLAGS())

def install():
    pisitools.dosed("smartd.service.in","sysconfig/smartmontools","conf.d/smartd")
    pisitools.dosed("smartd.service.in","smartd_opts","SMARTD_ARGS")
    autotools.rawInstall("DESTDIR=%s" % get.installDIR())

    pisitools.dodoc("AUTHORS", "NEWS", "README", "smartd.conf")


code:
from comar.service import *

serviceType="server"
serviceDesc = _({"en": "S.M.A.R.T. monitoring daemon",
                 "tr": "S.M.A.R.T. disk izleme hizmeti"})

serviceConf = "smartd"
PIDFILE = "/run/smartd.pid"

@synchronized
def start():
    args = "-p %s" % PIDFILE
    if config.get("smartd_opts"):
        args = "%s %s" % (args, config.get("smartd_opts"))
    startService(command="/usr/sbin/smartd",
                 args=args,
                 donotify=True)

@synchronized
def stop():
    stopService(pidfile=PIDFILE,
                donotify=True)

def reload():
    # FIXME: That's bad.
    run("/usr/bin/killall -HUP smartd")

def status():
    return isServiceRunning(pidfile=PIDFILE)


code:
diff -up smartmontools-5.38/smartd.conf.defaultconf smartmontools-5.38/smartd.conf
--- smartmontools-5.38/smartd.conf.defaultconf	2008-08-07 12:21:53.000000000 +0200
+++ smartmontools-5.38/smartd.conf	2008-08-07 12:24:26.000000000 +0200
@@ -20,7 +20,7 @@
 # Directives listed below, which will be applied to all devices that
 # are found.  Most users should comment out DEVICESCAN and explicitly
 # list the devices that they wish to monitor.
-DEVICESCAN
+DEVICESCAN -H -m root -n standby,10,q

 # Alternative setting to ignore temperature and power-on hours reports
 # in syslog.


code:
# command line options for smartd
smartd_opts="-q never"
# autogenerated config file options
# smartd_conf_opts="-H -m root"


code:
<?xml version="1.0"?>
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
    <Source>
        <Name>smartmontools</Name>
        <Homepage>http://smartmontools.sourceforge.net/</Homepage>
        <Packager>
            <Name>PisiLinux Community</Name>
            <Email>admins@pisilinux.org</Email>
        </Packager>
        <License>GPLv2+</License>
        <IsA>app:console</IsA>
        <Summary>Programs to control and monitor storage systems using the Self-Monitoring</Summary>
        <Description>The smartmontools package contains two utility programs (smartctl and smartd) to control and monitor storage systems using the Self-Monitoring, Analysis and Reporting Technology System (SMART) built into most modern ATA and SCSI hard disks.</Description>
        <Archive sha1sum="8946f6350d6df9341d571381d66ffbb7d83b8af2" type="targz">mirrors://sourceforge/smartmontools/6.6/smartmontools-6.6.tar.gz</Archive>
        <BuildDependencies>
             <Dependency>libutil-linux-devel</Dependency>
             <Dependency>libcap-ng-devel</Dependency>
        </BuildDependencies>
    </Source>

    <Package>
        <Name>smartmontools</Name>
        <RuntimeDependencies>
            <Dependency>libgcc</Dependency>
            <Dependency>libcap-ng</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="config">/etc</Path>
            <Path fileType="data">/lib/systemd/system</Path>
            <Path fileType="executable">/usr/sbin</Path>
            <Path fileType="executable">/usr/bin</Path>
            <Path fileType="doc">/usr/share/doc</Path>
            <Path fileType="man">/usr/share/man</Path>
            <Path fileType="man">/usr/share/smartmontools</Path>
        </Files>
        <AdditionalFiles>
            <AdditionalFile owner="root" permission="0644" target="/etc/conf.d/smartd">smartmontools.sysconf</AdditionalFile>
        </AdditionalFiles>
        <Provides>
            <COMAR script="service.py">System.Service</COMAR>
        </Provides>
    </Package>

    <History>
        <Update release="4">
            <Date>2018-01-03</Date>
            <Version>6.6</Version>
            <Comment>Version bump</Comment>
            <Name>Mustafa Cinasal</Name>
            <Email>muscnsl@gmail.com</Email>
        </Update>
        <Update release="3">
            <Date>2017-01-28</Date>
            <Version>6.5</Version>
            <Comment>Release Bump</Comment>
            <Name>Pisi Linux Community</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="2">
            <Date>2016-06-09</Date>
            <Version>6.4</Version>
            <Comment>Release Bump</Comment>
            <Name>Pisi Linux Community</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="1">
            <Date>2016-01-26</Date>
            <Version>6.4</Version>
            <Comment>First release</Comment>
            <Name>Stefan Gronewold</Name>
            <Email>groni@pisilinux.org</Email>
        </Update>
    </History>
</PISI>


code:
<?xml version="1.0" ?>
<PISI>
    <Source>
        <Name>smartmontools</Name>
        <Summary xml:lang="tr">Hard disk kontrol ve durumunu gösteren programlar</Summary>
        <Description xml:lang="tr">smartctl ve smartd adlı ATA ve SCSI diskleri kontrol ve durumlarını gösterir iki program.</Description>
    </Source>
</PISI>


code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU General Public License, version 3.
# See the file http://www.gnu.org/licenses/gpl.txt

from pisi.actionsapi import shelltools
from pisi.actionsapi import autotools
from pisi.actionsapi import pisitools
from pisi.actionsapi import get

def build():
    shelltools.cd("squashfs-tools")
    #Chakra features
    #reduce memory requirements of unsquashfs to support installation on systems with 256 MB RAM
    cmd1='sed -i -e "s/BUFFER_DEFAULT [0-9]*/BUFFER_DEFAULT 32/" unsquashfs.h'
    cmd2="sed -i 's|^#XZ_SUPPORT = 1|XZ_SUPPORT = 1|' Makefile"
    cmd3="sed -i 's|^#LZO_SUPPORT = 1|LZO_SUPPORT = 1|' Makefile"
    cmd4="sed -i 's|^COMP_DEFAULT = gzip|COMP_DEFAULT = xz|' Makefile"
    cmds=[cmd1,cmd2,cmd3,cmd4]

    for cmd in cmds:
        shelltools.system(cmd)
    autotools.make('RPM_OPT_FLAGS="%s"' % get.CFLAGS())

def install():
    shelltools.cd("squashfs-tools")
    autotools.install("INSTALL_DIR='%s/usr/sbin'" % get.installDIR())


code:
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
    <Source>
        <Name>squashfs-tools</Name>
        <Homepage>http://squashfs.sourceforge.net/</Homepage>
        <Packager>
            <Name>PisiLinux Community</Name>
            <Email>admins@pisilinux.org</Email>
        </Packager>
        <License>GPLv2</License>
        <IsA>app:console</IsA>
        <Summary>Userspace tools to create squashfs compressed filesystem</Summary>
        <Description>Squashfs is a highly compressed read-only filesystem for Linux. This package contains the utilities for manipulating squashfs filesystems.</Description>
        <Archive sha1sum="a615979db9cee82e4a934a1455577f597d290b41" type="targz">https://sourceforge.net/projects/squashfs/files/squashfs/squashfs4.3/squashfs4.3.tar.gz</Archive>
        <BuildDependencies>
            <Dependency>lzo-devel</Dependency>
            <!--xz-devel is in system.devel-->
            <Dependency>xz-devel</Dependency>
	    <Dependency>zlib-devel</Dependency>
        </BuildDependencies>
    </Source>

    <Package>
        <Name>squashfs-tools</Name>
        <RuntimeDependencies>
            <Dependency>lzo</Dependency>
            <!--xz is in system.base-->
            <Dependency>zlib</Dependency>
	    <Dependency>xz</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="executable">/usr/sbin</Path>
            <Path fileType="doc">/usr/share/doc</Path>
        </Files>
    </Package>

    <History>
        <Update release="3">
            <Date>2017-01-28</Date>
            <Version>4.3</Version>
            <Comment>Version bump.</Comment>
            <Name>Stefan Gronewold(groni)</Name>
            <Email>groni@pisilinux.org</Email>
        </Update>
        <Update release="2">
            <Date>2016-06-09</Date>
            <Version>4.2</Version>
            <Comment>Release Bump</Comment>
            <Name>Pisi Linux Community</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="1">
            <Date>2014-03-09</Date>
            <Version>4.2</Version>
            <Comment>First release</Comment>
            <Name>Varol Maksutoğlu</Name>
            <Email>waroi@pisilinux.org</Email>
        </Update>
    </History>
</PISI>


code:
<?xml version="1.0" ?>
<PISI>
    <Source>
        <Name>squashfs-tools</Name>
        <Summary xml:lang="tr">squashfs sıkıştırılmış salt-okunur dosya sistemi oluşturma aracı</Summary>
        <Description xml:lang="tr">squashfs, Linux için sıkıştırılmış ve salt-okunur bir dosya sistemidir. Bu paket squashfs dosya sistemiyle çalışmak için kullanılabilecek araçları içerir.</Description>
    </Source>
</PISI>


code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU General Public License, version 3.
# See the file http://www.gnu.org/licenses/gpl.txt

from pisi.actionsapi import autotools
from pisi.actionsapi import pisitools
from pisi.actionsapi import get

#WorkDir = "sshfs-fuse-%s" % get.srcVERSION()

def setup():
    autotools.configure("--disable-sshnodelay")

def build():
    autotools.make()

def install():
    autotools.rawInstall("DESTDIR=%s" % get.installDIR())

    pisitools.dodoc("AUTHORS","COPYING","ChangeLog")


code:
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
    <Source>
        <Name>sshfs</Name>
        <Homepage>http://fuse.sourceforge.net/sshfs.html</Homepage>
        <Packager>
            <Name>PisiLinux Community</Name>
            <Email>admins@pisilinux.org</Email>
        </Packager>
        <License>GPLv2</License>
        <IsA>app:console</IsA>
        <Summary>A filesystem client based on the SSH FTP</Summary>
        <Description>sshfs allows mounting remote SSH accounts as a filesystem.</Description>
        <Archive sha1sum="2b792aa5b3a45e0c3fe65c44bd9da8f64a690830" type="targz">https://github.com/libfuse/sshfs/releases/download/sshfs_2.8/sshfs-2.8.tar.gz</Archive>
        <BuildDependencies>
            <Dependency>fuse-devel</Dependency>
            <Dependency>glib2-devel</Dependency>
        </BuildDependencies>
    </Source>

    <Package>
        <Name>sshfs</Name>
        <RuntimeDependencies>
            <Dependency>fuse</Dependency>
            <Dependency>glib2</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="executable">/usr/bin</Path>
            <Path fileType="library">/usr/lib</Path>
            <Path fileType="doc">/usr/share/doc</Path>
            <Path fileType="man">/usr/share/man</Path>
        </Files>
    </Package>

    <History>
        <Update release="3">
            <Date>2017-01-28</Date>
            <Version>2.8</Version>
            <Comment>Version bump.</Comment>
            <Name>Stefan Gronewold(groni)</Name>
            <Email>groni@pisilinux.org</Email>
        </Update>
        <Update release="2">
            <Date>2016-06-09</Date>
            <Version>2.5</Version>
            <Comment>Release Bump</Comment>
            <Name>Pisi Linux Community</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="1">
            <Date>2016-01-27</Date>
            <Version>2.5</Version>
            <Comment>First release</Comment>
            <Name>Stefan Gronewold</Name>
            <Email>groni@pisilinux.org</Email>
        </Update>
    </History>
</PISI>


code:
<?xml version="1.0" ?>
<PISI>
    <Source>
        <Name>sshfs</Name>
        <Summary xml:lang="tr">SSH FTP alanı dosyasistemi</Summary>
        <Description xml:lang="tr">sshfs, SSH dosya aktarım protokülünü kullanarak bir dosyasistemi oluşturmanıza olanak verir. Böylece, uzak sistemdeki SSH FTP alanınızı diskinizin bir parçasıymış gibi kullanabilirsiniz.</Description>
    </Source>
</PISI>


code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Licensed under the GNU General Public License, version 3.
# See the file http://www.gnu.org/copyleft/gpl.txt

from pisi.actionsapi import autotools
from pisi.actionsapi import get

def setup():
    autotools.autoreconf()

    autotools.configure("--prefix=/usr")

def build():
    autotools.make()

def install():
    autotools.rawInstall("DESTDIR=%s" % get.installDIR())


code:
<PISI>
    <Source>
        <Name>thin-provisioning-tools</Name>
        <Homepage>http://github.com/jthornber/thin-provisioning-tools"</Homepage>
        <Packager>
            <Name>Ali Algul</Name>
            <Email>alialgul@pisilinux.org</Email>
        </Packager>
        <License>GPLv2</License>
        <Summary>A  suite of tools for thin provisioning on Linux</Summary>
        <Description>A  suite of tools for thin provisioning on Linux</Description>
        <BuildDependencies>
            <Dependency>libaio-devel</Dependency>
            <Dependency>boost-devel</Dependency>
            <Dependency>expat-devel</Dependency>
            <Dependency>libgcc</Dependency>
        </BuildDependencies>
        <Archive sha1sum="e2441a93736d452e061c15d4811a67ab0ab34486" type="targz">https://github.com/jthornber/thin-provisioning-tools/archive/v0.7.5.tar.gz</Archive>
    </Source>
    <Package>
        <Name>thin-provisioning-tools</Name>
        <RuntimeDependencies>
            <Dependency>expat</Dependency>
            <Dependency>libgcc</Dependency>
            <Dependency>libaio</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="executable">/usr/sbin/</Path>
            <Path fileType="man">/usr/share/man/man8/</Path>
        </Files>
    </Package>

    <History>
         <Update release="3">
            <Date>2018-01-01</Date>
            <Version>0.7.5</Version>
            <Comment>version Bump</Comment>
            <Name>Mustafa Cinasal</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="3">
            <Date>2017-04-09</Date>
            <Version>0.6.3</Version>
            <Comment>version Bump</Comment>
            <Name>Kamil Atlı</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="2">
            <Date>2016-06-09</Date>
            <Version>0.6.0</Version>
            <Comment>Release Bump</Comment>
            <Name>Pisi Linux Community</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="1">
            <Date>2016-01-31</Date>
            <Version>0.6.0</Version>
            <Comment>First release</Comment>
            <Name>Ali Algul</Name>
            <Email>alialgul@pisilinux.org</Email>
        </Update>
    </History>
</PISI>


code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU General Public License, version 3.
# See the file http://www.gnu.org/licenses/gpl.txt

from pisi.actionsapi import get
from pisi.actionsapi import autotools
from pisi.actionsapi import pisitools

def setup():
    autotools.configure("--disable-static \
                         --enable-fhs-media \
                         --with-systemdsystemunitdir=no \
                         --disable-gtk-doc")

def build():
    autotools.make()

def install():
    autotools.rawInstall("DESTDIR=%s" % get.installDIR())

    pisitools.dodoc("AUTHORS", "COPYING", "NEWS", "README")


code:
diff --git a/data/80-udisks2.rules b/data/80-udisks2.rules
index ed093ee..7112db8 100644
--- a/data/80-udisks2.rules
+++ b/data/80-udisks2.rules
@@ -94,6 +94,9 @@ SUBSYSTEMS=="usb", ENV{ID_VENDOR}=="*SanDisk*", ENV{ID_MODEL}=="*Cruzer*", ENV{I
 SUBSYSTEMS=="usb", ENV{ID_VENDOR}=="HP", ENV{ID_MODEL}=="*v125w*", ENV{ID_DRIVE_THUMB}="1"
 SUBSYSTEMS=="usb", ENV{ID_VENDOR_ID}=="13fe", ENV{ID_MODEL}=="*Patriot*", ENV{ID_DRIVE_THUMB}="1"

+# SD-Card reader in Chromebook Pixel
+SUBSYSTEMS=="usb", ENV{ID_VENDOR_ID}=="05e3", ENV{ID_MODEL_ID}=="0727", ENV{ID_DRIVE_FLASH_SD}="1"
+
 # ------------------------------------------------------------------------
 # ------------------------------------------------------------------------
 # ------------------------------------------------------------------------
diff --git a/doc/man/udisksctl.xml b/doc/man/udisksctl.xml
index 8f38479..434a8fb 100644
--- a/doc/man/udisksctl.xml
+++ b/doc/man/udisksctl.xml
@@ -104,6 +104,16 @@

     <cmdsynopsis>
       <command>udisksctl</command>
+      <arg choice="plain">power-off </arg>
+      <group choice="req">
+        <arg choice="plain">--object-path <replaceable>OBJECT</replaceable></arg>
+        <arg choice="plain">--block-device <replaceable>DEVICE</replaceable></arg>
+      </group>
+      <arg choice="opt">--no-user-interaction</arg>
+    </cmdsynopsis>
+
+    <cmdsynopsis>
+      <command>udisksctl</command>
       <arg choice="plain">smart-simulate </arg>
       <arg choice="plain">--file <replaceable>PATH</replaceable></arg>
       <group choice="req">
@@ -238,6 +248,31 @@
       </varlistentry>

       <varlistentry>
+        <term><option>power-off</option></term>
+        <listitem>
+          <para>
+            Arranges for the drive to be safely removed and powered
+            off. On the OS side this includes ensuring that no process
+            is using the drive, then requesting that in-flight buffers
+            and caches are committed to stable storage. The exact
+            steps for powering off the drive depends on the drive
+            itself and the interconnect used. For drives connected
+            through USB, the effect is that the USB device will be
+            deconfigured followed by disabling the upstream hub port
+            it is connected to.
+          </para>
+          <para>
+            Note that as some physical devices contain multiple drives
+            (for example 4-in-1 flash card reader USB devices)
+            powering off one drive may affect other drives. As such
+            there are not a lot of guarantees associated with
+            performing this action. Usually the effect is that the
+            drive disappears as if it was unplugged.
+          </para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry>
         <term><option>smart-simulate</option></term>
         <listitem>
           <para>
diff --git a/src/udisksdaemonutil.c b/src/udisksdaemonutil.c
index 574bf2c..a588580 100644
--- a/src/udisksdaemonutil.c
+++ b/src/udisksdaemonutil.c
@@ -830,7 +830,7 @@ udisks_daemon_util_get_caller_uid_sync (UDisksDaemon            *daemon,
     {
       struct passwd pwstruct;
       gchar pwbuf[8192];
-      static struct passwd *pw;
+      struct passwd *pw = NULL;
       int rc;

       rc = getpwuid_r (uid, &pwstruct, pwbuf, sizeof pwbuf, &pw);
@@ -840,6 +840,7 @@ udisks_daemon_util_get_caller_uid_sync (UDisksDaemon            *daemon,
                        UDISKS_ERROR,
                        UDISKS_ERROR_FAILED,
                        "User with uid %d does not exist", (gint) uid);
+          goto out;
         }
       else if (pw == NULL)
         {
diff --git a/src/udiskslinuxblock.c b/src/udiskslinuxblock.c
index d619850..22bcfd0 100644
--- a/src/udiskslinuxblock.c
+++ b/src/udiskslinuxblock.c
@@ -804,12 +804,23 @@ udisks_linux_block_update (UDisksLinuxBlock        *block,
       gchar *dm_name_dev_file = NULL;
       const gchar *dm_name_dev_file_as_symlink = NULL;

+      const gchar *dm_vg_name;
+      const gchar *dm_lv_name;
+      gchar *dm_lvm_dev_file = NULL;
+
       dm_name = g_udev_device_get_property (device->udev_device, "DM_NAME");
       if (dm_name != NULL)
         dm_name_dev_file = g_strdup_printf ("/dev/mapper/%s", dm_name);
+
+      dm_vg_name = g_udev_device_get_property (device->udev_device, "DM_VG_NAME");
+      dm_lv_name = g_udev_device_get_property (device->udev_device, "DM_LV_NAME");
+      if (dm_vg_name != NULL && dm_lv_name != NULL)
+        dm_lvm_dev_file =  g_strdup_printf ("/dev/%s/%s", dm_vg_name, dm_lv_name);
+
       for (n = 0; symlinks != NULL && symlinks[n] != NULL; n++)
         {
-          if (g_str_has_prefix (symlinks[n], "/dev/vg_"))
+          if (g_str_has_prefix (symlinks[n], "/dev/vg_")
+              || g_strcmp0 (symlinks[n], dm_lvm_dev_file) == 0)
             {
               /* LVM2 */
               preferred_device_file = symlinks[n];
@@ -824,6 +835,7 @@ udisks_linux_block_update (UDisksLinuxBlock        *block,
       if (preferred_device_file == NULL && dm_name_dev_file_as_symlink != NULL)
         preferred_device_file = dm_name_dev_file_as_symlink;
       g_free (dm_name_dev_file);
+      g_free (dm_lvm_dev_file);
     }
   else if (g_str_has_prefix (device_file, "/dev/md"))
     {
diff --git a/src/udiskslinuxdevice.c b/src/udiskslinuxdevice.c
index 0b65a69..8c4a3ed 100644
--- a/src/udiskslinuxdevice.c
+++ b/src/udiskslinuxdevice.c
@@ -199,6 +199,7 @@ probe_ata (UDisksLinuxDevice  *device,
     {
       /* ATA8: 7.16 IDENTIFY DEVICE - ECh, PIO Data-In */
       input.command = 0xec;
+      input.count = 1;
       output.buffer = g_new0 (guchar, 512);
       output.buffer_size = 512;
       if (!udisks_ata_send_command_sync (fd,
@@ -221,6 +222,7 @@ probe_ata (UDisksLinuxDevice  *device,
     {
       /* ATA8: 7.17 IDENTIFY PACKET DEVICE - A1h, PIO Data-In */
       input.command = 0xa1;
+      input.count = 1;
       output.buffer = g_new0 (guchar, 512);
       output.buffer_size = 512;
       if (!udisks_ata_send_command_sync (fd,
diff --git a/src/udiskslinuxdrive.c b/src/udiskslinuxdrive.c
index 170ba27..ed541ff 100644
--- a/src/udiskslinuxdrive.c
+++ b/src/udiskslinuxdrive.c
@@ -25,6 +25,12 @@
 #include <sys/stat.h>
 #include <sys/ioctl.h>
 #include <fcntl.h>
+#include <inttypes.h>
+#include <errno.h>
+#include <linux/bsg.h>
+#include <scsi/scsi.h>
+#include <scsi/sg.h>
+#include <scsi/scsi_ioctl.h>

 #include <pwd.h>
 #include <grp.h>
@@ -1192,6 +1198,122 @@ handle_set_configuration (UDisksDrive           *_drive,

 /* ---------------------------------------------------------------------------------------------------- */

+/* TODO: move to udisksscsi.[ch] similar what we do for ATA with udisksata.[ch] */
+
+static gboolean
+send_scsi_command_sync (gint      fd,
+                        guint8   *cdb,
+                        gsize     cdb_len,
+                        GError  **error)
+{
+  struct sg_io_v4 io_v4;
+  uint8_t sense[32];
+  gboolean ret = FALSE;
+  gint rc;
+  gint timeout_msec = 30000; /* 30 seconds */
+
+  g_return_val_if_fail (fd != -1, FALSE);
+  g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+
+  /* See http://sg.danny.cz/sg/sg_io.html and http://www.tldp.org/HOWTO/SCSI-Generic-HOWTO/index.html
+   * for detailed information about how the SG_IO ioctl work
+   */
+
+  memset (sense, 0, sizeof (sense));
+  memset (&io_v4, 0, sizeof (io_v4));
+  io_v4.guard = 'Q';
+  io_v4.protocol = BSG_PROTOCOL_SCSI;
+  io_v4.subprotocol = BSG_SUB_PROTOCOL_SCSI_CMD;
+  io_v4.request_len = cdb_len;
+  io_v4.request = (uintptr_t) cdb;
+  io_v4.max_response_len = sizeof (sense);
+  io_v4.response = (uintptr_t) sense;
+  io_v4.timeout = timeout_msec;
+
+  rc = ioctl (fd, SG_IO, &io_v4);
+  if (rc != 0)
+    {
+      /* could be that the driver doesn't do version 4, try version 3 */
+      if (errno == EINVAL)
+        {
+          struct sg_io_hdr io_hdr;
+          memset (&io_hdr, 0, sizeof (struct sg_io_hdr));
+          io_hdr.interface_id = 'S';
+          io_hdr.cmdp = (unsigned char*) cdb;
+          io_hdr.cmd_len = cdb_len;
+          io_hdr.dxfer_direction = SG_DXFER_NONE;
+          io_hdr.sbp = sense;
+          io_hdr.mx_sb_len = sizeof (sense);
+          io_hdr.timeout = timeout_msec;
+
+          rc = ioctl (fd, SG_IO, &io_hdr);
+          if (rc != 0)
+            {
+              g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errno),
+                           "SGIO v3 ioctl failed (v4 not supported): %m");
+              goto out;
+            }
+          else
+            {
+              if (!(io_hdr.status == 0 &&
+                    io_hdr.host_status == 0 &&
+                    io_hdr.driver_status == 0))
+                {
+                  g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+                               "Non-GOOD SCSI status from SGIO v3 ioctl: "
+                               "status=%d host_status=%d driver_status=%d",
+                               io_hdr.status,
+                               io_hdr.host_status,
+                               io_hdr.driver_status);
+                  goto out;
+                }
+            }
+        }
+      else
+        {
+          g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errno),
+                       "SGIO v4 ioctl failed: %m");
+          goto out;
+        }
+    }
+  else
+    {
+      if (!(io_v4.device_status == 0 &&
+            io_v4.transport_status == 0 &&
+            io_v4.driver_status == 0))
+        {
+          g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+                       "Non-GOOD SCSI status from SGIO v4 ioctl: "
+                       "device_status=%d transport_status=%d driver_status=%d",
+                       io_v4.device_status,
+                       io_v4.transport_status,
+                       io_v4.driver_status);
+          goto out;
+        }
+    }
+
+  ret = TRUE;
+
+ out:
+  return ret;
+}
+
+static gboolean
+send_scsi_start_stop_command_sync (gint      fd,
+                                   GError  **error)
+{
+  uint8_t cdb[6];
+
+  /* SBC3 (SCSI Block Commands), 5.20 START STOP UNIT command
+   */
+  memset (cdb, 0, sizeof cdb);
+  cdb[0] = 0x1b;                        /* OPERATION CODE: START STOP UNIT */
+
+  return send_scsi_command_sync (fd, cdb, sizeof cdb, error);
+}
+
+/* ---------------------------------------------------------------------------------------------------- */
+
 static gboolean
 handle_power_off (UDisksDrive           *_drive,
                   GDBusMethodInvocation *invocation,
@@ -1216,6 +1338,7 @@ handle_power_off (UDisksDrive           *_drive,
   gid_t caller_gid;
   pid_t caller_pid;
   GList *sibling_objects = NULL, *l;
+  gint fd = -1;

   object = udisks_daemon_util_dup_object (drive, &error);
   if (object == NULL)
@@ -1324,10 +1447,10 @@ handle_power_off (UDisksDrive           *_drive,
     {
       UDisksBlock *block_to_sync = UDISKS_BLOCK (l->data);
       const gchar *device_file;
-      gint fd;
+      gint device_fd;
       device_file = udisks_block_get_device (block_to_sync);
-      fd = open (device_file, O_RDONLY|O_NONBLOCK|O_EXCL);
-      if (fd == -1)
+      device_fd = open (device_file, O_RDONLY|O_NONBLOCK|O_EXCL);
+      if (device_fd == -1)
         {
           g_dbus_method_invocation_return_error (invocation,
                                                  UDISKS_ERROR,
@@ -1336,7 +1459,7 @@ handle_power_off (UDisksDrive           *_drive,
                                                  device_file);
           goto out;
         }
-      if (fsync (fd) != 0)
+      if (fsync (device_fd) != 0)
         {
           g_dbus_method_invocation_return_error (invocation,
                                                  UDISKS_ERROR,
@@ -1345,7 +1468,7 @@ handle_power_off (UDisksDrive           *_drive,
                                                  device_file);
           goto out;
         }
-      if (close (fd) != 0)
+      if (close (device_fd) != 0)
         {
           g_dbus_method_invocation_return_error (invocation,
                                                  UDISKS_ERROR,
@@ -1356,9 +1479,45 @@ handle_power_off (UDisksDrive           *_drive,
         }
     }

-  escaped_device = udisks_daemon_util_escape_and_quote (udisks_block_get_device (block));
+  /* Send the "SCSI START STOP UNIT" command to request that the unit
+   * be stopped but don't treat failure as fatal. In fact some
+   * USB-attached hard-disks fails with this command, probably due to
+   * the SCSI/SATA translation layer.
+   */
+  fd = open (udisks_block_get_device (block), O_RDONLY|O_NONBLOCK|O_EXCL);
+  if (fd == -1)
+    {
+      g_dbus_method_invocation_return_error (invocation,
+                                             UDISKS_ERROR,
+                                             UDISKS_ERROR_FAILED,
+                                             "Error opening %s: %m",
+                                             udisks_block_get_device (block));
+      goto out;
+    }
+  if (!send_scsi_start_stop_command_sync (fd, &error))
+    {
+      udisks_warning ("Ignoring SCSI command START STOP UNIT failure (%s) on %s",
+                      error->message,
+                      udisks_block_get_device (block));
+      g_clear_error (&error);
+    }
+  else
+    {
+      udisks_notice ("Powering off %s - successfully sent SCSI command START STOP UNIT",
+                     udisks_block_get_device (block));
+    }
+  if (close (fd) != 0)
+    {
+      g_dbus_method_invocation_return_error (invocation,
+                                             UDISKS_ERROR,
+                                             UDISKS_ERROR_FAILED,
+                                             "Error closing %s: %m",
+                                             udisks_block_get_device (block));
+      goto out;
+    }
+  fd = -1;

-  /* TODO: Send the eject? Send SCSI START STOP UNIT? */
+  escaped_device = udisks_daemon_util_escape_and_quote (udisks_block_get_device (block));
   device = udisks_linux_drive_object_get_device (object, TRUE /* get_hw */);
   if (device == NULL)
     {
@@ -1405,10 +1564,20 @@ handle_power_off (UDisksDrive           *_drive,
         }
     }
   fclose (f);
+  udisks_notice ("Powered off %s - successfully wrote to sysfs path %s",
+                 udisks_block_get_device (block),
+                 remove_path);

   udisks_drive_complete_power_off (UDISKS_DRIVE (drive), invocation);

  out:
+  if (fd != -1)
+    {
+      if (close (fd) != 0)
+        {
+          udisks_warning ("Error closing device: %m");
+        }
+    }
   g_list_free_full (blocks_to_sync, g_object_unref);
   g_list_free_full (sibling_objects, g_object_unref);
   g_free (remove_path);
diff --git a/src/udiskslinuxdriveata.c b/src/udiskslinuxdriveata.c
index 48cc6e6..534ef4d 100644
--- a/src/udiskslinuxdriveata.c
+++ b/src/udiskslinuxdriveata.c
@@ -1943,7 +1943,7 @@ udisks_linux_drive_ata_secure_erase_sync (UDisksLinuxDriveAta     *drive,
   /* First get the IDENTIFY data directly from the drive, for sanity checks */
   {
     /* ATA8: 7.16 IDENTIFY DEVICE - ECh, PIO Data-In */
-    UDisksAtaCommandInput input = {.command = 0xec};
+    UDisksAtaCommandInput input = {.command = 0xec, .count = 1};
     UDisksAtaCommandOutput output = {.buffer = identify.buf, .buffer_size = sizeof (identify.buf)};
     if (!udisks_ata_send_command_sync (fd,
                                        -1,
diff --git a/src/udiskslinuxfilesystem.c b/src/udiskslinuxfilesystem.c
index 4c8d8aa..f243046 100644
--- a/src/udiskslinuxfilesystem.c
+++ b/src/udiskslinuxfilesystem.c
@@ -348,13 +348,16 @@ find_mount_options_for_fs (const gchar *fstype)
 static gid_t
 find_primary_gid (uid_t uid)
 {
-  struct passwd *pw;
+  struct passwd *pw = NULL;
+  struct passwd pwstruct;
+  gchar pwbuf[8192];
+  int rc;
   gid_t gid;

   gid = (gid_t) - 1;

-  pw = getpwuid (uid);
-  if (pw == NULL)
+  rc = getpwuid_r (uid, &pwstruct, pwbuf, sizeof pwbuf, &pw);
+  if (rc != 0 || pw == NULL)
     {
       udisks_warning ("Error looking up uid %d: %m", uid);
       goto out;
@@ -370,7 +373,10 @@ is_uid_in_gid (uid_t uid,
                gid_t gid)
 {
   gboolean ret;
-  struct passwd *pw;
+  struct passwd *pw = NULL;
+  struct passwd pwstruct;
+  gchar pwbuf[8192];
+  int rc;
   static gid_t supplementary_groups[128];
   int num_supplementary_groups = 128;
   int n;
@@ -379,8 +385,8 @@ is_uid_in_gid (uid_t uid,

   ret = FALSE;

-  pw = getpwuid (uid);
-  if (pw == NULL)
+  rc = getpwuid_r (uid, &pwstruct, pwbuf, sizeof pwbuf, &pw);
+  if (rc != 0 || pw == NULL)
     {
       udisks_warning ("Error looking up uid %d: %m", uid);
       goto out;
diff --git a/src/udisksspawnedjob.c b/src/udisksspawnedjob.c
index 802551f..b181933 100644
--- a/src/udisksspawnedjob.c
+++ b/src/udisksspawnedjob.c
@@ -371,22 +371,25 @@ static void
 child_setup (gpointer user_data)
 {
   UDisksSpawnedJob *job = UDISKS_SPAWNED_JOB (user_data);
-  struct passwd *pw;
+  struct passwd pwstruct;
+  gchar pwbuf[8192];
+  struct passwd *pw = NULL;
+  int rc;
   gid_t egid;

   if (job->run_as_uid == getuid () && job->run_as_euid == geteuid ())
     goto out;

-  pw = getpwuid (job->run_as_euid);
-  if (pw == NULL)
+  rc = getpwuid_r (job->run_as_euid, &pwstruct, pwbuf, sizeof pwbuf, &pw);
+  if (rc != 0 || pw == NULL)
    {
      g_printerr ("No password record for uid %d: %m\n", (gint) job->run_as_euid);
      abort ();
    }
   egid = pw->pw_gid;

-  pw = getpwuid (job->run_as_uid);
-  if (pw == NULL)
+  rc = getpwuid_r (job->run_as_uid, &pwstruct, pwbuf, sizeof pwbuf, &pw);
+  if (rc != 0 || pw == NULL)
    {
      g_printerr ("No password record for uid %d: %m\n", (gint) job->run_as_uid);
      abort ();
diff --git a/tools/udisksctl.c b/tools/udisksctl.c
index 97b0f17..c87fe9f 100644
--- a/tools/udisksctl.c
+++ b/tools/udisksctl.c
@@ -1691,6 +1691,12 @@ handle_command_loop (gint        *argc,
           goto out;
         }

+      if (udisks_object_peek_loop (object) == NULL)
+        {
+          g_printerr ("Error: specified object is not a loop device\n");
+          goto out;
+        }
+
     delete_try_again:
       error = NULL;
       if (!udisks_loop_call_delete_sync (udisks_object_peek_loop (object),
@@ -2009,6 +2015,238 @@ handle_command_smart_simulate (gint        *argc,

 /* ---------------------------------------------------------------------------------------------------- */

+static gchar   *opt_power_off_object_path = NULL;
+static gchar   *opt_power_off_device = NULL;
+static gboolean opt_power_off_no_user_interaction = FALSE;
+
+static const GOptionEntry command_power_off_entries[] =
+{
+  {
+    "object-path",
+    'p',
+    0,
+    G_OPTION_ARG_STRING,
+    &opt_power_off_object_path,
+    "Object path for ATA device",
+    NULL
+  },
+  {
+    "block-device",
+    'b',
+    0,
+    G_OPTION_ARG_STRING,
+    &opt_power_off_device,
+    "Device file for ATA device",
+    NULL
+  },
+  {
+    "no-user-interaction",
+    0, /* no short option */
+    0,
+    G_OPTION_ARG_NONE,
+    &opt_power_off_no_user_interaction,
+    "Do not authenticate the user if needed",
+    NULL
+  },
+  {
+    NULL
+  }
+};
+
+static gint
+handle_command_power_off (gint        *argc,
+                          gchar      **argv[],
+                          gboolean     request_completion,
+                          const gchar *completion_cur,
+                          const gchar *completion_prev)
+{
+  gint ret;
+  GOptionContext *o;
+  gchar *s;
+  gboolean complete_objects;
+  gboolean complete_devices;
+  GList *l;
+  GList *objects;
+  UDisksObject *object;
+  UDisksDriveAta *ata;
+  guint n;
+  GVariant *options;
+  GVariantBuilder builder;
+  GError *error;
+
+  ret = 1;
+  opt_power_off_object_path = NULL;
+  opt_power_off_device = NULL;
+  object = NULL;
+  options = NULL;
+
+  modify_argv0_for_command (argc, argv, "power-off");
+
+  o = g_option_context_new (NULL);
+  if (request_completion)
+    g_option_context_set_ignore_unknown_options (o, TRUE);
+  g_option_context_set_help_enabled (o, FALSE);
+  g_option_context_set_summary (o, "Safely power off a drive.");
+  g_option_context_add_main_entries (o,
+                                     command_power_off_entries,
+                                     NULL /* GETTEXT_PACKAGE*/);
+
+  complete_objects = FALSE;
+  if (request_completion && (g_strcmp0 (completion_prev, "--object-path") == 0 || g_strcmp0 (completion_prev, "-p") == 0))
+    {
+      complete_objects = TRUE;
+      remove_arg ((*argc) - 1, argc, argv);
+    }
+
+  complete_devices = FALSE;
+  if (request_completion && (g_strcmp0 (completion_prev, "--block-device") == 0 || g_strcmp0 (completion_prev, "-b") == 0))
+    {
+      complete_devices = TRUE;
+      remove_arg ((*argc) - 1, argc, argv);
+    }
+
+  if (!g_option_context_parse (o, argc, argv, NULL))
+    {
+      if (!request_completion)
+        {
+          s = g_option_context_get_help (o, FALSE, NULL);
+          g_printerr ("%s", s);
+          g_free (s);
+          goto out;
+        }
+    }
+
+  if (request_completion)
+    {
+      if ((opt_power_off_object_path == NULL && !complete_objects) &&
+          (opt_power_off_device == NULL && !complete_devices))
+        {
+          g_print ("--object-path \n"
+                   "--block-device \n");
+        }
+
+      if (complete_objects)
+        {
+          const gchar *object_path;
+          objects = g_dbus_object_manager_get_objects (udisks_client_get_object_manager (client));
+          for (l = objects; l != NULL; l = l->next)
+            {
+              object = UDISKS_OBJECT (l->data);
+              ata = udisks_object_peek_drive_ata (object);
+              if (ata != NULL)
+                {
+                  object_path = g_dbus_object_get_object_path (G_DBUS_OBJECT (object));
+                  g_assert (g_str_has_prefix (object_path, "/org/freedesktop/UDisks2/"));
+                  g_print ("%s \n", object_path + sizeof ("/org/freedesktop/UDisks2/") - 1);
+                }
+            }
+          g_list_foreach (objects, (GFunc) g_object_unref, NULL);
+          g_list_free (objects);
+        }
+
+      if (complete_devices)
+        {
+          objects = g_dbus_object_manager_get_objects (udisks_client_get_object_manager (client));
+          for (l = objects; l != NULL; l = l->next)
+            {
+              object = UDISKS_OBJECT (l->data);
+              ata = udisks_object_peek_drive_ata (object);
+              if (ata != NULL)
+                {
+                  const gchar * const *symlinks;
+                  UDisksBlock *block;
+                  block = udisks_client_get_block_for_drive (client, udisks_object_peek_drive (object), TRUE);
+                  g_print ("%s \n", udisks_block_get_device (block));
+                  symlinks = udisks_block_get_symlinks (block);
+                  for (n = 0; symlinks != NULL && symlinks[n] != NULL; n++)
+                    g_print ("%s \n", symlinks[n]);
+                }
+            }
+          g_list_foreach (objects, (GFunc) g_object_unref, NULL);
+          g_list_free (objects);
+        }
+      goto out;
+    }
+
+  g_variant_builder_init (&builder, G_VARIANT_TYPE_VARDICT);
+  if (opt_power_off_no_user_interaction)
+    {
+      g_variant_builder_add (&builder,
+                             "{sv}",
+                             "auth.no_user_interaction", g_variant_new_boolean (TRUE));
+    }
+  options = g_variant_builder_end (&builder);
+  g_variant_ref_sink (options);
+
+  if (opt_power_off_object_path != NULL)
+    {
+      object = lookup_object_by_path (opt_power_off_object_path);
+      if (object == NULL)
+        {
+          g_printerr ("Error looking up object with path %s\n", opt_power_off_object_path);
+          goto out;
+        }
+    }
+  else if (opt_power_off_device != NULL)
+    {
+      UDisksObject *block_object;
+      UDisksDrive *drive;
+      block_object = lookup_object_by_device (opt_power_off_device);
+      if (block_object == NULL)
+        {
+          g_printerr ("Error looking up object for device %s\n", opt_power_off_device);
+          goto out;
+        }
+      drive = udisks_client_get_drive_for_block (client, udisks_object_peek_block (block_object));
+      object = (UDisksObject *) g_dbus_interface_dup_object (G_DBUS_INTERFACE (drive));
+      g_object_unref (block_object);
+    }
+  else
+    {
+      s = g_option_context_get_help (o, FALSE, NULL);
+      g_printerr ("%s", s);
+      g_free (s);
+      goto out;
+    }
+
+ try_again:
+  error = NULL;
+  if (!udisks_drive_call_power_off_sync (udisks_object_peek_drive (object),
+                                         options,
+                                         NULL,                       /* GCancellable */
+                                         &error))
+    {
+      if (error->domain == UDISKS_ERROR &&
+          error->code == UDISKS_ERROR_NOT_AUTHORIZED_CAN_OBTAIN &&
+          setup_local_polkit_agent ())
+        {
+          g_error_free (error);
+          goto try_again;
+        }
+      g_dbus_error_strip_remote_error (error);
+      g_printerr ("Error powering off drive: %s (%s, %d)\n",
+                  error->message, g_quark_to_string (error->domain), error->code);
+      g_clear_error (&error);
+      g_object_unref (object);
+      goto out;
+    }
+
+  g_object_unref (object);
+
+
+  ret = 0;
+
+ out:
+  if (options != NULL)
+    g_variant_unref (options);
+  g_option_context_free (o);
+  g_free (opt_power_off_object_path);
+  g_free (opt_power_off_device);
+  return ret;
+}
+
+/* ---------------------------------------------------------------------------------------------------- */
+
 static gchar *opt_info_object = NULL;
 static gchar *opt_info_device = NULL;
 static gchar *opt_info_drive = NULL;
@@ -2855,6 +3093,7 @@ usage (gint *argc, gchar **argv[], gboolean use_stdout)
                        "  lock            Lock an encrypted device\n"
                        "  loop-setup      Set-up a loop device\n"
                        "  loop-delete     Delete a loop device\n"
+                       "  power-off       Safely power off a drive\n"
                        "  smart-simulate  Set SMART data for a drive\n"
                        "\n"
                        "Use \"%s COMMAND --help\" to get help on each command.\n",
@@ -3053,6 +3292,15 @@ main (int argc,
                                            completion_prev);
       goto out;
     }
+  else if (g_strcmp0 (command, "power-off") == 0)
+    {
+      ret = handle_command_power_off (&argc,
+                                      &argv,
+                                      request_completion,
+                                      completion_cur,
+                                      completion_prev);
+      goto out;
+    }
   else if (g_strcmp0 (command, "dump") == 0)
     {
       ret = handle_command_dump (&argc,
@@ -3156,6 +3404,7 @@ main (int argc,
                    "unlock \n"
                    "loop-setup \n"
                    "loop-delete \n"
+                   "power-off \n"
                    "smart-simulate \n"
                    );
           ret = 0;


code:
# Danish translations for udisks.
# This file is distributed under the same license as the udisks package.
#
# Ozan Çağlayan <ozan@pardus.org.tr>, 2011.
msgid ""
msgstr ""
"Project-Id-Version: udisks\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-12-01 14:36-0500\n"
"PO-Revision-Date: 2011-03-28 11:17+0300\n"
"Last-Translator: Ozan Çağlayan <ozan@pardus.org.tr>\n"
"Language-Team: Turkish <tr@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1;plural=0;\n"
"X-Generator: Lokalize 1.2\n"

#: ../policy/org.freedesktop.udisks.policy.in.h:1
msgid "Authentication is required to cancel a job initiated by another user"
msgstr ""
"Başka bir kullanıcı tarafından başlatılan bir görevi iptal etmek için yetki gerekiyor"

#: ../policy/org.freedesktop.udisks.policy.in.h:2
msgid "Authentication is required to check the file system on the device"
msgstr "Aygıtın üzerindeki dosya sistemini denetlemek için yetki gerekiyor"

#: ../policy/org.freedesktop.udisks.policy.in.h:3
msgid "Authentication is required to configure Linux Software RAID devices"
msgstr "Yazılımsal RAID aygıtlarını yapılandırmak için yetki gerekiyor"

#: ../policy/org.freedesktop.udisks.policy.in.h:4
msgid "Authentication is required to configure drive spindown timeout"
msgstr ""
"Sürücünün dönüş hızının yavaşlama aralığını yapılandırmak için yetki gerekiyor"

#: ../policy/org.freedesktop.udisks.policy.in.h:5
msgid "Authentication is required to detach the drive"
msgstr "Sürücüyü ayırmak için yetki gerekiyor"

#: ../policy/org.freedesktop.udisks.policy.in.h:6
msgid "Authentication is required to eject media from the device"
msgstr "Ortamı aygıttan çıkartmak için yetki gerekiyor"

#: ../policy/org.freedesktop.udisks.policy.in.h:7
msgid "Authentication is required to inhibit media detection"
msgstr "Ortam tanımayı engellemek için yetki gerekiyor"

#: ../policy/org.freedesktop.udisks.policy.in.h:8
msgid "Authentication is required to list open files on a mounted file system"
msgstr ""
"Bağlı bir dosya sistemindeki açık dosyaların listelenmesi için yetki gerekiyor"

#: ../policy/org.freedesktop.udisks.policy.in.h:9
msgid ""
"Authentication is required to lock an encrypted device unlocked by another "
"user"
msgstr ""
"Başka bir kullanıcı tarafından kilidi çözülmüş şifreli bir aygıtın "
"kilitlenmesi için yetki gerekiyor"

#: ../policy/org.freedesktop.udisks.policy.in.h:10
msgid "Authentication is required to modify the device"
msgstr "Aygıtı değiştirmek için yetki gerekiyor"

#: ../policy/org.freedesktop.udisks.policy.in.h:11
msgid "Authentication is required to mount the device"
msgstr "Aygıtı bağlamak için yetki gerekiyor"

#: ../policy/org.freedesktop.udisks.policy.in.h:12
msgid "Authentication is required to refresh ATA SMART data"
msgstr "ATA SMART verilerinin tazelenmesi için yetki gerekiyor"

#: ../policy/org.freedesktop.udisks.policy.in.h:13
msgid "Authentication is required to retrieve historical ATA SMART data"
msgstr "Eski ATA SMART verilerinin alınması için yetki gerekiyor"

#: ../policy/org.freedesktop.udisks.policy.in.h:14
msgid "Authentication is required to run ATA SMART self tests"
msgstr "ATA SMART otomatik testlerinin çalıştırılması için yetki gerekiyor"

#: ../policy/org.freedesktop.udisks.policy.in.h:15
msgid "Authentication is required to unlock an encrypted device"
msgstr "Şifrelenmiş bir aygıtın çözülmesi için yetki gerekiyor"

#: ../policy/org.freedesktop.udisks.policy.in.h:16
msgid "Authentication is required to unmount devices mounted by another user"
msgstr ""
"Başka bir kullanıcı tarafından bağlanan aygıtların ayrılması için yetki gerekiyor"

#: ../policy/org.freedesktop.udisks.policy.in.h:17
msgid "Cancel a job initiated by another user"
msgstr "Başka bir kullanıcı tarafından başlatılan görevi iptal et"

#: ../policy/org.freedesktop.udisks.policy.in.h:18
msgid "Check file system of a system-internal device"
msgstr "Bir iç-sistem aygıtındaki dosya sistemini denetle"

#: ../policy/org.freedesktop.udisks.policy.in.h:19
msgid "Check file system on a device"
msgstr "Bir aygıttaki dosya sistemini denetle"

#: ../policy/org.freedesktop.udisks.policy.in.h:20
msgid "Configure Linux Software RAID"
msgstr "Yazılımsal RAID mekanizmasını yapılandır"

#: ../policy/org.freedesktop.udisks.policy.in.h:21
msgid "Detach a drive"
msgstr "Bir sürücüyü ayır"

#: ../policy/org.freedesktop.udisks.policy.in.h:22
msgid "Eject media from a device"
msgstr "Bir sürücüden ortam çıkart"

#: ../policy/org.freedesktop.udisks.policy.in.h:23
msgid "Inhibit media detection"
msgstr "Ortam algılamasını engelle"

#: ../policy/org.freedesktop.udisks.policy.in.h:24
msgid "List open files"
msgstr "Açık dosyaları listele"

#: ../policy/org.freedesktop.udisks.policy.in.h:25
msgid "List open files on a system-internal device"
msgstr "Bir iç-sistem aygıtındaki açık dosyaları listele"

#: ../policy/org.freedesktop.udisks.policy.in.h:26
msgid "Lock an encrypted device unlocked by another user"
msgstr ""
"Başka bir kullanıcı tarafından kilidi çözülmüş bir şifreli aygıtı kilitle"

#: ../policy/org.freedesktop.udisks.policy.in.h:27
msgid "Modify a device"
msgstr "Bir aygıtı değiştir"

#: ../policy/org.freedesktop.udisks.policy.in.h:28
msgid "Modify a system-internal device"
msgstr "Bir iç-sistem aygıtını değiştir"

#: ../policy/org.freedesktop.udisks.policy.in.h:29
msgid "Mount a device"
msgstr "Bir aygıtı bağla"

#: ../policy/org.freedesktop.udisks.policy.in.h:30
msgid "Mount a system-internal device"
msgstr "Bir iç-sistem aygıtını bağla"

#: ../policy/org.freedesktop.udisks.policy.in.h:31
msgid "Refresh ATA SMART data"
msgstr "ATA SMART verilerini tazele"

#: ../policy/org.freedesktop.udisks.policy.in.h:32
msgid "Retrieve historical ATA SMART data"
msgstr "Eski ATA SMART verilerini al"

#: ../policy/org.freedesktop.udisks.policy.in.h:33
msgid "Run ATA SMART Self Tests"
msgstr "ATA SMART Otomatik testlerini çalıştır"

#: ../policy/org.freedesktop.udisks.policy.in.h:34
msgid "Set drive spindown timeout"
msgstr "Sürücünün dönüş hızının yavaşlama aralığını belirle"

#: ../policy/org.freedesktop.udisks.policy.in.h:35
msgid "Unlock an encrypted device"
msgstr "Şifrelenmiş bir aygıtın kilidini çöz"

#: ../policy/org.freedesktop.udisks.policy.in.h:36
msgid "Unmount a device mounted by another user"
msgstr "Başka bir kullanıcı tarafından bağlanmış bir aygıtı ayır"

#: ../src/polkit-action-lookup.c:94
msgid "Authentication is required to delete a partition"
msgstr "Disk bölümünün silinmesi için yetki gerekiyor"

#: ../src/polkit-action-lookup.c:95
msgid "Authentication is required to create a filesystem"
msgstr "Dosya sistemi oluşturmak için yetki gerekiyor"

#: ../src/polkit-action-lookup.c:96
msgid "Authentication is required to create a partition"
msgstr "Disk bölümü oluşturmak için yetki gerekiyor"

#: ../src/polkit-action-lookup.c:97
msgid "Authentication is required to modify a partition"
msgstr "Disk bölümünü düzenlemek için yetki gerekiyor"

#: ../src/polkit-action-lookup.c:98
msgid "Authentication is required to create a partition table"
msgstr "Disk bölümü tablosu oluşturmak için yetki gerekiyor"

#: ../src/polkit-action-lookup.c:99
msgid "Authentication is required to set the file system label"
msgstr "Dosya sistemi etiketini belirlemek için yetki gerekiyor"

#: ../src/polkit-action-lookup.c:100
msgid "Authentication is required to stop a Software RAID device"
msgstr "Yazılımsal RAID aygıtını durdurmak için yetki gerekiyor"

#: ../src/polkit-action-lookup.c:101
msgid "Authentication is required to check a Software RAID device"
msgstr "Yazılımsal RAID aygıtını denetlemek için yetki gerekiyor"

#: ../src/polkit-action-lookup.c:102
msgid "Authentication is required to repair a Software RAID device"
msgstr "Yazılımsal RAID aygıtını onarmak için yetki gerekiyor"

#: ../src/polkit-action-lookup.c:103
msgid ""
"Authentication is required to add a new component to a Software RAID device"
msgstr "Yazılımsal RAID aygıtını yeni bir bileşen eklemek için yetki gerekiyor"

#: ../src/polkit-action-lookup.c:104
msgid ""
"Authentication is required to remove a component from a Software RAID device"
msgstr "Yazılımsal RAID aygıtından bir bileşen kaldırmak için yetki gerekiyor"

#: ../src/polkit-action-lookup.c:105
msgid "Authentication is required to start a Software RAID device"
msgstr "Yazılımsal RAID aygıtını başlatmak için yetki gerekiyor"

#: ../src/polkit-action-lookup.c:106
msgid "Authentication is required to create a Software RAID device"
msgstr "Yazılımsal RAID aygıtı oluşturmak için yetki gerekiyor"

#: ../src/polkit-action-lookup.c:107
msgid "Authentication is required to inhibit polling on a drive"
msgstr ""
"Sürücünü periyodik sorgulanmasının (polling) engellenmesi için yetki gerekiyor"

#: ../src/polkit-action-lookup.c:108
msgid "Authentication is required to poll for media"
msgstr "Periyodik ortam sorgulaması (polling) için yetki gerekiyor"

#: ../src/polkit-action-lookup.c:109
msgid "Authentication is required to inhibit all drive polling"
msgstr ""
"Tüm sürücülerin periyodik sorgulanmasının (polling) engellenmesi için yetki gerekiyor"

#: ../src/polkit-action-lookup.c:187
msgid "Device"
msgstr "Aygıt"

#: ../src/polkit-action-lookup.c:212
msgid "Drive"
msgstr "Sürücü"


code:
--- udisks-2.0.91.orig/src/udiskslinuxfilesystem.c
+++ udisks-2.0.91/src/udiskslinuxfilesystem.c
@@ -298,7 +298,7 @@ static const gchar *iso9660_allow_gid_se
 /* ---------------------- udf -------------------- */

 static const gchar *udf_defaults[] = { "uid=", "gid=", "iocharset=utf8", "umask=0077", NULL };
-static const gchar *udf_allow[] = { "iocharset=", "umask=", NULL };
+static const gchar *udf_allow[] = { "iocharset=", "umask=", "mode=", "dmode=", NULL };
 static const gchar *udf_allow_uid_self[] = { "uid=", NULL };
 static const gchar *udf_allow_gid_self[] = { "gid=", NULL };

@@ -512,7 +512,8 @@ is_mount_option_allowed (const FSMountOp
 }

 static gchar **
-prepend_default_mount_options (const FSMountOptions *fsmo,
+prepend_default_mount_options (UDisksBlock *block,
+                               const FSMountOptions *fsmo,
                                uid_t                 caller_uid,
                                GVariant             *given_options)
 {
@@ -520,6 +521,8 @@ prepend_default_mount_options (const FSM
   gint n;
   gchar *s;
   gid_t gid;
+  const gchar *probed_fs_type;
+  /* static default options from FSMountOptions */
   const gchar *option_string;

   options = g_ptr_array_new ();
@@ -552,6 +555,17 @@ prepend_default_mount_options (const FSM
         }
     }

+  /* dynamic default options */
+  /* some broken DVDs come with 0400 directory permissions, making them
+   * unreadable; overwrite readonly UDF media with a 0500 dmode. */
+  probed_fs_type = udisks_block_get_id_type(block);
+  if (g_strcmp0 (probed_fs_type, "udf") == 0 &&
+      udisks_block_get_read_only(block))
+    {
+      g_ptr_array_add (options, g_strdup("dmode=0500"));
+    }
+
+  /* user supplied options */
   if (g_variant_lookup (given_options,
                         "options",
                         "&s", &option_string))
@@ -709,7 +723,7 @@ calculate_mount_options (UDisksDaemon
   /* always prepend some reasonable default mount options; these are
    * chosen here; the user can override them if he wants to
    */
-  options_to_use = prepend_default_mount_options (fsmo, caller_uid, options);
+  options_to_use = prepend_default_mount_options (block, fsmo, caller_uid, options);

   /* validate mount options */
   str = g_string_new ("uhelper=udisks2,nodev,nosuid");


code:
This patch was 'rejected' by upstream at least for now. Drop this from next
release of UDisks 2.x:

http://bugs.freedesktop.org/show_bug.cgi?id=36361#c5

Should be replaced by the udev rules file installed by ntfs-3g package.

--- src/udiskslinuxfilesystem.c.orig
+++ src/udiskslinuxfilesystem.c
@@ -164,6 +164,7 @@
   "vfat",
   "exfat",
   "ntfs",
+  "ntfs-3g",
   NULL,
 };


code:
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
    <Source>
        <Name>udisks2</Name>
        <Homepage>http://udisks.freedesktop.org</Homepage>
        <Packager>
            <Name>PisiLinux Community</Name>
            <Email>admins@pisilinux.org</Email>
        </Packager>
        <License>GPLv2+</License>
        <IsA>library</IsA>
        <IsA>app:console</IsA>
        Disk Management Service
        <Description>udisks provides a daemon, API and command line tools for managing disk devices attached to the system.</Description>
        <Archive sha1sum="8e38580b435986570bb7b784facf387757d2de43" type="tarbz2">https://udisks.freedesktop.org/releases/udisks-2.1.8.tar.bz2</Archive>
        <AdditionalFiles>
            <AdditionalFile target="po/tr.po">tr.po</AdditionalFile>
        </AdditionalFiles>
        <BuildDependencies>
            <Dependency>gtk-doc</Dependency>
            <Dependency>acl-devel</Dependency>
            <Dependency>glib2-devel</Dependency>
            <Dependency>polkit-devel</Dependency>
            <Dependency>libgudev-devel</Dependency>
            <Dependency>parted-devel</Dependency>
            <Dependency>libatasmart-devel</Dependency>
            <Dependency>device-mapper-devel</Dependency>
            <Dependency>lvm2-devel</Dependency>
            <Dependency>gobject-introspection-devel</Dependency>
            <Dependency>sg3_utils-devel</Dependency>
            <Dependency>ntfsprogs</Dependency>
            <Dependency>dosfstools</Dependency>
            <Dependency>docbook-xsl</Dependency>
            <Dependency>libxslt</Dependency>
            <Dependency>intltool</Dependency>
        </BuildDependencies>
        <Patches>

        </Patches>
    </Source>

    <Package>
        <Name>udisks2</Name>
        <RuntimeDependencies>
            <Dependency>acl</Dependency>
            <Dependency>glib2</Dependency>
            <Dependency>polkit</Dependency>
            <Dependency>libgudev</Dependency>
            <Dependency>lvm2</Dependency>
            <Dependency>mdadm</Dependency>
            <Dependency>parted</Dependency>
            <Dependency>libatasmart</Dependency>
            <Dependency>device-mapper</Dependency>
            <Dependency>ntfsprogs</Dependency>
            <Dependency>dosfstools</Dependency>

            <Dependency>sg3_utils</Dependency>

        </RuntimeDependencies>
        <Files>
            <Path fileType="config">/etc/udisks2</Path>
            <Path fileType="config">/etc/dbus-1</Path>
            <Path fileType="executable">/lib/udev/rules.d</Path>
            <Path fileType="executable">/usr/bin</Path>
            <Path fileType="executable">/usr/sbin</Path>
            <Path fileType="library">/usr/lib</Path>
            <Path fileType="library">/usr/libexec</Path>
            <Path fileType="data">/usr/share/bash-completion/completions</Path>
            <Path fileType="doc">/usr/share/doc</Path>
            <Path fileType="data">/usr/share/dbus-1</Path>
            <Path fileType="data">/usr/share/gir-1.0</Path>
            <Path fileType="doc">/usr/share/gtk-doc/</Path>
            <Path fileType="localedata">/usr/share/locale</Path>
            <Path fileType="data">/usr/share/polkit-1/</Path>
            <Path fileType="man">/usr/share/man</Path>
            <Path fileType="data">/var/lib/</Path>
            <Path fileType="data">/run/udisks</Path>
            <Path fileType="data">/usr/share/dbus-1/interfaces/*.xml</Path>
        </Files>
    </Package>

    <Package>
        <Name>udisks2-devel</Name>
        Development files for udisks2
        <RuntimeDependencies>
            <Dependency release="current">udisks2</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="header">/usr/include</Path>
            <Path fileType="data">/usr/lib/pkgconfig</Path>
        </Files>
    </Package>

    <History>
        <Update release="3">
            <Date>2017-01-28</Date>
            <Version>2.1.8</Version>
            <Comment>Version bump.</Comment>
            <Name>Stefan Gronewold(groni)</Name>
            <Email>groni@pisilinux.org</Email>
        </Update>
        <Update release="2">
            <Date>2016-06-09</Date>
            <Version>2.1.6</Version>
            <Comment>Release Bump</Comment>
            <Name>Pisi Linux Community</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="1">
            <Date>2016-01-26</Date>
            <Version>2.1.6</Version>
            <Comment>First release</Comment>
            <Name>Ertuğrul Erata</Name>
            <Email>ertugrulerata@gmail.com</Email>
        </Update>
    </History>
</PISI>


code:
<?xml version="1.0" ?>
<PISI>
    <Source>
        <Name>udisks2</Name>
        Disk Yönetim Hizmeti
        <Description xml:lang="tr">udisks, sisteme bağlı disk aygıtlarını yönetmek için programlama kitaplığı ve komut satırı araçları sunar.</Description>
    </Source>

    <Package>
        <Name>udisks2-devel</Name>
        udisks için geliştirme dosyaları
    </Package>
</PISI>