rpasek / usbip-wsl2-instructions

355 stars 37 forks source link

git checkout v.4.4.0 error #4

Open keides2 opened 4 years ago

keides2 commented 4 years ago

I get an error in git checkout. Would you please tell me what to do?

$ uname -r
4.4.0-17763-Microsoft
$ uname -a
Linux xxxx 4.4.0-17763-Microsoft # 379-Microsoft Wed Mar 06 19:16:00 PST 2019 x86_64 x86_64 x86_64 GNU / Linux
$ sudo git clone https://github.com/microsoft/WSL2-Linux-Kernel.git /usr/src/4.4.0-17763-Microsoft
Cloning into '/usr/src/4.4.0-17763-Microsoft' ...
remote: Enumerating objects: 6302976, done.
remote: Total 6302976 (delta 0), reused 0 (delta 0), pack-reused 6302976
Receiving objects: 100% (6302976/6302976), 1.08 GiB | 2.85 MiB / s, done.
Resolving deltas: 100% (5294448/5294448), done.
Checking out files: 100% (61777/61777), done.
$ cd /usr/src/4.4.0-17763-Microsoft
kei @ xxxx: /usr/src/4.4.0-17763-Microsoft$ls
COPYING Kbuild MAINTAINERS README block drivers include kernel net security usr
CREDITS Kconfig Makefile README-Microsoft.WSL2 certs firmware init lib samples sound virt
Documentation LICENSES Microsoft arch crypto fs ipc mm scripts tools
kei @ xxxx: /usr/src/4.4.0-17763-Microsoft$ sudo git checkout v4.4.0
error: pathspec 'v4.4.0' did not match any file (s) known to git.

Thank you,

toml12953 commented 4 years ago

Try this: git checkout 4.4.0-17763-Microsoft

That worked for me.

keides2 commented 4 years ago

Thank @toml12953 for your response.

I tried below:

kei@xxxx:/usr/src/4.4.0-17763-Microsoft$ git checkout 4.4.0-17763-Microsoft
fatal: Unable to create '/usr/src/4.4.0-17763-Microsoft/.git/index.lock': Permission denied
kei@xxxx:/usr/src/4.4.0-17763-Microsoft$ sudo git checkout 4.4.0-17763-Microsoft
[sudo] password for kei:
error: pathspec '4.4.0-17763-Microsoft' did not match any file(s) known to git.
kei@xxxx:/usr/src/4.4.0-17763-Microsoft$

Thank you,

cakira commented 3 years ago

@keides2 , a little bit late, but your problem happened because your command missed a sudo.

kei@xxxx:/usr/src/4.4.0-17763-Microsoft$ sudo git checkout 4.4.0-17763-Microsoft

My commit above solves the problem with another approach: compile the kernel under you home dir and you won't need to sudo.