Gentoo Archives: gentoo-embedded

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