[Tutor] Python and boot sequences

David Rock david at graniteweb.com
Sun Jul 8 18:04:54 CEST 2012


* Dave Wilder <D.Wilder at F5.com> [2012-06-28 12:54]:
> 
> Can a Python script be written that has the ability to stop a Linux
> device in the middle of a boot when a certain sequence occurs and then
> perform an action?
> 
> For example, when I boot my switch (w/ Linux OS 2.7.3), I want to stop
> the boot when I see a series of asterisks.  When I see this, I need to
> hit the <ESC><SHIFT><9> sequence.  Then, I need to select a menu
> option (e.g. 1 to run a test or Q to quit and continue w/ the boot).
> Another example would be when doing a PXE boot, selecting the image to
> load when prompted during the reboot.

Probably not.  The issue is that you are dealing with the bootstrap
process of a system.  Typically, this is not a place where any semblance
of external user interaction exists.  The examples you show represent
compiled-in options that are more likely part of the initial ramdisk, 
BIOS-level code for a specific device, or something similar.  

The PXE boot menu example is usually something that's being presented by
an external server (via cobbler, or a similar product).  There isn't an
OS at that point that would likely be able to supply a python
environment to use.

I think we would need to better understand exactly what you are trying
to build, but you are probably looking for something that would be a
much lower level than python.

-- 
David Rock
david at graniteweb.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/tutor/attachments/20120708/4a3e58d0/attachment.pgp>


More information about the Tutor mailing list