View | Details | Raw Unified | Return to bug 216829
Collapse All | Expand All

(-)tools/tools/nanobsd/embedded/common (-6 / +33 lines)
Lines 73-80 Link Here
73
	echo "NANO_NAME not defined. Use foo.cfg instead."
73
	echo "NANO_NAME not defined. Use foo.cfg instead."
74
fi
74
fi
75
75
76
NANO_SLICE_FAT_SIZE=32m
76
if [ -z $NANO_SLICE_FAT_SIZE ]; then
77
NANO_SLICE_CFG_SIZE=32m
77
	NANO_SLICE_FAT_SIZE=32m
78
fi;
79
if [ -z $NANO_SLICE_CFG_SIZE ]; then
80
	NANO_SLICE_CFG_SIZE=32m
81
fi;
78
82
79
NANO_BOOT2CFG="-P -S115200"
83
NANO_BOOT2CFG="-P -S115200"
80
84
Lines 221-226 Link Here
221
	# Populate the FAT partition, if needed
225
	# Populate the FAT partition, if needed
222
	if [ -n "${NANO_SLICE_FAT}" ]; then
226
	if [ -n "${NANO_SLICE_FAT}" ]; then
223
		echo Creating MSDOS partition for kernel
227
		echo Creating MSDOS partition for kernel
228
#		newfs_msdos -C ${NANO_SLICE_FAT_SIZE} -c 1 -F 32 -L ${NANO_NAME} \
224
		newfs_msdos -C ${NANO_SLICE_FAT_SIZE} -F 16 -L ${NANO_NAME} \
229
		newfs_msdos -C ${NANO_SLICE_FAT_SIZE} -F 16 -L ${NANO_NAME} \
225
			${NANO_LOG}/_.${NANO_SLICE_FAT}
230
			${NANO_LOG}/_.${NANO_SLICE_FAT}
226
		if [ -d ${NANO_FAT_DIR} ]; then
231
		if [ -d ${NANO_FAT_DIR} ]; then
Lines 270-275 Link Here
270
	# Now shuffle all the slices together into the proper layout
275
	# Now shuffle all the slices together into the proper layout
271
	if [ -n "$NANO_SLICE_FAT" ]; then
276
	if [ -n "$NANO_SLICE_FAT" ]; then
272
		eval $NANO_SLICE_FAT=fat16b
277
		eval $NANO_SLICE_FAT=fat16b
278
#		eval $NANO_SLICE_FAT=fat32
273
	fi
279
	fi
274
280
275
	out=${NANO_DISKIMGDIR}/_.disk.image.${NANO_NAME}${fmt}
281
	out=${NANO_DISKIMGDIR}/_.disk.image.${NANO_NAME}${fmt}
Lines 278-294 Link Here
278
	# boot off parittion 3 or 2 by hand if you're playing around with this WIP
284
	# boot off parittion 3 or 2 by hand if you're playing around with this WIP
279
	case ${NANO_LAYOUT} in
285
	case ${NANO_LAYOUT} in
280
	std-embedded)
286
	std-embedded)
281
		mkimg -a 3 ${skiparg} ${fmtarg} ${bootmbr} -s mbr -p ${s1}:=${NANO_LOG}/_.s1 \
287
#		mkimg ${skiparg} ${fmtarg} ${bootmbr} -s mbr -p ${s1}:=${NANO_LOG}/_.s1 \
288
		mkimg ${skiparg} ${fmtarg} ${bootmbr} -s mbr -p ${s1}:=${NANO_LOG}/_.s1 \
282
			-p ${s2}:=${NANO_LOG}/_.s2 \
289
			-p ${s2}:=${NANO_LOG}/_.s2 \
283
			-p ${s3}:=${NANO_LOG}/_.s3 \
290
			-p ${s3}:=${NANO_LOG}/_.s3 \
284
			-o ${out}
291
			-o ${out}
292
		mdi=`mdconfig -f ${out}`
293
		gpart show $mdi
294
		gpart set -a active -i 3 $mdi
295
		gpart show $mdi
296
		mdconfig -d -u $mdi
285
		;;
297
		;;
286
	std-x86)
298
	std-x86)
