head	1.5;
access;
symbols
	import-20090318:1.1.1.8
	import-20081205:1.1.1.7
	rel-8-1-2-sv:1.4
	import-20080404:1.1.1.7
	import-20071105:1.1.1.6
	import-20070116:1.1.1.5
	import-20061124:1.1.1.5
	rel-6-2-2-sv:1.1.1.4
	rel-6-2-1-sv:1.1.1.4
	import-20060615:1.1.1.4
	import-20060530:1.1.1.4
	import-20060516:1.1.1.4
	import-20060421:1.1.1.3
	import-20060406:1.1.1.3
	import-29mar06:1.1.1.3
	import-14mar06:1.1.1.3
	import-13mar06:1.1.1.3
	fixed-post-import-14feb06:1.1.1.2
	import-14feb06:1.1.1.2
	fixed-post-import-6feb06:1.1.1.2
	import-6feb06:1.1.1.2
	import-6sep05:1.1.1.1
	start:1.1.1.1
	freescale:1.1.1;
locks; strict;
comment	@# @;


1.5
date	2009.03.18.18.20.09;	author seh;	state Exp;
branches;
next	1.4;
commitid	QYBbSyrKKuTQKxGt;

1.4
date	2008.04.04.15.48.10;	author seh;	state Exp;
branches;
next	1.3;
commitid	4LGH7zo3sfbm6OXs;

1.3
date	2007.11.07.14.15.04;	author seh;	state Exp;
branches;
next	1.2;
commitid	EGTWia6z4yxOmEEs;

1.2
date	2007.03.21.14.20.22;	author seh;	state Exp;
branches;
next	1.1;

1.1
date	2005.08.23.08.54.15;	author seh;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2005.08.23.08.54.15;	author seh;	state Exp;
branches;
next	1.1.1.2;

1.1.1.2
date	2006.02.06.14.20.04;	author seh;	state Exp;
branches;
next	1.1.1.3;

1.1.1.3
date	2006.03.13.17.44.08;	author seh;	state Exp;
branches;
next	1.1.1.4;

1.1.1.4
date	2006.05.16.14.20.55;	author seh;	state Exp;
branches;
next	1.1.1.5;

1.1.1.5
date	2006.11.27.11.19.19;	author seh;	state Exp;
branches;
next	1.1.1.6;

1.1.1.6
date	2007.11.06.15.44.45;	author seh;	state Exp;
branches;
next	1.1.1.7;
commitid	AdKoH3Xx8FxdUwEs;

1.1.1.7
date	2008.04.04.10.51.55;	author seh;	state Exp;
branches;
next	1.1.1.8;
commitid	GVikqE6sLnKPsMXs;

1.1.1.8
date	2009.03.18.17.53.28;	author seh;	state Exp;
branches;
next	;
commitid	2ZWvH4Ejl9NUBxGt;


desc
@@


1.5
log
@resolve conflicts from import-20090318
@
text
@#!/usr/bin/perl -w
eval 'LANG=C exec perl -w -S $0 ${1+"$@@"}'
    if $running_under_some_shell;
$running_under_some_shell = 0;

######################################################################
#
# Copyright  Freescale Semiconductor, Inc. 2004-2007. All rights reserved.
#
# Stuart Hughes, stuarth@@freescale.com, 14th June 2005
#   
# This file is part of LTIB.
#
# LTIB is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# 
# LTIB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with LTIB; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
#
#
######################################################################
use FindBin;
use Cwd;
$isodir = $FindBin::Bin;
$echo   = '';

die <<TXT if $> == 0;

You should not be root when installing LTIB

TXT

warn <<TXT unless -f "$isodir/EULA";

WARNING: cannot find $isodir/EULA

 If this is a release from Freesale, please report this:

   * go to http://www.freescale.com
   * click on "Support / Technical support"
   * click on "Submit a Service Request"
   * register to get a user name and password.
   * login in with your user name and password
   * on the "New Service Request" page:
      * category = Technical Request
      * topic = Linux BSP
      * Click on "Continue"
   * fill out the information for the service request
   * click on the "Submit" button at the bottom of the page.

TXT

umask(0);

print <<TXT;

You are about to install the LTIB (GNU/Linux Target Image Builder)

Before installing LTIB, you must read and accept the EULA 
(End User License Agreement) which will be presented next.

Do you want to continue ? Y|n
TXT
$_ = <STDIN>;
die "Installation aborted, goodbye\n" if /^n/i;

