[uClinux-dev] uClinux-dist/m68k-elf-tools/M5272C3/Redhat/Cygwin Quick Start Ins tructions

From: Banasik, Paul M (PaulMBanasik@eaton.com)
Date: Tue May 21 2002 - 14:39:27 EDT


Hi all -

I started working on this part-time about two weeks ago and finished it
today.  I hope it comes in handy for some of you.  Beyond getting the tools,
libraries, kernel, and default user apps to build, I learned a few useful
things:

1)  Decide which kernel version you're going to develop with first, then
build the tools and uClibc libraries.  The tools and libraries depend on the
kernel's headers, so if you mix kernels and libraries (e.g. 2.0.x kernel
with 2.4.x-based libraries, or vice versa) there will be problems.  In my
case, I have built tools and libraries for both the 2.0.x and 2.4.x kernels.
Choose a 2.0.x kernel for a smaller footprint; choose a 2.4.x kernel for
more features.

2)  If you're going to use any of the userland apps in the uClinux
distribution, the path of least resistance is to select uC-libc, not uClibc,
in the distribution's main configuration menu.  The userland apps have been
mostly ported with uC-libc in mind, so selecting uClibc for userland apps
will cause you to spend a lot of time fixing things.  Inside the uClinux
distribution, uC-libc is the way to go.  Outside of the uClinux
distribution, the uClibc included with the tools will be referenced by
default.  An opinion I've formed is that the uClinux distribution should
standardize on a single library to reduce confusion among the user
community.  One option would be to eliminate uClibc inside the distribution
and force all userland apps to work with uC-libc.  Another option would be
to eliminate uC-libc and update all userland apps to work with uClibc.  Of
the two options, I think the latter makes more sense because uClibc is
closer to glibc and is actively maintained.  For the time being, though, use
uC-libc for uClinux, and uClibc for everything else.

3)  The differences between development hosts (pure Linux machine, or
Cygwin/Windows hybrid) are not as significant as one might initially think.
In the past I've supported Cygwin/Windows because it allowed me to develop
with uClinux and remain a "good corporate citizen."  Many other people on
this message board use Linux machines as their hosts.  This time I wanted to
see how much additional work Cygwin inflicts on developers, document it, and
establish an objective basis for future discussions.  So I temporarily set
up two computers at work (one Redhat 7.2, one Cygwin 1.3.10/Windows 2000)
side-by-side, and let the build errors accumulate.  A few key pieces of
knowledge I picked up from side-by-side building made Cygwin a more "Linuxy"
development host; see the "known issues" sections in variations #3 and #4 of
the instructions below for more information.

Enjoy!

Paul B.

[----- Start Instructions Here -----]

uClinux Quick Start Instructions
Paul M. Banasik
May 7, 2002

The purpose of these instructions is to act as a quick start guide for those
interested in developing with uClinux on a MCF5272 target.  I have generated
four sets of sequential instructions to accommodate the following
host/target combinations.

Intel/Redhat 7.2 host --- MCF5272/uClinux-2.0.x target
Intel/Redhat 7.2 host --- MCF5272/uClinux-2.4.x target
Intel/Cygwin 1.3.10/Win2000 host --- MCF5272/uClinux-2.0.x target
Intel/Cygwin 1.3.10/Win2000 host --- MCF5272/uClinux-2.4.x target

I downloaded the following packages and burned two CD-R's as archives;
hence, in the instructions given below you'll see references to mounting one
CD or the other.

uClinux disc 1 of 2:

cygwin 1.3.10 (all except xfree directory)

uClinux disc 2 of 2:

cygwin 1.3.10 (xfree directory only)
xfree86 4.1.0/4.2.0 sources
dBUG Firmware
elf2flt-cvs-20020427
gdb-5.1.1
glibc-2.2.5
hexedit-1.2.2
m68k-elf-tools-20020410
minicom-2.00.0
uClibc-0.9.11
uClinux-dist-20020502

These instructions will be different depending on how you download and
archive the source packages.  Also, these instructions do not show how to
install all of the packages listed above; only the basic cross compiler,
library, and operating system packages are addressed.  Some of my personal
preferences or ways of doing things are embedded in these instructions; you
may have a preferred method that accomplishes the same goals.

