Gentoo Archives: gentoo-sparc

From: Ivan Kabaivanov <chepati@×××××.com>
To: gentoo-sparc@l.g.o
Subject: Re: [gentoo-sparc] QLA2xxx
Date: Thu, 28 Feb 2008 23:39:51
Message-Id: 200802281839.45130.chepati@yahoo.com
In Reply to: Re: [gentoo-sparc] QLA2xxx by BRM
1 On Thursday 28 February 2008, BRM wrote:
2 > Thanks. Quick additional Q though -
3 >
4 > where's the best place to store the initrd? USB? Floppy? CD?
5
6
7
8 the most logical place -- /boot, right next to the kernel image.
9
10 IvanK.
11
12
13
14 >
15 > As I said earlier, I have my preference, but any tips would certainly
16 > be welcome.
17 >
18 > Thanks!
19 >
20 > Ben
21 >
22 > --- Ivan Kabaivanov <chepati@×××××.com> wrote:
23 > > On Thursday 28 February 2008 16:39, BRM wrote:
24 > > > All,
25 > > >
26 > > > Thanks for the tips. I'm not sure how it'll all work out right now.
27 > > > They might provide a method for booting the system via the CD, but
28 > >
29 > > then
30 > >
31 > > > the only viable option after that seems to be using the specified
32 > >
33 > > patch
34 > >
35 > > > in kernel builds so that we can boot and gain access to the hard
36 > >
37 > > drive.
38 > >
39 > > > The system only has one hard drive, which is attached via the
40 > >
41 > > QLA2xxx
42 > >
43 > > > controller - so I don't see how relying on udev to load the
44 > >
45 > > firmware
46 > >
47 > > > would solve the problem of accessing the only hard drive in the
48 > > > system...
49 > >
50 > > Ben,
51 > >
52 > > if nobody explicitly mentioned it, it's because we all either forgot,
53 > > or took
54 > > it as common knowlegde -- you do need an initramfs in order to
55 > > bootstrap the
56 > > init process on QLA2xxx machines.
57 > >
58 > > OBP knows how to load silo, silo knows how to load the kernel.
59 > > Things break
60 > > when the kernel tries to find the root device and that's where you
61 > > need an
62 > > initramfs. You can roll your own. All it needs is the firmware
63 > > in /lib/firmware/, udev, qla2xxx.ko, scsi.ko, sd_mod.ko, ext3.ko, and
64 > > any
65 > > other modules you may need, and udev. You also need /etc/udev with
66 > > appropriate rules, /lib/udev and all the udev helpers, especially
67 > > firmware.sh. Your /init script needs to mount /proc, /sys, /dev,
68 > > start udev
69 > > and load qla2xxx.ko. udev will take care of firmware loading. After
70 > > that
71 > > just switch_root.
72 > >
73 > > IvanK.
74 > >
75 > > > It does occur to me that there might be another slight solution to
76 > >
77 > > the
78 > >
79 > > > problem, from which udev could then be relied on - using an initrd
80 > > > image, or booting using another device from which udev could be
81 > > > utilized.
82 > > >
83 > > > I'd rather not have to leave a floppy (yes the system has a floppy)
84 > >
85 > > or
86 > >
87 > > > CD in the drive all the time, from which it would load an initrd
88 > >
89 > > image
90 > >
91 > > > containing udev, the firmware, and whatever else would be needed;
92 > >
93 > > but
94 > >
95 > > > it seems the only other method would be to use a USB Storage
96 > >
97 > > device.
98 > >
99 > > > Does anyone know if the OpenBoot PROM on the SunBlade 2000 will
100 > >
101 > > boot a
102 > >
103 > > > USB device? The Service manual seems to indicate it would for a 100
104 > >
105 > > or
106 > >
107 > > > 250 Iomega Zip Drive (can you even get those anymore?!!) but that
108 > >
109 > > too
110 > >
111 > > > is not an ideal solution. I'd rather be able to get a USB Stick (2
112 > > > GB?), or even a USB Hard Drive (e.g. WD Passport or the likes) that
113 > > > could hold the base system and boot from that. Anyone know if that
114 > > > would work?
115 > > >
116 > > > Might one need to upgrade the OpenBoot PROM to to so? If so, how
117 > >
118 > > and
119 > >
120 > > > where do I get the new image?
121 > > >
122 > > > My only other alternative is to go and get OpenSolaris and try that
123 > > > out. (Hopefully it won't have the same issue.)
124 > > >
125 > > > Any how...thanks for all the helpful tips & everything.
126 > > >
127 > > > Ben
128 > > >
129 > > > --- Ivan Kabaivanov <chepati@×××××.com> wrote:
130 > > > > On Thursday 21 February 2008 14:50, Friedrich Oslage wrote:
131 > > > > > Hi,
132 > > > > >
133 > > > > > > The problem comes from the fact that the firmware is in the
134 > >
135 > > disk
136 > >
137 > > > > at
138 > > > >
139 > > > > > > /lib/firmware starting from kernel 2.6.18 or something. If
140 > >
141 > > you
142 > >
143 > > > > boot
144 > > > >
145 > > > > > > the 2617 from the CD it will probably work fine.
146 > > > > > > Anyway even creating a proper initrd with that /lib/firmware
147 > >
148 > > the
149 > >
150 > > > > > > kernel does not load it. Don't know why.
151 > > > > >
152 > > > > > Using an initrd works fine for me, you probably just forgot to
153 > >
154 > > put
155 > >
156 > > > > udev
157 > > > >
158 > > > > > in it.
159 > > > > >
160 > > > > > My initrd basicly looks like this:
161 > > > > > /dev/console
162 > > > > > /dev/null
163 > > > > > /bin/busybox
164 > > > > > /bin/udevd
165 > > > > > /lib/udev/firmware.sh
166 > > > > > /lib/udev/udev.conf
167 > > > > > /lib/udev/rules.d/50-udev.rules
168 > > > > > /firmware/ql2200_fw.bin
169 > > > > > /lib/modules/`uname -r`/modules.dep
170 > > > > > /lib/modules/`uname -r`/kernel/drivers/scsi/qla2xxx/qla2xxx.ko
171 > > > > > /linuxrc
172 > > > > >
173 > > > > > The script I used to create it is available @
174 > > > > > http://porno-bullen.de/~bluebird/initrd-qla2xxx/ but don't
175 > >
176 > > blame me
177 > >
178 > > > > if
179 > > > >
180 > > > > > it doesn't work ;)
181 > > > > >
182 > > > > > Cheers,
183 > > > > > bluebird
184 > > > >
185 > > > > This is the preferred method -- to let udev handle the firmware
186 > > > > loading.
187 > > > > However if you don't have udev in the initrd or it doesn't work,
188 > >
189 > > all
190 > >
191 > > > > is not
192 > > > > lost. There's a way to manually load the firmware, but it's
193 > >
194 > > tricky.
195 > >
196 > > > > It's
197 > > > > tricky because you have to be very quick -- you'll have maybe up
198 > >
199 > > to
200 > >
201 > > > > 4-5
202 > > > > seconds to load the firmware. Here's how:
203 > > > >
204 > > > > 1) boot the machine (either with an initrd from the hard drive or
205 > > > > with an
206 > > > > installation cd.)
207 > > > > 2) drop to a shell somehow -- I don't run gentoo so I don't know
208 > >
209 > > if
210 > >
211 > > > > the
212 > > > > installer has this option but debian does and so does ubuntu for
213 > > > > sparc.
214 > > > > 3) Load qla2xxx.ko (just modprobe qla2xxx)
215 > > > > 4) Find out the device path in /sys (on my sunfire280r
216 > > > > it's /sys/devices/pci0001\:00/0001\:00\:04.0/) It might take you
217 > >
218 > > a
219 > >
220 > > > > few tries
221 > > > > to find out. Look for a file
222 > > > > /sys/devices/pci0001:00/0001:00:04.0/obppath
223 > > > > with this line
224 > > > > /pci@8,600000/SUNW,qlc@4. (the numbers are not important. the
225 > > > > important part
226 > > > > is the qlc bit)
227 > > > > 5) Type this: echo 1 >
228 > >
229 > > /sys/devices/pci0001:00/0001:00:04.0/loading
230 > >
231 > > > > 6) Type cat /lib/firmware/ql2200_fw.bin
232 > > > >
233 > > > > > /sys/devices/pci0001:00/0001:00:04.0/data (this is one line)
234 > > > >
235 > > > > 7) Type echo 0 > /sys/devices/pci0001:00/0001:00:04.0/loading
236 > > > >
237 > > > > for 5), 6) and 7) you'll get error message file not found. It
238 > > > > doesn't matter.
239 > > > > The point is to cache these three command into the shell history
240 > >
241 > > so
242 > >
243 > > > > you can
244 > > > > recall them quickly when you need them. Remember, you have a
245 > >
246 > > window
247 > >
248 > > > > of a few
249 > > > > seconds and regardless how fast you type you won't make it
250 > >
251 > > without
252 > >
253 > > > > using
254 > > > > cached commands.
255 > > > >
256 > > > > 8) Unload qla2xxx (rmmod qla2xxx)
257 > > > > 9) Now load the kernel module again (modprobe qla2xxx). The
258 > >
259 > > clock
260 > >
261 > > > > starts
262 > > > > ticking now. The module tells the kernel that it needs a
263 > >
264 > > firmware
265 > >
266 > > > > before the
267 > > > > hardware can be initialized. The module creates a device path in
268 > > > > /sys and
269 > > > > creates two files, loading and data.
270 > > > > 10) Quickly recall from history the command from 5) and press
271 > >
272 > > enter
273 > >
274 > > > > 11) Quickly recall from history the command from 6) and press
275 > >
276 > > enter
277 > >
278 > > > > 12) Quickly recall from history the command from 7) and press
279 > >
280 > > enter
281 > >
282 > > > > You'll see messages that the card was initialized. Now you can
283 > >
284 > > load
285 > >
286 > > > > sd_mod.
287 > > > > If you had to resort to this, then chances are you don't have
288 > >
289 > > udev
290 > >
291 > > > > running so
292 > > > > you may have to manually create the device nodes in /dev. For
293 > >
294 > > your
295 > >
296 > > > > convenience:
297 > > > >
298 > > > > brw-rw---- 1 root disk 8, 0 2008-02-21 15:03 /dev/sda
299 > > > > brw-rw---- 1 root disk 8, 1 2008-02-21 15:03 /dev/sda1
300 > > > > brw-rw---- 1 root disk 8, 2 2008-02-21 15:03 /dev/sda2
301 > > > > brw-rw---- 1 root disk 8, 3 2008-02-21 15:03 /dev/sda3
302 > > > > brw-rw---- 1 root disk 8, 4 2008-02-21 15:03 /dev/sda4
303 > > > > brw-rw---- 1 root disk 8, 5 2008-02-21 15:03 /dev/sda5
304 > > > > brw-rw---- 1 root disk 8, 16 2008-02-21 15:03 /dev/sdb
305 > > > > brw-rw---- 1 root disk 8, 17 2008-02-21 15:03 /dev/sdb1
306 > > > > brw-rw---- 1 root disk 8, 18 2008-02-21 15:03 /dev/sdb2
307 > > > > brw-rw---- 1 root disk 8, 19 2008-02-21 15:03 /dev/sdb3
308 > > > > brw-rw---- 1 root disk 8, 20 2008-02-21 15:03 /dev/sdb4
309 > > > >
310 > > > > Once you have all the device nodes in /dev you can go back to the
311 > > > > installer
312 > > > > and resume. Make sure you install udev and make sure you copy
313 > >
314 > > the
315 > >
316 > > > > binary
317 > > > > firmware into /lib/firmware.
318 > > > >
319 > > > > If you're not fast enough the two files loading and data will
320 > > > > disappear. If
321 > > > > this happens, don't worry, just unload qla2xxx and load it again,
322 > >
323 > > and
324 > >
325 > > > > this
326 > > > > time make sure you're faster :-)
327 > > > >
328 > > > > I've done this in the past and I can guarantee that it works.
329 > > > >
330 > > > > 2.6.17 was the last kernel where the fimrware was built into the
331 > > > > module and
332 > > > > you didn't have to load it separately. If you can live with that
333 > >
334 > > old
335 > >
336 > > > > kernel,
337 > > > > you can downgrade.
338 > > > >
339 > > > > IvanK.
340 > > > >
341 > > > > --
342 > > > > gentoo-sparc@l.g.o mailing list
343 > >
344 > > --
345 > > gentoo-sparc@l.g.o mailing list
346
347
348
349 --
350 gentoo-sparc@l.g.o mailing list

Replies

Subject Author
Re: [gentoo-sparc] QLA2xxx BRM <bm_witness@×××××.com>