Re: make installworld broke / how to recover

2018-02-24 Thread Dave Cottlehuber
On Thu, 22 Feb 2018, at 14:41, tech-lists wrote:
> On Thu, Feb 22, 2018 at 03:10:17AM -0800, Jack L. wrote:
> >maybe try a clean buildworld, update /usr/src to the latest version, rm -rf
> >/usr/obj, then make buildworld && make installworld && make kernel and see
> >if that fixes the issue?
> 
> Is there a documented way of say booting to memstick, starting fixit,
> mounting the zfs from the broken system then building/installing a 
> new world? Is there enough "environment" and utilities to do this on the
> fixit disk?

I can't help from the source/installworld side, but I have a couple of
things to share that may help, apologies if this is already familiar to you.
The email's long enough to be a blog entry...

1. fixing a dead/borked system

I love using mfsbsd[1] by Martin Matuska for this. It's a bootable FreeBSD image
with DHCP support so you can ssh into it from a separate system.

You can then import the zpool and basically do all the cleanup from there.

zpool import -R /mnt -N -f zroot

then mount the datasets you need manually.

2. hacking a semblance of sanity back into the borked current

Try this, after doing a zfs snapshot of your filesystem.

- download the latest CURRENT snapshot and untar kernel + base in place over top
of the above mounted rootfs. Copy back anything "important" from your snapshot 
like
/etc/ and /boot/loader.conf and the system will probably boot now.

3. use boot environments

I use these all the time, so awesome. basically when you install 11.x the zfs 
dataset
layout already supports this by default. You can tweak an existing system to 
fit this
if needed, it's not too hard. Details elided, help available if you need it 
later on.

