OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [toolchain_script/] [MOF_ORSOC_TCHN_v5b_or32-elf.sh] - Blame information for rev 1774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1773 julius
#!/bin/bash
2
 
3
# Copyright (C) 2008,2009 www.meansoffreedom.org, www.orsoc.se
4
# This file is free software; you can redistribute it and/or modify it
5
# under the terms of the GNU General Public License as published by
6
# the Free Software Foundation; either version 2 of the License, or
7
# (at your option) any later version.
8
#
9
# This program is distributed in the hope that it will be useful, but
10
# WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
# General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License
15
# along with this program; if not, write to the Free Software
16
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
 
18
##Date: 21/04/2009
19
##Title: MOF_ORSOC_TCN_v5b_or32-elf.sh
20
##Purpose: Complete Toolchain Builder from MOF & ORSoC.
21
##initial rgd, mse
22
##updated jb
23
 
24
#Changelog
25
# 090306 - jb
26
#        - added exit code checking after each make and patch
27
#        - changed download method to instead generate a script and run it in
28
#          kermit (requiring single ftp logon per host)
29
# 090309 - jb
30
#        - changed download of GNU tools so they occurr from the GNU.org ftp
31
#          (except binutils-2.18.50, it's not there)
32
#        - changed download of Linux kernel so it's now from ftp.kernel.org
33
#        - changed patch for binutils (fixes gcc-4.3.2 compilation problem
34
#          caused by non-string literals in printf)
35
#        - changed or1ksim version from 0.3.0rc2 to 0.3.0
36
#        - changed Linux kernel version from 2.6.19 to 2.6.24
37
#        - changed Linux kernel patch version for this new kernel version
38
#          generated new patch for Linux kernel, based on one from MOF
39
#          (www.meansoffreedom.net) which contains a more complete config file.
40
#          removing need for user input during "make oldconfig"
41
#        - changed organisation so that all the packages are not copied into
42
#          the build directory before they are extracted, instead it's done
43
#          from where they are.
44
#        - changed gdb-6.8 patch version due to stricter gcc-4.3.2 checking
45
#          return types.
46
#        - included better or1ksim config file in Linux sources patch, now
47
#          named "or1ksim_linux.cfg"
48
# 100309 - jb
49
#        - changed back to wget for file retrieval
50
#        - changed introduction readme
51
#        - changed install destination checking and setup
52
#        - added md5sum checking of any existing downloaded files, removing
53
#          need for redownloading things every time
54
#        - added debug build mode - run script with -d at command line
55
#          note: not everything in this mode has been tested, may not work
56
#          in certain combinations!
57
# 120309 - jb
58
#        - New OS X version - busybox doesn't work (removed from script),
59
#          nor does ors1ksim (compiles but segfaults somewhere during test).
60
# 140309 - Added ability to change target name. Included some sed commands to
61
#          change or32-uclinux to whatever $TARGET is set to in some scripts
62
#          (mainly for uClibc install, the are set at configure time)
63
# 160309 - (v5a) Replaced busybox sources in download list (removed for OS X
64
#          version and forgot to replace it when running on Linux again.)
65
# 270309 - Changed the declaration of the check_exit_code function to be without
66
#          the preceeding "function" as this isn't valid in sh, and the new way
67
#          appears to be valid in bash.
68
#        - Changed the link in the error output to the new OpenCores forum.
69
# 210409 - Changed linux kernel and uClibc patch versions to latest
70
#        - Changed output to all be piped to appropriate files, makes things neater
71
 
72
# TODO: OS X build things - need an "elf.h" from some Linux machine's
73
#       /usr/local/include dir and put in Mac's /usr/local/include dir -
74
#       this solves issue with Linux compilation
75
# TODO: OS X build things - add HOST_LOADLIBES="lintl" to make line of uClibc
76
# TODO: OS X build things - must remove the -Werror line in $GDB_VER/gdb/Makefile,
77
#       sed command:
78
#       sed 's/WERROR\_CFLAGS\ \=\ \-Werror/WERROR\_CFLAGS\ \=/' $GDB_VER/gdb/Makefile
79
#       Can also just change the gdb-6.8/gdb/Makefile.in and remove the Werror= thing
80
# TODO: OS X build things - or1ksim, in or1ksim-0.3.0/peripheral/atadevice.c, it
81
#       includes byteswap.h - actually it's abstract.h that defines #LE_16() bswap_16(),
82
#       so in abstract.h we put in defines for bswap_16 as
83
#       #define bswap_16(value) ((((value) & 0xff) << 8) | ((value) >> 8))
84
# TODO: OS X Build things - or1ksim strndup.c, in or1k-0.3.0/port/strndup.c strndup function,
85
#       types not exist etc. Need to include sys/types.h and string.h to this file to fix
86
#       a few problems.
87
# TODO: OS X build things - or1ksim - or1ksim-0.3.0/sim-cmd.c passes one of our functions
88
#       to a readline function, rl_event_hook, but this is not defined in the OS X (BSD)
89
#       readline package, so the GNU readline package must be used.
90
# TODO: OS X build things - or1ksim segfaults when run for some reason.
91
 
92
## A function we'll call throughout the setup process to check if the previous
93
## command finished without error
94
function check_exit_code {
95
    if [ $? -ne 0 ]
96
    then
97
        echo
98
        echo "############################ERROR#############################"
99
        echo
100
        echo "Error during toolchain installation."
101
        echo
102
        echo "Please report this to the script maintainers."
103
        echo
104
        echo "A useful report would contain information such as the module"
105
        echo "buing built/\"make\"ed when the error occurred (relevant lines"
106
        echo "of console output), the version of GCC on the host system used"
107
        echo "to compile (gcc --version), linux distro and version, etc."
108
        echo "A good place to post this information is on the OpenCores"
109
        echo "forum for the OpenRISC project: "
110
        echo "http://opencores.org/?do=forum"
111
        echo
112
        exit $?
113
    fi
114
}
115
 
116
## SCRIPT VERSION ##
117
SCRIPT_VERSION="v5b"
118
 
119
## Beginning globals ##
120
 
121
## ORSoC FTP download settings ##
122
ORSOC_FTP_HOST="195.67.9.12"
123
ORSOC_FTP_USER="ocuser"
124
ORSOC_FTP_PASSWD="oc"
125
ORSOC_FTP_DIR="toolchain"
126
 
