Date: Sun, 27 Oct 2013 18:35:34 +1030 From: "Daniel O'Connor" <doconnor@gsoft.com.au> To: Ian Smith <smithi@nimnet.asn.au> Cc: David Boyd <David.Boyd49@twc.com>, freebsd-stable stable <freebsd-stable@freebsd.org> Subject: Re: memstick.img size adjustment Message-ID: <EF63BC86-1E38-4FF6-A00F-2E7D0549991A@gsoft.com.au> In-Reply-To: <20131027144834.T80429@sola.nimnet.asn.au> References: <0BEF1ADC0CFB448F9CB7264B652C4643@sneezy> <20131027144834.T80429@sola.nimnet.asn.au>
next in thread | previous in thread | raw e-mail | index | archive | help
On 27 Oct 2013, at 17:54, Ian Smith <smithi@nimnet.asn.au> wrote:
> But then, I never understood why we used DD mode (/dev/da0a) rather than
> a properly sliced MBR with the potential to have multiple releases &/or
> architectures on one stick. Again, PC-BSD (at 8.2 anyway) made a stick
> with a slice table, so storing data (dmesg, pciconf, whatever) back to
> the stick was trivial, as was adding boot0 to allow boot selection.
I don't know either, although given how makefs works it might be the easy option.
>> Or can someone identify the custom changes we need to generate-release.sh in
>> order to accomplish this?
>
> I'm all ears.
I make custom releases for work with a large (multi gigabyte) tar file which is unpacked over the installed system.
My script looks like..
== SNIP ==
set -e
PATH=/bin:/usr/bin:/sbin:/usr/sbin
export PATH
BLOCKSIZE=10240
if [ $# -lt 2 ]; then
echo "$0 file srcdir [path ..]"
echo ""
echo "For example.."
echo "$0 /tmp/memstick.img /usr/obj/usr/src/release/release /tmp/extra"
echo ""
echo "Note that srcdir must have a release built (we need the boot loader from it)"
exit 1
fi
FILE="${1}"
shift
SRC="${1}"
shift
DIRS="$@"
for d in $DIRS; do
if [ ! -e "${d}" ]; then
echo "${d} doesn't exist"
exit 1
fi
done
TMPDIR=`mktemp -d -q /tmp/make-usbimg.XXXXXX`
if [ $? -ne 0 ]; then
echo "Unable to create temporary directory"
exit 1
fi
mkdir -p "${TMPDIR}/etc"
echo '/dev/ufs/FreeBSD_Install / ufs ro,noatime 1 1' > ${TMPDIR}/etc/fstab
makefs -b 204800 -B little -o label=FreeBSD_Install ${FILE} ${TMPDIR} ${SRC} ${DIRS}
if [ $? -ne 0 ]; then
echo "makefs failed"
exit 1
fi
unit=`mdconfig -a -t vnode -f ${FILE}`
if [ $? -ne 0 ]; then
echo "mdconfig failed"
exit 1
fi
gpart create -s BSD ${unit}
gpart bootcode -b ${SRC}/boot/boot ${unit}
gpart add -t freebsd-ufs ${unit}
mdconfig -d -u ${unit}
rm -rf "${TMPDIR}"
== SNIP ==
I haven't tried using partitions, given the way it is made it might be tricky.
--
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
-- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?EF63BC86-1E38-4FF6-A00F-2E7D0549991A>
