diff options
-rw-r--r-- | Makefile | 1 | ||||
-rwxr-xr-x | command-stubs/losetup-stub | 40 | ||||
-rwxr-xr-x | losetup-stub | 40 | ||||
-rwxr-xr-x | scripts/upd-instroot | 1 | ||||
-rw-r--r-- | xkb.py | 11 |
5 files changed, 93 insertions, 0 deletions
@@ -70,6 +70,7 @@ install: cp -a *.so $(DESTDIR)/$(PYTHONLIBDIR) strip $(DESTDIR)/$(PYTHONLIBDIR)/*.so cp -a raid*stub $(DESTDIR)/$(PYTHONLIBDIR) + cp -a losetup-stub $(DESTDIR)/$(PYTHONLIBDIR) for d in $(SUBDIRS); do make DESTDIR=`cd $(DESTDIR); pwd` -C $$d install; [ $$? = 0 ] || exit 1; done archive: create-archive diff --git a/command-stubs/losetup-stub b/command-stubs/losetup-stub new file mode 100755 index 000000000..fed047d97 --- /dev/null +++ b/command-stubs/losetup-stub @@ -0,0 +1,40 @@ +#!/usr/bin/python + +import os +import sys + +# for testing +if (os.path.exists('isys')): + sys.path.append('isys') + +sys.path.append('/usr/lib/anaconda') + +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.makeDevInode(argv[2][-5:], argv[2]) + 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.makeDevInode(argv[1][-5:], argv[1]) + isys.losetup(argv[1], argv[2]) + except SystemError, (errno, msg): + print msg + sys.exit (1) + sys.exit(0) + +usage() diff --git a/losetup-stub b/losetup-stub new file mode 100755 index 000000000..fed047d97 --- /dev/null +++ b/losetup-stub @@ -0,0 +1,40 @@ +#!/usr/bin/python + +import os +import sys + +# for testing +if (os.path.exists('isys')): + sys.path.append('isys') + +sys.path.append('/usr/lib/anaconda') + +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.makeDevInode(argv[2][-5:], argv[2]) + 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.makeDevInode(argv[1][-5:], argv[1]) + isys.losetup(argv[1], argv[2]) + except SystemError, (errno, msg): + print msg + sys.exit (1) + sys.exit(0) + +usage() diff --git a/scripts/upd-instroot b/scripts/upd-instroot index d777ab129..65795180f 100755 --- a/scripts/upd-instroot +++ b/scripts/upd-instroot @@ -521,6 +521,7 @@ for p in $DEST $DESTGR; do echo -n -e "\rScrubbing trees..." "$p" ln -s ../lib/anaconda/raidstart-stub $p/usr/bin/raidstart ln -s ../lib/anaconda/raidstop-stub $p/usr/bin/raidstop + ln -s ../lib/anaconda/losetup-stub $p/usr/bin/losetup mv $p/usr/sbin/anaconda $p/usr/bin/anaconda mv $p/usr/sbin/anaconda-runrescue $p/usr/bin/anaconda-runrescue @@ -61,3 +61,14 @@ class XKB: def getMouseKeys (self): return _xkb.get_mousekeys () + +if __name__ == "__main__": + xkb = XKB() + print xkb.getVariants() + + + + + + + |