287
		# s1 is cfg, s2 is /, not sure how to make that
299
		# s1 is cfg, s2 is /, not sure how to make that
288
		# boot (marked as active) with mkimg yet
300
		# boot (marked as active) with mkimg yet
289
		mkimg -a 2 ${fmtarg} ${bootmbr} -s mbr -p ${s1}:=${NANO_LOG}/_.s1 \
301
		mkimg ${fmtarg} ${bootmbr} -s mbr -p ${s1}:=${NANO_LOG}/_.s1 \
290
			-p ${s2}:=${NANO_LOG}/_.s2 \
302
			-p ${s2}:=${NANO_LOG}/_.s2 \
291
			-o ${out}
303
			-o ${out}
304
		mdi=`mdconfig -f ${out}`
305
		gpart show $mdi
306
		gpart set -a active -i 2 $mdi
307
		gpart show $mdi
308
		mdconfig -d -u $mdi
292
		;;
309
		;;
293
	std-uefi)
310
	std-uefi)
294
		# s1 is boot, s2 is cfg, s3 is /, not sure how to make that
311
		# s1 is boot, s2 is cfg, s3 is /, not sure how to make that
Lines 302-313 Link Here
302
	std-uefi-bios)
319
	std-uefi-bios)
303
		# p1 is boot for uefi, p2 is boot for gpt, p3 is cfg, p4 is /
320
		# p1 is boot for uefi, p2 is boot for gpt, p3 is cfg, p4 is /
304
		# and p5 is alt-root (after resize)
321
		# and p5 is alt-root (after resize)
305
		mkimg -a 2 ${fmtarg} ${bootmbr} -s gpt \
322
		mkimg ${fmtarg} ${bootmbr} -s gpt \
306
			-p efi:=${NANO_WORLDDIR}/boot/boot1.efifat \
323
			-p efi:=${NANO_WORLDDIR}/boot/boot1.efifat \
307
			-p freebsd-boot:=${NAANO_WORLDDIR}/boot/gptboot \
324
			-p freebsd-boot:=${NAANO_WORLDDIR}/boot/gptboot \
308
			-p ${p3}:=${NANO_LOG}/_.p3 \
325
			-p ${p3}:=${NANO_LOG}/_.p3 \
309
			-p ${p4}:=${NANO_LOG}/_.p4 \
326
			-p ${p4}:=${NANO_LOG}/_.p4 \
310
			-o ${out}
327
			-o ${out}
328
		mdi=`mdconfig -f ${out}`
329
		gpart show $mdi
330
		gpart set -a active -i 2 $mdi
331
		gpart show $mdi
332
		mdconfig -d -u $mdi
311
		;;
333
		;;
312
	powerpc64-ibm)
334
	powerpc64-ibm)
313
		# A lie to make the boot loader work, it boots the first BSD partition
335
		# A lie to make the boot loader work, it boots the first BSD partition
Lines 316-325 Link Here
316
		# boot image is on a special partition, ala std-embedded, but that
338
		# boot image is on a special partition, ala std-embedded, but that
317
		# partition isn't FAT with special files, but a copy of the boot
339
		# partition isn't FAT with special files, but a copy of the boot
318
		# loader itself.
340
		# loader itself.
319
		mkimg -a 1 ${fmtarg} -s mbr -p prepboot:=${NANO_LOG}/_.s1 \
341
		mkimg ${fmtarg} -s mbr -p prepboot:=${NANO_LOG}/_.s1 \
320
			-p ${s2}:=${NANO_LOG}/_.s2 \
342
			-p ${s2}:=${NANO_LOG}/_.s2 \
321
			-p ${s3}:=${NANO_LOG}/_.s3a \
343
			-p ${s3}:=${NANO_LOG}/_.s3a \
322
			-o ${out}
344
			-o ${out}
345
		mdi=`mdconfig -f ${out}`
346
		gpart show $mdi
347
		gpart set -a active -i 1 $mdi
348
		gpart show $mdi
349
		mdconfig -d -u $mdi
323
		;;
350
		;;
324
	esac
351
	esac
325
	rm -f ${out}.xz
352
	rm -f ${out}.xz

Return to bug 216829