Sunday, December 19, 2004

once more the everything tumbled down.
i had mandrake 10 running great on the laptop.
i had linuxant driver loader working and i could
connect to about 95 % of all wireless around
where i live.
i could build the ptxdist/livecd project no problems
but no vmware and now i need vmware.
i have gone through about rebuilds
but i am still at the point where i dont have
the building process working.
i am using the earlier version of mandrake 9.2
i get the linuxant drivers to work.
i get vmware working great.
i also get all my favorite tools to work correclty
(source nav. and kdiff3 and off course subversion emacs)

ptxdist builds fine on gentoo box soo build
a gentoo chroot or even a debian chroot.
i a leaning to gentoo. because i can stabilize
to one target.
lets see.

instruction for building a gentoo chroot can be found at.

http://kapcoweb.com/p/static/docs/jc-gentoo-howto/jc-gentoo-howto.html

but i played with this in recent past and found that creation
of files in the temp directory was problematic.

here is what i did.

1. created the directory /home/gentoo
the /home directory is mounted to a partition with more than
enough space for what i need to do.
2. down loaded the stage1 tarball: stage1-x86-2004.2.tar.bz2
and untared it in /home/gentoo
3. created the simple script enterchroot:
--------------------------- begin ---------------------------
#!/bin/bash

mount -t proc proc /home/gentoo/proc
cp /etc/resolv.conf /home/gentoo/etc/
chroot /home/gentoo /bin/bash

---------------------------- end ------------------------------

in the saved this in the directory /home/gentoo.

4. ran the script and entered the chroot and
followed the aformentioned web pages instructions.
env-update

>>> Note: /etc/make.profile/make.defaults isn't available.
an 'emerge sync' will probably fix this.
>>> Regenerating /etc/ld.so.cache...
bash-2.05b# source /etc/profile


test / # emerge sync

i just pased the following to command line:

USE="-alsa -apm -arts berkdb -cjk crypt -cups -dvd emacs -esd
-flash gd -gnome -gtk -gtk2 guile -java -kde libwww -motif mysql
ncurses nls pam perl postgres python -qt -quicktime readline -samba
spell ssl tcpd -truetype -X -Xaw3d xml xml2 zlib"

CFLAGS="-march=pentium3 -O2 -pipe"

CXXFLAGS="${CFLAGS}"

# Remember, the suggested number for parallel makes (-j) is:
# number of CPUs + 1.
MAKEOPTS="-j3"

FEATURES="sandbox buildpkg distcc usersandbox notitles noclean noauto
cvs keeptemp keepwork"

echo'ed each define to see if the were as i defined
and they seemed to be.

then ran the following

test / # cd /usr/portage/
test portage # ./scripts/bootstrap.sh

this started the build process.

ok what will i end up with.
it looks like the version of gcc is 3.3.4

i am concerned of spinning out of control
i want to get back to building ptxdist
and i dont know if this will get me to
this place. once more i have to jump
out into the void.

what i like about ptxdist is the fact
that i get a make file that defines
the orders of what is build.
using bash scripts dependecies
have to forced and not computed
via make. also make system give
the chance to make small rebuilds
without re-doing everything at once.
that isnt absolutely true but true
enough. also
this is an expensive process.
i could instead using the debian
chroot download see what happens.
the debian would be a well know
set of binaries and i dont have
go through the long compilation
process. if this doesnt work i may
try this next. but keep in mind
every thing worked in mandrake 10.x
it may be sufficient that i have
at least a certian verions of
gcc/glibc/automake/make so forth.


i tried some new tricks

i wrote a new script that changes the roots .bashrc script

here it is.
--------------------------- enterchroot.sh -------------------------
#write to .bashrc to set up build params.

