Lines Matching +full:ia32 +full:- +full:3 +full:a

7 # be a boot tool for regression testing.
9 # insert code here to guess what you have -- yikes!
29 gpart show $dev | tail +2 | awk '$4 == "'$part'" { print $3; }'
34 case ${TARGET:-$(uname -m)} in
40 *) die "machine type $(uname -m) doesn't support UEFI" ;;
50 if [ "$sizekb" -ge "$fat32min" ]; then
52 elif [ "$sizekb" -ge "$fat16min" ]; then
58 stagedir=$(mktemp -d /tmp/stand-test.XXXXXX)
59 mkdir -p "${stagedir}/EFI/BOOT"
68 while [ ! -z $1 ]; do
69 if [ ! -z $2 ]; then
79 makefs -t msdos \
80 -o fat_type=${fatbits} \
81 -o sectors_per_cluster=1 \
82 -o volume_label=EFISYS \
83 -s ${sizekb}k \
85 rm -rf "${stagedir}"
96 if [ ! -z $3 ]; then
97 efibootname=$3
103 mntpt=$(mktemp -d /tmp/stand-test.XXXXXX)
109 newfs_msdos -F 32 -c 1 -L EFISYS "${dev}" > /dev/null 2>&1
112 mount -t msdosfs "${dev}" "${mntpt}"
113 if [ $? -ne 0 ]; then
119 kbfree=$(df -k "${mntpt}" | tail -1 | cut -w -f 4)
120 loadersize=$(stat -f %z "${file}")
126 if [ -f "${efibootfile}" ]; then
129 if [ -n "${isboot1}" ] && [ "$kbfree" -lt "${loadersize}" ]; then
134 … on ESP: renaming old boot1.efi file /EFI/BOOT/${efibootname}.efi /EFI/BOOT/${efibootname}-old.efi"
135 mv "${efibootfile}" "${mntpt}/EFI/BOOT/${efibootname}-old.efi"
139 if [ ! -f "${mntpt}/EFI/freebsd/${dst}.efi" ] && [ "$kbfree" -lt "$loadersize" ]; then
144 echo "Run e.g \"mount -t msdosfs ${dev} /mnt\" to inspect it for files that can be removed."
148 mkdir -p "${mntpt}/EFI/freebsd"
150 # Keep a copy of the existing loader.efi in case there's a problem with the new one
151 if [ -f "${mntpt}/EFI/freebsd/${dst}.efi" ] && [ "$kbfree" -gt "$((loadersize * 2))" ]; then
152 cp "${mntpt}/EFI/freebsd/${dst}.efi" "${mntpt}/EFI/freebsd/${dst}-old.efi"
158 # efibootmgr won't work on systems with ia32 UEFI firmware
159 # since we only use it to boot the 64-bit kernel
160 if [ -n "${updatesystem}" ] && [ ${efibootname} != "bootia32" ]; then
161 existingbootentryloaderfile=$(efibootmgr -v | grep "${mntpt}//EFI/freebsd/${dst}.efi")
163 if [ -z "$existingbootentryloaderfile" ]; then
164 # Try again without the double forward-slash in the path
165 existingbootentryloaderfile=$(efibootmgr -v | grep "${mntpt}/EFI/freebsd/${dst}.efi")
168 if [ -z "$existingbootentryloaderfile" ]; then
170 … efibootmgr --create --label FreeBSD --loader "${mntpt}/EFI/freebsd/${dst}.efi" > /dev/null
171 if [ $? -ne 0 ]; then
178 …bootorder=$(efivar --name 8be4df61-93ca-11d2-aa0d-00e098032b8c-BootOrder --print --no-name --hex |…
179 bootentry=$(echo "${bootorder}" | cut -w -f 3)$(echo "${bootorder}" | cut -w -f 2)
181 efibootmgr --activate "${bootentry}" > /dev/null
183 echo "Existing UEFI FreeBSD boot entry found: not creating a new one"
187 if [ ! -d "${mntpt}/EFI/BOOT" ]; then
188 mkdir -p "${mntpt}/EFI/BOOT"
204 if [ -f "$file" ]; then
216 if [ -z "$s" ] ; then
218 if [ -z "$s" ] ; then
230 if [ -z "$idx" ] ; then
240 idx=$(find_part $dev "freebsd-boot")
241 if [ -z "$idx" ] ; then
242 die "No freebsd-boot partition found"
244 doit gpart bootcode -b ${gpt0} -p ${gpt2} -i $idx $dev
252 boot_nogeli_gpt_ufs_legacy $1 $2 $3
253 boot_nogeli_gpt_ufs_uefi $1 $2 $3
260 idx=$(find_part $dev "freebsd-boot")
261 if [ -z "$idx" ] ; then
262 die "No freebsd-boot partition found"
264 doit gpart bootcode -b ${gpt0} -p ${gptzfs2} -i $idx $dev
272 boot_nogeli_gpt_zfs_legacy $1 $2 $3
273 boot_nogeli_gpt_zfs_uefi $1 $2 $3
280 doit gpart bootcode -b ${mbr0} ${dev}
282 if [ -z "$s" ] ; then
285 doit gpart bootcode -p ${mbr2} ${dev}s${s}
293 boot_nogeli_mbr_ufs_legacy $1 $2 $3
294 boot_nogeli_mbr_ufs_uefi $1 $2 $3
297 # ZFS+MBR+BIOS is not a supported configuration
307 boot_nogeli_mbr_zfs_uefi $1 $2 $3
311 boot_nogeli_gpt_ufs_legacy $1 $2 $3
315 boot_nogeli_gpt_ufs_uefi $1 $2 $3
319 boot_nogeli_gpt_ufs_both $1 $2 $3
323 boot_nogeli_gpt_zfs_legacy $1 $2 $3
327 boot_nogeli_gpt_zfs_uefi $1 $2 $3
331 boot_nogeli_gpt_zfs_both $1 $2 $3
334 # GELI+MBR is not a valid configuration
360 …printf 'Usage: %s -b bios [-d destdir] -f fs [-g geli] [-h] [-o optargs] -s scheme <bootdev>\n' "$…
363 printf ' -b bios bios type: legacy, uefi or both\n'
364 printf ' -d destdir destination filesystem root\n'
365 printf ' -f fs filesystem type: ufs or zfs\n'
366 printf ' -g geli yes or no\n'
367 printf ' -h this help/usage text\n'
368 printf ' -u Run commands such as efibootmgr to update the\n'
370 printf ' -o optargs optional arguments\n'
371 printf ' -s scheme mbr or gpt\n'
413 if [ -n "${scheme}" ] && [ -n "${fs}" ] && [ -n "${bios}" ]; then
414 shift $((OPTIND-1))
432 if [ -n "${dev}" ]; then
433 …}_${fs}_${bios} $dev $srcroot $opts || echo "Unsupported boot env: ${geli}-${scheme}-${fs}-${bios}"