[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

> 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

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