From owner-freebsd-current@freebsd.org Sun Jan 24 22:22:32 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 0C10E4DD264 for ; Sun, 24 Jan 2021 22:22:32 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x732.google.com (mail-qk1-x732.google.com [IPv6:2607:f8b0:4864:20::732]) (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 4DP6tt6YvVz4h6r for ; Sun, 24 Jan 2021 22:22:30 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x732.google.com with SMTP id c7so10859665qke.1 for ; Sun, 24 Jan 2021 14:22:30 -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=EamgXS7pSzaVWCU0Eb6CxqyNr37qSi/B8bychqJlFnY=; b=KXDajwqdx2aNrlUmXGFt2IHg1NJZwzU9Z8VFl9qP2eI4X7wEbZGxVY8Hl1zMpILksd 4vKepYo6xBLUS2L8cAFgbRUvmW8KMugygdrqieFeRoL1vn0dM9SDnurCIbytdKZw0Yhw R3z47sh/wlScxfrgEbSkjsi1lGGXIxe0yKwxg5r6zs3VdheZb8z84H6A9lOkBaiCo3L6 RPTauCFF8ttlU0RsFE4L8yLrdxCWjdR7b8QAcRHAycM1FteVtxPeWVKc5Sl2n/foLmxf aU1dnu+azH05D6nS5l9UPQ4xnVwD6vYAH2tRbZEk1c6WqAf6fZRJYUw3PvxO29HOfCBZ 4erQ== 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=EamgXS7pSzaVWCU0Eb6CxqyNr37qSi/B8bychqJlFnY=; b=pmTCf9bVXLTIl5FzSZ/O3AL2zPhnsJivRrxFM93SR7OQANrLmuteYfLW71Riyz13uH rkjDtrYzaZOGg/yDx/8XsxydSlYqJyD4eV6OjVSHe0YdsAzg2eI/9XIcAc1gvtDKfm6k 17VZEY33lI10Fe1n8xwdPflObZ6UmsIXtWEvMb9fOLe0BqJ7p3tkJArtWfkQKEeejgFv I1/7Bo83KxZWZSW25vqhCnn0dblmHFdZpryae21ACeTA5PnoMhgTWIi7hntFJt4epKiv 4XVY8fSHfitfY7XT4hkSW8xBui/wWbz0jeJgMHaWkG72KG0MQ1CYw9ymjvAimvdP44FR uwJg== X-Gm-Message-State: AOAM5312S6fdcmQVAibY6xKO7T25cykC1RZrRGznilASF5416ejXFcrt ArfLmfltTw5l8TNwQfWwaBtNuWmR2GkOE1QIpmcvtx/KAJaHQ+bW X-Google-Smtp-Source: ABdhPJzG61Pdq1MAmb6WcjGrh6ZhJ6/TSlRWfkR4gtgtPx4YXl6fZdykG1toHSZFPRHtsak9bONkXufh8Rtxcd3RHTY= X-Received: by 2002:a37:a34f:: with SMTP id m76mr2796415qke.89.1611526949645; Sun, 24 Jan 2021 14:22:29 -0800 (PST) MIME-Version: 1.0 References: <20210124041403.GB73653@troutmask.apl.washington.edu> <20210124191445.GA76809@troutmask.apl.washington.edu> In-Reply-To: <20210124191445.GA76809@troutmask.apl.washington.edu> From: Warner Losh Date: Sun, 24 Jan 2021 15:22:18 -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: 4DP6tt6YvVz4h6r X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=KXDajwqd; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::732) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-2.00 / 15.00]; RCVD_TLS_ALL(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::732:from]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; 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::732: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:+]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::732:from]; 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)[]; RCVD_COUNT_TWO(0.00)[2]; 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] 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:22:32 -0000 On Sun, Jan 24, 2021, 12:14 PM Steve Kargl wrote: > On Sun, Jan 24, 2021 at 09:00:45AM -0700, Warner Losh wrote: > > On Sun, Jan 24, 2021, 6:05 AM Jeffrey Bouquet > > > 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: % 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 >