diff options
author | Renato Botelho <renato@netgate.com> | 2016-11-17 08:42:29 -0200 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2016-11-17 08:42:29 -0200 |
commit | 2ca0a4a6d2548ad106320ba1f5dd1e7eb867aa98 (patch) | |
tree | fe3626afb0af5a3b8f3abc5895579765e93a2322 /release | |
parent | dd6dc5534e49668e03045afbda175036a5a74752 (diff) | |
download | FreeBSD-src-2ca0a4a6d2548ad106320ba1f5dd1e7eb867aa98.zip FreeBSD-src-2ca0a4a6d2548ad106320ba1f5dd1e7eb867aa98.tar.gz |
Fix mfsroot create process
Diffstat (limited to 'release')
-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 |