Gentoo Archives: gentoo-embedded

From: Heath H Holcomb <liquidcable@×××××.com>
To: michael@×××××××××××××.com, gentoo-embedded@l.g.o
Subject: [gentoo-embedded] Re: your very helpful embedded-gentoo howto and CF card
Date: Sat, 04 Jun 2005 15:46:12
Message-Id: 200506041045.51666.liquidcable@bulah.com
1 I would not use a 2.4 kernel unless your specific hardware is not stable on
2 2.6 or you need a custom application that only runs under 2.4. In either
3 case these requirements are rare, and 2.6 is mostly the way to go.
4
5 On my development system I have a hard drive with a full install of Gentoo
6 2005.0, and 1 GB partition setup so I can set up my embedded rootfs to test.
7 I use the Gentoo install to mount a NFS shared directory from my development
8 laptop (were I guild the embedded rootfs) and copy over the embedded rootfs
9 to the 1 GB partition. I then modify my gurb.conf to give me the option of
10 booting from the embedded rootfs on the 1 GB partition. This speeds
11 development because getting the embedded rootfs done write the first time is
12 almost impossible.
13
14 The problem sounds like a kernel thing. Move to 2.6 and then see what
15 happens. Remember lspci is your friend (to find out what hardware you have).
16
17 Also remember Compact Flash cards have limited writes to the flash cells
18 (usually measured in 100,000 to 300,000 writes); while hard drive have writes
19 measured in hundreds of millions or billions.
20
21 Your board uses the CLE266. If you want X (not using the generic vesa driver)
22 you need to look at the Unichrome project. I subscribe to there mailing
23 list.
24 http://unichrome.sourceforge.net/
25
26 I'm also sending this response to the mailing list.
27
28 I'm deploying my embedded rootfs to my test hard drive this weekend, so I'll
29 have corrections and modifications to the how-to. By the end of the weekend
30 the x86 how-to should be somewhat complete, at least at a very basic level.
31
32 --
33 Heath Holcomb
34 liquidcable
35 liquidcable at bulah.com
36
37
38 On Friday 03 June 2005 01:39 pm, you wrote:
39 > Hi Heath,
40 >
41 > As you may recall, I was going to try to use your HOWTO to
42 > create a gentoo embedded system on a CF card. I followed your
43 > instructions up to Step 6, and then I do the following. I'm
44 > not booting yet. Grub starts, but then seems to crash when
45 > the kernel starts. I'm not sure because it's on the screen for
46 > a split second and then my machine reboots. I suspect that I
47 > made some mistakes in the kernel so I'm going to rebuild it,
48 > and try again, but if you have any comments or thoughts on my
49 > process I welcome them:
50 >
51 > My target SBC is a VIA EPIA ME-6000. I have my CF card as
52 > my primary IDE device, and a CDROM drive as the secondary IDE device.
53 > In the CDROM I'm using the Gentoo 2005.0 live cd.
54 >
55 > I'm sending this to you alone because I don't know if it's of
56 > general enough interest. If you think it is, please feel free
57 > to send it to the gentoo-embedded list, or tell me and I'll do it.
58 >
59 > The mistake I think I made in the kernel is that I built it on an old
60 > gentoo system with a 2.4 kernel, so it created a 2.4 kernel, but your
61 > instructions seem to be for a 2.6, so I'm going to repeat the process on
62 > a newer gentoo system with a 2.6 kernel.
63 >
64 > Any comments are welcome
65 >
66 > Thanks again for writing your HOWTO
67 >
68 > Michael
69 >
70 > ---
71 >
72 >
73 > 1. attach CF card as primary, CDROM as secondary
74 >
75 > 2. boot Gentoo live CD
76 >
77 > 3. fdisk /dev/hda
78 >
79 > boot: hda1 32M ext2 type 83
80 > root: hda2 rest ext2 type 83
81 > remember to make hda1 bootable
82 >
83 > 4.
84 > mke2fs /dev/hda1
85 > mke2fs /dev/hda2
86 >
87 > 5. mount the root and boot partitions
88 >
89 > mkdir /mnt/hda1
90 > mount -t ext2 /dev/hda1 /mnt/hda1
91 > mkdir /mnt/hda2
92 > mount -t ext2 /dev/hda2 /mnt/hda2
93 >
94 > 6. copy the developed rootfs into the second partition on the CF card
95 >
96 > # on devel machine in chroot env
97 > cp -r /embedded_rootfs /tmp # first copy from chroot env to outside
98 > world
99 >
100 > # on devel machine in normal env
101 > scp -r /opt/i586-gentoo-uclibc-linux/tmp/embedded_rootfs \
102 > root@192.168.0.22:/mnt/hda2 # IP address of my target SBC
103 > FIXME do something about buzybox links
104 > FIXME some problem with portage - same?
105 >
106 > 7. copy grub
107 >
108 > # on devel machine in normal env
109 > scp /sbin/grub root@192.168.0.22:/mnt/hda2
110 >
111 > 8. copy boot dir to /boot
112 >
113 > on target SBC
114 > cp -r /mnt/hda2/boot/* /mnt/hda1
115 >
116 > 8. install grub
117 >
118 > % /mnt/hda2/grub
119 >
120 > root (hd0,0) # grub's root i.e. boot
121 > setup (hd0)
122 > quit
123 >
124 > 9. configure grub.conf
125 >
126 > % nano -w /mnt/hda1/grub/grub.conf
127 >
128 > default 0
129 > timeout 10
130 > splashimage=(hd0,0)/grub/splash.xpm.gz
131 >
132 > title=Linux 2.6.x
133 > root (hd0,0)
134 > kernel /vmlinuz-2.6.x root=/dev/hda1
135 >
136 > 10. fstab
137 >
138 > % nano -w /mnt/hda2/etc/fstab
139 >
140 > # <fs> <mountpoint> <type> <opts> <dump/pass>
141 > none /proc proc defaults
142 > 0 0
143 >
144 > # glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for
145 > # POSIX shared memory (shm_open, shm_unlink).
146 > # (tmpfs is a dynamically expandable/shrinkable ramdisk, and will
147 > # use almost no memory if not populated with files)
148 > # Adding the following line to /etc/fstab should take care of this:
149 >
150 > none /dev/shm tmpfs defaults
151 > 0 0 /dev/hda2 / ext2 ro 0 1
152 >
153 >
154 > 11. reboot
155 >
156 > sync # make sure writes are flushed to CF card
157 > reboot
158
159 --
160 gentoo-embedded@g.o mailing list

Replies

Subject Author
Re: [gentoo-embedded] Re: your very helpful embedded-gentoo howto and CF card michael@×××××××××××××.com