moving /usr/src and /usr/obj to another machine for installation

From: Matthias Apitz <guru_at_unixarea.de>
Date: Sat, 2 Jan 2021 14:10:42 +0100
Hello,

I have a potent machine where I build my systems and ports with
poudriere:

[root_at_jet /usr/src]# uname -a
FreeBSD jet 13.0-CURRENT FreeBSD 13.0-CURRENT #0 r368166: Mon Nov 30 10:06:30 CET 2020     guru_at_jet:/usr/obj/usr/src/amd64.amd64/sys/GENERIC  amd64

[root_at_jet /usr/src]# svn info
Path: .
Working Copy Root Path: /usr/src
URL: svn://svn.freebsd.org/base/head
Relative URL: ^/head
Repository Root: svn://svn.freebsd.org/base
Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revision: 368166
Node Kind: directory
Schedule: normal
Last Changed Author: melifaro
Last Changed Rev: 368164
Last Changed Date: 2020-11-29 20:43:33 +0100 (Sun, 29 Nov 2020)

The kernel there is built and installed the normal way

# make buildworld
# make buildkernel KERNCONF=GENERIC
...

and it works fine (poudiere compiled ~2400 ports on it).

My idea (and used procedure) in the past was: create a tar archive:

# tar cfz r368166-src-obj.tgz /usr/src /usr/obj

move the file r368166-src-obj.tgz to another small netbook and unpack it
there with:


[root_at_c720-r314251-vale /]# uname -a
FreeBSD c720-r314251-vale 12.0-CURRENT FreeBSD 12.0-CURRENT #1 r314251M: Tue Apr  2 07:19:39 CEST 2019     guru_at_c720-r314251-vale:/usr/obj/usr/src/sys/GENERIC  amd64

[root_at_c720-r314251-vale /]# rm -rf /usr/src /usr/obj
[root_at_c720-r314251-vale /]# cd /
[root_at_c720-r314251-vale /]# tar xzf r368166-src-obj.tgz
[root_at_c720-r314251-vale /]# cd /usr/src
[root_at_c720-r314251-vale /usr/src]# svn info
Path: .
Working Copy Root Path: /usr/src
URL: svn://svn.freebsd.org/base/head
Relative URL: ^/head
Repository Root: svn://svn.freebsd.org/base
Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revision: 368166
Node Kind: directory
Schedule: normal
Last Changed Author: melifaro
Last Changed Rev: 368164
Last Changed Date: 2020-11-29 20:43:33 +0100 (Sun, 29 Nov 2020)

And when I now want to recompile the kernel there (to fix a small bug
related to the keyboard in /usr/src/sys/dev/atkbdc/atkbdc.c), this fails
with

[root_at_c720-r314251-vale /usr/src]# make buildkernel -DNO_CLEAN KERNCONF=GENERIC

make[1]: "/usr/src/Makefile.inc1" line 341: SYSTEM_COMPILER: libclang will be built for bootstrapping a cross-compiler.
make[1]: "/usr/src/Makefile.inc1" line 346: SYSTEM_LINKER: libclang will be built for bootstrapping a cross-linker.
make[1]: "/usr/src/Makefile.inc1" line 454: The src.conf WITHOUT_CLEAN option can now be used instead of NO_CLEAN.

--------------------------------------------------------------
>>> Kernel build for GENERIC started on Sat Jan  2 13:35:31 CET 2021
--------------------------------------------------------------
===> GENERIC
mkdir -p /usr/obj/usr/src/amd64.amd64/sys

--------------------------------------------------------------
>>> stage 1: configuring the kernel
--------------------------------------------------------------
cd /usr/src/sys/amd64/conf;  PATH=/usr/obj/usr/src/amd64.amd64/tmp/bin:/usr/obj/usr/src/amd64.amd64/tmp/usr/sbin:/usr/obj/usr/src/amd64.amd64/tmp/usr/bin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/sbin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/bin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/bin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/libexec::/sbin:/bin:/usr/sbin:/usr/bin  config  -d /usr/obj/usr/src/amd64.amd64/sys/GENERIC  -I '/usr/src/sys/amd64/conf' -I '/usr/src/sys/amd64/conf'  '/usr/src/sys/amd64/conf/GENERIC'
Kernel build directory is /usr/obj/usr/src/amd64.amd64/sys/GENERIC
Don't forget to do ``make cleandepend && make depend''
cd /usr/src; MACHINE_ARCH=amd64  MACHINE=amd64  CPUTYPE= CC="cc -target x86_64-unknown-freebsd13.0 --sysroot=/usr/obj/usr/src/amd64.amd64/tmp -B/usr/obj/usr/src/amd64.amd64/tmp/usr/bin" CXX="c++  -target x86_64-unknown-freebsd13.0 --sysroot=/usr/obj/usr/src/amd64.amd64/tmp -B/usr/obj/usr/src/amd64.amd64/tmp/usr/bin"  CPP="cpp -target x86_64-unknown-freebsd13.0 --sysroot=/usr/obj/usr/src/amd64.amd64/tmp -B/usr/obj/usr/src/amd64.amd64/tmp/usr/bin"  AS="as" AR="ar" LD="ld" LLVM_LINK=""  NM=nm OBJCOPY="objcopy"  RANLIB=ranlib STRINGS=  SIZE="size" STRIPBIN="strip"  INSTALL="install -U"  PATH=/usr/obj/usr/src/amd64.amd64/tmp/bin:/usr/obj/usr/src/amd64.amd64/tmp/usr/sbin:/usr/obj/usr/src/amd64.amd64/tmp/usr/bin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/sbin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/bin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/bin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/libexec::/sbin:/bin:/usr/sbin:/usr/bin  SYSROOT=/usr/obj/usr/src/amd64.amd64/tmp make  -f Makefile.inc1  BWPHASE=buildkernel  DESTDIR=/usr/obj/usr/src/amd64.amd64/tmp _cleankernobj_fast_depend_hack
/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/sbin/make: Undefined symbol "readdir"
*** Error code 1

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

Stop.
make: stopped in /usr/src

Why this procedure does not work?

The file above
/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/sbin/make is really
outdated:

# ls -l /usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/sbin/make
-r-xr-xr-x  1 root  wheel  195944 Feb 12  2020 /usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/sbin/make

but it is also outdated on the source machine and in the tar file.
Maybe on the source host (jet) the /usr/obj was not purged before. But
why it does not hurt on the source host (I tested the same make buildkernel
right now, works fine) and it does hurt on the second host?

What is wrong with the above procedure?

Thanks

	matthias


-- 
Matthias Apitz, ✉ guru_at_unixarea.de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub
¡Con Cuba no te metas!  «»  Don't mess with Cuba!  «»  Leg Dich nicht mit Kuba an!
http://www.cubadebate.cu/noticias/2020/12/25/en-video-con-cuba-no-te-metas/
Received on Sat Jan 02 2021 - 12:10:47 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:26 UTC