print <<TXT;

Hit enter to continue:
TXT
system("cat $isodir/EULA | more");

do {
print <<TXT;

I have read and accept the EULA (yes|no):
TXT
$_ = <STDIN>;
} while (m,^\s*$,);

die "Installation aborted, goodbye\n" unless /^\s*yes/i;

$tag  = get_release_tag($isodir);
$tdir = cwd();

print <<TXT;

The LTIB files are extracted from a tar file which includes the
prefix $tag.  After installation you will find LTIB in:
$tdir/$tag
TXT

while(1){
    print "\nWhere do you want to install LTIB ? ($tdir)\n";
    chomp($line = <STDIN>);
    $tdir = $line if $line;
    warn("Cannot install into $isodir\n"), next if $tdir eq $isodir;
    warn("Directory $tdir/$tag already exists\n"), next if -d "$tdir/$tag";
    print "Making target directory $tdir/$tag\n";
    system("$echo mkdir -p $tdir/$tag") == 0 or next;
    last;
}

print "Installing LTIB to $tdir/$tag\n";
system("$echo tar -C $tdir -zxvf $isodir/ltib.tar.gz") == 0 or die;

if(-d "$tdir/$tag/pkgs") {
    print "Copying packages to $tdir/$tag/pkgs\n";
    system("$echo cp -dR $isodir/pkgs $tdir/$tag") == 0 or die;
    chmod(0755, "$tdir/$tag/pkgs");
}

print <<TXT;

Installation complete, your ltib installation has been placed in 
$tdir/$tag, to complete the installation:

cd $tdir/$tag
./ltib

TXT
exit 0;


sub get_release_tag
{
   my ($dir) = @@_;
   open(TAR, "tar -ztf $dir/ltib.tar.gz |")
                         or die("cannot run tar -ztf $dir/ltib.tar.gz: $!\n");
   $_ = <TAR>;
   close(TAR);
   my ($rtag) = m,([^./]+),;
   die("Cannot extract release tag") unless $rtag;
   return $rtag;
}
@


1.4
log
@import-20080404-conflict-resolution
@
text
@d115 5
a119 3
print "Copying packages to $tdir/$tag/pkgs\n";
system("$echo cp -dR $isodir/pkgs $tdir/$tag") == 0 or die;
chmod(0755, "$tdir/$tag/pkgs");
@


1.3
log
@import-20071105 conflig resolution commit
@
text
@d116 1
a116 1
system("$echo cp -a $isodir/pkgs $tdir/$tag") == 0 or die;
@


1.2
log
@Make missing EULA warn and not die
@
text
@d1 1
d8 1
a8 1
# Copyright  Freescale Semiconductor, Inc. 2004-2005. All rights reserved.
d45 14
@


1.1
log
@Initial revision
@
text
@d7 1
a7 1
# Copyright  Freescale Semicondutor, Inc. 2004-2005. All rights reserved.
d31 2
a32 7
$top = $FindBin::Bin;

