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 12-03-2009, 06:45 AM
Hans de Goede
 
Default If anaconda is not run from loader or liveinst, fail.

Hi,

One small nitpick.

On 12/02/2009 10:30 PM, Chris Lumens wrote:

Running anaconda from the command line has only ever been halfway supported
or functional. Now with test mode and rootPath modes gone, running from the
command line doesn't make any sense. So, catch this case and exit.
---
anaconda | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/anaconda b/anaconda
index ed72947..4aa002a 100755
--- a/anaconda
+++ b/anaconda
@@ -642,9 +642,19 @@ if __name__ == "__main__":

(opts, args) = parseOptions()

+ try:
+ parent = os.path.realpath("/proc/%s/exe" % os.getppid())
+ except:
+ parent = "/sbin/loader"
+
if opts.unsupportedMode:
stdoutLog.error("Running anaconda in %s mode is no longer supported." % opts.unsupportedMode)
sys.exit(0)
+ elif not opts.liveinst or not parent.endswith("/loader"):
+ stdoutLog.error("Running anaconda from the command line is not supported.
"
+ "Please start anaconda either from the boot media or from "
+ "the livecd environment.")
+ sys.exit(0)

# Now that we've got arguments, do some extra processing.
instClass = getInstClass()


I don't see the new if block as being exclusive to the opts.unsupportedMode if, therefor
it should be just an if not an elif. But that might just be my preference.

Other then that this entire patch set is a huge +1, please commit (with or without the elif
changed).

I wonder can we also get rid of the setupfilesystems flag stuff ?

Regards,

Hans

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 12-03-2009, 01:11 PM
Chris Lumens
 
Default If anaconda is not run from loader or liveinst, fail.

> > if opts.unsupportedMode:
> > stdoutLog.error("Running anaconda in %s mode is no longer supported." % opts.unsupportedMode)
> > sys.exit(0)
> >+ elif not opts.liveinst or not parent.endswith("/loader"):
> >+ stdoutLog.error("Running anaconda from the command line is not supported.
"
> >+ "Please start anaconda either from the boot media or from "
> >+ "the livecd environment.")
> >+ sys.exit(0)
> >
> > # Now that we've got arguments, do some extra processing.
> > instClass = getInstClass()
>
> I don't see the new if block as being exclusive to the opts.unsupportedMode if, therefor
> it should be just an if not an elif. But that might just be my preference.

I don't think it matters one way or the other, but I can certainly make
that change.

> I wonder can we also get rid of the setupfilesystems flag stuff ?

The only place we set flags.setupFilesystems is in flags.py, and it will
only ever be 1. Good catch. So yes, that can go too. One second...

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 12-03-2009, 02:02 PM
Bill Nottingham
 
Default If anaconda is not run from loader or liveinst, fail.

Chris Lumens (clumens@redhat.com) said:
> diff --git a/anaconda b/anaconda
> index ed72947..4aa002a 100755
> --- a/anaconda
> +++ b/anaconda
> @@ -642,9 +642,19 @@ if __name__ == "__main__":
>
> (opts, args) = parseOptions()
>
> + try:
> + parent = os.path.realpath("/proc/%s/exe" % os.getppid())
> + except:
> + parent = "/sbin/loader"
> +
> if opts.unsupportedMode:
> stdoutLog.error("Running anaconda in %s mode is no longer supported." % opts.unsupportedMode)
> sys.exit(0)
> + elif not opts.liveinst or not parent.endswith("/loader"):
> + stdoutLog.error("Running anaconda from the command line is not supported.
"
> + "Please start anaconda either from the boot media or from "
> + "the livecd environment.")
> + sys.exit(0)
>
> # Now that we've got arguments, do some extra processing.
> instClass = getInstClass()

As mentioned on IRC, I would think that the entirety of checks on
'opts.livenst' could be replaced with checks for the liveinst install
method; as it stands, you could pass --liveinst --method http://...., which
would likely explode spectacularly. But that would happen before this patch,
too.

Bill

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 12-03-2009, 02:31 PM
Jeremy Katz
 
Default If anaconda is not run from loader or liveinst, fail.

On Thu, Dec 3, 2009 at 10:02 AM, Bill Nottingham <notting@redhat.com> wrote:
> As mentioned on IRC, I would think that the entirety of checks on
> 'opts.livenst' could be replaced with checks for the liveinst install
> method; as it stands, you could pass --liveinst --method http://...., which
> would likely explode spectacularly. But that would happen before this patch,
> too.

I had fixed that to be working at one point per request of some
people. It'd be nice not to go out of the way to break it

- Jeremy

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

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