cat >> /home/gentoo/root/.bashrc << EOF
env-update
source /etc/profile
USE="-alsa -apm -arts berkdb -cjk crypt -cups -dvd emacs -esd -flash gd -gnome -gtk -gtk2 guile -java -kde libwww -motif mysql ncurses nls pam perl postgres python -qt -quicktime readline -samba spell ssl tcpd -truetype -X -Xaw3d xml xml2 zlib"
CFLAGS="-march=pentium3 -O2 -pipe"
CXXFLAGS="${CFLAGS}"
# Remember, the suggested number for parallel makes (-j) is:
# number of CPUs + 1.
MAKEOPTS="-j3"
FEATURES="sandbox buildpkg distcc usersandbox notitles noclean noauto cvs keeptemp keepwork"
EOF

mount -t proc proc /home/gentoo/proc
cp /etc/resolv.conf /home/gentoo/etc/
chroot /home/gentoo /bin/bash
FEATURES="sandbox buildpkg distcc usersandbox notitles noclean noauto
cvs keeptemp keepwork"


---------------------- end enterchroot.sh ------------------------------


Saturday, December 04, 2004

isolinux bootloader

next step
make a new makefile for the isolinux bootloader.
this requires nasm.
ok where does nasm fit in with the cross toolchain?

ok nasm builds
it ends up in:

/tmp/ptxdist-local/bin

along with a bunch of other files:
-rwxr-xr-x 1 root root 2230984 Dec 4 07:40 i586-linux-addr2line*
-rwxr-xr-x 2 root root 2252824 Dec 4 07:40 i586-linux-ar*
-rwxr-xr-x 2 root root 3513455 Dec 4 07:40 i586-linux-as*
-rwxr-xr-x 2 root root 341433 Dec 4 08:30 i586-linux-c++*
-rwxr-xr-x 1 root root 172616 Dec 4 08:30 i586-linux-c++filt*
-rwxr-xr-x 1 root root 342228 Dec 4 08:30 i586-linux-cpp*
-rwxr-xr-x 2 root root 341433 Dec 4 08:30 i586-linux-g++*
-rwxr-xr-x 1 root root 336945 Dec 4 08:31 i586-linux-gcc*
-rwxr-xr-x 1 root root 15803 Dec 4 08:30 i586-linux-gccbug*
-rwxr-xr-x 1 root root 125246 Dec 4 08:30 i586-linux-gcov*
-rwxr-xr-x 2 root root 2924288 Dec 4 07:40 i586-linux-ld*
-rwxr-xr-x 2 root root 2270205 Dec 4 07:40 i586-linux-nm*
-rwxr-xr-x 1 root root 2715345 Dec 4 07:40 i586-linux-objcopy*
-rwxr-xr-x 1 root root 2901580 Dec 4 07:40 i586-linux-objdump*
-rwxr-xr-x 2 root root 2252823 Dec 4 07:40 i586-linux-ranlib*
-rwxr-xr-x 1 root root 446178 Dec 4 07:40 i586-linux-readelf*
-rwxr-xr-x 1 root root 2102944 Dec 4 07:39 i586-linux-size*
-rwxr-xr-x 1 root root 2080050 Dec 4 07:40 i586-linux-strings*
-rwxr-xr-x 2 root root 2715340 Dec 4 07:40 i586-linux-strip*
-rwxr-xr-x 1 root root 723281 Dec 4 14:00 nasm*
-rwxr-xr-x 1 root root 206067 Dec 4 14:00 ndisasm*

thats great
but im concerned that nasm will create isolinux
that is dependant upone other lib files
but this unlikely. isolinux is a bootloader
not a user mode program.
Overview of using Ptxdist-0.4

Files used for build process.
The topdir makefile Makefile starts the build process.

make menuconfig cause a program called mconfig run against
a configuration file ./config/Config.in

The Config.in file will toggle values that can
be used globally through out the build system.

For a given menu option:

config GENERIC_OPTION
bool
prompt "User generic option"
default n
depends on PREVIOUS_OPTION

a macro will be defined PTXCONF_GENERIC_OPTION
that can be used in the make files in ./rules
directories

ifeq (y, $(PTXCONF_GENERIC_OPTION))
#Do something here
endif

note that the top leve makefile includes
all the makefiles from the directory ./rules
the decision on where or not to make the
package is controlled by a statement at
the beginning of the make file:

ifeq (y, $(PTXCONF_PACKAGE))
PACKAGES += packagename
endif

ok i have started to mod the ptx-0.4.0 distribution.

i have changed ./config/Config.in file
to have new targets or make use of the
targets present in the rules directory.

ill come back to this.

currently the coreutils will not compile du.c line 544
files
err = nftw (file, process_file, MAX_N_DESCRIPTORS, ftw_flags);
most likely MAX_N_DESCRIPTORS is not being set.
more on my list of todos.

i am going to skip this and worry about building chroot.

commented out the MAX_N_DESCRIPTORS and added a 1
builds fine.

i skipped it.



mkjail.sh

mkjail.sh. now i know why mkjail is included with crosstool.
to test the newly built libs. duh. i wonder how i could test
everything inside of vmware or xen?
i want to change mkjail to include builds of bash, ls and env.
here is my listing of what i want.

/bin
bash
cat
chmod
echo
df
kill
ls
mount
ping
ps
rm
sh

/sbin
ifconfig
init
route

/usr/bin
gdbserver
telnet

/lib
ld.so.1
ld-2.*.so
libc.so.6
libc-2*.so
libdl.so.2
libm.so.6
libm-2*.so
libncurses.so.5.*
libnss_dns.so.*
libnss_files*
libproc.so.2*
libpthread.so.*
libpthread-0.0.so
libresolve-2.2.3.so
librt.so.1
librt-2.2.3.s0
libstdc++-3-libc6.1*so
libutil.so.*
libutil.2*.

basically this what the embedded linux book said i should have.
maybe its less than that maybe more. and definitly different
versions of the what i have show above.

here is what header to mkjail.sh says:

# Create a tarball containing the shared libraries and executables from gcc/glibc

# (but not any shared libraries or executables that are otherwise crucial for a chroot jail).
# After this finishes, transfer jail.tar.gz and initjail.sh to the target, then
# run initjail.sh and tell it where you'd like the jail; it will unpack this tarball
# and complete the jail.
so transfer the tarball to the target. the original purpose of crosstool
was to create a cross compiler but im building on i386 for i386.
i will need to make a new script.

this still presupposes a couple of questions how do i take the new libraries
just build in mkjail and build bash, ls and so forth?

theory 1)
when ./demo-i686.sh finishes
the following is in /opt:
/opt/crosstool/i686-unknown-linux-gnu/gcc-3.3.2-glibc-2.3.2/i686-unknown-linux-gnu/bin

unpack bash and run the configure process to say gcc in this directory tree
and that libc is there as well would this work?

ok skip that ptxdist does that already skip doing mkjail.sh on crosstools
build and look what ptx builds. yes im lazy.

Friday, December 03, 2004

I have been toying around with the dan kegels crosstool shell scripts.
why? because lfs would never build for me. actually lots things
didnt work out. i have tried lnx-bbc, rock-linux, and gentoo-catalyst.

Ideas I have tried on my own:
The Uroborus of trying make or download somebodies chroot.
Ah then use the chroot build the new system
inside the chroot. Uroborus at its worst. This is a long
way to go about just making an embedded system.

Ok.
How do I build glibc that is not dependent on the system im building on,
and then move this to a nas·cent root file system. Even more just move
binaries, not the man files, not the header files.

I looked at kegels cross tool about 6 months ago and dismissed it.
Mostly because I didnt know what it could do (or might be able to).
I began to notice that the first steps of the lfs system are
almost exactly the same steps in kegels cross tool:

* build the binutils
* build a static version of gcc
* build glibc
* build the gcc again

lfs does the same, however with out the monking around with the path
variable's and needing to create a distict user called lfs.

so how do i know that what i have built with kegels crosstool
actually works.
I could build a chroot with them.
what will i need bash env ls so forth.
or the big test build all the root files
get make a hybrid of gentoo or some other
and use my newly created root file system.


tada

i have started farting around with 0.4.0 branch of the ptxdist
linux distribution. it does almost all of what i wanted to do.
create an a ultra small version verions of linux.