The instructions listed below were based on the host hardware, target
hardware, and software packages I had on-hand at the time I was writing
this.  Because so many variations of hardware and software exist in the
world, I can't guarantee the results 100% of the time.  I only hope to
accomplish three things:

- Flush out as many fundamental bugs as possible in building the tools and
default kernel images.
- Provide encouragement to new users so they can start using the packages as
easily as possible.
- Provide feedback to the maintainers of the packages so they can make
adjustments to the source code.

Variation #1

Host = Redhat 7.2 distribution on Intel processor
Target = uClinux-dist-20020502 on M5272C3 target (2.0.x kernel)
Tools = m68k-elf-tools-20020410, which includes uClibc 0.9.9

Known Issues

- Kernel version 2.0.x does not support the UNIX98PTY feature of uClibc;
uClibc has to be temporarily reconfigured at build time.
- The tool build script does not install elf2flt or flthdr in /usr/local/bin
during the tool build process, so the script complains when tar'ing the
complete package.
- The tool build script does not generate a complete mid-shared-library for
mcpu32.
- The uClinux makefile does not check for a /tftpboot directory, so if it
doesn't exist then /tftpboot/image.bin is simply named tftpboot.

The following instructions compensate for all of these issues except the
mid-shared-library.

1. Install Redhat 7.2 on computer with all options (KDE, Gnome, Development,
Games).
2. Reboot & log in as 'root'
3. mkdir /tftpboot
4. Insert 'uClinux 2 of 2' in CD-ROM drive.
5. mount /dev/hdc /mnt/cdrom
6. cp /mnt/cdrom/m68k-elf-tools-20020410/* ~/.
7. cp /mnt/cdrom/uClinux-dist-20020502/* ~/.
8. mkdir elf2flt-cvs-20020427
9. cp /mnt/cdrom/elf2flt-cvs-20020427/* ~/elf2flt-cvs-20020427/.
10. tar xzf uClibc.tar.gz
11. tar xzf uClinux-dist-20020502.tar.gz
12. cd uClinux-dist
13. make config

vendor/product=Motorola/M5272C3
kernel version=linux-2.0.x
libc version=uC-libc
default all settings=Y
customize kernel settings=N
customize vendor/user settings=N
update default vendor settings=N

14. make dep
15. cd
16. vi build-uclinux-tools.sh
17. Change the EDIT section to reflect the following information:

MAKE=make
ELF2FLT="$BASEDIR/elf2flt-cvs-20020427"
UCLIBC="$BASEDIR/uClibc"
# KERNEL="$BASEDIR/uClinux-dist/linux-2.4.x"
KERNEL="$BASEDIR/uClinux-dist/linux-2.0.x"
TARGET=m68k-elf

18. In fix_uclibc_config(), add the following line to the existing list of
expressions:

-e "s/^[ 	]*UNIX98PTY_ONLY[ 	]*=.*/UNIX98PTY_ONLY=false/"

19. :w! and :q
20. ./build-uclinux-tools.sh build 2>&1 | tee tool_build_results.txt
21. cp /usr/local/m68k-elf/bin/elf2flt /usr/local/bin/.
22. cp /usr/local/m68k-elf/bin/flthdr /usr/local/bin/.
23. ./build-uclinux-tools.sh uclibc 2>&1 | tee tool_uclibc_results.txt
24. ./build-uclinux-tools.sh tar 2>&1 | tee tool_tar_results.txt
25. cd uClinux-dist
26. make 2>&1 | tee make_results.txt

A default 2.0.x image for the M5272C3 eval board will now reside in
~/uClinux-dist/images and /tftpboot.

Variation #2

Host = Redhat 7.2 distribution on Intel processor
Target = uClinux-dist-20020502 on M5272C3 target (2.4.x kernel)
Tools = m68k-elf-tools-20020410, which includes uClibc 0.9.9

Known Issues

