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