Re: Finding the git hash for a build

From: Kevin Oberman <rkoberman_at_gmail.com>
Date: Fri, 19 Jul 2024 15:40:46 UTC
Thanks to both of you! I am baffled as to what I did wrong yesterday. How
can I type "git reset --hard" wrong? I cut and pasted the hash. And I still
kept getting a hash not found.

In any case, it worked perfectly today and buildworld should be complete in
about an hour.

Thanks so much!

On Fri, Jul 19, 2024 at 6:58 AM Dave Cottlehuber <dch@skunkwerks.at> wrote:

> On Fri, 19 Jul 2024, at 06:13, Kevin Oberman wrote:
> > I need to roll back my system to main-n271000-5654b42142e1. After an
> > update of the system today, it crashes in network startup and I need to
> > get back to a working system while I try to figure out why it won't
> > boot. Probably by bisecting the source.
> >
> > Right now, I am getting an error from 'geli attach' of:
> > geli: Invalid class name 'eli'.
> > This is probably the result of kernel and world not being in sync as I
> > had to restore the boot/modules directory to the state of the old
> > kernel.
> >
> > I had assumed that the version was a hash that I could use to get my
> > kernel and world back to a working state. I could restore from backup,
> > but would like to get back to the exact system of the kernel.old.
> >
> > I am just a git newby and trying to use 5654b42142e1 reports that the
> > hash is not found. I'lladmit that I'm lost!
>
>
> Hi Kevin
>
> you're correct, you can check via
> https://cgit.freebsd.org/src/commit/?id=5654b42142e1
> for example.
>
> Assuming you are already on main branch:
>
> cd /usr/src
> ### switch to the main branch if not already on it
> git switch main
> ### make sure we have all the recent commits, hopefully including that one
> git fetch origin main
> ### reset our "main" reference to that commit
> git reset --hard 5654b42142e1
> ### clean up any stray rubbish
> git clean -fdx
>
> and then rebuild as usual.
>
> A lazier way would be to grab base & kernel from
> https://download.freebsd.org/ftp/snapshots/amd64/amd64/15.0-CURRENT/
> there's a GITBRANCH and REVISION file in there you can compare from.
>
> An even lazier way would be boot environments, if you have zfs.
>
> A+
> Dave
>


-- 
Kevin Oberman, Part time kid herder and retired Network Engineer
E-mail: rkoberman@gmail.com
PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683