md.c revision 1.2.2.2 1 1.2.2.2 tls /* $NetBSD: md.c,v 1.2.2.2 2014/08/10 07:00:25 tls Exp $ */
2 1.2.2.2 tls
3 1.2.2.2 tls /*
4 1.2.2.2 tls * Copyright 1997 Piermont Information Systems Inc.
5 1.2.2.2 tls * All rights reserved.
6 1.2.2.2 tls *
7 1.2.2.2 tls * Based on code written by Philip A. Nelson for Piermont Information
8 1.2.2.2 tls * Systems Inc.
9 1.2.2.2 tls *
10 1.2.2.2 tls * Redistribution and use in source and binary forms, with or without
11 1.2.2.2 tls * modification, are permitted provided that the following conditions
12 1.2.2.2 tls * are met:
13 1.2.2.2 tls * 1. Redistributions of source code must retain the above copyright
14 1.2.2.2 tls * notice, this list of conditions and the following disclaimer.
15 1.2.2.2 tls * 2. Redistributions in binary form must reproduce the above copyright
16 1.2.2.2 tls * notice, this list of conditions and the following disclaimer in the
17 1.2.2.2 tls * documentation and/or other materials provided with the distribution.
18 1.2.2.2 tls * 3. The name of Piermont Information Systems Inc. may not be used to endorse
19 1.2.2.2 tls * or promote products derived from this software without specific prior
20 1.2.2.2 tls * written permission.
21 1.2.2.2 tls *
22 1.2.2.2 tls * THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``AS IS''
23 1.2.2.2 tls * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 1.2.2.2 tls * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 1.2.2.2 tls * ARE DISCLAIMED. IN NO EVENT SHALL PIERMONT INFORMATION SYSTEMS INC. BE
26 1.2.2.2 tls * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27 1.2.2.2 tls * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28 1.2.2.2 tls * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29 1.2.2.2 tls * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30 1.2.2.2 tls * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 1.2.2.2 tls * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
32 1.2.2.2 tls * THE POSSIBILITY OF SUCH DAMAGE.
33 1.2.2.2 tls */
34 1.2.2.2 tls
35 1.2.2.2 tls /* md.c -- cobalt machine specific routines */
36 1.2.2.2 tls
37 1.2.2.2 tls #include <sys/param.h>
38 1.2.2.2 tls #include <sys/sysctl.h>
39 1.2.2.2 tls #include <stdio.h>
40 1.2.2.2 tls #include <util.h>
41 1.2.2.2 tls #include <machine/cpu.h>
42 1.2.2.2 tls
43 1.2.2.2 tls #include "defs.h"
44 1.2.2.2 tls #include "md.h"
45 1.2.2.2 tls #include "msg_defs.h"
46 1.2.2.2 tls #include "menu_defs.h"
47 1.2.2.2 tls
48 1.2.2.2 tls /*
49 1.2.2.2 tls * Firmware reognizes only Linux Ext2 REV 0, so we have to have
50 1.2.2.2 tls * a Linux Ext2 fs to store our native bootloader.
51 1.2.2.2 tls */
52 1.2.2.2 tls static int nobootfs = 0;
53 1.2.2.2 tls static int bootpart_ext2fs = PART_BOOT_EXT2FS;
54 1.2.2.2 tls
55 1.2.2.2 tls void
56 1.2.2.2 tls md_init(void)
57 1.2.2.2 tls {
58 1.2.2.2 tls }
59 1.2.2.2 tls
60 1.2.2.2 tls void
61 1.2.2.2 tls md_init_set_status(int flags)
62 1.2.2.2 tls {
63 1.2.2.2 tls (void)flags;
64 1.2.2.2 tls }
65 1.2.2.2 tls
66 1.2.2.2 tls int
67 1.2.2.2 tls md_get_info(void)
68 1.2.2.2 tls {
69 1.2.2.2 tls return set_bios_geom_with_mbr_guess();
70 1.2.2.2 tls }
71 1.2.2.2 tls
72 1.2.2.2 tls /*
73 1.2.2.2 tls * md back-end code for menu-driven BSD disklabel editor.
74 1.2.2.2 tls */
75 1.2.2.2 tls int
76 1.2.2.2 tls md_make_bsd_partitions(void)
77 1.2.2.2 tls {
78 1.2.2.2 tls int i;
79 1.2.2.2 tls int part;
80 1.2.2.2 tls int maxpart = getmaxpartitions();
81 1.2.2.2 tls int partstart;
82 1.2.2.2 tls int part_raw, part_bsd;
83 1.2.2.2 tls int ptend;
84 1.2.2.2 tls int no_swap = 0;
85 1.2.2.2 tls partinfo *p;
86 1.2.2.2 tls
87 1.2.2.2 tls /*
88 1.2.2.2 tls * Initialize global variables that track space used on this disk.
89 1.2.2.2 tls * Standard 4.4BSD 8-partition labels always cover whole disk.
90 1.2.2.2 tls */
91 1.2.2.2 tls if (pm->ptsize == 0)
92 1.2.2.2 tls pm->ptsize = pm->dlsize - pm->ptstart;
93 1.2.2.2 tls if (pm->dlsize == 0)
94 1.2.2.2 tls pm->dlsize = pm->ptstart + pm->ptsize;
95 1.2.2.2 tls
96 1.2.2.2 tls partstart = pm->ptstart;
97 1.2.2.2 tls ptend = pm->ptstart + pm->ptsize;
98 1.2.2.2 tls
99 1.2.2.2 tls /* Ask for layout type -- standard or special */
100 1.2.2.2 tls msg_display(MSG_layout,
101 1.2.2.2 tls pm->ptsize / (MEG / pm->sectorsize),
102 1.2.2.2 tls DEFROOTSIZE + DEFSWAPSIZE + DEFUSRSIZE,
103 1.2.2.2 tls DEFROOTSIZE + DEFSWAPSIZE + DEFUSRSIZE + XNEEDMB);
104 1.2.2.2 tls
105 1.2.2.2 tls process_menu(MENU_layout, NULL);
106 1.2.2.2 tls
107 1.2.2.2 tls /* Set so we use the 'real' geometry for rounding, input in MB */
108 1.2.2.2 tls pm->current_cylsize = pm->dlcylsize;
109 1.2.2.2 tls set_sizemultname_meg();
110 1.2.2.2 tls
111 1.2.2.2 tls /* Build standard partitions */
112 1.2.2.2 tls memset(&pm->bsdlabel, 0, sizeof pm->bsdlabel);
113 1.2.2.2 tls
114 1.2.2.2 tls /* Set initial partition types to unused */
115 1.2.2.2 tls for (part = 0 ; part < maxpart ; ++part)
116 1.2.2.2 tls pm->bsdlabel[part].pi_fstype = FS_UNUSED;
117 1.2.2.2 tls
118 1.2.2.2 tls /* Whole disk partition */
119 1.2.2.2 tls part_raw = getrawpartition();
120 1.2.2.2 tls if (part_raw == -1)
121 1.2.2.2 tls part_raw = PART_C; /* for sanity... */
122 1.2.2.2 tls pm->bsdlabel[part_raw].pi_offset = 0;
123 1.2.2.2 tls pm->bsdlabel[part_raw].pi_size = pm->dlsize;
124 1.2.2.2 tls
125 1.2.2.2 tls if (part_raw == PART_D) {
126 1.2.2.2 tls /* Probably a system that expects an i386 style mbr */
127 1.2.2.2 tls part_bsd = PART_C;
128 1.2.2.2 tls pm->bsdlabel[PART_C].pi_offset = pm->ptstart;
129 1.2.2.2 tls pm->bsdlabel[PART_C].pi_size = pm->ptsize;
130 1.2.2.2 tls } else {
131 1.2.2.2 tls part_bsd = part_raw;
132 1.2.2.2 tls }
133 1.2.2.2 tls
134 1.2.2.2 tls if (pm->bootsize != 0) {
135 1.2.2.2 tls pm->bsdlabel[PART_BOOT_EXT2FS].pi_fstype = FS_EX2FS;
136 1.2.2.2 tls pm->bsdlabel[PART_BOOT_EXT2FS].pi_size = pm->bootsize;
137 1.2.2.2 tls pm->bsdlabel[PART_BOOT_EXT2FS].pi_offset = pm->bootstart;
138 1.2.2.2 tls pm->bsdlabel[PART_BOOT_EXT2FS].pi_flags |=
139 1.2.2.2 tls PART_BOOT_EXT2FS_PI_FLAGS;
140 1.2.2.2 tls strlcpy(pm->bsdlabel[PART_BOOT_EXT2FS].pi_mount,
141 1.2.2.2 tls PART_BOOT_EXT2FS_PI_MOUNT,
142 1.2.2.2 tls sizeof pm->bsdlabel[PART_BOOT_EXT2FS].pi_mount);
143 1.2.2.2 tls }
144 1.2.2.2 tls
145 1.2.2.2 tls #ifdef PART_REST
146 1.2.2.2 tls pm->bsdlabel[PART_REST].pi_offset = 0;
147 1.2.2.2 tls pm->bsdlabel[PART_REST].pi_size = pm->ptstart;
148 1.2.2.2 tls #endif
149 1.2.2.2 tls
150 1.2.2.2 tls /*
151 1.2.2.2 tls * Save any partitions that are outside the area we are
152 1.2.2.2 tls * going to use.
153 1.2.2.2 tls * In particular this saves details of the other MBR
154 1.2.2.2 tls * partitions on a multiboot i386 system.
155 1.2.2.2 tls */
156 1.2.2.2 tls for (i = maxpart; i--;) {
157 1.2.2.2 tls if (pm->bsdlabel[i].pi_size != 0)
158 1.2.2.2 tls /* Don't overwrite special partitions */
159 1.2.2.2 tls continue;
160 1.2.2.2 tls p = &pm->oldlabel[i];
161 1.2.2.2 tls if (p->pi_fstype == FS_UNUSED || p->pi_size == 0)
162 1.2.2.2 tls continue;
163 1.2.2.2 tls if (layoutkind == LY_USEEXIST) {
164 1.2.2.2 tls if (PI_ISBSDFS(p))
165 1.2.2.2 tls p->pi_flags |= PIF_MOUNT;
166 1.2.2.2 tls } else {
167 1.2.2.2 tls if (p->pi_offset < pm->ptstart + pm->ptsize &&
168 1.2.2.2 tls p->pi_offset + p->pi_size > pm->ptstart)
169 1.2.2.2 tls /* Not outside area we are allocating */
170 1.2.2.2 tls continue;
171 1.2.2.2 tls if (p->pi_fstype == FS_SWAP)
172 1.2.2.2 tls no_swap = 1;
173 1.2.2.2 tls }
174 1.2.2.2 tls pm->bsdlabel[i] = pm->oldlabel[i];
175 1.2.2.2 tls }
176 1.2.2.2 tls
177 1.2.2.2 tls if (layoutkind == LY_USEEXIST) {
178 1.2.2.2 tls /* XXX Check we have a sensible layout */
179 1.2.2.2 tls ;
180 1.2.2.2 tls } else
181 1.2.2.2 tls get_ptn_sizes(partstart, ptend - partstart, no_swap);
182 1.2.2.2 tls
183 1.2.2.2 tls /*
184 1.2.2.2 tls * OK, we have a partition table. Give the user the chance to
185 1.2.2.2 tls * edit it and verify it's OK, or abort altogether.
186 1.2.2.2 tls */
187 1.2.2.2 tls edit_check:
188 1.2.2.2 tls if (edit_and_check_label(pm->bsdlabel, maxpart, part_raw, part_bsd) == 0) {
189 1.2.2.2 tls msg_display(MSG_abort);
190 1.2.2.2 tls return 0;
191 1.2.2.2 tls }
192 1.2.2.2 tls if (md_check_partitions() == 0)
193 1.2.2.2 tls goto edit_check;
194 1.2.2.2 tls
195 1.2.2.2 tls /* Disk name */
196 1.2.2.2 tls msg_prompt(MSG_packname, pm->bsddiskname, pm->bsddiskname, sizeof pm->bsddiskname);
197 1.2.2.2 tls
198 1.2.2.2 tls /* save label to disk for MI code to update. */
199 1.2.2.2 tls (void)savenewlabel(pm->bsdlabel, maxpart);
200 1.2.2.2 tls
201 1.2.2.2 tls /* Everything looks OK. */
202 1.2.2.2 tls return 1;
203 1.2.2.2 tls }
204 1.2.2.2 tls
205 1.2.2.2 tls /*
206 1.2.2.2 tls * any additional partition validation
207 1.2.2.2 tls */
208 1.2.2.2 tls int
209 1.2.2.2 tls md_check_partitions(void)
210 1.2.2.2 tls {
211 1.2.2.2 tls int part;
212 1.2.2.2 tls
213 1.2.2.2 tls /* we need to find a boot partition, otherwise we can't write our
214 1.2.2.2 tls * bootloader. We make the assumption that the user hasn't done
215 1.2.2.2 tls * something stupid, like move it away from the MBR partition.
216 1.2.2.2 tls */
217 1.2.2.2 tls for (part = PART_A; part < MAXPARTITIONS; part++)
218 1.2.2.2 tls if (pm->bsdlabel[part].pi_fstype == FS_EX2FS) {
219 1.2.2.2 tls bootpart_ext2fs = part;
220 1.2.2.2 tls return 1;
221 1.2.2.2 tls }
222 1.2.2.2 tls
223 1.2.2.2 tls msg_display(MSG_nobootpartdisklabel);
224 1.2.2.2 tls process_menu(MENU_ok, NULL);
225 1.2.2.2 tls return 0;
226 1.2.2.2 tls }
227 1.2.2.2 tls
228 1.2.2.2 tls /*
229 1.2.2.2 tls * hook called before writing new disklabel.
230 1.2.2.2 tls */
231 1.2.2.2 tls int
232 1.2.2.2 tls md_pre_disklabel(void)
233 1.2.2.2 tls {
234 1.2.2.2 tls msg_display(MSG_dofdisk);
235 1.2.2.2 tls
236 1.2.2.2 tls /* write edited MBR onto disk. */
237 1.2.2.2 tls if (write_mbr(pm->diskdev, &mbr, 1) != 0) {
238 1.2.2.2 tls msg_display(MSG_wmbrfail);
239 1.2.2.2 tls process_menu(MENU_ok, NULL);
240 1.2.2.2 tls return 1;
241 1.2.2.2 tls }
242 1.2.2.2 tls return 0;
243 1.2.2.2 tls }
244 1.2.2.2 tls
245 1.2.2.2 tls /*
246 1.2.2.2 tls * hook called after writing disklabel to new target disk.
247 1.2.2.2 tls */
248 1.2.2.2 tls int
249 1.2.2.2 tls md_post_disklabel(void)
250 1.2.2.2 tls {
251 1.2.2.2 tls if (get_ramsize() <= 32)
252 1.2.2.2 tls set_swap(pm->diskdev, pm->bsdlabel);
253 1.2.2.2 tls
254 1.2.2.2 tls return 0;
255 1.2.2.2 tls }
256 1.2.2.2 tls
257 1.2.2.2 tls /*
258 1.2.2.2 tls * hook called after upgrade() or install() has finished setting
259 1.2.2.2 tls * up the target disk but immediately before the user is given the
260 1.2.2.2 tls * ``disks are now set up'' message.
261 1.2.2.2 tls */
262 1.2.2.2 tls int
263 1.2.2.2 tls md_post_newfs(void)
264 1.2.2.2 tls {
265 1.2.2.2 tls static const char *kernels[] = {
266 1.2.2.2 tls "vmlinux-nfsroot.gz",
267 1.2.2.2 tls "vmlinux.gz",
268 1.2.2.2 tls "vmlinux_RAQ.gz",
269 1.2.2.2 tls "vmlinux_raq-2800.gz"
270 1.2.2.2 tls };
271 1.2.2.2 tls static const char *bootfile = "boot.gz";
272 1.2.2.2 tls char bootdir[64];
273 1.2.2.2 tls unsigned int i;
274 1.2.2.2 tls
275 1.2.2.2 tls if (!nobootfs) {
276 1.2.2.2 tls msg_display(msg_string(MSG_copybootloader), pm->diskdev);
277 1.2.2.2 tls
278 1.2.2.2 tls snprintf(bootdir, sizeof(bootdir), "%s/boot",
279 1.2.2.2 tls target_expand(PART_BOOT_EXT2FS_PI_MOUNT));
280 1.2.2.2 tls run_program(0, "/bin/mkdir -p %s", bootdir);
281 1.2.2.2 tls run_program(0, "/bin/cp /usr/mdec/boot %s", bootdir);
282 1.2.2.2 tls run_program(0, "/bin/rm -f %s/%s", bootdir, bootfile);
283 1.2.2.2 tls run_program(0, "/usr/bin/gzip -9 %s/boot", bootdir);
284 1.2.2.2 tls for (i = 0; i < __arraycount(kernels); i++)
285 1.2.2.2 tls run_program(0, "/bin/ln -fs %s %s/%s",
286 1.2.2.2 tls bootfile, bootdir, kernels[i]);
287 1.2.2.2 tls }
288 1.2.2.2 tls
289 1.2.2.2 tls return 0;
290 1.2.2.2 tls }
291 1.2.2.2 tls
292 1.2.2.2 tls int
293 1.2.2.2 tls md_post_extract(void)
294 1.2.2.2 tls {
295 1.2.2.2 tls return 0;
296 1.2.2.2 tls }
297 1.2.2.2 tls
298 1.2.2.2 tls void
299 1.2.2.2 tls md_cleanup_install(void)
300 1.2.2.2 tls {
301 1.2.2.2 tls #ifndef DEBUG
302 1.2.2.2 tls enable_rc_conf();
303 1.2.2.2 tls #endif
304 1.2.2.2 tls }
305 1.2.2.2 tls
306 1.2.2.2 tls int
307 1.2.2.2 tls md_pre_update(void)
308 1.2.2.2 tls {
309 1.2.2.2 tls struct mbr_partition *part;
310 1.2.2.2 tls mbr_info_t *ext;
311 1.2.2.2 tls int i;
312 1.2.2.2 tls
313 1.2.2.2 tls if (get_ramsize() <= 32)
314 1.2.2.2 tls set_swap(pm->diskdev, NULL);
315 1.2.2.2 tls
316 1.2.2.2 tls read_mbr(pm->diskdev, &mbr);
317 1.2.2.2 tls /* do a sanity check of the partition table */
318 1.2.2.2 tls for (ext = &mbr; ext; ext = ext->extended) {
319 1.2.2.2 tls part = ext->mbr.mbr_parts;
320 1.2.2.2 tls for (i = 0; i < MBR_PART_COUNT; part++, i++) {
321 1.2.2.2 tls if (part->mbrp_type != MBR_PTYPE_LNXEXT2)
322 1.2.2.2 tls continue;
323 1.2.2.2 tls if (part->mbrp_size < (MIN_EXT2FS_BOOT / 512)) {
324 1.2.2.2 tls msg_display(MSG_boottoosmall);
325 1.2.2.2 tls msg_display_add(MSG_nobootpart, 0);
326 1.2.2.2 tls process_menu(MENU_yesno, NULL);
327 1.2.2.2 tls if (!yesno)
328 1.2.2.2 tls return 0;
329 1.2.2.2 tls nobootfs = 1;
330 1.2.2.2 tls }
331 1.2.2.2 tls }
332 1.2.2.2 tls }
333 1.2.2.2 tls if (md_check_partitions() == 0)
334 1.2.2.2 tls nobootfs = 1;
335 1.2.2.2 tls return 1;
336 1.2.2.2 tls }
337 1.2.2.2 tls
338 1.2.2.2 tls /* Upgrade support */
339 1.2.2.2 tls int
340 1.2.2.2 tls md_update(void)
341 1.2.2.2 tls {
342 1.2.2.2 tls md_post_newfs();
343 1.2.2.2 tls return 1;
344 1.2.2.2 tls }
345 1.2.2.2 tls
346 1.2.2.2 tls int
347 1.2.2.2 tls md_check_mbr(mbr_info_t *mbri)
348 1.2.2.2 tls {
349 1.2.2.2 tls mbr_info_t *ext;
350 1.2.2.2 tls struct mbr_partition *part;
351 1.2.2.2 tls int i;
352 1.2.2.2 tls
353 1.2.2.2 tls for (ext = mbri; ext; ext = ext->extended) {
354 1.2.2.2 tls part = ext->mbr.mbr_parts;
355 1.2.2.2 tls for (i = 0; i < MBR_PART_COUNT; part++, i++) {
356 1.2.2.2 tls if (part->mbrp_type == MBR_PTYPE_LNXEXT2) {
357 1.2.2.2 tls pm->bootstart = part->mbrp_start;
358 1.2.2.2 tls pm->bootsize = part->mbrp_size;
359 1.2.2.2 tls break;
360 1.2.2.2 tls }
361 1.2.2.2 tls }
362 1.2.2.2 tls }
363 1.2.2.2 tls if (pm->bootsize < (MIN_EXT2FS_BOOT / 512)) {
364 1.2.2.2 tls msg_display(MSG_boottoosmall);
365 1.2.2.2 tls msg_display_add(MSG_reeditpart, 0);
366 1.2.2.2 tls process_menu(MENU_yesno, NULL);
367 1.2.2.2 tls if (!yesno)
368 1.2.2.2 tls return 0;
369 1.2.2.2 tls return 1;
370 1.2.2.2 tls }
371 1.2.2.2 tls if (pm->bootstart == 0 || pm->bootsize == 0) {
372 1.2.2.2 tls msg_display(MSG_nobootpart);
373 1.2.2.2 tls msg_display_add(MSG_reeditpart, 0);
374 1.2.2.2 tls process_menu(MENU_yesno, NULL);
375 1.2.2.2 tls if (!yesno)
376 1.2.2.2 tls return 0;
377 1.2.2.2 tls return 1;
378 1.2.2.2 tls }
379 1.2.2.2 tls return 2;
380 1.2.2.2 tls }
381 1.2.2.2 tls
382 1.2.2.2 tls int
383 1.2.2.2 tls md_mbr_use_wholedisk(mbr_info_t *mbri)
384 1.2.2.2 tls {
385 1.2.2.2 tls struct mbr_sector *mbrs = &mbri->mbr;
386 1.2.2.2 tls mbr_info_t *ext;
387 1.2.2.2 tls struct mbr_partition *part;
388 1.2.2.2 tls
389 1.2.2.2 tls part = &mbrs->mbr_parts[0];
390 1.2.2.2 tls /* Set the partition information for full disk usage. */
391 1.2.2.2 tls while ((ext = mbri->extended)) {
392 1.2.2.2 tls mbri->extended = ext->extended;
393 1.2.2.2 tls free(ext);
394 1.2.2.2 tls }
395 1.2.2.2 tls memset(part, 0, MBR_PART_COUNT * sizeof *part);
396 1.2.2.2 tls #ifdef BOOTSEL
397 1.2.2.2 tls memset(&mbri->mbrb, 0, sizeof mbri->mbrb);
398 1.2.2.2 tls #endif
399 1.2.2.2 tls part[0].mbrp_type = MBR_PTYPE_LNXEXT2;
400 1.2.2.2 tls part[0].mbrp_size = EXT2FS_BOOT_SIZE / 512;
401 1.2.2.2 tls part[0].mbrp_start = bsec;
402 1.2.2.2 tls part[0].mbrp_flag = MBR_PFLAG_ACTIVE;
403 1.2.2.2 tls
404 1.2.2.2 tls part[1].mbrp_type = MBR_PTYPE_NETBSD;
405 1.2.2.2 tls part[1].mbrp_size = pm->dlsize - (bsec + EXT2FS_BOOT_SIZE / 512);
406 1.2.2.2 tls part[1].mbrp_start = bsec + EXT2FS_BOOT_SIZE / 512;
407 1.2.2.2 tls part[1].mbrp_flag = 0;
408 1.2.2.2 tls
409 1.2.2.2 tls pm->ptstart = part[1].mbrp_start;
410 1.2.2.2 tls pm->ptsize = part[1].mbrp_size;
411 1.2.2.2 tls pm->bootstart = part[0].mbrp_start;
412 1.2.2.2 tls pm->bootsize = part[0].mbrp_size;
413 1.2.2.2 tls return 1;
414 1.2.2.2 tls }
415 1.2.2.2 tls
416 1.2.2.2 tls int
417 1.2.2.2 tls md_pre_mount()
418 1.2.2.2 tls {
419 1.2.2.2 tls return 0;
420 1.2.2.2 tls }
421