diff options
Diffstat (limited to 'abs/core-testing/live-installer/install_proxy.sh')
-rwxr-xr-x | abs/core-testing/live-installer/install_proxy.sh | 151 |
1 files changed, 64 insertions, 87 deletions
diff --git a/abs/core-testing/live-installer/install_proxy.sh b/abs/core-testing/live-installer/install_proxy.sh index a9b52a5..d5aec45 100755 --- a/abs/core-testing/live-installer/install_proxy.sh +++ b/abs/core-testing/live-installer/install_proxy.sh @@ -52,6 +52,23 @@ function apply_new_auth () { } +function backup_sql_check { + + if [ -f $mountpoint/myth/backup/mythconverg.sql.gz ] + then + return 0 + else + return 1 + fi +} + +function upgrade_mount_search { + MYTH_P=`cat /tmp/etc/fstab |grep /myth| awk ' {print $1 '} ` + umount $mountpoint/myth + mount $MYTH_P $mountpoint/myth + return 0 + +} full_install () { @@ -93,7 +110,7 @@ full_install () { progress 100 sleep 1 cp -f /etc/systemconfig "$mountpoint"/etc - #run save syssettings to save settings, then copy to new mountpoint + #run save syssettings to save settings, then copy to new mountpoint $MV_ROOT/bin/restore_default_settings.sh -c save -t syssettings -h $MVHOSTNAME -d localhost SE=$TEMPLATES/settings/syssettings mkdir -p ${mountpoint}$SE @@ -139,7 +156,7 @@ full_install () { fi chroot "$mountpoint" $MV_ROOT/bin/systemconfig.sh advanced touch $mountpoint/home/mythtv/.configure && chmod 777 $mountpoint/home/mythtv/.configure - + echo "Done" > /tmp/.install_state cp /tmp/mythvantage_install.log $mountpoint/var/log/ $run unmount_it $disk @@ -182,7 +199,8 @@ function upgrade () { sleep 1 cp -rf /tmp/etc /new_boot/etc.old cp -rf /tmp/oss /new_boot/var/lib/oss.old - #$run copy_it $disk bin.lzm,boot.lzm,etc.lzm,home.lzm,lib.lzm,opt.lzm,root.lzm,sbin.lzm,usr.lzm,var.lzm + + SQUASHLIST="/tmp/.squashlist" createsquashlist $SQUASHLIST $run copy_it $disk $SQUASHLIST @@ -193,22 +211,18 @@ function upgrade () { cp -fp /new_boot/etc.old/ssh/*.key /new_boot/etc/ssh/ cp -fp /new_boot/etc.old/ssh/*key /new_boot/etc/ssh/ - #funckeys - cadir=/etc/pki/func/ca - mv /new_boot/etc/pki /new_boot/etc/pki.new - cp -rp /new_boot/etc.old/pki /new_boot/etc/ - #passwd/shadow/group - cp -fp /new_boot/etc.old/passwd /new_boot/etc/ - cp -fp /new_boot/etc.old/shadow /new_boot/etc/ - cp -fp /new_boot/etc.old/group /new_boot/etc/ + if [ ! -f /tmp/etc/KnoppMyth-version ] + then + #passwd/shadow/group + cp -fp /new_boot/etc.old/passwd /new_boot/etc/ + cp -fp /new_boot/etc.old/shadow /new_boot/etc/ + cp -fp /new_boot/etc.old/group /new_boot/etc/ + fi if [ x$rootfs = "xDo_not_format" ] then - #rootfs=`grep ${disk}1 /tmp/etc/fstab |awk ' { print $3 } '` rootfs=`grep \/\ /tmp/etc/fstab |awk ' { print $3 } '` fi -# #datafs=`grep ${disk}3 /tmp/etc/fstab |awk ' { print $3 } '` -# datafs=`grep \/data /tmp/etc/fstab |awk ' { print $3 } '|head 1` $run fstab_fix_it $disk UPGRADE echo "Writing boot sector" > /tmp/.install_state @@ -216,17 +230,35 @@ function upgrade () { sleep 1 $run grub_it $disk - echo "Configuring system" > /tmp/.install_state progress sleep 1 cp /etc/mtab "$mountpoint"/etc/mtab cp -f /etc/systemconfig "$mountpoint"/etc +#make sure mythconverg.sql.gz is present + if [ ! backup_sql_check ] + then + upgrade_mount_search + fi + + if [ -f /tmp/etc/KnoppMyth-version ] + then + #run save syssettings to save settings, then copy to new mountpoint + $MV_ROOT/bin/restore_default_settings.sh -c save -t syssettings -h $MVHOSTNAME -d localhost + SE=$TEMPLATES/settings/syssettings + mkdir -p ${mountpoint}$SE + cp -rp $SE/* ${mountpoint}$SE/ + chown root:mythtv "$mountpoint"/etc/systemconfig + chown -R mythtv:mythtv ${mountpoint}$SE + chmod -R 775 ${mountpoint}$SE + touch $mountpoint/home/mythtv/.kmupgrade && chmod 777 $mountpoint/home/mythtv/.kmupgrade + fi + cp -f $MV_ROOT/bin/*.sh "$mountpoint"$MV_ROOT/bin/ chmod -R 755 ${mountpoint}/root chown root:mythtv "$mountpoint"/etc/systemconfig chmod 775 "$mountpoint"/etc/systemconfig - touch $mountpoint/home/mythtv/.configure && chmod 777 $mountpoint/home/mythtv/.configure + touch $mountpoint/home/mythtv/.configure && chmod 777 $mountpoint/home/mythtv/.configure #mount /proc and /dev mount --bind /dev "$mountpoint/dev" mount --bind /proc "$mountpoint/proc" @@ -234,8 +266,11 @@ function upgrade () { chroot "$mountpoint" $MV_ROOT/bin/systemconfig.sh misc,hostype,network,advanced,this_is_install #wrap this in a network check_network, no need to update the db if the import worked. ##### do I need to start mysql? + /etc/rc.d/mysqld stop + chroot "$mountpoint" "$MV_ROOT/bin/restore_km_db_chroot.sh" > /tmp/chrootdb_km.out chroot "$mountpoint" DISPLAY=127.0.0.1:0 /usr/local/bin/MythVantage -t restore,default_1 chroot "$mountpoint" $MV_ROOT/bin/restore_default_settings.sh -c restore -t syssettings + # #Run second time chroot "$mountpoint" $MV_ROOT/bin/systemconfig.sh misc,hostype,network,advanced,this_is_install @@ -246,6 +281,7 @@ function upgrade () { cp /tmp/mythvantage_install.log $mountpoint/var/log/ $run unmount_it $disk + /etc/rc.d/mysqld start } function netboot-full_install () { @@ -278,66 +314,6 @@ ip address flush dev eth0 } -# function vnc_check() { -# CMDLINE=$(cat /proc/cmdline) -# echo $CMDLINE |grep -q vnc -# USEVNC=$? -# echo $CMDLINE |grep -q nfsroot -# NETBOOT=$? -# echo $USEVNC -# if [ ! x$USEVNC = x0 ] -# then -# echo "not using vnc" -# if [ ! x$NETBOOT = x0 ] -# then -# echo "not using netboot" -# else -# echo "using netboot" -# USEVNC=0 -# fi -# -# else -# echo " using vnc" -# fi -# } - - -# function network_setup () { -# DEVICE=eth0 -# if [ ! -f /etc/systemconfig ] -# then -# exit 1 -# fi -# -# if [ ! x$USEVNC = x0 ] -# then -# echo "Resetting the network" -# killdhcp -# if [ $UseDHCP = 0 ] -# then -# /sbin/dhcpcd $DEVICE -# if [ ! $? = 0 ] -# then -# exit 2 -# fi -# fi -# else -# echo "using vnc/netboot, will not reset network" -# echo "nameserver $nameserver" > /etc/resolv.conf -# return 0 -# fi -# -# if [ $UseDHCP = 1 ] -# then -# -# /sbin/ifconfig $DEVICE $ip -# /sbin/route add default gw $route -# echo "nameserver $nameserver" > /etc/resolv.conf -# -# fi -# -# -# } function SANE_SYSETTINGS () { sed -e '/HOSTrootfstype/d' \ @@ -367,18 +343,19 @@ echo "-----------------------------------------------------------------------3-- if [ -f /new_boot/etc/systemconfig ] then ###########ADD templates - mkdir -p $TEMP_TEMPLATES - cp -pr /new_boot/$TEMPLATES $TEMP_TEMPLATES - SANE_SYSETTINGS - cp -rp $TEMP_TEMPLATES/settings $TEMPLATES/ - - - cp /new_boot/etc/systemconfig /etc/systemconfig - cp -rf /new_boot/etc /tmp/etc - cp -rf /new_boot/var/lib/oss /tmp/oss - - $MV_ROOT/bin/restore_default_settings.sh -c restore -t syssettings -h $MVHOSTNAME -d 127.0.0.1 + mkdir -p $TEMP_TEMPLATES + cp -pr /new_boot/$TEMPLATES $TEMP_TEMPLATES + SANE_SYSETTINGS + cp -rp $TEMP_TEMPLATES/settings $TEMPLATES/ + cp /new_boot/etc/systemconfig /etc/systemconfig + cp -rf /new_boot/etc /tmp/etc + cp -rf /new_boot/var/lib/oss /tmp/oss + + $MV_ROOT/bin/restore_default_settings.sh -c restore -t syssettings -h $MVHOSTNAME -d 127.0.0.1 + else + cp -rf /new_boot/etc /tmp/etc fi + $run umount_it $disk ;; |