make-memstick.sh (265171) | make-memstick.sh (293188) |
---|---|
1#!/bin/sh 2# 3# This script generates a "memstick image" (image that can be copied to a 4# USB memory stick) from a directory tree. Note that the script does not 5# clean up after itself very well for error conditions on purpose so the 6# problem can be diagnosed (full filesystem most likely but ...). 7# 8# Usage: make-memstick.sh <directory tree> <image filename> 9# | 1#!/bin/sh 2# 3# This script generates a "memstick image" (image that can be copied to a 4# USB memory stick) from a directory tree. Note that the script does not 5# clean up after itself very well for error conditions on purpose so the 6# problem can be diagnosed (full filesystem most likely but ...). 7# 8# Usage: make-memstick.sh <directory tree> <image filename> 9# |
10# $FreeBSD: head/release/powerpc/make-memstick.sh 265171 2014-05-01 03:24:41Z nwhitehorn $ | 10# $FreeBSD: head/release/powerpc/make-memstick.sh 293188 2016-01-05 03:20:45Z gjb $ |
11# 12 13PATH=/bin:/usr/bin:/sbin:/usr/sbin 14export PATH 15 16BLOCKSIZE=10240 17 18if [ $# -ne 2 ]; then --- 9 unchanged lines hidden (view full) --- 28fi 29 30if [ -e ${2} ]; then 31 echo "won't overwrite ${2}" 32 exit 1 33fi 34 35echo '/dev/da0s3 / ufs ro,noatime 1 1' > ${1}/etc/fstab | 11# 12 13PATH=/bin:/usr/bin:/sbin:/usr/sbin 14export PATH 15 16BLOCKSIZE=10240 17 18if [ $# -ne 2 ]; then --- 9 unchanged lines hidden (view full) --- 28fi 29 30if [ -e ${2} ]; then 31 echo "won't overwrite ${2}" 32 exit 1 33fi 34 35echo '/dev/da0s3 / ufs ro,noatime 1 1' > ${1}/etc/fstab |
36echo 'root_rw_mount="NO"' > ${1}/etc/rc.conf.local |
|
36rm -f ${tempfile} 37makefs -B big ${tempfile} ${1} 38if [ $? -ne 0 ]; then 39 echo "makefs failed" 40 exit 1 41fi 42rm ${1}/etc/fstab | 37rm -f ${tempfile} 38makefs -B big ${tempfile} ${1} 39if [ $? -ne 0 ]; then 40 echo "makefs failed" 41 exit 1 42fi 43rm ${1}/etc/fstab |
44rm ${1}/etc/rc.conf.local |
|
43 44mkimg -s apm -p freebsd-boot:=${1}/boot/boot1.hfs -p freebsd-ufs/FreeBSD_Install:=${tempfile} -o ${2} 45 46rm -f ${tempfile} 47 | 45 46mkimg -s apm -p freebsd-boot:=${1}/boot/boot1.hfs -p freebsd-ufs/FreeBSD_Install:=${tempfile} -o ${2} 47 48rm -f ${tempfile} 49 |