2
# Used to Launch MythTV-Setup & MySQL as needed
3
# Copyright © 2007 Mario Limonciello
6
. /usr/share/debconf/confmodule
10
log='log-output -t mythbuntu'
12
mount -t proc none $ROOT/proc
13
mount -t devpts none $ROOT/dev/pts
14
mount -t sysfs sysfs $ROOT/sys
15
mount --bind /lib/modules/`uname -r`/volatile $ROOT/lib/modules/`uname -r`/volatile
17
#to run X apps in the chroot
18
HOSTNAME = `cat $ROOT/etc/hostname`
20
mkdir -p $ROOT/tmp/.X11-unix
21
mount --bind /tmp/.X11-unix $ROOT/tmp/.X11-unix
22
xauth extract - $DISPLAY > $ROOT/tmp/Xcookie
23
cat $ROOT/tmp/Xcookie | $chroot $ROOT xauth -f /root/.Xauthority merge -
24
cat $ROOT/tmp/Xcookie | $chroot $ROOT xauth merge -
26
#Prepare chroot script
27
db_get mythbuntu/install_type
29
if [ "$TYPE" = "Master Backend/Frontend" -o "$TYPE" = "Master Backend" ]; then
30
cat <<SETUP >$ROOT/tmp/mythtv_setup
34
hostname -F /etc/hostname
37
/etc/init.d/mysql start
43
zenity --title "Fill Database?" --question --text "Would you like to run mythfilldatabase?"
45
if [ "\$DATABASE_NOT" = "0" ]; then
46
xterm -title "Running mythfilldatabase" -e "unset DISPLAY && unset SESSION_MANAGER && mythfilldatabase; sleep 3"
50
/etc/init.d/mysql stop
52
#Make sure warning doesn't come up on next boot
53
mkdir -p /home/mythtv/.mythtv
54
touch /home/mythtv/.mythtv/backend_configured
55
chown mythtv:mythtv -R /home/mythtv/.mythtv
58
cat <<SETUP >$ROOT/tmp/mythtv_setup
62
hostname -F /etc/hostname
68
zenity --title "Fill Database?" --question --text "Would you like to run mythfilldatabase?"
70
if [ "\$DATABASE_NOT" = "0" ]; then
71
xterm -title "Running mythfilldatabase" -e "unset DISPLAY && unset SESSION_MANAGER && mythfilldatabase; sleep 3"
74
#Make sure warning doesn't come up on next boot
75
mkdir -p /home/mythtv/.mythtv
76
touch /home/mythtv/.mythtv/backend_configured
77
chown mythtv:mythtv -R /home/mythtv/.mythtv
82
chmod +x $ROOT/tmp/mythtv_setup
83
$log $chroot $ROOT /tmp/mythtv_setup
84
rm $ROOT/tmp/mythtv_setup
86
#to clean up the whole procedure
90
umount $ROOT/tmp/.X11-unix
91
umount $ROOT/lib/modules/`uname -r`/volatile