install sysutils/beadm-devel and have a go. Briefly, your / is kept in 
zroot/ROOT/
(called a Boot Environment) and variable data lives outside that namespace, but
overlaid using zfs mountpoints.  You can make multiple copies of these as you 
go along,
before upgrades, during patches, or major config changes. Real Data like 
/usr/home,
/var/log or (in my case) /var/db/* are in separate datasets and will always be 
present
and up to date, irrespective of which boot environment you are currently 
running under.

For example, I have a 11.1R boot environment, and about 3-4 12.0-CURRENT ones 
over
the last few weeks, in case something unexpected breaks for me.

At boot time, the loader (thanks Allan Jude IIRC for implementing this) allows 
you to
choose between those copies so you can simply switch back to the working one and
decide what you want to do with the borked one. see [2] for some really cool 
tricks
from Michael Dexter about mounting that into bhyve and then "live testing" 
before
upgrading.


4. beinstall.sh script from Will Andrews

If you're building from source, then you can combine #3 with [3] and have your
next incarnation automatically installed not into your existing working / 
dataset
but into its own dataset, cloned off your current /, and upgraded, all within 
the
boot environment. This is so awesome it's changed my world (pun intended), I
install a new CURRENT every 3-4 days now because rolling back is absolutely 
painless.

I borrowed xmj@ [4] tips on using ccache and metamode, which makes incremental
builds pretty quick.
 
I can later on mount the /usr/src and /usr/obj over NFS to other lesser powered
systems like my laptop, and beinstall.sh there too.

LIKE A BOSS.

Here's my current hacky scripts to build world & current, and stash everything 
into a
boot environment. It works for me, but I'm hardly a build-from-source guru so 
maybe
that could be improved [5]

[1]: http://mfsbsd.vx.sk/
[2]: http://www.callfortesting.org/bhyve-boot-environments/
[3]: https://svnweb.freebsd.org/base/head/tools/build/beinstall.sh?view=markup
[4]: https://xmj.github.io/articles/sysadmin/builds_ccache_memcached.html
[5]: https://gist.github.com/dch/99a0e3c42e971a08dd922aab20670d7d
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: make installworld broke / how to recover

2018-02-22 Thread tech-lists

On Thu, Feb 22, 2018 at 03:10:17AM -0800, Jack L. wrote:

maybe try a clean buildworld, update /usr/src to the latest version, rm -rf
/usr/obj, then make buildworld && make installworld && make kernel and see
if that fixes the issue?


Is there a documented way of say booting to memstick, starting fixit,
mounting the zfs from the broken system then building/installing a 
new world? Is there enough "environment" and utilities to do this on the

fixit disk?

[never had this happen before, anticipate steep learning curve]

--
J.
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: make installworld broke / how to recover

2018-02-22 Thread John
Hi, thanks for responding

On Thu, 22 Feb 2018, at 11:10, Jack L. wrote:
> maybe try a clean buildworld, update /usr/src to the latest version, rm -rf
> /usr/obj, then make buildworld && make installworld && make kernel and see
> if that fixes the issue?

I booted to the old kernel as it's apparently in sync with the (broken) world:

root@desktop:/usr/src# make -j32 cleandir && make -j32 clean && make -j32 clean 
<-- just to make sure!
[...]
root@desktop:/usr/src# less /etc/make.conf
/etc/make.conf: No such file or directory
root@desktop:/usr/src# less /etc/src.conf
/etc/src.conf: No such file or directory
root@desktop:/usr/src# svnlite update
Updating '.':
At revision 329819.
root@desktop:/usr/src# rm -rf /obj/* [ my /usr/obj is symlinked to /obj as /obj 
is on a SSD]
root@desktop:/usr/src# uname -KU
1101510 1101510

root@desktop:/usr/src# make -j1 buildworld

[...]

===> usr.bin/xinstall (obj,all,install)
/usr/obj/storage/usr/src/tmp/storage/usr/src/usr.bin/xinstall created for 
/storage/usr/src/usr.bin/xinstall
echo xinstall.full: /usr/lib/libc.a /usr/lib/libmd.a 
/usr/obj/storage/usr/src/tmp/legacy/usr/lib/libegacy.a >> .depend
cc -O2 -pipe  -I/storage/usr/src/contrib/mtree -I/storage/usr/src/lib/libnetbsd 
-g -MD  -MF.depend.xinstall.o -MTxinstall.o -std=gnu99  -Qunused-arguments  
-I/usr/obj/storage/usr/src/tmp/legacy/usr/include -c 
/storage/usr/src/usr.bin/xinstall/xinstall.c -o xinstall.o
cc -O2 -pipe  -I/storage/usr/src/contrib/mtree -I/storage/usr/src/lib/libnetbsd 
-g -MD  -MF.depend.getid.o -MTgetid.o -std=gnu99  -Qunused-arguments  
-I/usr/obj/storage/usr/src/tmp/legacy/usr/include -c 
/storage/usr/src/contrib/mtree/getid.c -o getid.o
cc -O2 -pipe -I/storage/usr/src/contrib/mtree -I/storage/usr/src/lib/libnetbsd 
-g -std=gnu99 -Qunused-arguments 
-I/usr/obj/storage/usr/src/tmp/legacy/usr/include  -static 
-L/usr/obj/storage/usr/src/tmp/legacy/usr/lib -o xinstall.full xinstall.o 
getid.o   -lmd -legacy
objcopy --only-keep-debug xinstall.full install.debug
objcopy --strip-debug --add-gnu-debuglink=install.debug  xinstall.full xinstall
sh /storage/usr/src/tools/install.sh  -s -o root -g wheel -m 555   xinstall 
/usr/obj/storage/usr/src/tmp/legacy/usr/bin/install
sh /storage/usr/src/tools/install.sh  -o root -g wheel -m 444  install.debug 
/usr/obj/storage/usr/src/tmp/legacy/usr/lib/debug/usr/bin/install.debug
install: install.debug: Inappropriate file type or format
*** [_proginstall] Error code 71

make[3]: stopped in /storage/usr/src/usr.bin/xinstall
1 error

make[3]: stopped in /storage/usr/src/usr.bin/xinstall
*** [_bootstrap-tools-usr.bin/xinstall] Error code 2

make[2]: stopped in /storage/usr/src
1 error

make[2]: stopped in /storage/usr/src
*** [_bootstrap-tools] Error code 2

make[1]: stopped in /storage/usr/src
1 error

make[1]: stopped in /storage/usr/src
*** [buildworld] Error code 2

make: stopped in /storage/usr/src
1 error

make: stopped in /storage/usr/src

-- 
  John
  tech-li...@zyxst.net
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: make installworld broke / how to recover

2018-02-22 Thread Jack L.
maybe try a clean buildworld, update /usr/src to the latest version, rm -rf
/usr/obj, then make buildworld && make installworld && make kernel and see
if that fixes the issue?

On Thu, Feb 22, 2018 at 2:57 AM, John  wrote:

> Hello,
>
> When trying to upgrade from 11-stable to 12-current, make installworld
> broke. The OS is mainly on a ssd, there is zfs installed (usr/src is on
> zfs). Is there a guide somewhere that shows how to recover from this
> situation? both 11.1 and 12-current kernels are bootable. I can just blat
> the system and install from scratch but that would mean i've not learned
> how to fix it. I have subsequently tried make buildworld again but it bais
> out with this error:
>
> #
>
> objcopy --only-keep-debug xinstall.full install.debug
> objcopy --strip-debug --add-gnu-debuglink=install.debug  xinstall.full
> xinstall
> sh /storage/usr/src/tools/install.sh  -s -o root -g wheel -m 555
>  xinstall /obj/storage/usr/src/amd64.amd64/tmp/legacy/usr/bin/install
> sh /storage/usr/src/tools/install.sh  -o root -g wheel -m 444
> install.debug /obj/storage/usr/src/amd64.amd64/tmp/legacy/usr/lib/
> debug/usr/bin/install.debug
> install: install.debug: Inappropriate file type or format
> *** Error code 71
>
> Stop.
> make[3]: stopped in /storage/usr/src/usr.bin/xinstall
> *** Error code 1
>
> Stop.
> make[2]: stopped in /storage/usr/src
> *** Error code 1
>
> Stop.
> make[1]: stopped in /storage/usr/src
> *** Error code 1
>
> Stop.
> make: stopped in /storage/usr/src
>
> #
>
> thanks,
>
> --
>   John
>   tech-li...@zyxst.net
> ___
> freebsd-current@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
>
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


make installworld broke / how to recover

2018-02-22 Thread John
Hello,

When trying to upgrade from 11-stable to 12-current, make installworld broke. 
The OS is mainly on a ssd, there is zfs installed (usr/src is on zfs). Is there 
a guide somewhere that shows how to recover from this situation? both 11.1 and 
12-current kernels are bootable. I can just blat the system and install from 
scratch but that would mean i've not learned how to fix it. I have subsequently 
tried make buildworld again but it bais out with this error:

#

objcopy --only-keep-debug xinstall.full install.debug
objcopy --strip-debug --add-gnu-debuglink=install.debug  xinstall.full xinstall
sh /storage/usr/src/tools/install.sh  -s -o root -g wheel -m 555   xinstall 
/obj/storage/usr/src/amd64.amd64/tmp/legacy/usr/bin/install
sh /storage/usr/src/tools/install.sh  -o root -g wheel -m 444  install.debug 
/obj/storage/usr/src/amd64.amd64/tmp/legacy/usr/lib/debug/usr/bin/install.debug
install: install.debug: Inappropriate file type or format
*** Error code 71

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

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

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

Stop.
make: stopped in /storage/usr/src

#

thanks,

-- 
  John
  tech-li...@zyxst.net
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"