- The 'fastdep: dummy' rule in uClinux-dist/linux-2.4.x/Rules.make includes
$(CFLAGS) and $(EXTRA_CFLAGS) in the $(TOPDIR)/scripts/mkdep command line;
these need to be deleted.
- The tool build script does not install elf2flt or flthdr in /usr/local/bin
during the tool build process, so the script complains when tar'ing the
complete package.
- The tool build script does not generate a complete mid-shared-library for
mcpu32.
- The uClinux makefile does not check for a /tftpboot directory, so if it
doesn't exist then /tftpboot/image.bin is simply named tftpboot.

The following instructions compensate for all of these issues except the
mid-shared-library.

1. Install Redhat 7.2 on computer with all options (KDE, Gnome, Development,
Games).
2. Reboot & log in as 'root'
3. mkdir /tftpboot
4. Insert 'uClinux 2 of 2' in CD-ROM drive.
5. mount /dev/hdc /mnt/cdrom
6. cp /mnt/cdrom/m68k-elf-tools-20020410/* ~/.
7. cp /mnt/cdrom/uClinux-dist-20020502/* ~/.
8. mkdir elf2flt-cvs-20020427
9. cp /mnt/cdrom/elf2flt-cvs-20020427/* ~/elf2flt-cvs-20020427/.
10. tar xzf uClibc.tar.gz
11. tar xzf uClinux-dist-20020502.tar.gz
12. cd uClinux-dist
13. make config

vendor/product=Motorola/M5272C3
kernel version=linux-2.4.x
libc version=uC-libc
default all settings=Y
customize kernel settings=N
customize vendor/user settings=N
update default vendor settings=N

14. cd linux-2.4.x
15. vi Rules.make
16. Search for 'fastdep' using the slash (/) command
17. Change the fastdep command to read:

$(TOPDIR)/scripts/mkdep -- $(wildcard *.[chS]) > .depend

18. :w and :q
19. cd ..
20. make dep
21. cd
22. vi build-uclinux-tools.sh
23. Change the EDIT section to reflect the following information:

MAKE=make
ELF2FLT="$BASEDIR/elf2flt-cvs-20020427"
UCLIBC="$BASEDIR/uClibc"
KERNEL="$BASEDIR/uClinux-dist/linux-2.4.x"
# KERNEL="$BASEDIR/uClinux-dist/linux-2.0.x"
TARGET=m68k-elf

24. In fix_uclibc_config(), add the following line to the existing list of
expressions:

-e "s/^[ 	]*UNIX98PTY_ONLY[ 	]*=.*/UNIX98PTY_ONLY=false/"

25. :w! and :q
26. ./build-uclinux-tools.sh build 2>&1 | tee tool_build_results.txt
27. cp /usr/local/m68k-elf/bin/elf2flt /usr/local/bin/.
28. cp /usr/local/m68k-elf/bin/flthdr /usr/local/bin/.
29. ./build-uclinux-tools.sh uclibc 2>&1 | tee tool_uclibc_results.txt
30. ./build-uclinux-tools.sh tar 2>&1 | tee tool_tar_results.txt
31. cd uClinux-dist
32. make 2>&1 | tee make_results.txt

A default 2.4.x image for the M5272C3 eval board will now reside in
~/uClinux-dist/images and /tftpboot.

Variation #3

Host = Cygwin 1.3.10/Windows 2000 on Intel processor
Target = uClinux-dist-20020502 on M5272C3 target (2.0.x kernel)
Tools = m68k-elf-tools-20020410, which includes uClibc 0.9.9

Known Issues

