Changeset View
Changeset View
Standalone View
Standalone View
release/amd64/make-memstick.sh
Show All 9 Lines | |||||
# $FreeBSD$ | # $FreeBSD$ | ||||
# | # | ||||
set -e | set -e | ||||
scriptdir=$(dirname $(realpath $0)) | scriptdir=$(dirname $(realpath $0)) | ||||
. ${scriptdir}/../../tools/boot/install-boot.sh | . ${scriptdir}/../../tools/boot/install-boot.sh | ||||
if [ "$(uname -s)" = "FreeBSD" ]; then | |||||
PATH=/bin:/usr/bin:/sbin:/usr/sbin | PATH=/bin:/usr/bin:/sbin:/usr/sbin | ||||
export PATH | export PATH | ||||
fi | |||||
if [ $# -ne 2 ]; then | if [ $# -ne 2 ]; then | ||||
echo "make-memstick.sh /path/to/directory/or/manifest /path/to/image/file" | echo "make-memstick.sh /path/to/directory/or/manifest /path/to/image/file" | ||||
exit 1 | exit 1 | ||||
fi | fi | ||||
MAKEFSARG=${1} | MAKEFSARG=${1} | ||||
Show All 17 Lines | |||||
echo 'root_rw_mount="NO"' > ${BASEBITSDIR}/etc/rc.conf.local | echo 'root_rw_mount="NO"' > ${BASEBITSDIR}/etc/rc.conf.local | ||||
if [ -n "${METALOG}" ]; then | if [ -n "${METALOG}" ]; then | ||||
metalogfilename=$(mktemp /tmp/metalog.XXXXXX) | metalogfilename=$(mktemp /tmp/metalog.XXXXXX) | ||||
cat ${METALOG} > ${metalogfilename} | cat ${METALOG} > ${metalogfilename} | ||||
echo "./etc/fstab type=file uname=root gname=wheel mode=0644" >> ${metalogfilename} | echo "./etc/fstab type=file uname=root gname=wheel mode=0644" >> ${metalogfilename} | ||||
echo "./etc/rc.conf.local type=file uname=root gname=wheel mode=0644" >> ${metalogfilename} | echo "./etc/rc.conf.local type=file uname=root gname=wheel mode=0644" >> ${metalogfilename} | ||||
MAKEFSARG=${metalogfilename} | MAKEFSARG=${metalogfilename} | ||||
fi | fi | ||||
makefs -D -B little -o label=FreeBSD_Install -o version=2 ${2}.part ${MAKEFSARG} | makefs -D -N ${BASEBITSDIR}/etc -B little -o label=FreeBSD_Install -o version=2 ${2}.part ${MAKEFSARG} | ||||
rm ${BASEBITSDIR}/etc/fstab | rm ${BASEBITSDIR}/etc/fstab | ||||
rm ${BASEBITSDIR}/etc/rc.conf.local | rm ${BASEBITSDIR}/etc/rc.conf.local | ||||
if [ -n "${METALOG}" ]; then | if [ -n "${METALOG}" ]; then | ||||
rm ${metalogfilename} | rm ${metalogfilename} | ||||
fi | fi | ||||
# Make an ESP in a file. | # Make an ESP in a file. | ||||
espfilename=$(mktemp /tmp/efiboot.XXXXXX) | espfilename=$(mktemp /tmp/efiboot.XXXXXX) | ||||
Show All 11 Lines |