diff options
Diffstat (limited to 'release/amd64/make-mfsroot-memstick.sh')
-rwxr-xr-x | release/amd64/make-mfsroot-memstick.sh | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/release/amd64/make-mfsroot-memstick.sh b/release/amd64/make-mfsroot-memstick.sh index 12914cc..da55c6b 100755 --- a/release/amd64/make-mfsroot-memstick.sh +++ b/release/amd64/make-mfsroot-memstick.sh @@ -28,30 +28,36 @@ if [ -e ${2} ]; then exit 1 fi +if [ -e "${1}.tmp" ]; then + rm -rf ${1}.tmp +fi + +mkdir -p ${1}.tmp + echo '/dev/md0 / ufs ro,noatime 1 1' > ${1}/etc/fstab echo 'root_rw_mount="NO"' > ${1}/etc/rc.conf.local -tar -C ${1} --exclude './mfsroot' -cf ${1}/mfsroot . +cp -rp ${1}/boot ${1}.tmp +makefs -o version=2 ${1}.tmp/mfsroot ${1} +gzip ${1}.tmp/mfsroot -for f in $(find ${1} -depth 1 \! -name boot \! -name mfsroot); do - chflags -R noschg ${f} - rm -rf ${f} -done +rm ${1}/etc/fstab +rm ${1}/etc/rc.conf.local -gzip ${1}/mfsroot +echo 'autoboot_delay="3"' >> ${1}.tmp/boot/loader.conf +echo 'mfs_load="YES"' >> ${1}.tmp/boot/loader.conf +echo 'mfs_type="mfs_root"' >> ${1}.tmp/boot/loader.conf +echo 'mfs_name="/mfsroot"' >> ${1}.tmp/boot/loader.conf +echo 'vfs.root.mountfrom="ufs:/dev/md0"' >> ${1}.tmp/boot/loader.conf -echo 'autoboot_delay="3"' >> ${1}/boot/loader.conf -echo 'mfs_load="YES"' >> ${1}/boot/loader.conf -echo 'mfs_type="mfs_root"' >> ${1}/boot/loader.conf -echo 'mfs_name="/mfsroot"' >> ${1}/boot/loader.conf -echo 'vfs.root.mountfrom="ufs:/dev/md0"' >> ${1}/boot/loader.conf - -makefs -B little -o label=pfSense_Install ${2}.part ${1} +makefs -B little -o label=pfSense_Install ${2}.part ${1}.tmp if [ $? -ne 0 ]; then echo "makefs failed" exit 1 fi +rm -rf ${1}.tmp + mkimg -s gpt -b ${1}/boot/pmbr -p efi:=${1}/boot/boot1.efifat -p freebsd-boot:=${1}/boot/gptboot -p freebsd-ufs:=${2}.part -p freebsd-swap::1M -o ${2} rm ${2}.part |