- The Cygwin startup batch files need to enable UNIX filesystem emulation
with the "ntea" attribute.
- Cygwin does not install shortcuts to Xfree86 by default; these have to be
done manually.
- Most Linux systems symbolically link sh to bash; Cygwin actually has a
unique sh.exe and bash.exe, so sh.exe must be replaced with a symbolic link
to bash.exe.
- The uClinux distribution includes script or utility files that are
precompiled in ELF format; they won't execute under Cygwin, so they must be
deleted so they are rebuilt with a local copy of the host's compiler.
- The file ~/gcc-2.95.3/gcc/config/i386/xm-cygwin.h defines an executable
suffix of ".exe," this line has to be removed in m68k-elf-tools so m68k
userland executables are generated without ".exe" appended.
- Kernel version 2.0.x does not support the UNIX98PTY feature of uClibc;
uClibc has to be temporarily reconfigured at build time.
- As Cygwin is not Linux, the genromfs package needs to have -Dlinux=1
included in the Makefile to force a successful build.
- The elf2flt package relies on elf.h, which doesn't exist in the Cygwin
include directory.
- Borrowing a elf.h include file from glibc-2.2.5 requires some data type
modifications.
- The tool build script does not generate a complete mid-shared-library for
mcpu32.
- The tool build script does not install elf2flt or flthdr in /usr/local/bin
during the tool build process, so the script complains when tar'ing the
complete package.
- The uClinux makefile does not check for a /tftpboot directory, so if it
doesn't exist then /tftpboot/image.bin is simply named tftpboot.

The following instructions compensate for all of these issues except the
mid-shared-library.

1. Boot a Windows 2000 host and log into an account with administrative
privileges.
2. Start Windows Explorer.
3. In c:\My Documents, create a Downloads-uClinux folder.
4. Insert "uClinux 1 of 2" in the CD-ROM drive.
5. Copy all package directories to c:\My Documents\Downloads-uClinux\
6. Remove "uClinux 1 of 2" from the CD-ROM drive.
7. Insert "uClinux 2 of 2" in the CD-ROM drive.
8. Copy all package directories to c:\My Documents\Downloads-uClinux\
9. Remove "uClinux 2 of 2" from the CD-ROM drive.
10. Go to c:\My Documents\Downloads-uClinux\cygwin_1.3.10, and double-click
on setup.exe.
11. Click "Next" to get past the announcement screen.
12. Pick "Install from Local Directory."
13. Click on "Next."
14. Leave the root directory as "c:\cygwin," install for all users, and keep
the default text type as UNIX.
15. Click on "Next." 
16. Leave the package directory alone, and click on "Next."
17. On the "+ All" package line, click on the circle icon until the action
for all packages is "Install."
18. Click on "Next" to proceed with the installation.
19. It will take a few minutes to install all of the packages; the installer
will then ask about creating icons.
20. Leave "Create Icon on Desktop" and "Add Icon to Start Menu" checked.
21. Click on "Finish."
22. A post-installation script will execute for a few minutes.
23. The installer will announce the installation is complete.
24. Click on "Ok" to close the installer.
25. Edit the cygwin.bat batch file located in c:\cygwin to look like this:

@echo off
set CYGWIN=title ntea
C:
chdir C:\cygwin\bin
bash --login -i

26. Save the modified batch file and close the editor.
27. The Cygwin 1.3.10 installation process also installs Xfree86 4.2.0, but
does not install any shortcuts.
28. On the Windows desktop, right-click first, then click on "New Shortcut."
29. Browse down to c:\cygwin\usr\X11R6\bin\startxwin.bat, click on "Ok,"
then click on "Next."
30. Name the shortcut "Cygwin-XFree86" and click on "Finish."
31. Right-click on the new desktop shortcut, click on "Properties," and
adjust the icon to your preferences.
32. Right-click on the adjusted desktop shortcut, and click on "Copy."
33. Right-click on the start menu button, and click on "Explore All Users."
34. Navigate down to c:\Documents and Settings\All Users\Start
Menu\Programs\Cygwin and paste a copy of the shortcut by right-clicking in
the file/shortcut area, then clicking on "Paste."
35. Edit the startxwin.bat batch file located in c:\cygwin\usr\X11R6\bin.
36. Change the top three lines of the batch file to read:

@echo off
set CYGWIN=ntea
SET DISPLAY=127.0.0.1:0.0

37. Save the modified batch file and close the editor.
38. Start a Cygwin console to automatically create a user account, then
logout by entering "exit".
39. Installation of Cygwin 1.3.10 and Xfree86 4.2.0 is now complete.

