Lines Matching +full:cs +full:- +full:x
3 # Copyright (c) 2005 Poul-Henning Kamp All rights reserved.
31 [ -n "$NANO_SECTS" ] || NANO_SECTS=63
32 [ -n "$NANO_HEADS" ] || NANO_HEADS=16
44 cs = $3 * $4
47 cyl = int ($1 / cs)
51 dsl = int (($7 + cs - 1) / cs)
57 csl = int (($6 + cs - 1) / cs)
61 isl = int ((cyl - dsl - csl) / $2)
63 isl = int (($5 + cs - 1) / cs)
67 print $3, isl * cs - $3, 1
68 c = isl * cs;
73 print $3 + c, isl * cs - $3, 2
74 c += isl * cs;
78 print c, csl * cs, 3
79 c += csl * cs
83 print c, dsl * cs, 4
85 print c, $1 - c, 4
88 c - $1, "sectors" > "/dev/stderr"
97 pprint 3 "log: ${NANO_OBJ}/_.cs"
102 mkdir -p ${MNT}
103 CODE_SIZE=`head -n 1 ${NANO_LOG}/_.partitioning | awk '{ print $2 }'`
106 MD=`mdconfig -a -t swap -s ${CODE_SIZE} -x ${NANO_SECTS} \
107 -y ${NANO_HEADS}`
110 rm -f ${IMG}
112 MD=`mdconfig -a -t vnode -f ${IMG} -x ${NANO_SECTS} \
113 -y ${NANO_HEADS}`
116 …trap "echo 'Running exit trap code' ; df -i ${MNT} ; umount ${MNT} || true ; mdconfig -d -u $MD" 1…
118 gpart create -s bsd "${MD}"
119 gpart add -t freebsd-ufs -b 16 "${MD}"
120 if [ -f ${NANO_WORLDDIR}/boot/boot ]; then
122 gpart bootcode -b ${NANO_WORLDDIR}/boot/boot ${MD}
132 ( cd ${MNT} && mtree -c ) > ${NANO_OBJ}/_.mtree
133 ( cd ${MNT} && du -k ) > ${NANO_OBJ}/_.du
140 mdconfig -d -u $MD
142 trap - 1 2 15 EXIT
144 ) > ${NANO_OBJ}/_.cs 2>&1
156 mkdir -p ${MNT}
159 MD=`mdconfig -a -t swap -s ${NANO_MEDIASIZE} -x ${NANO_SECTS} \
160 -y ${NANO_HEADS}`
163 rm -f ${IMG}
165 MD=`mdconfig -a -t vnode -f ${IMG} -x ${NANO_SECTS} \
166 -y ${NANO_HEADS}`
172 print "gpart create -s mbr $1"
176 print "gpart add -t freebsd -b ", $1, " -s ", $2, " -i ", $3, " $1"
181 print "gpart set -a active -i 1 $1"
185 …trap "echo 'Running exit trap code' ; df -i ${MNT} ; nano_umount ${MNT} || true ; mdconfig -d -u $…
191 if [ -f ${NANO_WORLDDIR}/${NANO_BOOTLOADER} ]; then
192 gpart bootcode -b ${NANO_WORLDDIR}/${NANO_BOOTLOADER} ${NANO_BOOTFLAGS} ${MD}
198 if [ $NANO_IMAGES -gt 1 -a $NANO_INIT_IMG2 -gt 0 ] ; then
205 sed -i "" "s=${NANO_DRIVE}${NANO_SLICE_ROOT}=${NANO_DRIVE}${NANO_SLICE_ALTROOT}=g" $f
210 if [ -n "${NANO_LABEL}" ]; then
211 tunefs -L ${NANO_LABEL}"${NANO_ALTROOT}" /dev/${MD}${NANO_ALTROOT}
219 if [ -n "$NANO_SLICE_DATA" -a "$NANO_SLICE_CFG" = "$NANO_SLICE_DATA" -a \
220 "$NANO_DATASIZE" -ne 0 ]; then
224 if [ $NANO_DATASIZE -ne 0 -a -n "$NANO_SLICE_DATA" ] ; then
241 mdconfig -d -u $MD
243 trap - 1 2 15 EXIT