Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/distrib/utils/embedded fix image building:
details: https://anonhg.NetBSD.org/src/rev/cf00afdcece8
branches: trunk
changeset: 334891:cf00afdcece8
user: christos <christos%NetBSD.org@localhost>
date: Sun Dec 14 00:28:46 2014 +0000
description:
fix image building:
- round up the total size of the disk image
- fix fdisk offset for netbsd ffs images
diffstat:
distrib/utils/embedded/conf/x86.conf | 7 ++++---
distrib/utils/embedded/mkimage | 11 +++++++++--
2 files changed, 13 insertions(+), 5 deletions(-)
diffs (59 lines):
diff -r 2d6b4f9c0e99 -r cf00afdcece8 distrib/utils/embedded/conf/x86.conf
--- a/distrib/utils/embedded/conf/x86.conf Sat Dec 13 19:30:04 2014 +0000
+++ b/distrib/utils/embedded/conf/x86.conf Sun Dec 14 00:28:46 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: x86.conf,v 1.4 2014/04/04 16:45:51 christos Exp $
+# $NetBSD: x86.conf,v 1.5 2014/12/14 00:28:46 christos Exp $
# x86 shared config
#
@@ -12,13 +12,14 @@
extra=8 # spare space
size=0 # autocompute
netbsdid=169
-ffsoffset=63b
+init=63
+ffsoffset=${init}b
make_label() {
# compute all sizes in terms of sectors
local totalsize=$(( ${newsize} * 1024 * 2 / 512 ))
- local aoffset=63
+ local aoffset=${init}
local asize=$(( ${totalsize} - ${aoffset} ))
local bps=512
diff -r 2d6b4f9c0e99 -r cf00afdcece8 distrib/utils/embedded/mkimage
--- a/distrib/utils/embedded/mkimage Sat Dec 13 19:30:04 2014 +0000
+++ b/distrib/utils/embedded/mkimage Sun Dec 14 00:28:46 2014 +0000
@@ -1,5 +1,5 @@
#!/bin/sh
-# $NetBSD: mkimage,v 1.48 2014/04/03 22:51:38 christos Exp $
+# $NetBSD: mkimage,v 1.49 2014/12/14 00:28:46 christos Exp $
#
# Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -190,6 +190,13 @@
size="$(getsize "${image}")"
fi
newsize=$((${size} / 2 / 1024))
+compare=$((${newsize} * 2 * 1024))
+while [ "${compare}" != "${size}" ]
+do
+ size="$((size + size - compare))"
+ newsize="$((${size} / 2 / 1024))"
+ compare="$((${newsize} * 2 * 1024))"
+done
echo ${bar} Adding label ${bar}
make_label > ${tmp}/label
@@ -202,7 +209,7 @@
elif [ -n "${netbsdid}" ]; then
echo ${bar} Running fdisk ${bar}
${FDISK} -f -i ${image}
- ${FDISK} -f -a -u -0 -s 169 ${image}
+ ${FDISK} -f -a -u -0 -s 169/${init} ${image}
${INSTALLBOOT} -f -v ${image} ${release}/usr/mdec/bootxx_ffsv1
fi
Home |
Main Index |
Thread Index |
Old Index