summaryrefslogtreecommitdiffstats
path: root/booty
diff options
context:
space:
mode:
authorJesse Keating <jkeating@redhat.com>2009-04-17 16:39:24 -0700
committerJesse Keating <jkeating@redhat.com>2009-04-17 16:39:24 -0700
commit5e184c33a83eedc7dd71c5fc6a8e5586d6639d95 (patch)
tree93c4fe78721988bc34c1394d1abea529e8c179b3 /booty
parentfc982ce3ae77d0ad8708a94a3d4ba46a4825773c (diff)
downloadanaconda-5e184c33a83eedc7dd71c5fc6a8e5586d6639d95.tar.gz
anaconda-5e184c33a83eedc7dd71c5fc6a8e5586d6639d95.tar.xz
anaconda-5e184c33a83eedc7dd71c5fc6a8e5586d6639d95.zip
Clean up argument list after changing from rhpl to iutil for execWithRedirect
iutil uses subprocess.Popen and passes in the argv as a list, which causes Popen to use the first entry of the list as the executable, and the rest of the entires as arguments to that executable. This is different from how rhpl did things in which the first argument of the arglist had to be the executable itself. Also iutil expects argv to be a real list not a tuple.
Diffstat (limited to 'booty')
-rw-r--r--booty/alpha.py4
-rw-r--r--booty/bootloaderInfo.py10
-rw-r--r--booty/ppc.py2
-rw-r--r--booty/s390.py3
-rw-r--r--booty/sparc.py2
-rw-r--r--booty/x86.py4
6 files changed, 12 insertions, 13 deletions
diff --git a/booty/alpha.py b/booty/alpha.py
index 461086c1e..efe4446fd 100644
--- a/booty/alpha.py
+++ b/booty/alpha.py
@@ -110,7 +110,7 @@ class alphaBootloaderInfo(bootloaderInfo):
# Calling swriteboot. The first argument is the disk to write
# to and the second argument is a path to the bootstrap loader
# file.
- args = ("swriteboot", ("/dev/%s" % wbd), "/boot/bootlx")
+ args = [("/dev/%s" % wbd), "/boot/bootlx"]
iutil.execWithRedirect ('/sbin/swriteboot', args,
root = instRoot,
stdout = "/dev/tty5",
@@ -121,7 +121,7 @@ class alphaBootloaderInfo(bootloaderInfo):
# the number of the partition on which aboot.conf resides.
# It's always the boot partition whether it's / or /boot (with
# the mount point being omitted.)
- args = ("abootconf", ("/dev/%s" % wbd), str (bdpn))
+ args = [("/dev/%s" % wbd), str (bdpn)]
iutil.execWithRedirect ('/sbin/abootconf', args,
root = instRoot,
stdout = "/dev/tty5",
diff --git a/booty/bootloaderInfo.py b/booty/bootloaderInfo.py
index b50a11a6c..dfd96d29b 100644
--- a/booty/bootloaderInfo.py
+++ b/booty/bootloaderInfo.py
@@ -67,12 +67,12 @@ def syncDataToDisk(dev, mntpt, instRoot = "/"):
# and xfs is even more "special" (#117968)
if isys.readFSType(dev) == "xfs":
iutil.execWithRedirect("/usr/sbin/xfs_freeze",
- ["/usr/sbin/xfs_freeze", "-f", mntpt],
+ ["-f", mntpt],
stdout = "/dev/tty5",
stderr = "/dev/tty5",
root = instRoot)
iutil.execWithRedirect("/usr/sbin/xfs_freeze",
- ["/usr/sbin/xfs_freeze", "-u", mntpt],
+ ["-u", mntpt],
stdout = "/dev/tty5",
stderr = "/dev/tty5",
root = instRoot)
@@ -534,7 +534,7 @@ class efiBootloaderInfo(bootloaderInfo):
# XXX wouldn't it be nice to have a real interface to use efibootmgr from?
def removeOldEfiEntries(self, instRoot):
p = os.pipe()
- iutil.execWithRedirect('/usr/sbin/efibootmgr', ["efibootmgr"],
+ iutil.execWithRedirect('/usr/sbin/efibootmgr', [],
root = instRoot, stdout = p[1])
os.close(p[1])
@@ -552,7 +552,7 @@ class efiBootloaderInfo(bootloaderInfo):
if string.join(fields[1:], " ") == productName:
entry = fields[0][4:8]
iutil.execWithRedirect('/usr/sbin/efibootmgr',
- ["efibootmgr", "-b", entry, "-B"],
+ ["-b", entry, "-B"],
root = instRoot,
stdout="/dev/tty5", stderr="/dev/tty5")
@@ -582,7 +582,7 @@ class efiBootloaderInfo(bootloaderInfo):
argv = [ "/usr/sbin/efibootmgr", "-c" , "-w", "-L",
productName, "-d", "/dev/%s" % bootdisk,
"-p", bootpart, "-l", "\\EFI\\redhat\\" + self.bootloader ]
- iutil.execWithRedirect(argv[0], argv, root = instRoot,
+ iutil.execWithRedirect(argv[0], argv[1:], root = instRoot,
stdout = "/dev/tty5",
stderr = "/dev/tty5")
diff --git a/booty/ppc.py b/booty/ppc.py
index e1a948907..4633f079d 100644
--- a/booty/ppc.py
+++ b/booty/ppc.py
@@ -144,7 +144,7 @@ class ppcBootloaderInfo(bootloaderInfo):
if not flags.test:
iutil.execWithRedirect(ybinargs[0],
- ybinargs,
+ ybinargs[1:],
stdout = "/dev/tty5",
stderr = "/dev/tty5",
root = instRoot)
diff --git a/booty/s390.py b/booty/s390.py
index 575ab2813..717f50ffa 100644
--- a/booty/s390.py
+++ b/booty/s390.py
@@ -153,8 +153,7 @@ class s390BootloaderInfo(bootloaderInfo):
f.close()
if not justConfigFile:
- argv = [ "/sbin/zipl" ]
- iutil.execWithRedirect(argv[0], argv, root = instRoot,
+ iutil.execWithRedirect("/sbin/zipl", [], root = instRoot,
stdout = "/dev/stdout",
stderr = "/dev/stderr")
diff --git a/booty/sparc.py b/booty/sparc.py
index b094a4512..39b84f167 100644
--- a/booty/sparc.py
+++ b/booty/sparc.py
@@ -95,7 +95,7 @@ class sparcBootloaderInfo(bootloaderInfo):
if not flags.test:
iutil.execWithRedirect(sbinargs[0],
- sbinargs,
+ sbinargs[1:],
stdout = "/dev/tty5",
stderr = "/dev/tty5",
root = instRoot)
diff --git a/booty/x86.py b/booty/x86.py
index d710fbb8e..99f2e5d93 100644
--- a/booty/x86.py
+++ b/booty/x86.py
@@ -71,7 +71,7 @@ class x86BootloaderInfo(efiBootloaderInfo):
# copy the stage files over into /boot
iutil.execWithRedirect("/sbin/grub-install",
- ["/sbin/grub-install", "--just-copy"],
+ ["--just-copy"],
stdout = "/dev/tty5", stderr = "/dev/tty5",
root = instRoot)
@@ -89,7 +89,7 @@ class x86BootloaderInfo(efiBootloaderInfo):
syncDataToDisk(bootDev, "/", instRoot)
iutil.execWithRedirect('/sbin/grub' ,
- [ "grub", "--batch", "--no-floppy",
+ [ "--batch", "--no-floppy",
"--device-map=/boot/grub/device.map" ],
stdin = p[0],
stdout = "/dev/tty5", stderr = "/dev/tty5",