add a prompt screen to let user confirm disk partition operation

jason zhang jason.gnu at gmail.com
Fri Oct 31 08:56:53 UTC 2008


I'm using RHEL5 to test this, anaconda version should be 11.1.2.87. that's
so strange, I do think anaconda should wait pre-script finish then perform
next action.  Maybe os.wait() not work properly this case? so anaconda think
the pre-script has already done while the subprocess of pre-script is still
running.

Best Regards,
Kevin

On Thu, Oct 30, 2008 at 9:49 PM, Peter Åstrand <astrand at cendio.se> wrote:

>
> That's strange; Anaconda should halt until the %pre script is finished.
> You are sure you haven't added a '&' by mistake, or something like that?
> Or, it might depend on the Anaconda version; we are using Fedora 8.
>
> Regards,
> Peter Åstrand
>
> On Thu, 30 Oct 2008, jason zhang wrote:
>
> > Peter,
> > I've tested the code you offered, seems it can not stop anaconda doing
> > partition erase while the your code promote the user to confirm, that
> means
> > if user don't select 'reboot' action at the VT8 screen before anaconda
> keep
> > processing 'package dependency check'  then perform partition and disk
> > format at VT6, the user still will face data loss risk. Any trick to
> suspend
> > anaconda to wait user indeed do a confirmation?
> >
> > BR,
> > Kevin
> >
> > On Mon, Oct 27, 2008 at 5:07 PM, Peter Åstrand <astrand at cendio.se>
> wrote:
> >
> > > >
> > > > does anyone know how can I add a custom screen to prompt user to
> confirm
> > > the
> > > > disk operations(they  will lose their disk data) when perform a
> kickstart
> > > > auto-installation. It's just need add some magic in %pre scripts, Eg.
> use
> > >
> > > This is what we are doing in TLCOS (ThinLinc Client OS):
> > >
> > > In ks.cfg:
> > >
> > > %pre
> > > /mnt/runtime/confirm-erase
> > > %end
> > >
> > > confirm-erase looks like:
> > >
> > > #!/usr/bin/python
> > > # -*-mode: python; coding: UTF-8 -*-
> > > #
> > > # Copyright 2002-2008 Cendio AB.
> > > # For more information, see http://www.cendio.com
> > >
> > > # FIXME: Determine current VT to switch back to
> > >
> > > VT = 8
> > > import os
> > > import sys
> > > import snack
> > > import time
> > > import fcntl
> > > import termios
> > >
> > > pid = os.fork()
> > > if pid != 0:
> > >    os.wait()
> > >    os._exit(0)
> > > os.system("chvt %d" % VT)
> > > fd = os.open("/dev/tty%d" % VT, os.O_RDWR)
> > > os.dup2(fd, 0)
> > > os.dup2(fd, 1)
> > > os.dup2(fd, 2)
> > > sys.stdin = os.fdopen(0, "r")
> > > sys.stdout = os.fdopen(1, "w")
> > > sys.stderr = os.fdopen(2, "w")
> > > os.setsid()
> > > fcntl.ioctl(fd, termios.TIOCSCTTY, 1)
> > > screen = snack.SnackScreen()
> > > if "reboot" == snack.ButtonChoiceWindow(screen, "WARNING",
> > >    "WARNING! All data on your hard disk will be DELETED!",
> > >    buttons=["reboot", "continue"]):
> > >    os.system("reboot")
> > >    while 1: time.sleep(10)
> > > screen.finish()
> > > os.system("chvt %d" % 1)
> > >
> > >
> > > Regards,
> > > ---
> > > Peter Åstrand           ThinLinc Chief Developer
> > > Cendio AB               http://www.cendio.com
> > > Wallenbergs gata 4
> > > 583 30 Linköping        Phone: +46-13-21 46 00
> > > _______________________________________________
> > > Kickstart-list mailing list
> > > Kickstart-list at redhat.com
> > > https://www.redhat.com/mailman/listinfo/kickstart-list
> > >
> >
>
>
> ---
> Peter Åstrand           ThinLinc Chief Developer
> Cendio AB               http://www.cendio.com
> Wallenbergs gata 4
> 583 30 Linköping        Phone: +46-13-21 46 00
>
> _______________________________________________
> Kickstart-list mailing list
> Kickstart-list at redhat.com
> https://www.redhat.com/mailman/listinfo/kickstart-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/kickstart-list/attachments/20081031/33982c7e/attachment.htm>


More information about the Kickstart-list mailing list