Note:  The usage of Xfree86 is entirely optional while working with uClinux;
all common development tasks can be carried out within one or more Cygwin
consoles directly.  The instructions presented here provide only the most
basic installation.  If you revisit the Cygwin 1.3.10 download directory,
you'll find there are a number of optional enhancements located in cygwin
1.3.10\xfree\contrib.  Xfce, nedit, and mxterm all provide a richer user
experience than twm, vi, and xterm.  In addition to those packages, the
Cygwin home page lists a number of other packages that have been ported to
Cygwin, such as joe or minicom.  The extent to which you want change the
functionality or aesthetics of Xfree86 is entirely up to you.

40. Using Windows Explorer, copy all of the files from c:\My
Documents\Downloads-uClinux\m68k-elf-tools-20020410 into
c:\cygwin\home\Administrator.
41. Copy all of the files from c:\My
Documents\Downloads-uClinux\uClinux-dist-20020502 into
c:\cygwin\home\Administrator.
42. Copy glibc-2.2.5.tar.gz from c:\My
Documents\Downloads-uClinux\glibc-2.2.5 into c:\cygwin\home\Administrator.
43. Create a new folder in c:\cygwin\home\Administrator called
elf2flt-cvs-20020427.
44. Copy all of the files from c:\My
Documents\Downloads-uClinux\elf2flt-cvs-20020427 into
c:\cygwin\home\Administrator\elf2flt-cvs-20020427.
45. Start a Cygwin console.
46. cd /bin
47. mv sh.exe sh-original.exe
48. ln -s bash.exe sh.exe
49. cd
50. mkdir /tftpboot
51. tar xzf uClibc.tar.gz
52. tar xzf glibc-2.2.5.tar.gz
53. tar xzf uClinux-dist-20020502.tar.gz
54. cd uClinux-dist
55. make config

vendor/product=Motorola/M5272C3
kernel version=linux-2.0.x
libc version=uC-libc
default all settings=Y
customize kernel settings=N
customize vendor/user settings=N
update default vendor settings=N

56. rm linux-2.0.x/scripts/mkdep
57. make dep
58. cd
59. vi build-uclinux-tools.sh
60. Change the EDIT section to reflect the following information:

MAKE=make
ELF2FLT="$BASEDIR/elf2flt-cvs-20020427"
UCLIBC="$BASEDIR/uClibc"
# KERNEL="$BASEDIR/uClinux-dist/linux-2.4.x"
KERNEL="$BASEDIR/uClinux-dist/linux-2.0.x"
TARGET=m68k-elf

61. In fix_uclibc_config(), add the following line to the existing list of
expressions:

-e "s/^[ 	]*UNIX98PTY_ONLY[ 	]*=.*/UNIX98PTY_ONLY=false/"

62. In stage 4, after schk 4 || return 0, and before rm -rf ${TARGET}-gcc,
add the following four lines:

cd gcc-2.95.3/gcc/config/i386
cp xm-cygwin.h xm-cygwin.h.orig
sed "s/#define EXECUTABLE_SUFFIX \".exe\"//" < xm-cygwin.h.orig >
xm-cygwin.h
cd

63. Edit stage 7 to reflect the following:

stage7()
{
schk 7 || return 0
rm -rf genromfs-0.5.1
extract genromfs-0.5.1*
cd genromfs-0.5.1
cp Makefile Makefile.orig
sed "s/^CFLAGS = -O2 -Wall/CFLAGS = -O2 -Wall -Dlinux=1/" < Makefile.orig >
Makefile
${MAKE}
cp genromfs.exe ${PREFIX}/bin/.
chmod 755 ${PREFIX}/bin/genromfs.exe
cd $BASEDIR
mark 7
}

