summaryrefslogtreecommitdiffstats
path: root/release/amd64
diff options
context:
space:
mode:
authornwhitehorn <nwhitehorn@FreeBSD.org>2011-03-22 01:14:53 +0000
committernwhitehorn <nwhitehorn@FreeBSD.org>2011-03-22 01:14:53 +0000
commit7e04216c28d5b4d3bdfc88b1ccc8a0dfd148bb06 (patch)
tree704ab914b05ae7a30ce5fef0a9f70d87d26b3012 /release/amd64
parent57d3996c320e3d8655f5bc5464824d4a2bb015be (diff)
downloadFreeBSD-src-7e04216c28d5b4d3bdfc88b1ccc8a0dfd148bb06.zip
FreeBSD-src-7e04216c28d5b4d3bdfc88b1ccc8a0dfd148bb06.tar.gz
Use labels to find release media instead of hard-coded device paths. This
makes booting more reliable (and working at all on USB sticks). While here, move responsibility for setting up fstab into the various platform mk-*.sh scripts. Suggested by: many
Diffstat (limited to 'release/amd64')
-rwxr-xr-xrelease/amd64/make-memstick.sh23
-rw-r--r--release/amd64/mkisoimages.sh3
2 files changed, 12 insertions, 14 deletions
diff --git a/release/amd64/make-memstick.sh b/release/amd64/make-memstick.sh
index 18f9cf1..42f56f7 100755
--- a/release/amd64/make-memstick.sh
+++ b/release/amd64/make-memstick.sh
@@ -32,12 +32,14 @@ if [ -e ${2} ]; then
exit 1
fi
+echo '/dev/gpt/FreeBSD_Install / ufs rw,noatime 1 1' > ${1}/etc/fstab
rm -f ${tempfile}
-makefs ${tempfile} ${1}
+makefs -B little ${tempfile} ${1}
if [ $? -ne 0 ]; then
echo "makefs failed"
exit 1
fi
+rm ${1}/etc/fstab
#
# Use $BLOCKSIZE for transfers to improve efficiency. When calculating
@@ -46,7 +48,7 @@ fi
#
filesize=`stat -f "%z" ${tempfile}`
-blocks=$(($filesize / ${BLOCKSIZE} + 2))
+blocks=$(($filesize / ${BLOCKSIZE} + 256))
dd if=/dev/zero of=${2} bs=${BLOCKSIZE} count=${blocks}
if [ $? -ne 0 ]; then
echo "creation of image file failed"
@@ -59,19 +61,12 @@ if [ $? -ne 0 ]; then
exit 1
fi
-fdisk -BIq /dev/${unit}
-if [ $? -ne 0 ]; then
- echo "fdisk failed"
- exit 1
-fi
-
-bsdlabel -B -w /dev/${unit}
-if [ $? -ne 0 ]; then
- echo "bsdlabel failed"
- exit 1
-fi
+gpart create -s GPT ${unit}
+gpart add -t freebsd-boot -s 64K ${unit}
+gpart bootcode -b ${1}/boot/pmbr -p ${1}/boot/gptboot -i 1 ${unit}
+gpart add -t freebsd-ufs -l FreeBSD_Install ${unit}
-dd if=${tempfile} of=/dev/${unit}a bs=$BLOCKSIZE conv=sync
+dd if=${tempfile} of=/dev/${unit}p2 bs=$BLOCKSIZE conv=sync
if [ $? -ne 0 ]; then
echo "copying filesystem into image file failed"
exit 1
diff --git a/release/amd64/mkisoimages.sh b/release/amd64/mkisoimages.sh
index a538d5b..c8c1986 100644
--- a/release/amd64/mkisoimages.sh
+++ b/release/amd64/mkisoimages.sh
@@ -54,4 +54,7 @@ fi
LABEL=$1; shift
NAME=$1; shift
+echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > $1/etc/fstab
mkisofs $bootable -r -J -V $LABEL -publisher "$publisher" -o $NAME $*
+rm $1/etc/fstab
+
OpenPOWER on IntegriCloud