Re: Disaster recovery after panic while doing installworld

From: Kevin Oberman <rkoberman_at_gmail.com>
Date: Tue, 25 Oct 2022 23:06:51 UTC
On Tue, Oct 25, 2022 at 1:23 PM Kevin Oberman <rkoberman@gmail.com> wrote:

> On Tue, Oct 25, 2022 at 9:36 AM Polytropon <freebsd@edvax.de> wrote:
>
>> On Tue, 25 Oct 2022 09:27:36 -0700, Kevin Oberman wrote:
>> > I hope to recover it by booting  a live system from a main snapshot,
>> but I
>> > am uncertain of what environmental variables I will need to set to
>> convince
>> > the system to make installworld from the /usr/obj on /mnt and install
>> into
>> > /mnt.
>> >
>> > Any suggestions?
>>
>> You can find details in "man 7 build"; probably the
>> settings $MAKEOBJDIRPREFIX and $DESTDIR will be what
>> you need, you'll find them in the ENVIRONMENT secion
>> of the manpage.
>>
>>
>> Good luck!
>>
>>
>>
>> --
>> Polytropon
>> Magdeburg, Germany
>> Happy FreeBSD user since 4.0
>> Andra moi ennepe, Mousa, ...
>>
>
> Well, there is more required and, being anxious to get my system running,
> I will ask for a little more help.
>
> I tried defining DESTDIR and MAKEOBJDIRPREFIX and fired off a "make -C
> /mnt/usr/src/ make installworld, but it failed instantly because it could
> not find cc. Of course, there is no compiler on the install drive, so...
>
> I had to define CC and LD to point at the right places, but then I get:
> make[1]:"/mnt/usr/src/Makefile.inc1" line 106: A build is required first.
> You may have the wrong MAKEOBJDIRPREFIX set. I set it to /mnt/usr/obj and
> that is the proper directory. It contains only the directory 'usr', as I
> would expect. So I am baffled. Any ideas on what the heck is missing. I'm
> feeling a bit nauseous about now.
>

Slow progress, but I seem to be at a dead end in Makefile.inc1 at line 104.
It tries to load toolchain_metadata from $OBJTOP, but it is defined not as
"/mnt/usr/obj/usr/src/amd64.amd64", but as
"/mnt/usr/obj/mnt/usr/src/amd64.amd64". MAKEOBJDIRPREFIX is "/mnt/usr/obj".
I have tried figuring out the makefiles, but can't understand how $OBJTOP
is created from $MAKEOBJDIRPREFIX. Looks like a bug that is inserting the
additional /mnt. Is it somehow getting there from $DESTDIR?
-- 
Kevin Oberman, Part time kid herder and retired Network Engineer
E-mail: rkoberman@gmail.com
PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683