diff options
author | James Meyer <james.meyer@operamail.com> | 2014-10-13 17:03:13 (GMT) |
---|---|---|
committer | James Meyer <james.meyer@operamail.com> | 2014-10-13 17:03:13 (GMT) |
commit | 2e7abbab92370a4a99ad68e460c476d02296e665 (patch) | |
tree | 1d6273195dd2c4f2e22d71d26a486cbfaa77052c /build_tools/archiso-19/mythvantage/backup_copy/root-image.old_can_be_delted/etc/rc.local | |
parent | 8bef8020a022c52a8d1d4bb373b5c8cdc256284f (diff) | |
download | linhes_dev-2e7abbab92370a4a99ad68e460c476d02296e665.zip |
archiso-19 + configs for linhes iso.
This provides archiso-19 but doesn't install it inside the dev env.
Diffstat (limited to 'build_tools/archiso-19/mythvantage/backup_copy/root-image.old_can_be_delted/etc/rc.local')
-rwxr-xr-x | build_tools/archiso-19/mythvantage/backup_copy/root-image.old_can_be_delted/etc/rc.local | 112 |
1 files changed, 112 insertions, 0 deletions
diff --git a/build_tools/archiso-19/mythvantage/backup_copy/root-image.old_can_be_delted/etc/rc.local b/build_tools/archiso-19/mythvantage/backup_copy/root-image.old_can_be_delted/etc/rc.local new file mode 100755 index 0000000..6e49dc1 --- /dev/null +++ b/build_tools/archiso-19/mythvantage/backup_copy/root-image.old_can_be_delted/etc/rc.local @@ -0,0 +1,112 @@ +#!/bin/bash +# +# /etc/rc.local: Local multi-user startup script. +# +. /etc/rc.conf +. /etc/rc.d/functions +. /etc/profile +. ${MV_ROOT}/bin/install_functions.sh + +function mysql_check { + mysql -e "show databases;" 2>/dev/null >/dev/null + return $? +} + +function mythconverg_check { + mysql mythconverg -e "describe settings;" 2>/dev/null >/dev/null + return $? +} + +function install_db { + pacman --noconfirm -R mythdb-initial 2>/dev/null > /dev/null + pacman -S --noconfirm mythdb-initial 2>/dev/null > /dev/null +} + + +#set bootdev.txt for shutdown eject in archiso_shutdown +mount|grep bootmnt|cut -f1 -d" " > /run/initramfs/bootdev.txt +cp -f /usr/bin/eject /run/initramfs/usr/bin/eject + +#check to see if mysql is running +stat_busy "Checking Mysql" +ATTEMPT=0 +mysql_check && printhl " Installing the initial database" &&install_db +mythconverg_check +status=$? +while [ ! $status = 0 ] +do + /etc/rc.d/mysqld start + mysqlstatus=$? + if [ $mysqlstatus = 0 ] + then + mysql_check && install_db + mythconverg_check + status=$? + else + ((ATTEMPT=ATTEMPT+1)) + /etc/rc.d/mysqld stop + sleep 2 + fi + if [ $ATTEMPT = 20 ] + then + printhl " Could not start mysql or install mythconverg within 20 attempts" + printhl " Aborting install" + exit 20 + fi +done +stat_done + +#check network parms +stat_busy "Checking network" +init_network +stat_done + +stat_busy "Probing network" +request_dhcp & +stat_done + +#save some cmdline options +stat_busy "Parsing command line" +parse_cmdline_2_db +bootsplash_setup +stat_done + +#search for remote +stat_busy "Checking for remote" +init_remote +stat_done +printhl "Finished" + +#creating /myth for live cd +. /usr/MythVantage/bin/mv_config.py +HDIR=`dirname $MYTHHOME` +mkdir -p $HDIR +useradd -b $HDIR -m -p "" -G "audio,disk,optical,wheel,storage,video,users" mythtv +chown -R mythtv.mythtv $MYTHHOME +#creating mountpoint for live cd +mkdir -p $DATAMOUNT +create_media_dirs.sh $DATAMOUNT +chown -R mythtv.mythtv $DATAMOUNT/media + + + +printhl "Finished" +/etc/rc.d/dbus start +/etc/rc.d/avahi-daemon start +echo $CMDLINE | grep -qi NoX +if [ $? = 0 ] +then + echo "" + printhl "No auto X option found" + # /usr/bin/chvt 2 +else + /root/startx & +fi + +# Set up automatically logged in user +if [ -f /.livesys/autologin ]; then + cp /.livesys/autologin /tmp/newuser +fi + +#sh /usr/bin/go.sh & + |