127
## GNU FTP download settings ##
128
GNU_FTP_HOST="ftp.gnu.org"
129
GNU_FTP_USER="anonymous"
130
#GNU_FTP_BINUTILS_DIR="gnu/binutils"
131
GNU_FTP_GCC_DIR="gnu/gcc/gcc-4.2.2"
132
GNU_FTP_GDB_DIR="gnu/gdb"
133
 
134
## Linux kernel download settings ##
135
KERNEL_FTP_HOST="ftp.kernel.org"
136
KERNEL_FTP_USER="anonymous"
137
KERNEL_FTP_PASSWD="anonymous"
138
KERNEL_FTP_DIR="pub/linux/kernel/v2.6"
139
 
140
## Local directory variables ##
141
START_DIR=`pwd`
142
DN="n"
143
DIR=`pwd`
144
 
145
## Versions of the toolchain components ##
146
BINUTILS_VER=binutils-2.18.50
147
GCC_VER=gcc-4.2.2
148
GDB_VER=gdb-6.8
149
UCLIB_VER=uClibc-0.9.29
150
LINUX_VER=linux-2.6.24
151
BUSY_VER=busybox-1.7.5
152
SIM_VER=or1ksim-0.3.0
153
 
154
## Patches ##
155
BINUTILS_PATCH="$BINUTILS_VER.or32_fixed_patch-v2.0.bz2"
156
GCC_PATCH=$GCC_VER.or32patch.bz2
157
LINUX_PATCH="linux_2.6.24_or32_unified_v2.2.bz2" ## New version, changed rgd_dot_config in root, changed or1ksim config file name and contents##
158
UCLIBC_PATCH="uClibc-0.9.29-or32-patch-1.0.bz2"
159
GDB_PATCH="or32-gdb-6.8-patch-2.4.bz2"
160
 
161
## MD5sum file ##
162
MD5SUM_FILE=md5sums
163
 
164
## Configs ##
165
#CONFIG1="rgd_uc_29dotconfig" ## Now changed to rgd_uc_29v5dotconfig as it uses paths to the 2.6.24 kernel ##
166
CONFIG1="rgd_uc_29v5dotconfig"
167
CONFIG2="rgd_bb_1.75dotconfig"
168
 
169
## Ramdisk name ##
170
RAMDISK_FILE=initrd-fb-03.ext2.last.work.1.7.5
171
LINUX_RAMDISK_FILE=arch/or32/support/initrd-fb-03.ext2 ## The location and name of the ramdisk that Linux wants when it compiles
172
 
173
## Toolchain prefix ##
174
TARGET=or32-elf
175
 
176
 
177
## Tarballs ##
178
ZBALL1=$BINUTILS_VER.tar.bz2
179
TBALL1=$BINUTILS_VER.tar
180
ZBALL2=$GCC_VER.tar.bz2
181
TBALL2=$GCC_VER.tar
182
ZBALL3=$UCLIB_VER.tar.bz2
183
TBALL3=$UCLIB_VER.tar
184
ZBALL4=$LINUX_VER.tar.bz2
185
TBALL4=$LINUX_VER.tar
186
ZBALL5=$BUSY_VER.tar.bz2
187
TBALL5=$BUSY_VER.tar
188
ZBALL6=$SIM_VER.tar.bz2
189
TBALL6=$SIM_VER.tar
190
ZBALL7=$RAMDISK_FILE.bz2
191
ZBALL8=$GDB_VER.tar.bz2
192
TBALL8=$GDB_VER.tar
193
 
194
ORSOC_FTP_FILE_LIST="$ZBALL1
195
        $ZBALL3
196
        $ZBALL5
197
        $ZBALL6
198
        $ZBALL7
199
        $BINUTILS_PATCH
200
        $GCC_PATCH
201
        $LINUX_PATCH
202
        $UCLIBC_PATCH
203
        $GDB_PATCH
204
        $CONFIG1
205
        $CONFIG2"
206
 
207
GNU_FTP_FILE_LIST="$ZBALL2
208
$ZBALL8"
209
 
210
KERNEL_FTP_FILE_LIST=$ZBALL4
211
 
212
 
213
 
214
##Welcome message
215
echo
216
echo "The OpenRISC toolchain install script - Provided by ORSoC & MeansOfFreedom.net"
217
echo "Version $SCRIPT_VERSION"
218
echo
219
echo "#####################################README#####################################"
220
echo
221
echo "This script will install tools required for development on the OpenRISC platform"
222
echo "This version ($SCRIPT_VERSION) includes: "
223
echo "        $GCC_VER, $BINUTILS_VER, $UCLIB_VER"
224
echo "        $LINUX_VER, $GDB_VER, $BUSY_VER and $SIM_VER"
225
echo
226
echo "Please follow the prompts to select the install location."
227
echo
228
echo "Note: Two new directories, or32-build and or32-download, will be created in the"
229
echo "current directory for storing downloaded files and building the tools."
230
echo "Also: This script attempts to mount a ramdisk image in a local directory to copy"
231
echo "in the freshly built busybox. This requires root user privileges - if they are"
232
echo "not deteceted the existing busybox binaries will remain in the ramdisk image."
233
echo
234
echo "#####################################README#####################################"
235
echo
236
 
237
echo "Install the toolchain under current directory?"
238
echo "Current directory: [$DIR]"
239
echo "Tools will be installed in [$DIR/$TARGET]"
240
echo [Y/n]:
241
read YN
242
 
243
## $YN will be zero length string if user just pressed enter ##
244
if [ -z $YN ]
245
    then
246
    VAL="y"
247
else
248
    VAL=$(echo $YN | tr [:upper:] [:lower:])
249
fi
250
 
251
if [ $VAL = "n" ]
252
    then
253
    # Optional install path
254
    echo "Enter the path the toolchain will be installed in:"
255
    read DIR
256
 
257
    # Check if the path exists and ask the user to verify it
258
    until [ $DN = "y" ]
259
      do
260
 
261
        #Check the path exists
262
        if [ -d $DIR ]
263
            then
264
            # The path entered is OK
265
            echo "Chosen directory is [$DIR]"
266
            echo "Tools will be installed in [$DIR/$TARGET]"
267
            echo "[y/n]:"
268
            read DN
269
 
270
            if [ -z $DN ]
271
                then
272
                # Presume yes here
273
                DN="y"
274
            fi
275
 
276
            VAL=$(echo $DN | tr [:upper:] [:lower:])
277
        else
278
            echo
