> That's a lot of python for a confirmation box.  Have you looked at using 
> dialog? 

Last time I checked, dialog was not available in the installation 
environment. Also, most of the code is for changing virtual console. This 
would be necessary even with the dialog binary. But if anyone has a 
smaller solution, please let me know. 


Best regards, 
Peter Åstrand
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Peter Åstrand
> Sent: Tuesday, November 27, 2007 12:10 AM
> To: Discussion of Fedora build system; [EMAIL PROTECTED]
> Subject: Re: Confirming predefined partition layout using kickstart
> 
> On Mon, 26 Nov 2007, Jeremy Katz wrote:
> 
> > > Using F8 and Kickstart, we want to predefine everything about 
> > > partitions, but also let the user confirm that the disk is going to 
> > > be wiped. I thought this could be done with just
> 
> > You could go with the route of popping up a dialog in %pre for 
> > confirmation if that's all you really want.
> 
> Thanks for your help. I've tried a %pre solution now and it seems to work 
> great. Here's what I did:
> 
> %pre --interpreter /usr/bin/python
> TTY = 3
> 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" % TTY)
> fd = os.open("/dev/tty%d" % TTY, 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)
> %end
> 
> 
> Best regards,
> ---
> Peter Åstrand         ThinLinc Chief Developer
> Cendio AB             http://www.cendio.se
> Wallenbergs gata 4
> 583 30 Linköping      Phone: +46-13-21 46 00
> 
> _______________________________________________
> Kickstart-list mailing list
> [EMAIL PROTECTED]
> https://www.redhat.com/mailman/listinfo/kickstart-list
> 

---
Peter Åstrand           ThinLinc Chief Developer
Cendio AB               http://www.cendio.se
Wallenbergs gata 4
583 30 Linköping        Phone: +46-13-21 46 00
--
Fedora-buildsys-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/fedora-buildsys-list

Reply via email to