FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 11-23-2009, 07:40 PM
Chris Lumens
 
Default When anaconda halts, return a code so init knows what to do (#525615).

Also, do the appropriate shutdown/halt/reboot kickstart action at the end of
anaconda as well.
---
anaconda | 31 ++++++++++++++++++++++---------
1 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/anaconda b/anaconda
index 785fa7e..caa6dbc 100755
--- a/anaconda
+++ b/anaconda
@@ -1062,19 +1062,32 @@ if __name__ == "__main__":
else:
kickstart.setSteps(anaconda)

+ rc = 0
+
try:
anaconda.intf.run(anaconda)
except SystemExit, code:
- anaconda.intf.shutdown()
-
- if anaconda.isKickstart and anaconda.id.ksdata.reboot.eject:
- for drive in anaconda.id.storage.devicetree.devices.values():
- if drive.type != "cdrom":
- continue
-
- log.info("attempting to eject %s" % drive.path)
- drive.eject()
+ rc = code

+ anaconda.intf.shutdown()
del anaconda.intf

+ if anaconda.isKickstart:
+ from pykickstart.constants import KS_HALT, KS_POWEROFF
+
+ if anaconda.id.ksdata.reboot.eject:
+ for drive in anaconda.id.storage.devicetree.getDevicesByType("c drom"):
+ log.info("attempting to eject %s" % drive.path)
+ drive.eject()
+
+ # Only perform these actions if anaconda properly finished up. The
+ # default action for anaconda is to reboot, so we don't need to do
+ # that here.
+ if rc == 0 and anaconda.id.ksdata.reboot.action == KS_HALT:
+ iutil.execWithRedirect("halt", [], searchPath=1)
+ elif rc == 0 and anaconda.id.ksdata.reboot.action == KS_POWEROFF:
+ iutil.execWithRedirect("poweroff", [], searchPath=1)
+
+ sys.exit(rc)
+
# vim:tw=78:ts=4:et:sw=4
--
1.6.5.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 12-01-2009, 08:32 PM
Chris Lumens
 
Default When anaconda halts, return a code so init knows what to do (#525615).

Also, do the appropriate shutdown/halt/reboot kickstart action at the end of
anaconda as well.
---
anaconda | 31 ++++++++++++++++++++++---------
1 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/anaconda b/anaconda
index 55eaf8d..f404f14 100755
--- a/anaconda
+++ b/anaconda
@@ -1066,19 +1066,32 @@ if __name__ == "__main__":
else:
kickstart.setSteps(anaconda)

+ rc = 0
+
try:
anaconda.intf.run(anaconda)
except SystemExit, code:
- anaconda.intf.shutdown()
-
- if anaconda.isKickstart and anaconda.id.ksdata.reboot.eject:
- for drive in anaconda.id.storage.devicetree.devices.values():
- if drive.type != "cdrom":
- continue
-
- log.info("attempting to eject %s" % drive.path)
- drive.eject()
+ rc = code

+ anaconda.intf.shutdown()
del anaconda.intf

+ if anaconda.isKickstart:
+ from pykickstart.constants import KS_HALT, KS_POWEROFF
+
+ if anaconda.id.ksdata.reboot.eject:
+ for drive in anaconda.id.storage.devicetree.getDevicesByType("c drom"):
+ log.info("attempting to eject %s" % drive.path)
+ drive.eject()
+
+ # Only perform these actions if anaconda properly finished up. The
+ # default action for anaconda is to reboot, so we don't need to do
+ # that here.
+ if rc == 0 and anaconda.id.ksdata.reboot.action == KS_HALT:
+ iutil.execWithRedirect("halt", [], searchPath=1)
+ elif rc == 0 and anaconda.id.ksdata.reboot.action == KS_POWEROFF:
+ iutil.execWithRedirect("poweroff", [], searchPath=1)
+
+ sys.exit(rc)
+
# vim:tw=78:ts=4:et:sw=4
--
1.6.5.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 07:10 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org