[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: add a prompt screen to let user confirm disk partition operation



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 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 redhat com
https://www.redhat.com/mailman/listinfo/kickstart-list


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]