freebsd-dev/release
Glen Barber e07ca0423d Implement an evil workaround that prevents UFS/MSDOS labels from being
written to disk with newfs(8) and newfs_msdosfs(8).

When iterating through snapshot builds in serial, it is possible for
a build failure to leave stale md(4) devices behind, in some cases, they
could have a UFS or MSDOS filesystem label assigned.

If the md(4) is not destroyed (or not able to be destroyed, as has
happened recently due to my own fault), the filesystem label that
already exists can interfere with a new md(4) device that is targeted to
have the same label.

This behavior, although admittedly a logic error in the wrapper build
scripts, has caused intermittent reports (in particular with the armv6
builds) of missing UFS/MSDOSFS labels, causing the image to fallback to
the mountroot prompt.  This appears to only happen when the backing
md(4) device is destroyed before the calling umount(8) on the target
mount, after which the UFS/MSDOSFS label persists.

The workaround is this:  If EVERYTHINGISFINE is set to non-empty value,
check for an existing ufs/rootfs and msdosfs/MSDOSBOOT filesystem label
in arm_create_disk(), and rm(1) them if they exist.

The EVERYTHINGISFINE variable is chosen because it is used in exactly
one other place - release/Makefile.mirrors - and there are big scary
warnings at the top of that file as well that it should *not* be used
under normal circumstances.  This should not destroy a build machine
that also uses '/dev/ufs/rootfs' as the UFS label, and I have verified
in extensive local testing that the destroyed label is recreated when
the md(4) is unmounted/mounted, but this really should not be enabled
by anyone.

Having said all that, I absolutely *do* plan MFC this to stable/10 for
the 10.2-RELEASE cycle, as so far, I have only observed this behavior
on stable/10, but this is a temporary solution until I can unravel all
of the failure paths to properly trap them.

MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2015-07-02 02:13:20 +00:00
..
amd64 Merge the following revisions from ^/projects/release-vmimage: 2015-01-20 23:56:04 +00:00
arm Increase the FreeBSD/arm image sizes back to 1G for 11-CURRENT. 2015-06-18 10:26:27 +00:00
arm64 Do not nest the BSD and MBR partitions, which produces 2015-04-27 18:07:11 +00:00
doc Refine the lockstat(1) entry based on corrections and 2015-07-01 10:33:19 +00:00
i386 Use mkimg(1) to create the i386 memstick images, similar to 2015-05-23 00:32:58 +00:00
pc98 - Add CHECKSUM.* support in Makefile[1]. 2013-02-03 10:26:24 +00:00
picobsd do not strip /stand 2015-01-24 08:48:05 +00:00
pkg_repos Update the pkg-stage target to be more compatible with pkg-1.2: 2014-01-16 16:12:09 +00:00
powerpc Use mkimg instead of md(4) and gpart. 2014-05-01 03:24:41 +00:00
scripts Add Support for uploading Vagrant images to Hashicorp Atlas. 2015-06-29 21:26:41 +00:00
sparc64 - Once we have shifted arguments thrice, base-bits-dir is $1 rather than $4. 2013-07-26 14:23:25 +00:00
tools Implement an evil workaround that prevents UFS/MSDOS labels from being 2015-07-02 02:13:20 +00:00
Makefile Remove arm/Makefile.{KERNEL} files, as this project 2015-05-07 19:47:15 +00:00
Makefile.azure Remove the HH-MM suffix from the build date suffix. 2015-07-01 14:51:26 +00:00
Makefile.ec2 Remove the HH-MM suffix from the build date suffix. 2015-07-01 14:51:26 +00:00
Makefile.gce Remove the HH-MM suffix from the build date suffix. 2015-07-01 14:51:26 +00:00
Makefile.mirrors Consider PRERELEASE builds snapshots, in addition to CURRENT and 2015-06-25 13:40:00 +00:00
Makefile.vagrant Remove the HH-MM suffix from the build date suffix. 2015-07-01 14:51:26 +00:00
Makefile.vm Add initial support for building Vagrant images for VMWare. Next steps will be adding Virtualbox support and uploading to Hashicorp Atlas for others to consume. 2015-06-27 20:39:13 +00:00
rc.local Create /tmp/bsdinstall_etc even if we aren't starting the installer so that 2014-09-13 20:09:02 +00:00
release.conf.sample Merge the following from ^/projects/release-arm64 to allow 2015-04-21 00:48:35 +00:00
release.sh Merge ^/projects/release-arm-redux into ^/head. 2015-05-09 21:08:12 +00:00