279
            #echo "Path does not exist. Please create it and ensure user has correct permissions."
280
            echo "Path does not exist. Create $DIR now?"
281
            echo "[y/N]:"
282
            read MKPATH
283
            if [ -z $MKPATH ]
284
                then
285
                ## $MKPATH was zero, so user probably just pressed enter without entering anything, which we'll interpret as "n" ##
286
                MKPATHYN="n"
287
            else
288
                MKPATHYN=$(echo $MKPATH | tr [:upper:] [:lower:])
289
            fi
290
 
291
            if [ $MKPATHYN = "y" ]
292
                then
293
                `mkdir $DIR`
294
 
295
                # Check we made it successfully
296
                if [ $? -ne 0 ]
297
                    then
298
                    DN="n"
299
                else
300
                    DN="x" # Set this so we do go back through and ask the user to verify
301
                fi
302
 
303
            else
304
                DN="n"
305
            fi
306
        fi
307
 
308
        if [ $DN = "n" ]
309
            then
310
            echo "Enter the path the toolchain should be installed in:"
311
            read DIR
312
        fi
313
 
314
    done
315
    cd $DIR
316
#    echo "loop done"
317
    echo "Working in " `pwd`
318
fi
319
 
320
BUILD_TOP=$START_DIR/or32-build
321
export BUILD_TOP
322
 
323
## Set donload directory to be under the current directory ##
324
DOWNLOAD_DIR=$START_DIR/or32-download
325
 
326
## Setup the target tool installation directory ##
327
INSTALL_DIR=$DIR
328
 
329
mkdir $INSTALL_DIR
330
 
331
####################################################################################################
332
## Now check which sources have already been downloaded, if any ##
333
 
334
## Check if download directory exists, if not create it ##
335
if [ -d $DOWNLOAD_DIR ]
336
    then
337
    cd $DOWNLOAD_DIR
338
else
339
    mkdir $DOWNLOAD_DIR
340
    cd $DOWNLOAD_DIR
341
fi
342
 
343
## We'll need the md5sum file ##
344
## This is a file stored on the ORSoC FTP server, containing checksums of all the files we need ##
345
rm -f $MD5SUM_FILE
346
wget ftp://$ORSOC_FTP_USER:$ORSOC_FTP_PASSWD@$ORSOC_FTP_HOST/$ORSOC_FTP_DIR/$MD5SUM_FILE
347
## Make sure we got that OK ##
348
check_exit_code
349
 
350
## We have lists of what to get from each FTP let's create a loop for each ##
351
 
352
## ORSoC FTP server downloads ##
353
for CURRENT_FILE in $ORSOC_FTP_FILE_LIST
354
  do
355
  # Check if we've already got the file
356
  if [ -e $CURRENT_FILE ]
357
      then
358
      echo "File $CURRENT_FILE exists locally."
359
      echo "Verifying MD5 checksum:"
360
      ## Verify it's right by checking the MD5 checksum ##
361
      ## First we get the line for $CURRENT_FILE out of the $MD5SUM_FILE, then feed it to "md5sum -c"
362
      ## which checks it and sets the return code, $? to 0 if OK, 1 if problem ##
363
      cat $MD5SUM_FILE | grep $CURRENT_FILE | md5sum -c
364
      if [ $? -ne 0 ]
365
          then
366
          #MD5sum of $CURRENT_FILE differs from expected value - we'll download it again
367
          echo "MD5 checksum of $CURRENT_FILE differs from expected value. Re-downloading."
368
          rm -f $CURRENT_FILE
369
          wget ftp://$ORSOC_FTP_USER:$ORSOC_FTP_PASSWD@$ORSOC_FTP_HOST/$ORSOC_FTP_DIR/$CURRENT_FILE
370
          check_exit_code
371
      fi
372
  else
373
      # File doesn't exist locally - we'll download it
374
      echo "Downloading $CURRENT_FILE"
375
      wget ftp://$ORSOC_FTP_USER:$ORSOC_FTP_PASSWD@$ORSOC_FTP_HOST/$ORSOC_FTP_DIR/$CURRENT_FILE
376
      check_exit_code
377
  fi
378
  echo
379
done
380
 
381
## GNU FTP server downloads ##
382
for CURRENT_FILE in $GNU_FTP_FILE_LIST
383
  do
384
  ## Check if we've already got the file ##
385
  if [ -e $CURRENT_FILE ]
386
      then
387
      echo "File $CURRENT_FILE exists locally."
388
      echo "Verifying MD5 checksum:"
389
      ## Verify it's right by checking the MD5 checksum ##
390
      ## First we get the line for $CURRENT_FILE out of the $MD5SUM_FILE, then feed it to "md5sum -c"
391
      ## which checks it and sets the return code, $? to 0 if OK, 1 if problem ##
392
      cat $MD5SUM_FILE | grep $CURRENT_FILE | md5sum -c
393
      if [ $? -ne 0 ]
394
          then
395
          ## MD5sum of present one is incorrect - we'll download it again ##
396
          echo "MD5 checksum of $CURRENT_FILE differs from expected value. Re-downloading."
397
          rm -f $CURRENT_FILE
398
          ## Depending on the file, we need a specific path ##
399
          ## gcc's path on ftp ##
400
          if [ $CURRENT_FILE = $ZBALL2 ]; then
401
              GNU_FTP_DIR=$GNU_FTP_GCC_DIR
402
          fi
403
          ## gdb's path on ftp ##
404
          if [ $CURRENT_FILE = $ZBALL8 ]; then
405
              GNU_FTP_DIR=$GNU_FTP_GDB_DIR
406
          fi
407
          wget ftp://$GNU_FTP_USER:$GNU_FTP_USER@$GNU_FTP_HOST/$GNU_FTP_DIR/$CURRENT_FILE
408
          check_exit_code
409
      fi
410
  else
411
      # File doesn't exist - we'll download it
412
      echo "Downloading $CURRENT_FILE"
413
      ## Depending on the file, we need a specific path ##
414
      ## gcc's path on ftp ##
415
      if [ $CURRENT_FILE = $ZBALL2 ]; then
416
              GNU_FTP_DIR=$GNU_FTP_GCC_DIR
417
      fi
418
      ## gdb's path on ftp ##
419
      if [ $CURRENT_FILE = $ZBALL8 ]; then
420
          GNU_FTP_DIR=$GNU_FTP_GDB_DIR
421
      fi
