Bug 230459 - Release generation targets are broken after r336526
Summary: Release generation targets are broken after r336526
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: Roger Pau Monné
URL:
Keywords: patch, regression
Depends on:
Blocks:
 
Reported: 2018-08-08 15:58 UTC by Roger Pau Monné
Modified: 2018-08-29 20:22 UTC (History)
1 user (show)

See Also:


Attachments
add DB_FROM_SRC when building mergemaster temproot for release (531 bytes, patch)
2018-08-08 16:20 UTC, Ian Lepore
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Roger Pau Monné freebsd_committer freebsd_triage 2018-08-08 15:58:43 UTC
r336526 broke the generation of the install media unless the ntpd user/group is present on the system that creates such installation media. Trying to build release media (for example using `make -C release ftp`) on a box running pre-r336526 with a source version equal or greater than r336526 will result in errors.

Here is the log of the error I see when trying to run the ftp target:

sh /usr/home/osstest/build.125801.build-amd64-freebsd/freebsd/release/scripts/mm-mtree.sh -m /usr/home/osstest/build.125801.build-amd64-freebsd/freebsd/release/.. -F  "TARGET_ARCH=amd64 TARGET=amd64 "  -D "/usr/home/osstest/build.125801.build-amd64-freebsd/freebsd/release/dist/base"
*** Creating the temporary root environment in /var/tmp/temproot.GeKDEEWO
 *** /var/tmp/temproot.GeKDEEWO ready for use
 *** Creating and populating directory structure in /var/tmp/temproot.GeKDEEWO

cd /usr/home/osstest/build.125801.build-amd64-freebsd/freebsd/etc; MACHINE_ARCH=amd64  MACHINE=amd64  CPUTYPE= CC="cc -target x86_64-unknown-freebsd12.0 --sysroot=/usr/home/osstest/build.125801.build-amd64-freebsd/obj/usr/home/osstest/build.125801.build-amd64-freebsd/freebsd/amd64.amd64/tmp -B/usr/home/osstest/build.125801.build-amd64-freebsd/obj/usr/home/osstest/build.125801.build-amd64-freebsd/freebsd/amd64.amd64/tmp/usr/bin" CXX="c++  -target x86_64-unknown-freebsd12.0 --sysroot=/usr/home/osstest/build.125801.build-amd64-freebsd/obj/usr/home/osstest/build.125801.build-amd64-freebsd/freebsd/amd64.amd64/tmp -B/usr/home/osstest/build.125801.build-amd64-freebsd/obj/usr/home/osstest/build.125801.build-amd64-freebsd/freebsd/amd64.amd64/tmp/usr/bin"  CPP="cpp -target x86_64-unknown-freebsd12.0 --sysroot=/usr/home/osstest/build.125801.build-amd64-freebsd/obj/usr/home/osstest/build.125801.build-amd64-freebsd/freebsd/amd64.amd64/tmp -B/usr/home/osstest/build.125801.build-amd64-freebsd/obj/usr/home/osstest/build.125801.build-amd64-freebsd/freebsd/amd64.amd64/tmp/usr/bin"  AS="as" AR="ar" LD="ld" LLVM_LINK=""  NM=nm OBJCOPY="objcopy"  RANLIB=ranlib STRINGS=  SIZE="size" PATH=/usr/home/osstest/build.125801.build-amd64-freebsd/obj/usr/home/osstest/build.125801.build-amd64-freebsd/freebsd/amd64.amd64/tmp/legacy/usr/sbin:/usr/home/osstest/build.125801.build-amd64-freebsd/obj/usr/home/osstest/build.125801.build-amd64-freebsd/freebsd/amd64.amd64/tmp/legacy/usr/bin:/usr/home/osstest/build.125801.build-amd64-freebsd/obj/usr/home/osstest/build.125801.build-amd64-freebsd/freebsd/amd64.amd64/tmp/legacy/bin:/usr/home/osstest/build.125801.build-amd64-freebsd/obj/usr/home/osstest/build.125801.build-amd64-freebsd/freebsd/amd64.amd64/tmp/usr/sbin:/usr/home/osstest/build.125801.build-amd64-freebsd/obj/usr/home/osstest/build.125801.build-amd64-freebsd/freebsd/amd64.amd64/tmp/usr/bin:/sbin:/bin:/usr/sbin:/usr/bin make    METALOG= distrib-dirs
for file in /usr/share/doc/usd/10.exref /usr/share/doc/usd/11.edit /usr/share/doc/usd/12.vi /usr/share/doc/usd/13.viref; do  if [ -f /usr/home/osstest/build.125801.build-amd64-freebsd/freebsd/release/dist/base/${file} ]; then  rm -f /usr/home/osstest/build.125801.build-amd64-freebsd/freebsd/release/dist/base/${file};  fi;  done
mtree -deU -i -f /usr/home/osstest/build.125801.build-amd64-freebsd/freebsd/etc/mtree/BSD.root.dist -p /usr/home/osstest/build.125801.build-amd64-freebsd/freebsd/release/dist/base/
mtree -deU -i -f /usr/home/osstest/build.125801.build-amd64-freebsd/freebsd/etc/mtree/BSD.var.dist -p /usr/home/osstest/build.125801.build-amd64-freebsd/freebsd/release/dist/base/var
mtree: unknown user `ntpd'
mtree: failed at line 49 of the specification
*** Error code 1

Stop.
make[3]: stopped in /usr/home/osstest/build.125801.build-amd64-freebsd/freebsd/etc
*** Error code 1

Stop.
make[2]: stopped in /usr/home/osstest/build.125801.build-amd64-freebsd/freebsd
*** Error code 1

This is a regression which now prevents generating install media from previous FreeBSD releases, or even from previous HEAD versions that don't have r336526.
Comment 1 Ian Lepore freebsd_committer freebsd_triage 2018-08-08 16:20:05 UTC
Created attachment 196009 [details]
add DB_FROM_SRC when building mergemaster temproot for release

Give this patch a try.  I doubt it's sufficient, but it may move things along to find the next similar glitch.

I had a feeling trying to automatically add DB_FROM_SRC in Makefile.inc1 wasn't going to be sufficient.  I suspect this change isn't sufficient either, there will likely be other places in the release building process that need this flag added.

I wonder how this ever worked in the past.  It's only been a couple years since we last added a new user (I think unbound was the last one).
Comment 2 Roger Pau Monné freebsd_committer freebsd_triage 2018-08-09 08:42:06 UTC
(In reply to Ian Lepore from comment #1)
Thanks! I've expanded your patch and now it seems to WFM. I've created a review at:

https://reviews.freebsd.org/D16638
Comment 3 commit-hook freebsd_committer freebsd_triage 2018-08-17 07:27:28 UTC
A commit references this bug:

Author: royger
Date: Fri Aug 17 07:27:16 UTC 2018
New revision: 337960
URL: https://svnweb.freebsd.org/changeset/base/337960

Log:
  build: skip the database check when generating install media

  There are several scripts and targets solely used to generate install
  media, make sure DB_FROM_SRC is used in that case in order to prevent
  checking the host database, which is irrelevant when generating
  install binaries.

  Sponsored by:		Citrix Systems R&D
  PR:			230459
  Reviewed by:		gjb
  Differential revision:	https://reviews.freebsd.org/D16638

Changes:
  head/Makefile.inc1
  head/release/Makefile
  head/release/scripts/mm-mtree.sh