Bug 238615 - Release script fails building stripped arm image
Summary: Release script fails building stripped arm image
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: arm (show other bugs)
Version: CURRENT
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-arm (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-16 13:48 UTC by Daniel Engberg
Modified: 2023-02-16 04:50 UTC (History)
5 users (show)

See Also:


Attachments
release/release.sh arm patch (773 bytes, patch)
2019-06-17 14:20 UTC, Glen Barber
no flags Details | Diff
release/release.sh arm patch (1.26 KB, patch)
2019-06-17 14:35 UTC, Glen Barber
no flags Details | Diff
release/release.sh arm patch (1.26 KB, patch)
2019-06-17 14:39 UTC, Glen Barber
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Engberg freebsd_committer freebsd_triage 2019-06-16 13:48:20 UTC
I've been trying to generate "slim"/non-debug image for arm using the release script but it seems like settings from make.conf / src.conf are getting dropped somewhere in the install process.

Host: 
13.0-CURRENT r349025 (AMD64)
Source: http://ftp.freebsd.org/pub/FreeBSD/snapshots/ISO-IMAGES/13.0/FreeBSD-13.0-CURRENT-amd64-20190614-r349025-disc1.iso
/usr/src --> Revision: 349025

Configuration file (ORANGEPI-PC.conf):

#!/bin/sh

EMBEDDED_TARGET_ARCH="armv7"
EMBEDDED_TARGET="arm"
EMBEDDEDBUILD=1
EMBEDDEDPORTS="sysutils/u-boot-orangepi-pc"
FAT_SIZE="50m -b 1m"
FAT_TYPE="16"
IMAGE_SIZE="3072M"
KERNEL="GENERIC-NODEBUG"
MD_ARGS="-x 63 -y 255"
NODOC=1
PART_SCHEME="MBR"
MAKE_CONF="/etc/release-confs/make.conf"
SRC_CONF="/etc/release-confs/src.conf"
export BOARDNAME="ORANGEPI-PC"
SRCBRANCH="base/head@r349025"

arm_install_uboot() {
	UBOOT_DIR="/usr/local/share/u-boot/u-boot-orangepi-pc"
	UBOOT_FILES="u-boot-sunxi-with-spl.bin"
	chroot ${CHROOTDIR} dd if=${UBOOT_DIR}/${UBOOT_FILES} \
		of=/dev/${mddev} bs=1k seek=8 conv=sync

	return 0
}

Contents of /etc/release-confs/make.conf:

WITHOUT_DEBUG=YES
MK_PROFILE=no
WITH_EXTRA_TCP_STACKS=1
MALLOC_PRODUCTION=yes

Contents of /etc/release-confs/src.conf:

WITHOUT_DEBUG_FILES=yes
WITHOUT_KERNEL_SYMBOLS=yes
WITHOUT_TESTS=yes
WITHOUT_PROFILE=yes

Command:
root@freebsd-13-buildbox:/usr/src/release/arm # sh release.sh -c arm/ORANGEPI-PC.conf

--------------------------------------------------------------
Error log 
--------------------------------------------------------------
--------------------------------------------------------------
>>> Installing everything started on Sun Jun 16 13:34:11 UTC 2019
--------------------------------------------------------------
cd /usr/src; make -f Makefile.inc1 install
make[3]: "/usr/obj/usr/src/arm.armv7/toolchain-metadata.mk" line 1: Using cached toolchain metadata from build at freebsd-13-buildbox on Sun Jun 16 12:12:54 UTC 2019
===> lib (install)
===> lib/csu (install)
===> lib/csu/arm (install)
installing DIRS FILESDIR
install  -d -m 0755 -o root  -g wheel  /usr/obj/usr/src/arm.armv7/release/GENERIC-NODEBUG/usr/lib
install  -o root  -g wheel -m 444  crt1.o /usr/obj/usr/src/arm.armv7/release/GENERIC-NODEBUG/usr/lib/crt1.o
install  -o root  -g wheel -m 444  crti.o /usr/obj/usr/src/arm.armv7/release/GENERIC-NODEBUG/usr/lib/crti.o
install  -o root  -g wheel -m 444  crtn.o /usr/obj/usr/src/arm.armv7/release/GENERIC-NODEBUG/usr/lib/crtn.o
install  -o root  -g wheel -m 444  Scrt1.o /usr/obj/usr/src/arm.armv7/release/GENERIC-NODEBUG/usr/lib/Scrt1.o
install  -o root  -g wheel -m 444  gcrt1.o /usr/obj/usr/src/arm.armv7/release/GENERIC-NODEBUG/usr/lib/gcrt1.o
install  -o root  -g wheel -m 444  crtbegin.o /usr/obj/usr/src/arm.armv7/release/GENERIC-NODEBUG/usr/lib/crtbegin.o
install  -o root  -g wheel -m 444  crtbeginS.o /usr/obj/usr/src/arm.armv7/release/GENERIC-NODEBUG/usr/lib/crtbeginS.o
install  -o root  -g wheel -m 444  crtbeginT.o /usr/obj/usr/src/arm.armv7/release/GENERIC-NODEBUG/usr/lib/crtbeginT.o
install  -o root  -g wheel -m 444  crtend.o /usr/obj/usr/src/arm.armv7/release/GENERIC-NODEBUG/usr/lib/crtend.o
install  -o root  -g wheel -m 444  crtendS.o /usr/obj/usr/src/arm.armv7/release/GENERIC-NODEBUG/usr/lib/crtendS.o
===> lib/csu/tests (install)
installing DIRS testsFILESDIR
install  -d -m 0755 -o root  -g wheel  /usr/obj/usr/src/arm.armv7/release/GENERIC-NODEBUG/usr/tests/lib/csu
install  -o root  -g wheel -m 444  Kyuafile /usr/obj/usr/src/arm.armv7/release/GENERIC-NODEBUG/usr/tests/lib/csu/Kyuafile
===> lib/csu/tests/dso (install)
install  -s -o root -g wheel -m 444   -S  libh_csu.so /usr/obj/usr/src/arm.armv7/release/GENERIC-NODEBUG/usr/tests/lib/csu/dynamiclib//
install: libh_csu.so: No such file or directory
*** Error code 71

Stop.
make[7]: stopped in /usr/src/lib/csu/tests/dso
*** Error code 1

Stop.
make[6]: stopped in /usr/src/lib/csu/tests
*** Error code 1

Stop.
make[5]: stopped in /usr/src/lib/csu
*** Error code 1

Stop.
make[4]: stopped in /usr/src/lib
*** Error code 1

Stop.
make[3]: stopped in /usr/src
*** Error code 1

Stop.
make[2]: stopped in /usr/src
*** Error code 1

Stop.
make[1]: stopped in /usr/src
*** Error code 1

Stop.
make: stopped in /usr/src
umount: unmount of /scratch/dev failed: Device busy
Comment 1 Daniel Engberg freebsd_committer freebsd_triage 2019-06-16 17:23:14 UTC
Forgot to mention, WITHOUT_DEBUG_FILES=yes also breaks the installation section alone.
Comment 2 Glen Barber freebsd_committer freebsd_triage 2019-06-17 14:20:23 UTC
Created attachment 205183 [details]
release/release.sh arm patch

Can you please try this patch?
Comment 3 Glen Barber freebsd_committer freebsd_triage 2019-06-17 14:35:24 UTC
Created attachment 205184 [details]
release/release.sh arm patch

One more change needed to be made.  Can you please try this patch instead?
Comment 4 Glen Barber freebsd_committer freebsd_triage 2019-06-17 14:39:02 UTC
Created attachment 205186 [details]
release/release.sh arm patch

Sorry, one more try at this.  Could you try this patch instead?
Comment 5 Daniel Engberg freebsd_committer freebsd_triage 2019-06-17 22:43:28 UTC
Can confirm that this fixes the issue and I've also run-tested the image successfully. Thanks for the quick fix!
Comment 6 commit-hook freebsd_committer freebsd_triage 2019-06-17 22:53:55 UTC
A commit references this bug:

Author: gjb
Date: Mon Jun 17 22:53:40 UTC 2019
New revision: 349160
URL: https://svnweb.freebsd.org/changeset/base/349160

Log:
  Fix passing ${CONF_FILES} (which contains MAKE_CONF and
  SRC_CONF, __MAKE_CONF and SRCCONF, respectively) through
  to arm_install_base() and chroot_arm_build_release().
  This prevents failures when the target image is intended
  to be build with make.conf(5) and src.conf(5) overrides,
  which are correctly handled for non-embedded image builds.

  Reported and tested by:	Daniel Engberg
  PR:		238615
  MFC after:	3 days
  Sponsored by:	The FreeBSD Foundation

Changes:
  head/release/release.sh
  head/release/tools/arm.subr
Comment 7 Glen Barber freebsd_committer freebsd_triage 2019-06-17 22:54:17 UTC
Thank you for testing.  Committed to head, will MFC after 3 days.
Comment 8 commit-hook freebsd_committer freebsd_triage 2019-06-20 14:34:54 UTC
A commit references this bug:

Author: gjb
Date: Thu Jun 20 14:34:46 UTC 2019
New revision: 349232
URL: https://svnweb.freebsd.org/changeset/base/349232

Log:
  MFC r349160:
   Fix passing ${CONF_FILES} (which contains MAKE_CONF and
   SRC_CONF, __MAKE_CONF and SRCCONF, respectively) through
   to arm_install_base() and chroot_arm_build_release().
   This prevents failures when the target image is intended
   to be build with make.conf(5) and src.conf(5) overrides,
   which are correctly handled for non-embedded image builds.

  PR:		238615
  Sponsored by:	The FreeBSD Foundation

Changes:
_U  stable/12/
  stable/12/release/release.sh
  stable/12/release/tools/arm.subr
Comment 9 Glen Barber freebsd_committer freebsd_triage 2019-06-20 14:36:23 UTC
I will not merge this to stable/11 immediately, as the code has diverged a bit, particularly with the inclusion of WITH_UNIFIED_OBJDIR in head and stable/12.  As such, I do not plan to include this in releng/11.3 for 11.3-RELEASE, as I am not comfortable with disturbing this code at this stage of the release cycle.
Comment 10 Michael Dexter 2023-02-14 18:15:19 UTC
Might this be the same bug?

===> lib/csu/tests (distribute)
[Creating objdir /usr/obj/usr/src/amd64.amd64/lib/csu/tests...]
===> lib/csu/tests/dso (distribute)
[Creating objdir /usr/obj/usr/src/amd64.amd64/lib/csu/tests/dso...]
cd /usr/src/lib/csu/tests/dso;  make install installconfig -DNO_SUBDIR DESTDIR=/usr/obj/usr/src/amd64.amd64/release/dist/base SHARED=copies
install -N /usr/src/etc  -s -o root -g wheel -m 444   -S  libh_csu.so /usr/obj/usr/src/amd64.amd64/release/dist/base/usr/tests/lib/csu/dynamiclib//
install: libh_csu.so: No such file or directory

Circumstances:

Exclude all build options except these:

build_options="WITHOUT_AUTO_OBJ WITHOUT_UNIFIED_OBJDIR WITHOUT_INSTALLLIB WITHOUT_BOOT WITHOUT_LOADER_LUA WITHOUT_LOCALES WITHOUT_ZONEINFO WITHOUT_EFI WITHOUT_ZFS WITHOUT_LOADER_ZFS WITHOUT_CDDL WITHOUT_CRYPT WITHOUT_OPENSSL WITHOUT_LOADER_GELI WITHOUT_DYNAMICROOT WITHOUT_FP_LIBC WITHOUT_VI"

Buildworld, kernel, run 'make cdrom' or 'make memstick' from the release directory.

Including these options did not help: WITHOUT_TESTS=YES WITHOUT_TESTS_SUPPORT WITHOUT_DEBUG_FILES

'man csu' does not return a manual page and the source directory is not obvious as to what "csu" is.
Comment 11 Michael Dexter 2023-02-16 04:50:34 UTC
Issue found. Ignore that.