422
      wget ftp://$GNU_FTP_USER:$GNU_FTP_USER@$GNU_FTP_HOST/$GNU_FTP_DIR/$CURRENT_FILE
423
      check_exit_code
424
  fi
425
  echo
426
done
427
 
428
## Kernel.org FTP server downloads ##
429
CURRENT_FILE=$KERNEL_FTP_FILE_LIST
430
## Usually just a single file from the kernel.org ftp site ##
431
if [ -e $CURRENT_FILE ]
432
    then
433
    echo "File $CURRENT_FILE exists locally."
434
    echo "Verifying MD5 checksum:"
435
    ## Verify it's right by checking the MD5 checksum ##
436
    ## First we get the line for $CURRENT_FILE out of the $MD5SUM_FILE, then feed it to "md5sum -c"
437
    ## which checks it and sets the return code, $? to 0 if OK, 1 if problem ##
438
    cat $MD5SUM_FILE | grep $CURRENT_FILE | md5sum -c
439
    if [ $? -ne 0 ]
440
        then
441
        #MD5sum of present one is incorrect - we'll download it again
442
        echo "MD5 checksum of $CURRENT_FILE differs from expected value. Re-downloading."
443
        rm -f $CURRENT_FILE
444
        wget ftp://$KERNEL_FTP_USER:$KERNEL_FTP_USER@$KERNEL_FTP_HOST/$KERNEL_FTP_DIR/$CURRENT_FILE
445
        check_exit_code
446
    fi
447
else
448
    ## Download it ##
449
    echo "Downloading $CURRENT_FILE"
450
    wget ftp://$KERNEL_FTP_USER:$KERNEL_FTP_PASSWD@$KERNEL_FTP_HOST/$KERNEL_FTP_DIR/$CURRENT_FILE
451
    check_exit_code
452
fi
453
echo
454
 
455
####################################################################################################
456
 
457
cd $START_DIR
458
 
459
#if [ 0 eq 1 ] ## DEBUG skipping thing ##
460
#then
461
##Stuff you want to skip in here
462
#else ## DEBUG else
463
#cd $BUILD_TOP
464
#export PATH=$BUILD_TOP/tools/or32-uclinux/bin:$PATH
465
#fi ## DEBUG skipping end
466
 
467
## A couple of command line options to help if this thing breaks ##
468
## We won't clear away all the directories if run with the -d or -D options ##
469
DBG_BUILD=0
470
while getopts d OPT; do
471
    case "$OPT" in
472
        d)
473
        DBG_BUILD=1
474
        ;;
475
    esac
476
done
477
 
478
## if not debug building, let's remove all the old stuff ##
479
 
480
if [ $DBG_BUILD -eq 0 ]
481
    then
482
## Always start with a clean build dir ##
483
    rm -fr $BUILD_TOP
484
    mkdir $BUILD_TOP
485
    chmod 777 $BUILD_TOP
486
 
487
    mkdir $BUILD_TOP/b-gcc
488
    mkdir $BUILD_TOP/b-b
489
fi
490
 
491
## default build option is yes ##
492
BUILD_THIS="y"
493
 
494
if [ $DBG_BUILD -eq 1 ]
495
    then
496
    ## Ask if we should build binutils ##
497
    echo "Re-build $BINUTILS_VER ?"
498
    echo "[y/N]:"
499
    read YN
500
    ## $YN will be zero length string if user just pressed enter ##
501
    if [ -z $YN ]
502
        then
503
        BUILD_THIS="n"
504
    else
505
        BUILD_THIS=$(echo $YN | tr [:upper:] [:lower:])
506
    fi
507
 
508
    if [ $BUILD_THIS = "y" ]
509
        then
510
        ## Delete and recreate the binutils directory ##
511
        rm -rf $BUILD_TOP/b-b
512
        rm -rf $BUILD_TOP/$BINUTILS_VER
513
        mkdir $BUILD_TOP/b-b
514
 
515
    fi
516
fi
517
 
518
##########################Building Binutils#######################
519
if [ $BUILD_THIS = "y" ]
520
    then
521
 
522 1774 julius
    echo "############################## Building binutils ###############################"
523 1773 julius
    echo
524
    echo "Decompressing source"
525
    cd $BUILD_TOP
526
 
527
## Extract sources ##
528
    tar xjf $DOWNLOAD_DIR/$ZBALL1
529
 
530
    echo
531
    echo "Patching binutils with $BINUTILS_PATCH"
532
 
533
    cd $BINUTILS_VER
534
 
535
    bzip2 -dc $DOWNLOAD_DIR/$BINUTILS_PATCH | patch -p1 > $BINUTILS_VER-patch.log 2>&1
536
 
537
## Make sure that patched ok ##
538
    check_exit_code
539
 
540
    cd ..
541
    cd $BUILD_TOP/b-b
542
 
543
    echo
544
    echo "Configuring $BINUTILS_VER: --target=$TARGET --prefix=$INSTALL_DIR/$TARGET --disable-checking"
545
    echo "Logging output to $BINUTILS_VER-configure.log"
546
    $BUILD_TOP/$BINUTILS_VER/configure --target=$TARGET --prefix=$INSTALL_DIR/$TARGET --disable-checking > $BINUTILS_VER-configure.log 2>&1
547
 
548
    echo
549
    echo "Making and installing $BINUTILS_VER"
550
    echo "Logging output to $BINUTILS_VER-make.log "
551
    make all install > $BINUTILS_VER-make.log 2>&1
552
 
553
## Make sure that built ok ##
554
    check_exit_code
555
 
556
    cd $BUILD_TOP
557
 
558
fi
559
#######################Finish Building Binutils#####################
560
 
561
## Export the path to the new or32 binaries directory, used by the rest of this script ##
562
echo
563
echo "Adding $INSTALL_DIR/$TARGET/bin to the PATH variable"
564
export PATH=$INSTALL_DIR/$TARGET/bin:$PATH
565
 
566
## default build option is yes ##
567
BUILD_THIS="y"
568
 
569
if [ $DBG_BUILD -eq 1 ]
570
    then
571
    ## Ask if we should do the initial builds of GCC and Linux ##
572
    echo "Re-do initial $GCC_VER and $LINUX_VER builds (note if you choose to do this then it's EXTREMELY likely that you will have to do the rest of the script, particularly the re-build of gcc that occurs later)?"
573
    echo "[y/N]:"
574
    read YN
575
    ## $YN will be zero length string if user just pressed enter ##
