On Mon, Jan 13 '03 at 14:24, Len Moskowitz wrote:
> Is there someone out there who could flesh out each of these steps, so
> that a non-Guru might be able to succeed building the initrd and
> zImage files?
The correct reply might be: STFW
For a start, lets just assume Philip Blundell, is right and we actually
CAN use cramfs ...
Step by Step:
- So we need mkcramfs or mkfs.cramfs, that is part of linux-utils and
should be i installed with your box, for TSL2.0 you have to install
cramfsprpgs
host: ~ > which mkfs.cramgs
/sbin/mkfs.cramfs
success here
- let's make a directory to work in
host: ~ > mkdir dualboot
host: ~ > cd dualboot
- now we would like a.tar.gz of a current familiar+gpe version
host: ~/dualboot > rsync familiar.handhelds.org::ftp/linux/dists/familiar/releases/v0.6.1/install/|grep tar
-rw------- 7556071 2002/10/22 00:39:11 bootopie-v06-21.tar.gz
-rw------- 7747770 2002/10/30 07:45:56 bootopie-v061-02.tar.gz
-rw------- 999424 2002/10/30 15:44:07 bootopie-v061-03.tar.gz
only opie, what we don't care about, so we have to make our own
- lets get side tracked and install familiar v0.6.1 to an ipaq ...
my 3970 is up and running nicely and I don't want to fsck it just
because Len Moskowitz has been bugging my all day long. but luckely
I've a 3630 that I wanted to upgrade - not now, but whan I've time -
well, but that's live
(-> http://store4.yimg.com/I/demotivators_1715_2676919 ;-) )
checking our local familiar mirror, we find that bootgpe-v061-01.jffs2
might be worth a shot
host: ??? > md5sum -c bootgpe-v061-01.jffs2.md5sum
bootgpe-v061-01.jffs2: OK
that looks good.
first install the bootloader: STFW, it's on handhelds.org,
minicom, load bootldr, ^A-S, xmodem, ... and we end with:
boot> ver
Compaq OHH BootLoader, Rev 2-18-54 [BIG_KERNEL] [MD5] [MONO]
Last link date: Thu Oct 17 16:29:24 EDT 2002
Contact: bootldr_at_handhelds.org
this worked, now for the jffs2 image.
As I'm lazy I'll just attach a USB card reader, copy the file to a
128MB CF card and than use the new bootloader to just load the image
(I just hope onone is going to ask me how to attach a USB card reader
to a linux box :-/ )
boot> copy hda1:/bootgpe.jffs2 root
... [ still takes ages ] ...
boot> boot
...
Starting GPE display manager: gpe-dm
familiar login:
that looks nice. you should do postinstall now, but I will not,
because i'm not allowed to include the M$ fonts. I'll just erase the
ssh keys, so that everyone gets its own and install the ext2/3
modules: (I've a dualsleeve and a aironet350 card, just install it
and it works)
ipaq: ~ # rm /etc/ssh/ssh_host_*
ipaq: ~ # ipkg update
...
ipaq: ~ # ipkg upgrade
...
ipaq: ~ # ipkg install ext2-modules-2.4.18-rmk3
...
ipaq: ~ # ipkg install ext2-modules-2.4.18-rmk3
...
ipaq: ~ # ipkg install loopback-modules-2.4.18-rmk3
...
ipaq: ~ # df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/mtdblock/1 16128 12212 3916 76% /
tmpfs 15376 56 15320 0% /mnt/ramfs
/dev/hda1 125028 9774 115254 8% /mnt/hda
ipaq: ~ #
that looks nice, too. About 12M are installed, but the CF card has
still 115M free.
- convert installed JFFS2 image to a tar
ipaq: ~ # cd /
ipaq: / # ls
bin dev home linuxrc proc sbin usr
boot etc lib mnt root tmp var
ipaq: / # tar -cvf /mnt/hda/bootgpe.tar bin/ boot/ etc/ home/ lib/ linuxrc/ root/ sbin/ tmp/ usr/ var/
.
.
.
ipaq: / # ls -l /mnt/hda/bootgpe.tar
-rwxr-xr-x 1 root root 20124160 Jan 1 00:57 /mnt/hda/bootgpe.tar
as it's no longer compressed, it's a lot larger, but that's no problem
- copy that tar to your linux box:
ipaq: / # scp /mnt/hda/bootgpe.tar me_at_my_linux_box:dualboot/
we'll need the kernel, too
ipaq: / # scp /boot/zImage-2.4.18-rmk3 me_at_my_linux_box:dualboot/
and not to forget the ramfs structure
ipaq: / # scp .ramfs.tar.gz me_at_my_linux_box:dualboot/
ipaq: / # logout
50 minutes spend getting a bootgpe-v0.6.1-01.tar.
- now we can go to the linux host.
- get my old initrd, it's in the boot.zip
host: ~/dualboot > wget http://linix.blacknet.de/ipaq/boot.zip
as the DNS config seams to still be fcsked, this will not work for
you, oh well, too bad.
Extract initrd from boot.zip
host: ~/dualboot > unzip boot.zip
Archive: boot.zip
creating: boot/
inflating: boot/initrd
inflating: boot/params
inflating: boot/zImage
host: ~/dualboot > cd boot
loopmount initrd (must be root to mount stuff)
host: ~/dualboot/boot > mkdir m
host: ~/dualboot/boot > mv initrd initrd.gz
host: ~/dualboot/boot > gunzip initrd.gz
host: ~/dualboot/boot > sodu -s
host: .../boot # mount -o loop initrd m
host: .../boot # ls m
bin dev etc lib linuxrc lost+found mnt proc sbin tmp usr var
host: .../boot #
next we have to get the modules from the bootgpe.tar
host: .../boot # cd ..
host: .../dualboot # mkdir img ; cd img
host: .../img # tar -xf ../bootgpe.tar
you might get some warnings about broken time here, could have used
ntp on the ipaq
host: .../img # ls lib/modules/
2.4.18-rmk3/
host: .../img # cd ../boot/m/lib/modules/
host: .../lib/modules #
copy the required modules, this is a one shut action, don't screw it
up:
host: .../lib/modules # for i in `find ./ -type f` ; do \
rm $i ; \
if [ -e ../../../../img/lib/modules/$i ] ; then \
cp ../../../../img/lib/modules/$i $i ; \
else \
echo missing: $i; \
fi ; \
done
missing: ./2.4.18-rmk3/kernel/drivers/char/pcmcia/serial_cs.o
missing: ./2.4.18-rmk3/kernel/drivers/serial/serial_8250.o
host: .../lib/modules #
the missing serial modules are bad, but thay had just been renamed:
host: .../lib/modules # rmdir 2.4.18-rmk3/kernel/drivers/char/pcmcia
host: .../lib/modules # cp ../../../../img/lib/modules/2.4.18-rmk3/kernel/drivers/char/serial.o 2.4.18-rmk3/kernel/drivers/char/
don't forget the ext2fs modules
host: .../lib/modules # mkdir 2.4.18-rmk3/kernel/fs/ext2
host: .../lib/modules # cp ../../../../img/lib/modules/2.4.18-rmk3/kernel/fs/ext2/ext2.o 2.4.18-rmk3/kernel/fs/ext2
so we have updated the modules, hurra!!
More fun, now we have to patch the linuxrc to use ext2 and the new
serial module:
(using attached linuxrc.patch)
host: .../lib/modules # cd ../..
host: .../boot/m # patch -p0 < <path_to>/linuxrc.patch
let's make a cramfs of this initrd
host: .../boot/m # mkfs.cramgs ./ ../initrd.cramfs
host: .../boot/m # cd ../..
create a linux.img, what ever size. Don't make holes in this file, I'm
not sure vfat can haldle it
host: ~/dualboot # dd if=/dev/zero of=linux.img bs=1M count=64
64+0 records in
64+0 records out
make a file system. I still think a journaling fs is very bad for a CF
card, but that's up to you. just add -j
host: ~/dualboot # mke2fs -F linux.img
mke2fs 1.25 (20-Sep-2001)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
16384 inodes, 65536 blocks
3276 blocks (5.00%) reserved for the super user
First data block=1
8 block groups
8192 blocks per group, 8192 fragments per group
2048 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 27 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
host: ~/dualboot #
copy the content of the tar file there
host: ~/dualboot # mkdir m
host: ~/dualboot # mount -o loop linux.img m
host: ~/dualboot # cd img
host: dualboot/img # cp -a ./ ../m/
add the missing dirs, we did not pack into the tar file
host: dualboot/img # cd ../m
host: dualboot/m # mkdir -p dev mnt/hda mnt/ramfs proc
and the ramfs.tar.gz
host: ~/dualboot/m # cp ../.ramfs.tar.gz .
and finaly the linuxrc needs an initrd directory
host: ~/dualboot/m # mkdir initrd
host: ~/dualboot/m # ls -la
total 34
drwxr-xr-x 16 root root 1024 Jan 14 02:23 .
drwx------ 5 me users 4096 Jan 14 02:22 ..
-rw-r--r-- 1 root root 308 Jan 14 02:22 .ramfs.tar.gz
drwxr-xr-x 2 root root 1024 Oct 28 23:25 bin
drwxr-xr-x 2 root root 1024 Oct 28 23:26 boot
drwxr-xr-x 2 root root 1024 Jan 14 02:23 dev
drwxr-xr-x 32 root root 2048 Jan 1 1970 etc
drwxr-xr-x 2 root kmem 1024 Oct 28 23:25 home
drwxr-xr-x 2 root root 1024 Jan 14 02:36 initrd
drwxr-xr-x 4 root root 1024 Jan 1 1970 lib
-rwxr-xr-x 1 root kmem 861 Oct 28 23:25 linuxrc
drwxr-xr-x 2 root root 12288 Jan 14 02:16 lost+found
drwxr-xr-x 4 root root 1024 Jan 14 02:23 mnt
drwxr-xr-x 2 root root 1024 Jan 14 02:23 proc
drwxr-xr-x 4 root root 1024 Jan 1 1970 root
drwxr-xr-x 2 root root 1024 Jan 1 1970 sbin
drwxrwxrwt 3 root root 1024 Jan 1 1970 tmp
drwxr-xr-x 8 root root 1024 Oct 28 23:33 usr
drwxr-xr-x 9 root root 1024 Jan 1 1970 var
host: dualboot/m # cd ..
ok, now we have an up to date linux.img
unmount it, and move it to a CF card
host: ~/dualboot # umount m
host: ~/dualboot # rmdir m
host: ~/dualboot # umount boot/m
assumeing you have a CF card reader any a CF card, and that it's
mounted as /mnt/cf
host: ~/dualboot # mkdir /mnt/cf/boot
host: ~/dualboot # cp linux.img /mnt/cf
host: ~/dualboot # cp boot/params /mnt/cf/boot
host: ~/dualboot # cp zImage-2.4.18-rmk3 /mnt/cf/boot/zImage
host: ~/dualboot # cp boot/initrd.cramfs /mnt/cf/boot/initrd
host: ~/dualboot # sync
on your CF card you should now have (beside other stuff)
host: ~/dualboot # ls -l /mnt/cf
drwxr-xr-x 2 root root 2048 Jan 14 02:32 boot
-rwxr-xr-x 1 root root 67108864 Jan 14 02:29 linux.img
host: ~/dualboot # ls -l /mnt/cf/boot
total 2464
-rwxr-xr-x 1 root root 1908736 Jan 14 02:32 initrd
-rwxr-xr-x 1 root root 107 Jan 14 02:30 params
-rwxr-xr-x 1 root root 610536 Jan 14 02:31 zImage
host: ~/dualboot #
unmount the CF card, get your iPaq, insert the CF card into a
CF2PCMCIA adapter, that into the PCMCIA slot, put it into your iPaq
Boot and cross your fingers:
boot> boot vfat
h3600_sleeve_init_module
h3600_generic_pcmcia_init_module: registering sleeve drivers
registering sleeve driver 000311BC
.
.
.
Disabling LCD controller
linuxEntryPoint=C0008000
Booting Linux image
Uncompressing Linux............................................. done, booting .
a look to the LCD tells us
RAMDISK: cramfs filesystem found at block 0
RAMDISK: Loading 1864 blocks [1 disk] into ram disk ... done
Freeing initrd memory: 1864k
Kernel panic: VFS: Unable to mount rootfs on 01:00
ok, that sucks, lets write Philip and Len a bill, 4 hours as <lots>Euros,
quite bad, but they asked for it >:-)
OTOH I've now an 3630 with v0.6.1 running on it.
BTW: at http://80.254.130.70/ipaq/initrd.cramfs you can get the initrd
i've just created. you must make your own linux.img, but that I've
just explained in length.
the 80.254.130.70 is the real ip of linux.blacknet.de and the
webserver will force you to linux.blacknet.de if you use a smart
client. Note: THAT IS AN OLD IP, the new blacknet servers are just
beeing installed (where from I've just taken 6hour) on different
IPs. NEVER EVER COMPLAIN TO ME THAT 80.254.130.70 DOES NOT WORK.
BTW2: Contrary to the FDL this mail is basicaly licensed under,
WHO EVER REPLIES TO THIS MAIL AND QUOTES MORE THAN 10% (en block)
WILL HAVE TO PAYPAL ME 15 U$D or EURO. And yes, this is a valid
and binding license.
--
Goetz Bock (c) 2003 blacknet.de - Munich - Germany /"\
IT Consultant secure mobile Linux everNETting \ /
X
ASCII Ribbon Campaign against HTML email & microsoft attachments / \
Received on Tue Jan 14 2003 - 02:02:23 EST
This archive was generated by hypermail 2.2.0 : Mon Jul 25 2005 - 18:33:21 EDT