[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

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?


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:


confirm-erase looks like:

# -*-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.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")
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"]):
   while 1: time.sleep(10)
os.system("chvt %d" % 1)

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

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