576
    if [ -z $YN ]
577
        then
578
        BUILD_THIS="n" # default is no
579
    else
580
        BUILD_THIS=$(echo $YN | tr [:upper:] [:lower:])
581
    fi
582
 
583
    if [ $BUILD_THIS = "y" ]
584
        then
585
        ## Delete and recreate the gcc directory ##
586
        rm -rf $BUILD_TOP/b-gcc
587
        rm -rf $BUILD_TOP/$GCC_VER
588
        rm -rf $BUILD_TOP/$LINUX_VER
589
 
590
        mkdir $BUILD_TOP/b-gcc
591
 
592
        ## Undo everything done in the next part
593
        rm -rf $INSTALL_DIR/$TARGET/include
594
        unlink $INSTALL_DIR/$TARGET/sys-include
595
 
596
    fi
597
fi
598
 
599
##########################Building GCC and Linux############################
600
if [ $BUILD_THIS = "y" ]
601
    then
602
 
603
    echo
604 1774 julius
    echo "####################### Building or32 gcc and Linux ############################"
605 1773 julius
    echo
606
    echo "Decompressing source"
607
 
608
    cd $BUILD_TOP
609
 
610
## Extract sources ##
611
    tar xjf $DOWNLOAD_DIR/$ZBALL2 ## gcc sources ##
612
 
613
    tar xjf $DOWNLOAD_DIR/$ZBALL4 ## Linux kernel sources ##
614
 
615
    echo
616
    echo "Patching $LINUX_VER with patch file $LINUX_PATCH"
617
 
618
    cd $LINUX_VER
619
 
620
## Apply patch to linux kernel sources ##
621
    bzip2 -dc $DOWNLOAD_DIR/$LINUX_PATCH | patch -p1 > $LINUX_VER-patch.log 2>&1
622
 
623
## Make sure that patched ok ##
624
    check_exit_code
625
 
626
    cp rgd_dot_config .config
627
 
628
    echo
629
    echo "Making Linux oldconfig"
630
 
631
    make oldconfig > $LINUX_VER-make-oldconfig.log 2>&1
632
 
633
## Make sure that built ok ##
634
    check_exit_code
635
 
636
    cd $BUILD_TOP
637
 
638
    mkdir $INSTALL_DIR/$TARGET/include
639
    mkdir $INSTALL_DIR/$TARGET/include/asm
640
    mkdir $INSTALL_DIR/$TARGET/include/linux
641
 
