summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile1
-rwxr-xr-xcommand-stubs/pump-stub36
-rwxr-xr-xpump-stub36
-rwxr-xr-xscripts/upd-instroot1
4 files changed, 74 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 5a03919ec..c7ea1222d 100644
--- a/Makefile
+++ b/Makefile
@@ -70,6 +70,7 @@ install:
strip $(DESTDIR)/$(PYTHONLIBDIR)/*.so
cp -a raid*stub $(DESTDIR)/$(PYTHONLIBDIR)
cp -a losetup-stub $(DESTDIR)/$(PYTHONLIBDIR)
+ cp -a pump-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/pump-stub b/command-stubs/pump-stub
new file mode 100755
index 000000000..936315358
--- /dev/null
+++ b/command-stubs/pump-stub
@@ -0,0 +1,36 @@
+#!/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: pump [-i device]"
+ sys.exit(1)
+
+iface = "eth0"
+
+argv = argv[1:]
+while (argv):
+ if argv[0] == "-i":
+ if len(argv) < 2: usage()
+ iface = argv[1]
+ argv = argv[2:]
+ else:
+ usage()
+
+ns = isys.pumpNetDevice(iface)
+if ns:
+ f = open("/etc/resolv.conf", "w")
+ f.write("nameserver %s\n" % ns)
+ f.close()
+
+sys.exit(0)
diff --git a/pump-stub b/pump-stub
new file mode 100755
index 000000000..936315358
--- /dev/null
+++ b/pump-stub
@@ -0,0 +1,36 @@
+#!/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: pump [-i device]"
+ sys.exit(1)
+
+iface = "eth0"
+
+argv = argv[1:]
+while (argv):
+ if argv[0] == "-i":
+ if len(argv) < 2: usage()
+ iface = argv[1]
+ argv = argv[2:]
+ else:
+ usage()
+
+ns = isys.pumpNetDevice(iface)
+if ns:
+ f = open("/etc/resolv.conf", "w")
+ f.write("nameserver %s\n" % ns)
+ f.close()
+
+sys.exit(0)
diff --git a/scripts/upd-instroot b/scripts/upd-instroot
index dbbd1ca06..e2cce6db3 100755
--- a/scripts/upd-instroot
+++ b/scripts/upd-instroot
@@ -532,6 +532,7 @@ for p in $DEST $DESTGR; do
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
+ ln -s ../lib/anaconda/pump-stub $p/usr/bin/pump
mv $p/usr/sbin/anaconda $p/usr/bin/anaconda
mv $p/usr/lib/anaconda-runtime/lib* $p/usr/lib