From owner-freebsd-current@freebsd.org Sun Jan 24 22:29:49 2021 Return-Path: Delivered-To: freebsd-current@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4B9904DD9EA for ; Sun, 24 Jan 2021 22:29:49 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DP73J495dz4hbG for ; Sun, 24 Jan 2021 22:29:48 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qt1-x836.google.com with SMTP id c12so8447992qtv.5 for ; Sun, 24 Jan 2021 14:29:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LBN1L0zSMhpuSmyWvAx+9CqVqOHfKVCvQmeJg0tzhmI=; b=QjhyHt7NObb+3KATyg3RpC1pDKx86++cbfrZBY7JZ/xwuucWJKXkaWrYmtKMSyVUH2 Ekdsj6pNth/UPMtKvxXT/lqQO/A578AM/0BSitGivDbU5lOOLOQ6nVSuBZWtnkPUxBo5 lP2cq6mAjO5OvOQBxpYzeX7QQ7K6+ymFh8Y1EAg2GeTaQNkC2doCjkzvgaRptIvoRzU1 gv5nqDJ+X7Ab4UbUQRkQzKa3mg/josOKRK0+xlHyBnXv4HkWpbZI055MnVVUmBH3eG5z NA/G6i3d5g9Iz44emycvwrTUu+rqKHfCx2F5J9HzB0pKAgP7VsWF8S8UH3HkD7BkWhFN 1xiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LBN1L0zSMhpuSmyWvAx+9CqVqOHfKVCvQmeJg0tzhmI=; b=mewH9Ujx5oO/rpIaVu/QDZ0bdV6tLiMITgDwp+dNwc2wY4IvUH+/EXX5um5MojEtNP OFklxRpZcipxEsm7m+p4tLyUpI0SuvZzIa54onIjGPezQOEODOX8zxLDHHxbFCE2r8RV R/7+32TdJfRSrfKOCOifBz7pmh3olpJbbkelCUxC/rvFlGkujnrV6FN+03NK8LIN+voL /1PzEKkUxUEiZuODlXLzrANsk1jH2FCYhQeiveuDJ1TO0Wam11OSEKFBkzfK+nT8HNEr 7U/N1+Syryj8Fm5tGqyGOV/UtwMvtb9+9W4aMxrfina9fW6xU8ej8OfjhdpOCSqdgfud oFfQ== X-Gm-Message-State: AOAM532ydnttM5guEHoVR6hbCtm7D5MzdjQBIG3cgKRLVNPlQE2FOfkk SuUD+pg8O7JTTAn0ZmSItDyVPujyJDvRYSAwrJqOcEQ8B3hPCw== X-Google-Smtp-Source: ABdhPJxRfrwBw3/COHLt1tCm6Ya/5zK5X34wIscfwBhJBas8kkK7TVLPgkjhDqoiLWFbqPq4W51bhwXcD3zH0xuHgWU= X-Received: by 2002:aed:2de2:: with SMTP id i89mr2261014qtd.73.1611527387226; Sun, 24 Jan 2021 14:29:47 -0800 (PST) MIME-Version: 1.0 References: <20210124041403.GB73653@troutmask.apl.washington.edu> <20210124191445.GA76809@troutmask.apl.washington.edu> In-Reply-To: From: Warner Losh Date: Sun, 24 Jan 2021 15:29:36 -0700 Message-ID: Subject: Re: Getting /usr/src to match specific git hash? To: Steve Kargl Cc: Jeffrey Bouquet , Yasuhiro Kimura , freebsd-current X-Rspamd-Queue-Id: 4DP73J495dz4hbG X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=QjhyHt7N; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::836) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-2.00 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::836:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::836:from]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::836:from]; NEURAL_HAM_SHORT(-1.00)[-1.000]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; MAILMAN_DEST(0.00)[freebsd-current]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2021 22:29:49 -0000 On Sun, Jan 24, 2021 at 3:22 PM Warner Losh wrote: > > > On Sun, Jan 24, 2021, 12:14 PM Steve Kargl < > sgk@troutmask.apl.washington.edu> wrote: > >> On Sun, Jan 24, 2021 at 09:00:45AM -0700, Warner Losh wrote: >> > On Sun, Jan 24, 2021, 6:05 AM Jeffrey Bouquet < >> jbtakk@iherebuywisely.com> >> > wrote: >> > >> > > >> > > >> > > On Sat, 23 Jan 2021 20:14:03 -0800, Steve Kargl < >> > > sgk@troutmask.apl.washington.edu> wrote: >> > > >> > > > On Sun, Jan 24, 2021 at 01:08:05PM +0900, Yasuhiro Kimura wrote: >> > > > > From: Steve Kargl >> > > > > Subject: Getting /usr/src to match specific git hash? >> > > > > Date: Sat, 23 Jan 2021 19:58:52 -0800 >> > > > > >> > > > > > Suppose one has an empty /usr/src. >> > > > > > >> > > > > > Suppose further that one had to re-install a 32-bit >> > > > > > i386-*-freebsd with the 24 Dec 2020 image available >> > > > > > from freebsd.org. >> > > > > > >> > > > > > uname -a for the booted kernel shows >> > > > > > >> > > > > > % uname -a >> > > > > > FreeBSD mobile 13.0-CURRENT FreeBSD 13.0-CURRENT #0 \ >> > > > > > 3cc0c0d66a0-c255241(main)-dirty: Thu Dec 24 05:43:23 UTC 2020 \ >> > > > > > root@releng1.nyi.freebsd.org: >> /usr/obj/usr/src/i386.i386/sys/GENERIC >> > > i386 >> > > > > > >> > > > > > How does one use git to pull the exact sources that match >> > > > > > this specifc kernel? >> > > > > >> > > > > cd /usr >> > > > > git clone https://git.freebsd.org/src.git >> > > > > cd src >> > > > > git checkout 3cc0c0d66a0 >> > > > > >> > > > >> > > > Thank you. >> > > > >> > > >> > > Can this be put in /usr/src/UPDATING with an explanation of precisely >> how >> > > each >> > > of the git commands populates or repopulated the directories in >> /usr??? >> > > >> > >> > It is in the mini primer I wrote, along with how to bisect and other >> useful >> > things. This will migrate into the handbook once the doc tree converts >> to >> > asciidoc (happening this weekend). >> > >> > https://github.com/bsdimp/freebsd-git-docs/blob/main/mini-primer.md >> > >> >> Any advice on how to jump, say, 4 days ahead of the current >> date of the src/ tree? That is, I have src/ that should >> correspond to 24 Dec 2020. How do I jump to 28 Dec 2020? >> > > You could use git bisect, but as you say, the laundry list is extensive. > > Git doesn't offer checkout by date, alas. So here's some tools to help you > out. > > First, let's get a count of how many commits behind main you are at the > moment. Use 'git log --oneline --first-parent HEAD..main | wc' to get a > count of the number of commits between what you have checked out and the > tip of current. My count is 994, but I just updated, so your count will > differ and that's OK.The --first-parent in the git log above is critical, > since otherwise a number of commits from vendor merges in the vendor > branches will appear in git log's output, throwing the count off). > > Now, this is 1 month worth of -current. 4 days in the month is about 13%. > However, let's keep things simple and step forward 100 commits at a time > (which is 10% of 1000). The precise numbers don't matter, but it works out > well in this case. > > So, your commit is: > % git log -1 3cc0c0d66a0 > Author: Li-Wen Hsu > Date: Sun Dec 20 02:59:44 2020 +0000 > > Mark the repository as being converted to Git. > > which is the last subversion commit. It's also head~994, you can do a 'git > log -1 main~900' to verify that. So, let's move forward 94 commits. This > would be: > The 'main~900' should be 'main~994' here since you are verifying main~944. Also 'head~994' was a typo for 'main~994'. Sorry for any confusion these mistakes caused. > % git log main~900 > commit 8d405efd73d3991fe1647f91a2b7c9989dd5f18f > Author: Ulrich Sprlein > Date: Wed Dec 23 22:29:34 2020 +0100 > > Fix newvers.sh to no longer print an outdated SVN rev > > which is 3 days newer and may be a good place to start: > > % git checkout main~900 > > and that will move you forward 94 commits. Do it again with main~800, etc > to find a spot that's good for you. Not as convenient as giving dates, but > once you have a count of the number of commits between where you are and > head, you can use that number to decide how far forward to go. > > You can adjust this as needed. If you don't do a git pull during this > process (and you likely shouldn't) these numbers will be stable, and a lot > easier to work with than hashes. I've found I like to move N commits rather > than N days. > > Hope this is helpful. Sadly I found no way to say HEAD+50 commits directly > in git, but maybe one of the more knowledgeable folks on this list can give > a better hint there. > > Warner > > > My past week experience with top-of-tree suggests doing >> a bisection would be frought with peril. My laptop runs >> well with 24 Dec 2020 kernel/world. Getting to top-of-tree, >> one has to deal with >> (1) infinite recursion in wpa_supplicant, >> (2) possible locking issue in UFS (30 second system freezes), >> (3) memory alignment messages from the kernel, >> (4) processes being killed with out-of-swapspace messages >> even though I have 4 GB of untouched swap space. Might >> be associated with (3). >> (5) graphic console mess >> (6) pilot-error of using -march=core2, which matches the >> processor in the laptop, to build kernel/world but >> manifests a llvm bug >> >> I would like to creep up on the issues. >> >> -- >> Steve >> >