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 > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 05-10-2010, 12:28 PM
Hans de Goede
 
Default cleanup booty x86 flag.serial handling (#589773)

Bug 589773 is caused by booty's x86 flag.serial handling not setting
self.serial at all, when serial is present on the cmdline, but no
console= argument it present and the system is not ia64.

Looking closer at the code I also noticed that it will try to
access the options list at index 1, even though it is empty, when
console=ttyS0 is passed rather then console=ttyS0,...

All in all the code was rather messy, so this patch rewrites it to
better readable, hopefully obviously correct code.
---
booty/bootloaderInfo.py | 43 ++++++++++++++++++++-----------------------
1 files changed, 20 insertions(+), 23 deletions(-)

diff --git a/booty/bootloaderInfo.py b/booty/bootloaderInfo.py
index 2aaac7a..d63c9a1 100644
--- a/booty/bootloaderInfo.py
+++ b/booty/bootloaderInfo.py
@@ -556,6 +556,9 @@ class bootloaderInfo(object):
self.above1024 = 0
self.timeout = None
self.storage = anaconda.storage
+ self.serial = 0
+ self.serialDevice = None
+ self.serialOptions = None

# this has somewhat strange semantics. if 0, act like a normal
# "install" case. if 1, update lilo.conf (since grubby won't do that)
@@ -567,34 +570,28 @@ class bootloaderInfo(object):
self._drivelist = None

if flags.serial != 0:
- options = ""
- device = ""
- console = flags.cmdline.get("console", "")
+ self.serial = 1
+ self.timeout = 5

- # the options are everything after the comma
- comma = console.find(",")
- if comma != -1:
- options = console[comma:]
- device = console[:comma]
+ console = flags.cmdline.get("console", "")
+ if console:
+ # the options are everything after the comma
+ comma = console.find(",")
+ if comma != -1:
+ self.serialDevice = console[:comma]
+ self.serialOptions = console[comma + 1:]
+ else:
+ self.serialDevice = console
+ self.serialOptions = ""
else:
- device = console
-
- if not device and iutil.isIA64():
self.serialDevice = "ttyS0"
self.serialOptions = ""
+
+ if self.serialOptions:
+ self.args.append("console=%s,%s" %(self.serialDevice,
+ self.serialOptions))
else:
- self.serialDevice = device
- # don't keep the comma in the options
- self.serialOptions = options[1:]
-
- if self.serialDevice:
- self.args.append("console=%s%s" %(self.serialDevice, options))
- self.serial = 1
- self.timeout = 5
- else:
- self.serial = 0
- self.serialDevice = None
- self.serialOptions = None
+ self.args.append("console=%s,%s" % self.serialDevice)

if flags.virtpconsole is not None:
if flags.virtpconsole.startswith("/dev/"):
--
1.7.0.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 05-10-2010, 03:55 PM
"Brian C. Lane"
 
Default cleanup booty x86 flag.serial handling (#589773)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 05/10/2010 05:28 AM, Hans de Goede wrote:
> Bug 589773 is caused by booty's x86 flag.serial handling not setting
> self.serial at all, when serial is present on the cmdline, but no
> console= argument it present and the system is not ia64.
>
> Looking closer at the code I also noticed that it will try to
> access the options list at index 1, even though it is empty, when
> console=ttyS0 is passed rather then console=ttyS0,...
>
> All in all the code was rather messy, so this patch rewrites it to
> better readable, hopefully obviously correct code.
> ---


> + if self.serialOptions:
> + self.args.append("console=%s,%s" %(self.serialDevice,
> + self.serialOptions))
> else:
> + self.args.append("console=%s,%s" % self.serialDevice)

I think you meant:

self.args.append("console=%s" % self.serialDevice)

with no serial options.

Other than that, looks good to me.

- --
Brian C. Lane <bcl@redhat.com>
Red Hat / Port Orchard, WA
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQEVAwUBS+gsfhF+jBaO/jp/AQK98Af/cC3Cw2fkObfRP68J22LJSLqp8U27Bl/v
JUyA7pVFdSS0D6aov6G8GoubRyqKhqLpT1QSJ2UrQN8ACU3cne JTwTxmqf4W/2P/
rtQyQzgQSDfRS0/52DWA4iHng9g5Smzqrka9CItj/eaZoAyorfdy93SlSitqLbPB
PYq+78D19NLY7UlNsPFu1ud2ZhYKjLbsCPO16IwyjwMdR2DBpK YqwFgjt30hOv4E
bYBrC1ozObVZaX2hVC7iT4mQgKVEzS+wsavkWeqqjOMEcnUwpr +BQwB8Hx/KUbI9
XVDaeg+n7ba4jSqTF1pDng/DuJ1WWgpoose3l6H+EsCZowKmvpmIqw==
=nPKn
-----END PGP SIGNATURE-----

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 05-11-2010, 09:41 AM
Hans de Goede
 
Default cleanup booty x86 flag.serial handling (#589773)

Hi,

On 05/10/2010 05:55 PM, Brian C. Lane wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 05/10/2010 05:28 AM, Hans de Goede wrote:

Bug 589773 is caused by booty's x86 flag.serial handling not setting
self.serial at all, when serial is present on the cmdline, but no
console= argument it present and the system is not ia64.

Looking closer at the code I also noticed that it will try to
access the options list at index 1, even though it is empty, when
console=ttyS0 is passed rather then console=ttyS0,...

All in all the code was rather messy, so this patch rewrites it to
better readable, hopefully obviously correct code.
---




+ if self.serialOptions:
+ self.args.append("console=%s,%s" %(self.serialDevice,
+ self.serialOptions))
else:
+ self.args.append("console=%s,%s" % self.serialDevice)


I think you meant:

self.args.append("console=%s" % self.serialDevice)

with no serial options.



Ah yes, good one.

Thanks,

Hans

_______________________________________________
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 02:29 AM.

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