--- rescue.py | 25 ++++++++++++++++++++++++- scripts/upd-instroot | 4 +++- 2 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/rescue.py b/rescue.py index 665c56c..ba8455c 100644 --- a/rescue.py +++ b/rescue.py @@ -34,6 +34,7 @@ import iutil import shutil import time import network +import subprocess
import gettext _ = lambda x: gettext.ldgettext("anaconda", x) @@ -128,6 +129,22 @@ def makeMtab(instPath, fsset): finally: f.close()
+def makeFStab(instPath = ""): + if os.access("/etc/mtab", os.R_OK): + f = open("/etc/mtab" %(instPath,), "r") + buf = f.read() + f.close() + else: + buf = "" + + try: + f = open(instPath + "/etc/fstab", "w+") + if buf: + f.write(buf) + f.close() + except IOError, e: + log.info("failed to write /etc/fstab: %s" % e) + # make sure they have a resolv.conf in the chroot def makeResolvConf(instPath): if not os.access("/etc/resolv.conf", os.R_OK): @@ -183,7 +200,10 @@ def runShell(screen = None, msg=""): "system will reboot.")) print
- if os.path.exists("/bin/bash"): + if os.path.exists("/usr/bin/firstaidkit-qs") and os.path.exists("/usr/bin/dialog"): + proc = subprocess.Popen(["/bin/firstaidkit-qs"]) + proc.wait() + elif os.path.exists("/bin/bash"): iutil.execConsole() else: print(_("Unable to find /bin/sh to execute! Not starting shell")) @@ -436,6 +456,9 @@ def runRescue(anaconda, instClass): log.error("error making a resolv.conf: %s" %(e,)) msgStr = _("Your system is mounted under the %s directory.") % (anaconda.rootPath,)
+ #create /etc/fstab in ramdisk, so it is easier to work with RO mounted filesystems + makeFStab() + # run %post if we've mounted everything if anaconda.isKickstart: from kickstart import runPostScripts diff --git a/scripts/upd-instroot b/scripts/upd-instroot index 8a6ddca..31e5d89 100755 --- a/scripts/upd-instroot +++ b/scripts/upd-instroot @@ -235,7 +235,7 @@ PACKAGESRESCUE="bzip2 bzip2-libs dump libidn modutils mtools mt-st mtr net-tools open smartmontools openssh openssh-clients pciutils rsh traceroute tar rsync device-mapper device-mapper-libs dmraid ntfsprogs samba-client - firstaidkit-plugin-all" + firstaidkit firstaidkit-plugin-all dialog"
if [ $ARCH = i386 -o $ARCH = i586 -o $ARCH = x86_64 ]; then PACKAGESRESCUE="$PACKAGESRESCUE gpart grub" @@ -815,6 +815,8 @@ usr/sbin/smartctl usr/sbin/traceroute usr/$LIBDIR/firstaidkit/plugins/ usr/lib/python?.?/site-packages/pyfirstaidkit/ +usr/bin/dialog +usr/bin/firstaidkit-qs EOF
if [ $ARCH = i386 -o $ARCH = i586 -o $ARCH = x86_64 ]; then
The second bug which is fixed by this is also improvement of the user experience.. #440327 Martin
----- "Martin Sivak" msivak@redhat.com wrote:
rescue.py | 25 ++++++++++++++++++++++++- scripts/upd-instroot | 4 +++- 2 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/rescue.py b/rescue.py index 665c56c..ba8455c 100644 --- a/rescue.py +++ b/rescue.py @@ -34,6 +34,7 @@ import iutil import shutil import time import network +import subprocess
import gettext _ = lambda x: gettext.ldgettext("anaconda", x) @@ -128,6 +129,22 @@ def makeMtab(instPath, fsset): finally: f.close()
+def makeFStab(instPath = ""):
- if os.access("/etc/mtab", os.R_OK):
f = open("/etc/mtab" %(instPath,), "r")
buf = f.read()
f.close()
- else:
buf = ""
- try:
f = open(instPath + "/etc/fstab", "w+")
if buf:
f.write(buf)
f.close()
- except IOError, e:
log.info("failed to write /etc/fstab: %s" % e)
# make sure they have a resolv.conf in the chroot def makeResolvConf(instPath): if not os.access("/etc/resolv.conf", os.R_OK): @@ -183,7 +200,10 @@ def runShell(screen = None, msg=""): "system will reboot.")) print
- if os.path.exists("/bin/bash"):
- if os.path.exists("/usr/bin/firstaidkit-qs") and
os.path.exists("/usr/bin/dialog"):
proc = subprocess.Popen(["/bin/firstaidkit-qs"])
proc.wait()
- elif os.path.exists("/bin/bash"): iutil.execConsole() else: print(_("Unable to find /bin/sh to execute! Not starting
shell")) @@ -436,6 +456,9 @@ def runRescue(anaconda, instClass): log.error("error making a resolv.conf: %s" %(e,)) msgStr = _("Your system is mounted under the %s directory.") % (anaconda.rootPath,)
- #create /etc/fstab in ramdisk, so it is easier to work with RO
mounted filesystems
- makeFStab()
- # run %post if we've mounted everything if anaconda.isKickstart: from kickstart import runPostScripts
diff --git a/scripts/upd-instroot b/scripts/upd-instroot index 8a6ddca..31e5d89 100755 --- a/scripts/upd-instroot +++ b/scripts/upd-instroot @@ -235,7 +235,7 @@ PACKAGESRESCUE="bzip2 bzip2-libs dump libidn modutils mtools mt-st mtr net-tools open smartmontools openssh openssh-clients pciutils rsh traceroute tar rsync device-mapper device-mapper-libs dmraid ntfsprogs samba-client
firstaidkit-plugin-all"
firstaidkit firstaidkit-plugin-all dialog"
if [ $ARCH = i386 -o $ARCH = i586 -o $ARCH = x86_64 ]; then PACKAGESRESCUE="$PACKAGESRESCUE gpart grub" @@ -815,6 +815,8 @@ usr/sbin/smartctl usr/sbin/traceroute usr/$LIBDIR/firstaidkit/plugins/ usr/lib/python?.?/site-packages/pyfirstaidkit/ +usr/bin/dialog +usr/bin/firstaidkit-qs EOF
if [ $ARCH = i386 -o $ARCH = i586 -o $ARCH = x86_64 ]; then
1.5.4.3
If the firstaidkit-qs is a bash script that basically lets the user choose to enter bash, enter firstaidkit or reboot, wouldn't it be better to put that script in anaconda instead of firstaidkit?
On Mon, Jul 13, 2009 at 01:57:16PM +0200, Martin Sivak wrote:
rescue.py | 25 ++++++++++++++++++++++++- scripts/upd-instroot | 4 +++- 2 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/rescue.py b/rescue.py index 665c56c..ba8455c 100644 --- a/rescue.py +++ b/rescue.py @@ -34,6 +34,7 @@ import iutil import shutil import time import network +import subprocess
import gettext _ = lambda x: gettext.ldgettext("anaconda", x) @@ -128,6 +129,22 @@ def makeMtab(instPath, fsset): finally: f.close()
+def makeFStab(instPath = ""):
- if os.access("/etc/mtab", os.R_OK):
f = open("/etc/mtab" %(instPath,), "r")
buf = f.read()
f.close()
- else:
buf = ""
- try:
f = open(instPath + "/etc/fstab", "w+")
if buf:
f.write(buf)
f.close()
- except IOError, e:
log.info("failed to write /etc/fstab: %s" % e)
# make sure they have a resolv.conf in the chroot def makeResolvConf(instPath): if not os.access("/etc/resolv.conf", os.R_OK): @@ -183,7 +200,10 @@ def runShell(screen = None, msg=""): "system will reboot.")) print
- if os.path.exists("/bin/bash"):
- if os.path.exists("/usr/bin/firstaidkit-qs") and os.path.exists("/usr/bin/dialog"):
proc = subprocess.Popen(["/bin/firstaidkit-qs"])
proc.wait()
- elif os.path.exists("/bin/bash"): iutil.execConsole() else: print(_("Unable to find /bin/sh to execute! Not starting shell"))
@@ -436,6 +456,9 @@ def runRescue(anaconda, instClass): log.error("error making a resolv.conf: %s" %(e,)) msgStr = _("Your system is mounted under the %s directory.") % (anaconda.rootPath,)
- #create /etc/fstab in ramdisk, so it is easier to work with RO mounted filesystems
- makeFStab()
- # run %post if we've mounted everything if anaconda.isKickstart: from kickstart import runPostScripts
diff --git a/scripts/upd-instroot b/scripts/upd-instroot index 8a6ddca..31e5d89 100755 --- a/scripts/upd-instroot +++ b/scripts/upd-instroot @@ -235,7 +235,7 @@ PACKAGESRESCUE="bzip2 bzip2-libs dump libidn modutils mtools mt-st mtr net-tools open smartmontools openssh openssh-clients pciutils rsh traceroute tar rsync device-mapper device-mapper-libs dmraid ntfsprogs samba-client
firstaidkit-plugin-all"
firstaidkit firstaidkit-plugin-all dialog"
if [ $ARCH = i386 -o $ARCH = i586 -o $ARCH = x86_64 ]; then PACKAGESRESCUE="$PACKAGESRESCUE gpart grub" @@ -815,6 +815,8 @@ usr/sbin/smartctl usr/sbin/traceroute usr/$LIBDIR/firstaidkit/plugins/ usr/lib/python?.?/site-packages/pyfirstaidkit/ +usr/bin/dialog +usr/bin/firstaidkit-qs EOF
if [ $ARCH = i386 -o $ARCH = i586 -o $ARCH = x86_64 ]; then
1.5.4.3
Anaconda-devel-list mailing list Anaconda-devel-list@redhat.com https://www.redhat.com/mailman/listinfo/anaconda-devel-list
On Monday, July 13 2009, Joel Granados said:
If the firstaidkit-qs is a bash script that basically lets the user choose to enter bash, enter firstaidkit or reboot, wouldn't it be better to put that script in anaconda instead of firstaidkit?
Even better would be to replace the prompts we have now in rescue mode with essentially starting firstaidkit. And then firstaidkit hopefully has "launch a shell in my system root" as one of the things you can do :-)
Jeremy
Firstaidkit itself no.. but the firstaidkit-qs (as quick-start) does exactly this. It shows a menu using dialog shell command with all the usual tasks. (it contains firstaidkit diagnostic, shell, reboot at the moment)
This patch (I have modified it slightly since the original post, so it fallbacks to sh if anything fails) adds exactly the needed functionality into rescue.sh.
----- "Jeremy Katz" katzj@redhat.com wrote:
On Monday, July 13 2009, Joel Granados said:
If the firstaidkit-qs is a bash script that basically lets the user choose to enter bash, enter firstaidkit or reboot, wouldn't it be
better
to put that script in anaconda instead of firstaidkit?
Even better would be to replace the prompts we have now in rescue mode with essentially starting firstaidkit. And then firstaidkit hopefully has "launch a shell in my system root" as one of the things you can do :-)
Jeremy
Anaconda-devel-list mailing list Anaconda-devel-list@redhat.com https://www.redhat.com/mailman/listinfo/anaconda-devel-list
My original concern that firstaidkit would be taking care os something that, to me, was best left in anaconda (deciding what to do when in rescue mode). But, moving to a situation where firstaidkit completely handles the rescue mode environment, I don't see why this script can't be in firstaidkit.
I'll go back on my original suggestion and give a +1 to the firstaidkit-qs script.
On Mon, Jul 13, 2009 at 11:34:38AM -0400, Martin Sivak wrote:
Firstaidkit itself no.. but the firstaidkit-qs (as quick-start) does exactly this. It shows a menu using dialog shell command with all the usual tasks. (it contains firstaidkit diagnostic, shell, reboot at the moment)
This patch (I have modified it slightly since the original post, so it fallbacks to sh if anything fails) adds exactly the needed functionality into rescue.sh.
----- "Jeremy Katz" katzj@redhat.com wrote:
On Monday, July 13 2009, Joel Granados said:
If the firstaidkit-qs is a bash script that basically lets the user choose to enter bash, enter firstaidkit or reboot, wouldn't it be
better
to put that script in anaconda instead of firstaidkit?
Even better would be to replace the prompts we have now in rescue mode with essentially starting firstaidkit. And then firstaidkit hopefully has "launch a shell in my system root" as one of the things you can do :-)
Jeremy
Anaconda-devel-list mailing list Anaconda-devel-list@redhat.com https://www.redhat.com/mailman/listinfo/anaconda-devel-list
Anaconda-devel-list mailing list Anaconda-devel-list@redhat.com https://www.redhat.com/mailman/listinfo/anaconda-devel-list
anaconda-devel@lists.fedoraproject.org