64. In the build_tar_file() function, add a ".exe" suffix to genromfs,
elf2flt, and flthdr in the section titled, "tar it all up."
65. Near the bottom of the build script, in the section titled "You have to
be root for this one," delete everything from "else" to just before "fi."
66. :w! and :q
67. cd elf2flt-cvs-20020427
68. cp ../glibc-2.2.5/elf/elf.h .
69. vi Makefile.in
70. In the elf2flt rule, add -lintl after $(LIBS).
71. In the install rule, change all instances of ld to ld.exe, and ld.real
to ld.real.exe.
72. :w and :q
73. vi elf2flt.c
74. Change #include <elf.h> to be #include "elf.h".
75. :w and :q
76. vi elf.h
77. Delete the __BEGIN_DECL macro at the top of the file.
78. Delete the __END_DECL macro at the bottom of the file.
79. Change #include <stdint.h> to be #include <sys/types.h>.
80. For the typedefs declared at the top of the file, change all uint16_t,
uint32_t, and uint64_t types to u_int16_t, u_int32_t, and u_int64_t
respectively.
81. :w and :q
82. cd
83. ./build-uclinux-tools.sh build 2>&1 | tee tool_build_results.txt
84. cp /usr/local/m68k-elf/bin/elf2flt.exe /usr/local/bin/.
85. cp /usr/local/m68k-elf/bin/flthdr.exe /usr/local/bin/.
86. ./build-uclinux-tools.sh uclibc 2>&1 | tee tool_uclibc_results.txt
87. ./build-uclinux-tools.sh tar 2>&1 | tee tool_tar_results.txt
88. cd uClinux-dist
89. make 2>&1 | tee make_results.txt

A default 2.0.x image for the M5272C3 eval board will now reside in
~/uClinux-dist/images and /tftpboot.

Variation #4

Host = Cygwin 1.3.10/Windows 2000 on Intel processor
Target = uClinux-dist-20020502 on M5272C3 target (2.4.x kernel)
Tools = m68k-elf-tools-20020410, which includes uClibc 0.9.9

Known Issues

- The Cygwin startup batch files need to enable UNIX filesystem emulation
with the "ntea" attribute.
- Cygwin does not install shortcuts to Xfree86 by default; these have to be
done manually.
- Most Linux systems symbolically link sh to bash; Cygwin actually has a
unique sh.exe and bash.exe, so sh.exe must be replaced with a symbolic link
to bash.exe.
- The uClinux distribution includes script or utility files that are
precompiled in ELF format; they won't execute under Cygwin, so they must be
deleted so they are rebuilt with a local copy of the host's compiler.
- The 'dep-files:' rule in uClinux-dist/linux-2.4.x/Makefile has a 'find'
expression that doesn't evaluate properly with slanted single quotes under
Cygwin/bash.
- The 'fastdep: dummy' rule in uClinux-dist/linux-2.4.x/Rules.make includes
$(CFLAGS) and $(EXTRA_CFLAGS) in the $(TOPDIR)/scripts/mkdep command line;
these need to be deleted.
- The file ~/gcc-2.95.3/gcc/config/i386/xm-cygwin.h defines an executable
suffix of ".exe," this line has to be removed in m68k-elf-tools so m68k
userland executables are generated without ".exe" appended.
- As Cygwin is not Linux, the genromfs package needs to have -Dlinux=1
included in the Makefile to force a successful build.
- The elf2flt package relies on elf.h, which doesn't exist in the Cygwin
include directory.
- Borrowing a elf.h include file from glibc-2.2.5 requires some data type
modifications.
- The tool build script does not generate a complete mid-shared-library for
mcpu32.
- The tool build script does not install elf2flt or flthdr in /usr/local/bin
during the tool build process, so the script complains when tar'ing the
complete package.
- The uClinux makefile does not check for a /tftpboot directory, so if it
doesn't exist then /tftpboot/image.bin is simply named tftpboot.

The following instructions compensate for all of these issues except the
mid-shared-library.

1. Boot a Windows 2000 host and log into an account with administrative
privileges.
2. Start Windows Explorer.
3. In c:\My Documents, create a Downloads-uClinux folder.
4. Insert "uClinux 1 of 2" in the CD-ROM drive.
5. Copy all package directories to c:\My Documents\Downloads-uClinux\
6. Remove "uClinux 1 of 2" from the CD-ROM drive.
7. Insert "uClinux 2 of 2" in the CD-ROM drive.
8. Copy all package directories to c:\My Documents\Downloads-uClinux\
9. Remove "uClinux 2 of 2" from the CD-ROM drive.
10. Go to c:\My Documents\Downloads-uClinux\cygwin_1.3.10, and double-click
on setup.exe.
11. Click "Next" to get past the announcement screen.
12. Pick "Install from Local Directory."
13. Click on "Next."
14. Leave the root directory as "c:\cygwin," install for all users, and keep
the default text type as UNIX.
15. Click on "Next." 
16. Leave the package directory alone, and click on "Next."
17. On the "+ All" package line, click on the circle icon until the action
for all packages is "Install."
18. Click on "Next" to proceed with the installation.
19. It will take a few minutes to install all of the packages; the installer
will then ask about creating icons.
20. Leave "Create Icon on Desktop" and "Add Icon to Start Menu" checked.
21. Click on "Finish."
22. A post-installation script will execute for a few minutes.
23. The installer will announce the installation is complete.
24. Click on "Ok" to close the installer.
25. Edit the cygwin.bat batch file located in c:\cygwin to look like this:

