NetBSD Problem Report #55929

From paul@whooppee.com  Thu Jan 14 21:27:51 2021
Return-Path: <paul@whooppee.com>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 10B701A9217
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 14 Jan 2021 21:27:51 +0000 (UTC)
Message-Id: <20210114212748.42D1730F2C4@speedy.whooppee.com>
Date: Thu, 14 Jan 2021 13:27:48 -0800 (PST)
From: paul@whooppee.com
Reply-To: paul@whooppee.com
To: gnats-bugs@NetBSD.org
Subject: ``build.sh install-image'' doesn't work with KERNEL_DIR=yes
X-Send-Pr-Version: 3.95

>Number:         55929
>Category:       install
>Synopsis:       ``build.sh install-image'' doesn't work with KERNEL_DIR=yes
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pgoyette
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 14 21:30:00 +0000 2021
>Closed-Date:    Sat Apr 26 14:15:34 +0000 2025
>Last-Modified:  Tue May 06 22:12:33 +0000 2025
>Originator:     Paul Goyette
>Release:        NetBSD 9.99.77
>Organization:
+--------------------+--------------------------+-----------------------+
| Paul Goyette       | PGP Key fingerprint:     | E-mail addresses:     |
| (Retired)          | FA29 0E3B 35AF E8AE 6651 | paul@whooppee.com     |
| Software Developer | 0786 F758 55DE 53BA 7731 | pgoyette@netbsd.org   |
+--------------------+--------------------------+-----------------------+
>Environment:


System: NetBSD speedy.whooppee.com 9.99.77 NetBSD 9.99.77 (SPEEDY 2020-12-09 16:52:22 UTC) #0: Thu Dec 10 00:56:59 UTC 2020 paul@speedy.whooppee.com:/build/netbsd-local/obj/amd64/sys/arch/amd64/compile/SPEEDY amd64
Architecture: x86_64
Machine: amd64
>Description:
	Running ``build.sh install-image'' fails if the distribution
	was built with KERNEL_DIR=yes

	Here's the relevant log file:

===> build.sh command:    ./build.sh -T /build/netbsd-local/tools/x86_64/amd64 -D /build/netbsd-local/dest/amd64 -O /build/netbsd-local/obj/amd64 -R /build/netbsd-local/release -V RELEASEMACHINEDIR=amd64 -V MKDEBUG=yes -V MKKDEBUG=yes -V MKDEBUGLIB=no -V KERNEL_DIR=yes -V MKPAM=no -U -u -x -N2 -m amd64 -j1 install-image
===> build.sh started:    Thu Jan 14 21:20:38 UTC 2021
===> NetBSD version:      9.99.77
===> MACHINE:             amd64
===> MACHINE_ARCH:        x86_64
===> Build platform:      NetBSD 9.99.77 amd64
===> HOST_SH:             /bin/sh
===> MAKECONF file:       /etc/mk.conf
===> TOOLDIR path:        /build/netbsd-local/tools/x86_64/amd64
===> DESTDIR path:        /build/netbsd-local/dest/amd64
===> RELEASEDIR path:     /build/netbsd-local/release
===> Updated makewrapper: /build/netbsd-local/tools/x86_64/amd64/bin/nbmake-amd64
install-image ===> etc
install_image ===> /build/netbsd-local/src_ro/distrib	(with: INSTIMG_RELEASEDIR=/build/netbsd-local/release/images)
install_image ===> /build/netbsd-local/src_ro/distrib/notes
install_image ===> /build/netbsd-local/src_ro/distrib/utils
install_image ===> /build/netbsd-local/src_ro/distrib/amd64
install_image ===> /build/netbsd-local/src_ro/distrib/amd64/installimage
/build/netbsd-local/tools/x86_64/amd64/bin/nbsed							 -e "s/@@MACHINE@@/amd64/"				 -e "s/@@VERSION@@/9.99.77/"				 < /build/netbsd-local/src_ro/distrib/amd64/installimage/boot.cfg.in > boot.cfg
Missing /build/netbsd-local/release/amd64/binary/sets/kern-GENERIC.tar.xz, aborting

*** Failed target:  imgroot.fs
*** Failed command: if [ ! -f /build/netbsd-local/release/amd64/binary/sets/kern-GENERIC.tar.xz ]; then echo "Missing /build/netbsd-local/release/amd64/binary/sets/kern-GENERIC.tar.xz, aborting"; false; fi
*** Error code 1