$cf = {
    echo => '',
    lpp  => '/var/tmp/pkgs',
    tdir => cwd(),
};
d40 6
d49 1
d52 3
d60 18
a77 2
while(1){
    print <<TXT;
d79 1
a79 1
Where do you want to install LTIB under ? ($cf->{tdir})
d81 3
d85 9
a93 13
    chomp($cf->{tdir} = <STDIN>);
    $cf->{tdir} ||= cwd();
    warn("Cannot install into $top\n"), next if $cf->{tdir} eq $top;
    warn("Directory $cf->{tdir}/ltib already exists\n"), next 
                                             if -d "$cf->{tdir}/ltib";
    if(! -d $cf->{tdir}) {
        print <<TXT;
The install directory: $cf->{tdir} does not exist, do you want
to create it ? Y|n
TXT
        next if /^n/i;
        system("$cf->{echo} mkdir -p $cf->{tdir}") == 0 or die;
    }
d97 2
a98 5
print "Updating lpp from local packages to $cf->{lpp}\n";
system("$cf->{echo} rsync -av --ignore-existing $top/pkgs/* $cf->{lpp}") == 0 or die;

print "Installing LTIB to $cf->{tdir}\n";
system("$cf->{echo} tar -C $cf->{tdir} -zxvf $top/ltib.tar.gz") == 0 or die;
d100 3
d106 2
a107 1
Installation complete, to complete the installation:
d109 1
a109 1
cd $cf->{tdir}/ltib
d116 11
a126 6






@


1.1.1.1
log
@LTIB external initial import
@
text
@@


1.1.1.2
log
@Import from fsl 6feb06
@
text
@d31 7
a37 2
$isodir = $FindBin::Bin;
$echo   = '';
a47 1

d55 2
a56 2
$tag  = get_release_tag($isodir);
$tdir = cwd();
d58 1
a58 1
print <<TXT;
a59 3
The LTIB files are extracted from a tar file which includes the
prefix $tag.  After installation you will find LTIB in:
$tdir/$tag
d61 13
a73 9

while(1){
    print "\nWhere do you want to install LTIB ? ($tdir)\n";
    chomp($line = <STDIN>);
    $tdir = $line if $line;
    warn("Cannot install into $isodir\n"), next if $tdir eq $isodir;
    warn("Directory $tdir/$tag already exists\n"), next if -d "$tdir/$tag";
    print "Making target directory $tdir/$tag\n";
    system("$echo mkdir -p $tdir/$tag") == 0 or next;
d77 5
a81 2
print "Installing LTIB to $tdir/$tag\n";
system("$echo tar -C $tdir -zxvf $isodir/ltib.tar.gz") == 0 or die;
a82 3
print "Copying packages to $tdir/$tag/pkgs\n";
system("$echo rsync -av --ignore-existing $isodir/pkgs $tdir/$tag") == 0 or die;
chmod(0755, "$tdir/$tag/pkgs");
d86 1
a86 2
Installation complete, your ltib installation has been placed in 
$tdir/$tag, to complete the installation:
d88 1
a88 1
cd $tdir/$tag
d95 6
a100 11
sub get_release_tag
{
   my ($dir) = @@_;
   open(TAR, "tar -ztf $dir/ltib.tar.gz |")
                         or die("cannot run tar -ztf $dir/ltib.tar.gz: $!\n");
   $_ = <TAR>;
   close(TAR);
   my ($rtag) = m,([^./]+),;
   die("Cannot extract release tag") unless $rtag;
   return $rtag;
}
@


1.1.1.3
log
@Import from fsl 13mar06
@
text
@d76 1
a76 1
system("$echo cp -a $isodir/pkgs $tdir/$tag") == 0 or die;
@


1.1.1.4
log
@Import from fsl 20060516
@
text
@d7 1
a7 1
# Copyright  Freescale Semiconductor, Inc. 2004-2005. All rights reserved.
@


1.1.1.5
log
@Import from fsl 20061124
@
text
@a39 6
die <<TXT unless -f "$isodir/EULA";

Cannot find $isodir/EULA, aborting installation

TXT

a45 3
Before installing LTIB, you must read and accept the EULA 
(End User License Agreement) which will be presented next.

a50 16
print <<TXT;

Hit enter to continue:
TXT
system("cat $isodir/EULA | more");

do {
print <<TXT;

I have read and accept the EULA (yes|no):
TXT
$_ = <STDIN>;
} while (m,^\s*$,);

die "Installation aborted, goodbye\n" unless /^\s*yes/i;

@


1.1.1.6
log
@Import from fsl 20071105
@
text
@a0 1
#!/usr/bin/perl -w
d7 1
a7 1
# Copyright  Freescale Semiconductor, Inc. 2004-2007. All rights reserved.
d40 1
a40 1
warn <<TXT unless -f "$isodir/EULA";
a43 14
 If this is a release from Freesale, please report this:

   * go to http://www.freescale.com
   * click on "Support / Technical support"
   * click on "Submit a Service Request"
   * register to get a user name and password.
   * login in with your user name and password
   * on the "New Service Request" page:
      * category = Technical Request
      * topic = Linux BSP
      * Click on "Continue"
   * fill out the information for the service request
   * click on the "Submit" button at the bottom of the page.

@


1.1.1.7
log
@Import from fsl 20080404
@
text
@d116 1
a116 1
system("$echo cp -dR $isodir/pkgs $tdir/$tag") == 0 or die;
@


1.1.1.8
log
@Import from fsl 20090318
@
text
@d43 1
a43 1
WARNING: cannot find $isodir/EULA
d115 3
a117 5
if(-d "$tdir/$tag/pkgs") {
    print "Copying packages to $tdir/$tag/pkgs\n";
    system("$echo cp -dR $isodir/pkgs $tdir/$tag") == 0 or die;
    chmod(0755, "$tdir/$tag/pkgs");
}
@