@echo off
set CYGWIN=title ntea
C:
chdir C:\cygwin\bin
bash --login -i

26. Save the modified batch file and close the editor.
27. The Cygwin 1.3.10 installation process also installs Xfree86 4.2.0, but
does not install any shortcuts.
28. On the Windows desktop, right-click first, then click on "New Shortcut."
29. Browse down to c:\cygwin\usr\X11R6\bin\startxwin.bat, click on "Ok,"
then click on "Next."
30. Name the shortcut "Cygwin-XFree86" and click on "Finish."
31. Right-click on the new desktop shortcut, click on "Properties," and
adjust the icon to your preferences.
32. Right-click on the adjusted desktop shortcut, and click on "Copy."
33. Right-click on the start menu button, and click on "Explore All Users."
34. Navigate down to c:\Documents and Settings\All Users\Start
Menu\Programs\Cygwin and paste a copy of the shortcut by right-clicking in
the file/shortcut area, then clicking on "Paste."
35. Edit the startxwin.bat batch file located in c:\cygwin\usr\X11R6\bin.
36. Change the top three lines of the batch file to read:

@echo off
set CYGWIN=ntea
SET DISPLAY=127.0.0.1:0.0

37. Save the modified batch file and close the editor.
38. Start a Cygwin console to automatically create a user account, then
logout by entering "exit".
39. Installation of Cygwin 1.3.10 and Xfree86 4.2.0 is now complete.

Note:  The usage of Xfree86 is entirely optional while working with uClinux;
all common development tasks can be carried out within one or more Cygwin
consoles directly.  The instructions presented here provide only the most
basic installation.  If you revisit the Cygwin 1.3.10 download directory,
you'll find there are a number of optional enhancements located in cygwin
1.3.10\xfree\contrib.  Xfce, nedit, and mxterm all provide a richer user
experience than twm, vi, and xterm.  In addition to those packages, the
Cygwin home page lists a number of other packages that have been ported to
Cygwin, such as joe or minicom.  The extent to which you want change the
functionality or aesthetics of Xfree86 is entirely up to you.

40. Using Windows Explorer, copy all of the files from c:\My
Documents\Downloads-uClinux\m68k-elf-tools-20020410 into
c:\cygwin\home\Administrator.
41. Copy all of the files from c:\My
Documents\Downloads-uClinux\uClinux-dist-20020502 into
c:\cygwin\home\Administrator.
42. Copy glibc-2.2.5.tar.gz from c:\My
Documents\Downloads-uClinux\glibc-2.2.5 into c:\cygwin\home\Administrator.
43. Create a new folder in c:\cygwin\home\Administrator called
elf2flt-cvs-20020427.
44. Copy all of the files from c:\My
Documents\Downloads-uClinux\elf2flt-cvs-20020427 into
c:\cygwin\home\Administrator\elf2flt-cvs-20020427.
45. Start a Cygwin console.
46. cd /bin
47. mv sh.exe sh-original.exe
48. ln -s bash.exe sh.exe
49. cd
50. mkdir /tftpboot
51. tar xzf uClibc.tar.gz
52. tar xzf glibc-2.2.5.tar.gz
53. tar xzf uClinux-dist-20020502.tar.gz
54. cd uClinux-dist
55. make config

vendor/product=Motorola/M5272C3
kernel version=linux-2.4.x
libc version=uC-libc
default all settings=Y
customize kernel settings=N
customize vendor/user settings=N
update default vendor settings=N

