[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH 2/2 f14-branch master] Remove losetup and unlosetup from isys



No longer used. mount can now handle loop devices itself.
---
 data/command-stubs/losetup-stub |   50 ---------------------------------------
 pyanaconda/isys/__init__.py     |   28 ---------------------
 scripts/upd-instroot            |    1 -
 3 files changed, 0 insertions(+), 79 deletions(-)
 delete mode 100755 data/command-stubs/losetup-stub

diff --git a/data/command-stubs/losetup-stub b/data/command-stubs/losetup-stub
deleted file mode 100755
index 27c6bbc..0000000
--- a/data/command-stubs/losetup-stub
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/usr/bin/python
-#
-# losetup-stub
-#
-# Copyright (C) 2007  Red Hat, Inc.  All rights reserved.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-#
-
-import os
-import sys
-
-from pyanaconda import isys
-from sys import argv
-
-def usage():
-    print "usage: losetup [-d] /dev/loopN [image]"
-    sys.exit(1)
-
-if len(argv) < 3:
-    usage()
-
-if argv[1] == "-d" and len(argv[2]) > 4 and argv[2][-5:-1] == "loop":
-    try:
-        isys.unlosetup(argv[2])
-    except SystemError, (errno, msg):
-        print msg
-        sys.exit (1)
-    sys.exit(0)
-
-if len(argv[1]) > 4 and argv[1][-5:-1] == "loop":
-    try:
-        isys.losetup(argv[1], argv[2])
-    except SystemError, (errno, msg):
-        print msg
-        sys.exit (1)
-    sys.exit(0)
-
-usage()
diff --git a/pyanaconda/isys/__init__.py b/pyanaconda/isys/__init__.py
index 3f026fc..aebcad1 100755
--- a/pyanaconda/isys/__init__.py
+++ b/pyanaconda/isys/__init__.py
@@ -80,24 +80,6 @@ EARLY_SWAP_RAM = _isys.EARLY_SWAP_RAM
 def pathSpaceAvailable(path):
     return _isys.devSpaceFree(path)
 
-## Set up an already existing device node to be used as a loopback device.
-# @param device The full path to a device node to set up as a loopback device.
-# @param file The file to mount as loopback on device.
-# @param readOnly Should this loopback device be used read-only?
-def losetup(device, file, readOnly = 0):
-    # FIXME: implement this as a storage.devices.Device subclass
-    if readOnly:
-	mode = os.O_RDONLY
-    else:
-	mode = os.O_RDWR
-    targ = os.open(file, mode)
-    loop = os.open(device, mode)
-    try:
-        _isys.losetup(loop, targ, file)
-    finally:
-        os.close(loop)
-        os.close(targ)
-
 def lochangefd(device, file):
     # FIXME: implement this as a storage.devices.Device subclass
     loop = os.open(device, os.O_RDONLY)
@@ -108,16 +90,6 @@ def lochangefd(device, file):
         os.close(loop)
         os.close(targ)
 
-## Disable a previously setup loopback device.
-# @param device The full path to an existing loopback device node.
-def unlosetup(device):
-    # FIXME: implement this as a storage.devices.Device subclass
-    loop = os.open(device, os.O_RDONLY)
-    try:
-        _isys.unlosetup(loop)
-    finally:
-        os.close(loop)
-
 ## Mount a filesystem, similar to the mount system call.
 # @param device The device to mount.  If bindMount is True, this should be an
 #               already mounted directory.  Otherwise, it should be a device
diff --git a/scripts/upd-instroot b/scripts/upd-instroot
index 3a28b26..937f513 100755
--- a/scripts/upd-instroot
+++ b/scripts/upd-instroot
@@ -1107,7 +1107,6 @@ ln -snf /modules $DEST/lib/modules
 ln -snf /firmware $DEST/lib/firmware
 cp $DEST/usr/share/anaconda/raidstart-stub $DEST/usr/bin/raidstart
 cp $DEST/usr/share/anaconda/raidstop-stub $DEST/usr/bin/raidstop
-cp $DEST/usr/share/anaconda/losetup-stub $DEST/usr/bin/losetup
 cp $DEST/usr/share/anaconda/list-harddrives-stub $DEST/usr/bin/list-harddrives
 cp $DEST/usr/share/anaconda/loadkeys-stub $DEST/usr/bin/loadkeys
 cp $DEST/usr/share/anaconda/mknod-stub $DEST/usr/bin/mknod
-- 
1.7.2.2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]