642
    cp -f -dR $LINUX_VER/include/linux/* $INSTALL_DIR/$TARGET/include/linux
643
    cp -f -dR $LINUX_VER/include/asm-or32/* $INSTALL_DIR/$TARGET/include/asm
644
 
645
    cd $INSTALL_DIR/$TARGET
646
    ln -s include sys-include
647
    cd $BUILD_TOP
648
 
649
    cd $GCC_VER
650
 
651
## Patch gcc ##
652
    echo
653
    echo "Patching $GCC_VER with $GCC_PATCH"
654
 
655
    bzip2 -dc $DOWNLOAD_DIR/$GCC_PATCH | patch -p1 > $GCC_VER-patch.log 2>&1
656
 
657
## Make sure that patched ok ##
658
    check_exit_code
659
 
660
    cd $BUILD_TOP
661
    cd b-gcc
662
 
663
    # configure GCC
664
    echo
665
    echo "Configuring $GCC_VER: --target=$TARGET --prefix=$INSTALL_DIR/$TARGET --with-local-prefix=$INSTALL_DIR/$TARGET/or32-uclinux --with-gnu-as --with-gnu-ld --disable-libssp --enable-languages=c"
666
    echo "Logging output to $GCC_VER-configure.log"
667
    $BUILD_TOP/$GCC_VER/configure --target=$TARGET --prefix=$INSTALL_DIR/$TARGET --with-local-prefix=$INSTALL_DIR/$TARGET/or32-uclinux --with-gnu-as --with-gnu-ld --disable-libssp --enable-languages=c > $GCC_VER-configure.log 2>&1
668
 
669
    echo
670
    echo "Making and installing $GCC_VER"
671
    echo "Logging output to $GCC_VER-make.log"
672
    make all install > $GCC_VER-make.log 2>&1
673
 
674
## Make sure that built ok ##
675
    check_exit_code
676
 
677
    cd $BUILD_TOP
678
 
679
    echo
680
    echo "Making vmlinux image"
681
    echo "Logging output to vmlinux-make.log"
682
 
683
    cd $LINUX_VER
684
    make vmlinux ARCH=or32 CROSS_COMPILE=$INSTALL_DIR/$TARGET/bin/$TARGET- > vmlinux-make.log 2>&1
685
 
686
## Make sure that built ok ##
687
    check_exit_code
688
fi
689
##########################Finish Building GCC and Linux############################
690
 
691
 
692
## default build option is yes ##
693
BUILD_THIS="y"
694
 
695
if [ $DBG_BUILD -eq 1 ]
696
    then
697
    ## Ask if we should rebuild uClibc ##
698
    echo "Re-build $UCLIB_VER ?"
699
    echo "[y/N]:"
700
    read YN
701
    ## $YN will be zero length string if user just pressed enter ##
702
    if [ -z $YN ]
703
        then
704
        BUILD_THIS="n" # default is no
705
    else
706
        BUILD_THIS=$(echo $YN | tr [:upper:] [:lower:])
707
    fi
708
 
709
    if [ $BUILD_THIS = "y" ]
710
        then
711
        ## Delete the uClibc directory ##
712
        rm -rf $BUILD_TOP/$UCLIB_VER
713
    fi
714
fi
715
 
716
##########################Building uClibc#########################
717
if [ $BUILD_THIS = "y" ]
718
    then
719
 
720
    echo
721 1774 julius
    echo "############################## Building uClibc #################################"
722 1773 julius
    echo
723
    echo "Decompressing source"
724
 
725
    cd $BUILD_TOP
726
    tar xjf $DOWNLOAD_DIR/$ZBALL3 ## uClibc sources ##
727
 
728
    echo
729
    echo "Patching $UCLIB_VER with $UCLIBC_PATCH"
730
 
731
    cd $UCLIB_VER
732
 
733
## Patch uClibc sources ##
734
    bzip2 -dc $DOWNLOAD_DIR/$UCLIBC_PATCH  | patch -p1 > $UCLIB_VER-patch.log 2>&1
735
 
736
## Make sure that patched ok ##
737
    check_exit_code
738
 
739
    export CC=$TARGET-gcc
740
    export BUILD_TOP
741
    #cp $DOWNLOAD_DIR/$CONFIG1  $BUILD_TOP/$UCLIB_VER/.config
742
    #cp $DOWNLOAD_DIR/$CONFIG1  $BUILD_TOP/$UCLIB_VER/.config.old
743
 
744
    ## $TARGET name implementation into config script ##
745
    ## First get the second part of the target name, after the "-", the "elf" in "or32-elf", for example ##
746
    TARGET_SECOND_PART=`echo $TARGET | cut -f 2 -d "-"`
747
    ## First change any references to the uclinux target ##
748
    ## And delete the line saying DEVEL_PREFIX so we can put our $INSTALL_DIR path in ##
749
    sed "s/or32\-uclinux/\or32\-$TARGET_SECOND_PART/" $DOWNLOAD_DIR/$CONFIG1 | sed "/DEVEL\_PREFIX\=/d"  > $BUILD_TOP/$UCLIB_VER/.config  ## Output to the .config ##
750
    ## Now output the new DEVEL_PATH= value ##
751
    echo "DEVEL_PREFIX=\"$INSTALL_DIR/$TARGET\"" >> $BUILD_TOP/$UCLIB_VER/.config
752
    ## copy it to .config.old ##
753
    cp $BUILD_TOP/$UCLIB_VER/.config $BUILD_TOP/$UCLIB_VER/.config.old
754
    ## Do the configuration ##
755
 
756
## Change the cross compiler name in the Config.or32 file
757
## First get the second part of the target name, after the "-" ##
758
    TARGET_SECOND_PART=`echo $TARGET | cut -f 2 -d "-"`
759
## Removes the uclinux line and changes to whatever our current target is ##
760
    sed "s/or32\-uclinux/\or32\-$TARGET_SECOND_PART/" $BUILD_TOP/$UCLIB_VER/extra/Configs/Config.or32  > $BUILD_TOP/$UCLIB_VER/extra/Configs/Config.or32.newtarget
761
    mv $BUILD_TOP/$UCLIB_VER/extra/Configs/Config.or32.newtarget $BUILD_TOP/$UCLIB_VER/extra/Configs/Config.or32
762
 
763
    echo
764
    echo "Making uClibc oldconfig"
765
    make oldconfig > $UCLIB_VER-make-oldconfig.log 2>&1
766
 
767
## Make sure that built ok ##
768
    check_exit_code
769
 
770
    ln -s extra/Configs/Config.or32 Config
771
 
772
    echo
773
    echo "Making and install $UCLIB_VER"
774
    echo "Logging output to $UCLIB_VER-make.log"
775
    make all install > $UCLIB_VER-make.log 2>&1
776
 
777
## Make sure that built ok ##
778
    check_exit_code
779
 
780
    unset CC
781
fi
782
##########################Finish Building uClibc#########################
783
 
784
 
785
## default build option is yes ##
786
BUILD_THIS="y"
787
 
788
if [ $DBG_BUILD -eq 1 ]
789
    then
790
    ## Ask if we should rebuild gcc ##
791
    echo "Perform $GCC_VER re-build? - YES (y) if you rebuilt GCC and Linux previously, otherwise definitely NO (n)."
792
    echo "[y/N]:"
793
    read YN
794
    ## $YN will be zero length string if user just pressed enter ##
795
    if [ -z $YN ]
796
        then
797
        BUILD_THIS="n" # default is no
798
    else
799
        BUILD_THIS=$(echo $YN | tr [:upper:] [:lower:])
800
    fi
801
 
802
    if [ $BUILD_THIS = "y" ]
803
        then
804
        ## Undo some things we did before after doing this compile ##
805
        unlink $INSTALL_DIR/$TARGET/$TARGET/sys-include
806
        rm -rf $INSTALL_DIR/$TARGET/$TARGET/lib/*
807
    fi
808
fi
809
 
810
 
811
##########################re-Building GCC########################
812
if [ $BUILD_THIS = "y" ]
813
    then
814
 
815
    echo
816 1774 julius
    echo "############################## Re-building or-32 gcc ###########################"
817 1773 julius
    echo
818
    echo "Re-building $GCC_VER"
819
 
820
    cd $BUILD_TOP
821
 
822
    cd b-gcc
823
 
824
    echo
825
    echo "Re-configuring $GCC_VER: --target=$TARGET --prefix=$INSTALL_DIR/$TARGET --with-local-prefix=$INSTALL_DIR/$TARGET/$TARGET --with-gnu-as --with-gnu-ld --disable-libssp --enable-languages=c"
826
    echo "Logging output to $GCC_VER-rebuild-configure.log"
827
 
828
    $BUILD_TOP/$GCC_VER/configure --target=$TARGET --prefix=$INSTALL_DIR/$TARGET --with-local-prefix=$INSTALL_DIR/$TARGET/$TARGET --with-gnu-as --with-gnu-ld --disable-libssp --enable-languages=c > $GCC_VER-rebuild-configure.log 2>&1
829
 
830
 
831
 
832
    echo
833
    echo "Re-building and re-installing $GCC_VER"
834
    echo "Logging output to $GCC_VER-rebuild-make.log"
835
    make all install > $GCC_VER-rebuild-make.log 2>&1
836
 
837
## Make sure that built ok ##
838
    check_exit_code
839
 
840
    cd $INSTALL_DIR/$TARGET/$TARGET
841
    ln -s ../include sys-include
842
    cd lib
843
    cp -f -dR ../../lib/* .
844
    cd $BUILD_TOP
845
 
846
fi
847
 
848
##########################finish re-Building GCC########################
849
 
850
 
851
## default build option is yes ##
852
BUILD_THIS="y"
853
 
854
if [ $DBG_BUILD -eq 1 ]
855
    then
856
    ## Ask if we should rebuild gdb ##
857
    echo "Rebuild $GDB_VER?"
858
    echo "[y/N]:"
859
    read YN
860
    ## $YN will be zero length string if user just pressed enter ##
861
    if [ -z $YN ]
862
        then
863
        BUILD_THIS="n" # default is no
864
    else
865
        BUILD_THIS=$(echo $YN | tr [:upper:] [:lower:])
866
    fi
867
 
868
    if [ $BUILD_THIS = "y" ]
869
        then
870
        ## Delete existing gdb dir ##
871
        rm -rf $BUILD_TOP/$GDB_VER
872
    fi
873
fi
874
 
875
 
876
########################## GDB build ################
877
if [ $BUILD_THIS = "y" ]
878
    then
879
 
880
    echo
881 1774 julius
    echo "############################## Building GDB ####################################"
882 1773 julius
    echo
883
    echo "Decompressing source"
884
 
885
 
886
    cd $BUILD_TOP
887
 
888
    tar xjf $DOWNLOAD_DIR/$ZBALL8
889
 
890
    echo
891
    echo "Patching $GDB_VER with $GDB_PATCH"
892
 
893
    cd $GDB_VER
894
 
895
    bzcat -dc $DOWNLOAD_DIR/$GDB_PATCH | patch -p1 > $GDB_VER-patch.log 2>&1
896
 
897
## Make sure that patched ok ##
898
    check_exit_code
899
 
900
    echo
901
    echo "Configuring $GDB_VER: --target=$TARGET --prefix=$INSTALL_DIR/$TARGET"
902
 
903
    ./configure --target=$TARGET --prefix=$INSTALL_DIR/$TARGET > $GDB_VER-configure.log 2>&1
904
 
905
    echo
906
    echo "Making and installing $GDB_VER"
907
 
908
    make all install > $GDB_VER-make.log 2>&1
909
 
910
## Make sure that built ok ##
911
    check_exit_code
912
 
913
    cd $BUILD_TOP
914
 
915
fi
916
########################## finish GDB build ################
917
 
918
## default build option is yes ##
919
BUILD_THIS="y"
920
 
921
if [ $DBG_BUILD -eq 1 ]
922
    then
923
    ## Ask if we should rebuild busybox ##
924
    echo "Rebuild $BUSY_VER?"
925
    echo "[y/N]:"
926
    read YN
927
    ## $YN will be zero length string if user just pressed enter ##
928
    if [ -z $YN ]
929
        then
930
        BUILD_THIS="n" # default is no
931
    else
932
        BUILD_THIS=$(echo $YN | tr [:upper:] [:lower:])
933
    fi
934
 
935
    if [ $BUILD_THIS = "y" ]
936
        then
937
        ## Delete existing busybox stuff ##
938
        rm -rf $BUILD_TOP/$BUSY_VER
939
    fi
940
fi
941
 
942
##########################Building Busybox########################
943
if [ $BUILD_THIS = "y" ]
944
    then
945
 
946
    echo
947 1774 julius
    echo "############################## Building BusyBox ################################"
948 1773 julius
    echo
949
    echo "Decompressing source"
950
 
951
 
952
    cd $BUILD_TOP
953
 
954
    tar xjf $DOWNLOAD_DIR/$ZBALL5
955
 
956
 
957
    cd $BUSY_VER
958
    cp $DOWNLOAD_DIR/$CONFIG2  $BUILD_TOP/$BUSY_VER/.config
959
    cp $DOWNLOAD_DIR/$CONFIG2  $BUILD_TOP/$BUSY_VER/.config.old
960
 
961
    echo
962
    echo "Making $BUSY_VER oldconfig"
963
    make oldconfig > $BUSY_VER-make-oldconfig.log 2>&1
964
 
965
## Make Sure that built ok ##
966
    check_exit_code
967
 
968
## Put the Linux headers in BusyBox's include dir ##
969
 
970
    ln -s $BUILD_TOP/$LINUX_VER/include/linux $BUILD_TOP/$BUSY_VER/include/.
971
    ln -s $BUILD_TOP/$LINUX_VER/include/asm $BUILD_TOP/$BUSY_VER/include/.
972
 
973
    echo
974
    echo "Making $BUSY_VER"
975
    echo "Logging output to $BUSY_VER-make.log"
976
    make ARCH=or32 CROSS_COMPILE=$INSTALL_DIR/$TARGET/bin/$TARGET- > $BUSY_VER-make.log 2>&1
977
 
978
## Make sure that built ok ##
979
    check_exit_code
980
 
981
    echo
982
    echo "Installing $BUSY_VER"
983
    echo "Logging output to $BUSY_VER-install.log"
984
    make install ARCH=or32 CROSS_COMPILE=$INSTALL_DIR/$TARGET/bin/$TARGET- > $BUSY_VER-install.log 2>&1
985
 
986
## Make sure that built ok ##
987
    check_exit_code
988
 
989
    cd $BUILD_TOP
990
 
991
## Copy and extract the ramdisk image file
992
 
993
    cp $DOWNLOAD_DIR/$ZBALL7 . ## Ramdisk file ##
994
 
995
    bunzip2 $RAMDISK_FILE.bz2
996
 
997
    RT=`whoami`
998
    if [ $RT = "root" ];then
999
        mkdir rd_mount
1000
        chmod 777 rd_mount
1001
        mount -t ext2 -o loop $RAMDISK_FILE rd_mount
1002
        cp -f -dR $BUILD_TOP/busy_out.1.7.5/* $BUILD_TOP/rd_mount
1003
        umount rd_mount
1004
        cp -f $RAMDISK_FILE $LINUX_VER/$LINUX_RAMDISK_FILE
1005
    else
1006
        echo
1007
        echo "User is not root. Unable to mount Linux ramdisk."
1008
        echo "Note that this program built BusyBox but did not"
1009
        echo "install it on the ramdisk. Defaults are used."
1010
        cp -f $RAMDISK_FILE $LINUX_VER/$LINUX_RAMDISK_FILE
1011
    fi
1012
 
1013
    cd $BUILD_TOP
1014
fi
1015
##########################finish Building Busybox########################
1016
 
1017
########################## Finish BusyBox build ################
1018
 
1019
## default build option is yes ##
1020
BUILD_THIS="y"
1021
 
1022
if [ $DBG_BUILD -eq 1 ]
1023
    then
1024
    ## Ask if we should rebuild linux again##
1025
    echo "Rebuild the $LINUX_VER rebuild (only ever yes (y) if performed previous linux rebuild)?"
1026
    echo "[y/N]:"
1027
    read YN
1028
    ## $YN will be zero length string if user just pressed enter ##
1029
    if [ -z $YN ]
1030
        then
1031
        BUILD_THIS="n" # default is no
1032
    else
1033
        BUILD_THIS=$(echo $YN | tr [:upper:] [:lower:])
1034
    fi
1035
 
1036
fi
1037
 
1038
#echo "Start Building Linux kernel?"
1039
#read Q
1040
##########################Final Linux kernel build################
1041
if [ $BUILD_THIS = "y" ]
1042
    then
1043
 
1044
    echo
1045 1774 julius
    echo "########################### Linux image generation #############################"
1046 1773 julius
    cd $BUILD_TOP
1047
    cd $LINUX_VER
1048
 
1049
    echo
1050
    echo "Making vmlinux"
1051
    echo "Logging output to vmlinux-remake.log"
1052
    make vmlinux ARCH=or32 CROSS_COMPILE=$INSTALL_DIR/$TARGET/bin/$TARGET- > vmlinux-remake.log 2>&1
1053
 
1054
## Make sure that built ok ##
1055
    check_exit_code
1056
 
1057
    cd $BUILD_TOP
1058
fi
1059
##########################Finished Final Linux kernel build################
1060
 
1061
## default build option is yes ##
1062
BUILD_THIS="y"
1063
 
1064
if [ $DBG_BUILD -eq 1 ]
1065
    then
1066
    ## Ask if we should rebuild or1ksim##
1067
    echo "Rebuild $SIM_VER ?"
1068
    echo "[y/N]:"
1069
    read YN
1070
    ## $YN will be zero length string if user just pressed enter ##
1071
    if [ -z $YN ]
1072
        then
1073
        BUILD_THIS="n" # default is no
1074
    else
1075
        BUILD_THIS=$(echo $YN | tr [:upper:] [:lower:])
1076
    fi
1077
 
1078
    if [ $BUILD_THIS = "y" ]
1079
        then
1080
        ## Clean previous or1ksim directories ##
1081
        rm -rf $BUILD_TOP/$SIM_VER
1082
    fi
1083
fi
1084
 
1085
 
1086
#echo "Start Building Simulator?"
1087
#read Q
1088
##########################Simulator build#########################
1089
if [ $BUILD_THIS = "y" ]
1090
    then
1091
 
1092
    echo
1093 1774 julius
    echo "############################## Building or1ksim ################################"
1094 1773 julius
    echo
1095
    echo "Decompressing source"
1096
 
1097
    cd $BUILD_TOP
1098
 
1099
    tar xjf $DOWNLOAD_DIR/$ZBALL6
1100
 
1101
    cd $SIM_VER
1102
 
1103
    echo
1104
    echo "Configuring $SIM_VER: --target=$TARGET --prefix=$INSTALL_DIR/$TARGET"
1105
 
1106
    ./configure --target=$TARGET --prefix=$INSTALL_DIR/$TARGET > $SIM_VER-configure.log 2>&1
1107
 
1108
    echo
1109
    echo "Making and installing $SIM_VER"
1110
    echo "Logging output to $SIM_VER-make.log"
1111
    make all install > $SIM_VER-make.log 2>&1
1112
 
1113
## Make sure that built ok ##
1114
    check_exit_code
1115
 
1116
    cd $BUILD_TOP
1117
fi
1118
##########################Finish Simulator build#########################
1119
 
1120
 
1121
##########################Code Test###############################
1122
cd $BUILD_TOP
1123
echo "Launch the simulator with the newly compiled Linux image and BusyBox apps?"
1124
echo "[y/N]:"
1125
read SI
1126
 
1127
if [ -z $SI ]
1128
    then
1129
    SVAL="n" ## Default is no ##
1130
else
1131
    SVAL=$(echo $SI | tr [:upper:] [:lower:])
1132
fi
1133
 
1134
if [ $SVAL = "y" ];then
1135
 
1136
    ## Check for X's xterm, if we find it, and a valid $DISPLAY variable, we'll open the simulator with an xterm tty ##
1137
    which xterm
1138
 
1139
 
1140
    if [ $? -eq 0 ]
1141
        then
1142
        # Xterm exists, check if the $DISPLAY variable is set
1143
        # Get the display variable
1144
        DISPLAY=`printenv DISPLAY`
1145
        echo "DISPLAY variable is set to $DISPLAY"
1146
        if [ -n $DISPLAY ]
1147
            then
1148
            ## It appears display is set, let's set the or1ksim_linux.cfg file to use an xterm instead of telnet ##
1149
            cd $LINUX_VER
1150
            ## Rename the original script, adding .orig to the end ##
1151
            mv or1ksim_linux.cfg or1ksim_linux.cfg.orig
1152
            ## Now use sed to comment the line specifiying a telnet tty and uncomment the xterm line, restoring the original script ##
1153
            sed 's/channel\ \=\ \"tcp\:10084\"/\/\*\ channel\ \=\ \"tcp\:10084\"\ \*\//' or1ksim_linux.cfg.orig | sed 's/\/\*\ channel\ \=\ \"xterm\:\"\ \*\//\ channel\ \=\ \"xterm\:\"\ /' > or1ksim_linux.cfg
1154
            echo "########################## or1ksim ###############################"
1155
            echo
1156
            echo "or1ksim will open an xterm for console output as Linux is booting."
1157
            echo
1158
            echo "########################## or1ksim ###############################"
1159
            cd $BUILD_TOP
1160
        fi
1161
 
1162
    else
1163
        echo "########################## or1ksim ###############################"
1164
        echo
1165
        echo "     To connect to the simulator run: telnet 127.0.0.1 10084"
1166
        echo
1167
        echo "########################## or1ksim ###############################"
1168
 
1169
    fi
1170
 
1171
 
1172
    cd $BUILD_TOP/$LINUX_VER
1173
    $INSTALL_DIR/$TARGET/bin/$TARGET-sim -f or1ksim_linux.cfg vmlinux
1174
 
1175
else
1176
    ## User didn't run the sim, but tell them how to anyway ##
1177
    echo "The compiled linux image is found in $BUILD_TOP/$LINUX_VER/vmlinux"
1178
    echo "To run it in the simulator, cd to $BUILD_TOP/$LINUX_VER"
1179
    echo "and run:"
1180
    echo "$TARGET-sim -f or1ksim_linux.cfg vmlinux"
1181
    echo
1182
 
1183
fi
1184
 
1185
echo
1186
echo "OpenRISC toolchain and architectural simulator build is complete!"
1187
echo
1188
echo "Your tools are installed in: $INSTALL_DIR/$TARGET"
1189
echo
1190
echo "Please add $INSTALL_DIR/$TARGET/bin to your PATH variable"
1191
echo
1192
exit 0
1193
 
1194
##########################End Script##############################

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.