~mythbuntu/mythbuntu/mythbuntu

« back to all changes in this revision

Viewing changes to ubiquity/src/ubiquity-1.5.4mythbuntu4/d-i/source/mythbuntu/mythbuntu-setup

  • Committer: Mario Limonciello
  • Date: 2007-06-30 17:04:27 UTC
  • Revision ID: supermario@portablemario-20070630170427-8u91ie5uym2iabsm
remove ubiquity from the branch.  It is put in its own branch for easy merges

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
# Used to Launch MythTV-Setup & MySQL as needed
3
 
# Copyright © 2007  Mario Limonciello
4
 
 
5
 
#Let debconf work
6
 
. /usr/share/debconf/confmodule
7
 
 
8
 
ROOT="/target"
9
 
chroot=chroot
10
 
log='log-output -t mythbuntu'
11
 
 
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
16
 
 
17
 
#to run X apps in the chroot
18
 
HOSTNAME = `cat $ROOT/etc/hostname`
19
 
xhost +$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 -
25
 
 
26
 
#Prepare chroot script
27
 
db_get mythbuntu/install_type
28
 
TYPE="$RET"
29
 
if [ "$TYPE" = "Master Backend/Frontend" -o "$TYPE" = "Master Backend" ]; then
30
 
    cat <<SETUP >$ROOT/tmp/mythtv_setup
31
 
#!/bin/bash
32
 
 
33
 
#Set our new hostname
34
 
hostname -F /etc/hostname
35
 
 
36
 
#Startup SQL
37
 
/etc/init.d/mysql start
38
 
 
39
 
#Run Mythtv-setup
40
 
mythtv-setup.real
41
 
 
42
 
#Fill Database
43
 
zenity --title "Fill Database?" --question --text "Would you like to run mythfilldatabase?"
44
 
DATABASE_NOT=\$?
45
 
if [ "\$DATABASE_NOT" = "0" ]; then
46
 
    xterm -title "Running mythfilldatabase" -e "unset DISPLAY && unset SESSION_MANAGER && mythfilldatabase; sleep 3"
47
 
fi
48
 
 
49
 
#Stop SQL
50
 
/etc/init.d/mysql stop
51
 
 
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
56
 
SETUP
57
 
else
58
 
    cat <<SETUP >$ROOT/tmp/mythtv_setup
59
 
#!/bin/bash
60
 
 
61
 
#Set our new hostname
62
 
hostname -F /etc/hostname
63
 
 
64
 
#Run Mythtv-setup
65
 
mythtv-setup.real
66
 
 
67
 
#Fill Database
68
 
zenity --title "Fill Database?" --question --text "Would you like to run mythfilldatabase?"
69
 
DATABASE_NOT=\$?
70
 
if [ "\$DATABASE_NOT" = "0" ]; then
71
 
    xterm -title "Running mythfilldatabase" -e "unset DISPLAY && unset SESSION_MANAGER && mythfilldatabase; sleep 3"
72
 
fi
73
 
 
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
78
 
SETUP
79
 
fi
80
 
 
81
 
#Launch chroot script
82
 
chmod +x $ROOT/tmp/mythtv_setup
83
 
$log $chroot $ROOT /tmp/mythtv_setup
84
 
rm $ROOT/tmp/mythtv_setup
85
 
 
86
 
#to clean up the whole procedure
87
 
umount $ROOT/proc
88
 
umount $ROOT/sys
89
 
umount $ROOT/dev/pts
90
 
umount $ROOT/tmp/.X11-unix
91
 
umount $ROOT/lib/modules/`uname -r`/volatile