Stop.
nbmake[4]: stopped in /build/netbsd-local/src_ro/distrib/amd64/installimage
*** [install_image] Error code 1

nbmake[3]: stopped in /build/netbsd-local/src_ro/distrib/amd64
1 error

nbmake[3]: stopped in /build/netbsd-local/src_ro/distrib/amd64

*** Failed target:  install_image-amd64
*** Failed command: _makedirtarget() { dir="$1"; shift; target="$1"; shift; case "${dir}" in /*) this="${dir}/"; real="${dir}" ;; .) this="/build/netbsd-local/src_ro/distrib/"; real="/build/netbsd-local/src_ro/distrib" ;; *) this="/build/netbsd-local/src_ro/distrib/${dir}/"; real="/build/netbsd-local/src_ro/distrib/${dir}" ;; esac; show=${this:-.}; echo "${target} ===> ${show%/}${1:+ (with: $@)}"; cd "${real}" && /build/netbsd-local/tools/x86_64/amd64/bin/nbmake _THISDIR_="${this}" "$@" ${target}; }; _makedirtarget amd64 install_image
*** Error code 2

Stop.
nbmake[2]: stopped in /build/netbsd-local/src_ro/distrib
*** [install-image] Error code 1

nbmake[1]: stopped in /build/netbsd-local/src_ro/etc
1 error

nbmake[1]: stopped in /build/netbsd-local/src_ro/etc
*** [install-image] Error code 2

nbmake: stopped in /build/netbsd-local/src_ro

nbmake: stopped in /build/netbsd-local/src_ro

>How-To-Repeat:
	See above
>Fix:
	Unknown

>Release-Note:

>Audit-Trail:
From: Paul Goyette <paul@whooppee.com>
To: gnats-bugs@netbsd.org
Cc: christos@netbsd.org
Subject: Re: install/55929: ``build.sh install-image'' doesn't work with
 KERNEL_DIR=yes
Date: Thu, 24 Apr 2025 12:45:23 -0700 (PDT)

 OK, I finally figured out where the kernel-set files were going...

 In $SRCDIR/etc/Makefile we have at line 647

  	...
  			if [ ${KERNEL_DIR} = "yes" ]; then \
  				mv $${kern_tgz} ..; \
  			fi; \
  		} \
  	...

 The ``mv'' command moves the kernel-set file out of the $RELEASEDIR
 completely, and the subsequent usage of the kernel-set by the image
 code fails to find the file.

 It's not clear to me why we want to move the file, and it is even
 less clear why it is being moved back into the $OBJDIR hierarchy
 (the ``mv'' command executes with its working directory set to
 $OBJDIR/amd64/sys/arch/amd64/compile/$CONFIG/kernel$)

 Furthermore, the kernel-set files are not cleaned up, so an update
 build will fail when trying to move a new kern-set file into the
 $OBJDIR location (as previously reported).


 +---------------------+--------------------------+----------------------+
 | Paul Goyette (.sig) | PGP Key fingerprint:     | E-mail addresses:    |
 | (Retired)           | 1B11 1849 721C 56C8 F63A | paul@whooppee.com    |
 | Software Developer  | 6E2E 05FD 15CE 9F2D 5102 | pgoyette@netbsd.org  |
 | & Network Engineer  |                          | pgoyette99@gmail.com |
 +---------------------+--------------------------+----------------------+

Responsible-Changed-From-To: install-manager->pgoyette
Responsible-Changed-By: pgoyette@NetBSD.org
Responsible-Changed-When: Sat, 26 Apr 2025 14:15:34 +0000
Responsible-Changed-Why:
it's mine


State-Changed-From-To: open->closed
State-Changed-By: pgoyette@NetBSD.org
State-Changed-When: Sat, 26 Apr 2025 14:15:34 +0000
State-Changed-Why:
resolved

Module Name:    src
Committed By:   pgoyette
Date:           Fri Apr 25 19:34:39 UTC 2025

Modified Files:
        src/etc: Makefile

Log Message:
Leave the kernel-dir sets in the $RELEASE directories so the
subsequent image-building targets can find them.

Use `ln -f'' to allow overwriting previous versions of links.

Addresses kern/55929

XXX More to come for building the image targets.

christos@ says ``go for it''


To generate a diff of this commit:
cvs rdiff -u -r1.474 -r1.475 src/etc/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2025 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.