Blame Scripts/Functions/Brand/brandFirstboot.sh

4c79b5
#!/bin/bash
4c79b5
#
4c79b5
# brandFirstboot - Firstboot branding script.
4c79b5
#
c28d1b
# Copyright (C) 2009-2011 Alain Reguera Delgado
fa95b1
#
fa95b1
# This program is free software; you can redistribute it and/or modify
fa95b1
# it under the terms of the GNU General Public License as published by
dcd347
# the Free Software Foundation; either version 2 of the License, or (at
dcd347
# your option) any later version.
fa95b1
#
74a058
# This program is distributed in the hope that it will be useful, but
74a058
# WITHOUT ANY WARRANTY; without even the implied warranty of
4c79b5
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4c79b5
# General Public License for more details.
4c79b5
#
4c79b5
# You should have received a copy of the GNU General Public License
4c79b5
# along with this program; if not, write to the Free Software
dcd347
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
4c79b5
# ----------------------------------------------------------------------
418249
# $Id$
4c79b5
# ----------------------------------------------------------------------
4c79b5
4c79b5
function brandFirstboot {
4c79b5
4c79b5
   # Define file's source and target.
fe1b62
   local ARTDIR=~/artwork/trunk/Identity/Themes/$(cli_getPathComponent '--theme')/Distro/Anaconda
4c79b5
   local PIXMAP=/usr/share/firstboot/pixmaps
4c79b5
   local SOURCE=''
4c79b5
   local TARGET=''
4c79b5
4c79b5
   # Define list of files used as base to determine which files may
4c79b5
   # need to be updated.  Remove target from file path. Do not use
4c79b5
   # basename command. We may need the directory structure (if any)
4c79b5
   # under target, for further evaluation.
4c79b5
   local FILES=$(find ${PIXMAP}/ | sort | uniq | sed "s!${PIXMAP}/!!g")
4c79b5
   local FILE=''
4c79b5
4c79b5
   for FILE in $FILES;do
4c79b5
4c79b5
      # Define which file is release-specific, and specify the correct
4c79b5
      # path on source.
4c79b5
      case $FILE in
4c79b5
4c79b5
         splash-small.png )
4c79b5
         SOURCE=$ARTDIR/Firstboot/Img/$MAJOR_RELEASE/$FILE 
4c79b5
         TARGET=$PIXMAP/$FILE
4c79b5
         ;;
4c79b5
4c79b5
         firstboot-left.png )
4c79b5
         SOURCE=$ARTDIR/Firstboot/Img/$FILE 
4c79b5
         TARGET=$PIXMAP/$FILE
4c79b5
         ;;
4c79b5
4c79b5
         * )
4c79b5
         SOURCE=$ARTDIR/Firstboot/Img/$FILE
4c79b5
         TARGET=$PIXMAP/$FILE
4c79b5
      esac
4c79b5
4c79b5
      # Check if file exists on source. If file doesn't exist on the
4c79b5
      # source it is not updated on target. Go to next file in the
4c79b5
      # loop and check again. Only file names on source that match
4c79b5
      # those in target are updated.
4c79b5
      cli_checkFiles "$SOURCE"
4c79b5
   
4c79b5
      # File exists and will be installed on target.
4c79b5
      cli_printMessage "$TARGET" "AsUpdatingLine"
4c79b5
4c79b5
      # Update file.
4c79b5
      #cp $SOURCE $TARGET
4c79b5
   
4c79b5
      # Set file's access rights.
4c79b5
      #chown root:root $TARGET
4c79b5
      #chmod 755 $TARGET
4c79b5
      #chcon system_u:object_r:usr_t $TARGET
4c79b5
4c79b5
   done
4c79b5
}