56. cd linux-2.4.x
57. vi Makefile
58. Search for 'dep-files' using the slash (/) command
59. Change the quotes around the 'find' expression from slanted single
quotes (`) to vertical single quotes (')
60. :w and :q
61. vi Rules.make
62. Search for 'fastdep' using the slash (/) command
63. Change the fastdep command to read:

$(TOPDIR)/scripts/mkdep -- $(wildcard *.[chS]) > .depend

64. :w and :q
65. cd ..
66. make dep
67. cd
68. vi build-uclinux-tools.sh
69. Change the EDIT section to reflect the following information:

MAKE=make
ELF2FLT="$BASEDIR/elf2flt-cvs-20020427"
UCLIBC="$BASEDIR/uClibc"
KERNEL="$BASEDIR/uClinux-dist/linux-2.4.x"
# KERNEL="$BASEDIR/uClinux-dist/linux-2.0.x"
TARGET=m68k-elf

70. In fix_uclibc_config(), add the following line to the existing list of
expressions:

-e "s/^[ 	]*UNIX98PTY_ONLY[ 	]*=.*/UNIX98PTY_ONLY=false/"

71. In stage 4, after schk 4 || return 0, and before rm -rf ${TARGET}-gcc,
add the following four lines:

cd gcc-2.95.3/gcc/config/i386
cp xm-cygwin.h xm-cygwin.h.orig
sed "s/#define EXECUTABLE_SUFFIX \".exe\"//" < xm-cygwin.h.orig >
xm-cygwin.h
cd

72. Edit stage 7 to reflect the following:

stage7()
{
schk 7 || return 0
rm -rf genromfs-0.5.1
extract genromfs-0.5.1*
cd genromfs-0.5.1
cp Makefile Makefile.orig
sed "s/^CFLAGS = -O2 -Wall/CFLAGS = -O2 -Wall -Dlinux=1/" < Makefile.orig >
Makefile
${MAKE}
cp genromfs.exe ${PREFIX}/bin/.
chmod 755 ${PREFIX}/bin/genromfs.exe
cd $BASEDIR
mark 7
}

73. In the build_tar_file() function, add a ".exe" suffix to genromfs,
elf2flt, and flthdr in the section titled, "tar it all up."
74. Near the bottom of the build script, in the section titled "You have to
be root for this one," delete everything from "else" to just before "fi."
75. :w! and :q
76. cd elf2flt-cvs-20020427
77. cp ../glibc-2.2.5/elf/elf.h .
78. vi Makefile.in
79. In the elf2flt rule, add -lintl after $(LIBS).
80. In the install rule, change all instances of ld to ld.exe, and ld.real
to ld.real.exe.
81. :w and :q
82. vi elf2flt.c
83. Change #include <elf.h> to be #include "elf.h".
84. :w and :q
85. vi elf.h
86. Delete the __BEGIN_DECL macro at the top of the file.
87. Delete the __END_DECL macro at the bottom of the file.
88. Change #include <stdint.h> to be #include <sys/types.h>.
89. For the typedefs declared at the top of the file, change all uint16_t,
uint32_t, and uint64_t types to u_int16_t, u_int32_t, and u_int64_t
respectively.
90. :w and :q
91. cd
92. ./build-uclinux-tools.sh build 2>&1 | tee tool_build_results.txt
93. cp /usr/local/m68k-elf/bin/elf2flt.exe /usr/local/bin/.
94. cp /usr/local/m68k-elf/bin/flthdr.exe /usr/local/bin/.
95. ./build-uclinux-tools.sh uclibc 2>&1 | tee tool_uclibc_results.txt
96. ./build-uclinux-tools.sh tar 2>&1 | tee tool_tar_results.txt
97. cd uClinux-dist
98. make 2>&1 | tee make_results.txt

A default 2.4.x image for the M5272C3 eval board will now reside in
~/uClinux-dist/images and /tftpboot.

[----- End Instructions Here -----]
This message resent by the uclinux-dev@uclinux.org list server http://www.uClinux.org/


This archive was generated by hypermail 2.1.4 : Thu Sep 19 2002 - 13:21:17 EDT