Date: Sat, 2 Jan 2021 14:10:42 +0100 From: Matthias Apitz <guru@unixarea.de> To: freebsd-current@freebsd.org Subject: moving /usr/src and /usr/obj to another machine for installation Message-ID: <X/Bw0lYuQQCabilq@c720-r368166.fritz.box>
next in thread | raw e-mail | index | archive | help
Hello, I have a potent machine where I build my systems and ports with poudriere: [root@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@jet:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64 [root@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=3DGENERIC =2E.. 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@c720-r314251-vale /]# uname -a FreeBSD c720-r314251-vale 12.0-CURRENT FreeBSD 12.0-CURRENT #1 r314251M: Tu= e Apr 2 07:19:39 CEST 2019 guru@c720-r314251-vale:/usr/obj/usr/src/sys= /GENERIC amd64 [root@c720-r314251-vale /]# rm -rf /usr/src /usr/obj [root@c720-r314251-vale /]# cd / [root@c720-r314251-vale /]# tar xzf r368166-src-obj.tgz [root@c720-r314251-vale /]# cd /usr/src [root@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@c720-r314251-vale /usr/src]# make buildkernel -DNO_CLEAN KERNCONF=3DG= ENERIC 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 opti= on can now be used instead of NO_CLEAN. -------------------------------------------------------------- >>> Kernel build for GENERIC started on Sat Jan 2 13:35:31 CET 2021 -------------------------------------------------------------- =3D=3D=3D> GENERIC mkdir -p /usr/obj/usr/src/amd64.amd64/sys -------------------------------------------------------------- >>> stage 1: configuring the kernel -------------------------------------------------------------- cd /usr/src/sys/amd64/conf; PATH=3D/usr/obj/usr/src/amd64.amd64/tmp/bin:/u= sr/obj/usr/src/amd64.amd64/tmp/usr/sbin:/usr/obj/usr/src/amd64.amd64/tmp/us= r/bin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/sbin:/usr/obj/usr/src/amd= 64.amd64/tmp/legacy/usr/bin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/bin:/us= r/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=3Damd64 MACHINE=3Damd64 CPUTYPE=3D CC=3D"cc -ta= rget x86_64-unknown-freebsd13.0 --sysroot=3D/usr/obj/usr/src/amd64.amd64/tm= p -B/usr/obj/usr/src/amd64.amd64/tmp/usr/bin" CXX=3D"c++ -target x86_64-un= known-freebsd13.0 --sysroot=3D/usr/obj/usr/src/amd64.amd64/tmp -B/usr/obj/u= sr/src/amd64.amd64/tmp/usr/bin" CPP=3D"cpp -target x86_64-unknown-freebsd1= 3.0 --sysroot=3D/usr/obj/usr/src/amd64.amd64/tmp -B/usr/obj/usr/src/amd64.a= md64/tmp/usr/bin" AS=3D"as" AR=3D"ar" LD=3D"ld" LLVM_LINK=3D"" NM=3Dnm OB= JCOPY=3D"objcopy" RANLIB=3Dranlib STRINGS=3D SIZE=3D"size" STRIPBIN=3D"st= rip" INSTALL=3D"install -U" PATH=3D/usr/obj/usr/src/amd64.amd64/tmp/bin:/= usr/obj/usr/src/amd64.amd64/tmp/usr/sbin:/usr/obj/usr/src/amd64.amd64/tmp/u= sr/bin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/sbin:/usr/obj/usr/src/am= d64.amd64/tmp/legacy/usr/bin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/bin:/u= sr/obj/usr/src/amd64.amd64/tmp/legacy/usr/libexec::/sbin:/bin:/usr/sbin:/us= r/bin SYSROOT=3D/usr/obj/usr/src/amd64.amd64/tmp make -f Makefile.inc1 B= WPHASE=3Dbuildkernel DESTDIR=3D/usr/obj/usr/src/amd64.amd64/tmp _cleankern= obj_fast_depend_hack /usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/sbin/make: Undefined symbol "re= addir" *** 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 --=20 Matthias Apitz, =E2=9C=89 guru@unixarea.de, http://www.unixarea.de/ +49-176= -38902045 Public GnuPG key: http://www.unixarea.de/key.pub =C2=A1Con Cuba no te metas! =C2=AB=C2=BB Don't mess with Cuba! =C2=AB=C2= =BB Leg Dich nicht mit Kuba an! http://www.cubadebate.cu/noticias/2020/12/25/en-video-con-cuba-no-te-metas/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?X/Bw0lYuQQCabilq>