Commit 676c08d2 authored by Claes's avatar Claes

LiveCD customization files added

parent 00aa7a0b
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=Backup
Type=Application
Comment=Backup your Proview configuration
Exec=xterm -title "Proview Configuration Backup" -e /home/pwrp/backup-script.sh
Icon=drive-removable-media.png
Categories=GNOME;GTK;Application;
#!/bin/bash
lsof 2>&1 | grep -cqE 'usr/(local/)?pwr' && zenity --info --text "There are files in /usr/pwr* in use. It is strongly recommended to close all Proview instances and files before continuing."
medialist=$(mount | awk '/on \/media\// {print $3}')
echo -n "Found media:"
if [[ -z "$medialist" ]] ; then
echo " NONE"
zenity --error --text "No backup media found.\n\nPlease mount an external storage device such as an USB flash drive."
exit 2
else
echo
echo $medialist
fi
media=$(echo $medialist | zenity --list --text "Please select the mass storage to backup your Proview data to:" --column=Media)
if [[ -z "$media" ]] ; then
echo "You have to select a media to store the data on" >&2
zenity --error --text "You have to select a media to store the data on."
exit 1
else
echo "Using \"$media\" for backup"
fi
echo "Compressing data, please wait ..."
target="${media}/proview-livecd-backup.tar.lzma"
cd /
nice sudo /bin/tar -cp --exclude '*.lock' usr/local/pwr* usr/pwrp/adm | pv | nice -n 19 lzma >${target} || zenity --error --text "Creating the backup failed.\n\nPlease check the error messages as shown in the terminal."
ls -l ${target}
test -s "${target}" && zenity --info --text 'The backup has been saved as\n\n'"${target}"
sleep 5
#!/bin/bash
#pwrpkg_dir=$pwre_broot/os_linux/hw_x86/bld/pkg
pwrpkg_dir=~
customize_dir=~/tmp/remaster-root/tmp
apt_cache=/var/cache/apt/archives
libn1="libmysql++"
lib1="libmysql++3_3.0.9-1ubuntu2_i386.deb"
libn2="libjs-mootools"
lib2="libjs-mootools_1.2.4.0~debian1-1_all.deb"
libn3="midori"
lib3="midori_0.2.4-3_i386.deb"
libn4="thttpd"
lib4="thttpd_2.25b-11_i386.deb"
libn5="pv"
lib5="pv_1.1.4-1_i386.deb"
if [ "$1" == "" ]; then
# Check packages
let notfound=0
if [ ! -e $apt_cache/$lib1 ]; then
echo "-- Downloading $apt_cache/$lib1"
sudo apt-get install --reinstall -d $libn1
notfound=1
fi
if [ ! -e $apt_cache/$lib2 ]; then
echo "-- Downloading $apt_cache/$lib2"
sudo apt-get install --reinstall -d $libn2
notfound=1
fi
if [ ! -e $apt_cache/$lib3 ]; then
echo "-- Downloading $apt_cache/$lib3"
sudo apt-get install --reinstall -d $libn3
notfound=1
fi
if [ ! -e $apt_cache/$lib4 ]; then
echo "-- Downloading $apt_cache/$lib4"
sudo apt-get install --reinstall -d $libn4
notfound=1
fi
if [ ! -e $apt_cache/$lib5 ]; then
echo "-- Downloading $apt_cache/$lib5"
sudo apt-get install --reinstall -d $libn5
notfound=1
fi
echo ""
echo " Start UCK with"
echo ""
echo " > uck-gui"
echo ""
echo " Questions: - Language: en"
echo " - Customize the CD: yes"
echo " - Name: Proview LiveCD"
echo " - Delete files: no"
echo " - Choose actions: Run console application"
echo ""
echo " Then start build.sh with argument \"copy\" when the"
echo " UCK customization console is opened"
echo ""
elif [ "$1" == "copy" ]; then
#
# Copy packages to customize dir
cp $pwrpkg_dir/pwr48_4.8.0-1_i386.deb $customize_dir/
cp $pwrpkg_dir/pwrdemo48_4.8.0-1_i386.deb $customize_dir/
#
# Copy installation-scripts and setup
cp ./pwr_customize.sh $customize_dir/
cp ./pwr_install.sh $customize_dir/
cp ./pwr_renamenode.sh $customize_dir/
cp ./pwr_remove.sh $customize_dir/
cp ./casper.conf $customize_dir/
cp ./custom.conf $customize_dir/
#
# Scripts, icons and settings for user pwrp
cp ./backup-script.sh $customize_dir/
cp ./restore-script.sh $customize_dir/
cp ./demoweb-script.sh $customize_dir/
cp ./backup-script.desktop $customize_dir/
cp ./restore-script.desktop $customize_dir/
cp ./pwrdemoweb.desktop $customize_dir/
cp ./welcome.html $customize_dir/
cp ./midori.desktop $customize_dir/
cp ./pwr_gconf_config_local.tar.gz $customize_dir/
#
# Debian packages
cp $apt_cache/$lib1 $customize_dir/
cp $apt_cache/$lib2 $customize_dir/
cp $apt_cache/$lib3 $customize_dir/
cp $apt_cache/$lib4 $customize_dir/
cp $apt_cache/$lib5 $customize_dir/
echo ""
echo " Execute "
echo ""
echo " > cd /tmp"
echo " > ./pwr_customize.sh"
echo ""
echo " in the UCK customization console"
echo ""
fi
# This file should go in /etc/casper.conf
# Supported variables are:
# USERNAME, USERFULLNAME, HOST, BUILD_SYSTEM
export USERNAME="pwrp"
export USERFULLNAME="Proview user"
export HOST="ubuntu"
export BUILD_SYSTEM="Ubuntu"
[daemon]
AutomaticLoginEnable=true
AutomaticLogin=pwrp
#! /bin/bash
initst=`eval pidof rt_ini`
if [ -z $initst ]; then
source /etc/pwrp_profile
export pwra_db=/usr/pwrp/adm/db
source $pwra_db/pwr_setup.sh
source $pwra_db/pwra_env.sh set project pwrdemo48
export PWR_BUS_ID=999
source pwr_stop.sh
rt_ini &
sleep 10
initst=`eval pidof rt_ini`
if [ -z $initst ]; then
zenity --error --text "Unable to start the Demo Project Runtime Enviroment"
source pwr_stop.sh
exit
fi
fi
firefox http://ubuntu/index.html
source pwr_stop.sh
[Desktop Entry]
Type=Application
Exec=/usr/bin/midori /home/pwrp/welcome.html
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[C]=Welcome
Name=Welcome
Comment[C]=Show warm welcome to user
Comment=Show warm welcome to user
#cd /root/pwr
./pwr_install.sh
./pwr_remove.sh
#rm /tmp/*
#
# Install
apt-get -y install libdb4.8
apt-get -y install libdb4.8++
apt-get -y install g++
apt-get -y install mysql-common
apt-get -y install libmysqlclient16
dpkg -i libmysql++3_3.0.9-1ubuntu2_i386.deb
dpkg -i pwr48_4.8.0-1_i386.deb
dpkg -i pwrdemo48_4.8.0-1_i386.deb
apt-get -y install midori
apt-get -y install default-jre-headless
ln -s /usr/lib/jvm/default-java/jre /usr/local/jre
apt-get -y install firefox
apt-get -y install icedtea6-plugin
dpkg -i thttpd_2.25b-11_i386.deb
dpkg -i pv_1.1.4-1_i386.deb
#
# Configure
chmod a+w /etc/casper.conf
cp ./casper.conf /etc/
cp ./custom.conf /etc/gdm/
sed -i 's/no/yes/g' /etc/default/thttpd
sed -i 's/sudo:x:27:/sudo:x:27:pwrp/g' /etc/group
#
# Rename host nodename to livecd nodename in proview files
/tmp/pwr_renamenode.sh
#
# User pwrp
cp ./backup-script.sh /home/pwrp/
cp ./restore-script.sh /home/pwrp/
cp ./demoweb-script.sh /home/pwrp/
chmod a+x /home/pwrp/*.sh
cp ./backup-script.desktop /home/pwrp/Desktop/
cp ./restore-script.desktop /home/pwrp/Desktop/
cp ./pwrdemoweb.desktop /home/pwrp/Desktop
chmod a+x /home/pwrp/Desktop/*.desktop
cp ./welcome.html /home/pwrp/
mkdir -p /home/pwrp/.config/autostart
cp ./midori.desktop /home/pwrp/.config/autostart
chmod a+x /home/pwrp/.config/autostart/midori.desktop
tar --directory /home/pwrp -xzf ./pwr_gconf_config_local.tar.gz
chown -R pwrp:pwrp /home/pwrp/*
chown -R pwrp:pwrp /home/pwrp/.*
#
# Web
cp /usr/pwrp/pwrdemo48/bld/common/web/* /var/www/
cp /usr/pwrp/pwrdemo48/bld/common/load/*.flw /var/www/
cp /usr/pwrp/pwrdemo48/bld/common/load/*rtt*.dat /var/www/
cp /usr/pwr48/os_linux/hw_x86/exp/lib/pwr_jopc.jar /var/www/
cp /usr/pwr48/os_linux/hw_x86/exp/lib/pwr_jop.jar /var/www/
cp /usr/pwr48/os_linux/hw_x86/exp/lib/pwr_rt_client.jar /var/www/
cp /usr/pwr48/os_linux/hw_x86/exp/exe/pwr_logga.gif /var/www/
#
# Midori
dpkg -i libjs-mootools_1.2.4.0~debian1-1_all.deb
dpkg -i midori_0.2.4-3_i386.deb
#
# Clean
#rm /tmp/*.deb
rm -r /usr/pwr48/os_linux/hw_x86/exp/doc/*
rm /usr/pwr48/os_linux/hw_x86/exp/exe/co_help_gtk
rm /usr/pwr48/os_linux/hw_x86/exp/exe/sev_xtt_gtk
rm /usr/pwr48/os_linux/hw_x86/exp/exe/wb_cmd_gtk
rm /usr/pwr48/os_linux/hw_x86/exp/exe/wb_ge_gtk
rm /usr/pwr48/os_linux/hw_x86/exp/exe/xtt_ge_jprint
rm /usr/pwr48/os_linux/hw_x86/exp/exe/wb_upgrade
rm /usr/pwr48/os_linux/hw_x86/exp/exe/wb_rtt
rm /usr/pwr48/os_linux/hw_x86/exp/exe/wb_ldlist
chown -R pwrp:pwrp /usr/pwrp
chown -R pwrp:pwrp /usr/local/pwrp
apt-get -y remove aisleriot
apt-get -y remove gbrainy
apt-get -y remove gnome-mahjongg
apt-get -y remove gnome-sudoku
apt-get -y remove gnomine
apt-get -y remove gnome-games-common
apt-get -y remove openoffice.org-core
#apt-get -y remove firefox
apt-get -y remove bogofilter-common
apt-get -y remove shotwell
apt-get -y remove brasero-common
apt-get -y remove pitivi
apt-get -y remove rhythmbox
apt-get -y remove totem
apt-get -y remove totem-common
apt-get -y remove aspell
apt-get -y remove evolution
apt-get -y remove empathy-common
apt-get -y remove gwibber
apt-get -y remove gwibber-service
apt-get -y remove gdb
apt-get -y remove nano
apt-get -y remove sane-utils
apt-get -y remove min12xxw
apt-get -y remove erlang-base
apt-get -y remove icedtea-6-jre-cacao
apt-get -y remove libcanberra-pulse
apt-get -y remove lp-solve
apt-get -y remove speech-dispatcher
#
# Remove to avoid Try/Install screen
apt-get -y remove ubiquity
broot=/usr/pwrp/pwrdemo48/bld
sed -i 's/red-ant/ubuntu/g' $broot/common/load/ld_boot_red-ant_0999.dat
sed -i 's/red-ant/ubuntu/g' $broot/common/load/ld_node_red-ant_0999.dat
mv $broot/common/load/ld_boot_red-ant_0999.dat $broot/common/load/ld_boot_ubuntu_0999.dat
mv $broot/common/load/ld_node_red-ant_0999.dat $broot/common/load/ld_node_ubuntu_0999.dat
mv $broot/common/load/ld_appl_red-ant_999.txt $broot/common/load/ld_appl_ubuntu_999.txt
mv $broot/x86_linux/exe/plc_red-ant_0999_00005 $broot/x86_linux/exe/plc_ubuntu_0999_00005
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Name=Proview Demo Web
Comment=Start Proview Demo Web
GenericName=Web Browser
Exec=xterm -title "Proview Web Demo Console" -e /home/pwrp/demoweb-script.sh
Terminal=false
Type=Application
Icon=/usr/pwrp/adm/db/proview_icon.png
Categories=Application;Internet;Network;WebBrowser;
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=Restore
Type=Application
Comment=Restore your Proview configuration
Exec=xterm -title "Proview Configuration Restore" -e /home/pwrp/restore-script.sh
Icon=drive-removable-media.png
Categories=GNOME;GTK;Application;
#!/bin/bash
lsof 2>&1 | grep -cqE 'usr/(local/)?pwr' && zenity --info --text "There are files in /usr/pwr* in use. It is strongly recommended to close all Proview instances and files before continuing."
medialist=$(mount | awk '/on \/media\// {print $3}')
echo -n "Found media:"
if [[ -z "$medialist" ]] ; then
echo " NONE"
zenity --error --text "No backup media found.\n\nPlease mount an external storage device such as an USB flash drive."
exit 2
else
echo
echo $medialist
fi
media=$(echo $medialist | zenity --list --text "Please select the mass storage to restore your Proview data from:" --column=Media)
if [[ -z "$media" ]] ; then
echo "You have to select a media to restore the data from" >&2
zenity --error --text "You have to select a media to restore the data from."
exit 1
else
echo "Using \"$media\" for restore"
fi
target="${media}/proview-livecd-backup.tar.lzma"
if [[ ! -f "${target}" ]] ; then
echo "Backup file does not exist: ${target}" >&2
zenity --error --text "Backup file does not exist:\n\n${target}"
exit 2
fi
# make backup of old files & directories to be overwritten by this restore script
cd /usr/local
sudo /bin/rm -rf _backup_pwr*
for old in pwr* ; do test -e "$old" && sudo /bin/mv "$old" "_backup_$old" ; done
sudo /bin/rm -rf /usr/pwrp/_backup_adm
test -e /usr/pwrp/adm && sudo /bin/mv /usr/pwrp/adm /usr/pwrp/_backup_adm
nice -n 19 unlzma <${target} | pv | nice sudo /bin/tar -xp -C /
if [ $? ] ; then
ls -l ${target}
zenity --info --text "Restoring the backup succeeded.\n\nStill, please check that there are no error messages shown in the terminal."
# remove temporary backup
cd /usr/local
sudo /bin/rm -rf _backup_pwr*
sudo /bin/rm -rf /usr/pwrp/_backup_adm
else
ls -l ${target}
zenity --error --text "Restoring the backup failed.\n\nPlease check the error messages as shown in the terminal."
# restore went wrong, restore previous state
cd /usr/local
sudo /bin/rm -rf pwr*
sudo /bin/rm -rf /usr/pwrp/adm
for old in _backup_pwr* ; do test -e "$old" && sudo /bin/mv "$old" "${old/_backup_}" ; done
test -e /usr/pwrp/_backup_adm && sudo /bin/mv /usr/pwrp/_backup_adm /usr/pwrp/adm
fi
sleep 5
<html>
<head>
<title>Welcome to the Proview Live CD</title>
</head>
<body>
<h1>Welcome to the Proview Live CD</h1>
<p><strong>Thank you</strong> for downloading and testing this Live CD.
We hope it will give you a good first impression what <a href="http://www.proview.se/">Proview</a> is and how to use it.</p>
<p>This browser has several bookmarks preconfigured, e.g. pointing to Proview's <a href="http://www.proview.se/index.php?option=com_joomlaboard&Itemid=24&task=listcat&catid=1">forum</a> or <a href="http://www.proview.se/index.php?option=com_content&task=view&id=15&Itemid=23">documentation</a>.</p>
<p>You may want to get started by running the demo by clicking on the &quot;Proview Demo&quot; icon on the desktop or by reading the <a href="http://www.proview.se/files/doc/pwr_doc/en_us/man_gsg.pdf">&quot;Getting Started&quot; documentation</a> <small>(click on &quot;Open&quot; if asked)</small>.</p>
<p>As we are constantly looking into improving both Proview and this Live CD, please <a href="http://www.proview.se/index.php?option=com_joomlaboard&Itemid=24&task=listcat&catid=1">share your ideas in the forum</a>.</p>
<p>Have fun with Proview!<br/><i>The Proview team</i></p>
</body></html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment