Ask Your Question

Not able to build a fedora kernel

asked 2015-07-29 12:54:44 +0000

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.


I want build a fedora kernel. For this I used the steps described in https://fedoraproject.org/wiki/Buildi... . But it failed when I executed "git checkout origin/f22". The command "fedpkg clone -a kernel" was successful. I think command "fedpkg clone kernel " is not required as I tried to check out the code as anonymous user.

The following is the error: [kanda@localhost kernel]$ git checkout origin/f22 Note: checking out 'origin/f22'.

You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example:

git checkout -b new_branch_name

HEAD is now at 61b3efd... - CVE-2015-3290 CVE-2015-3291 NMI issues (rhbz 1243465 1245927) [kanda@localhost kernel]$

Any idea on how to resolve the issue?

Regards, Kanda

edit retag flag offensive close merge delete


Everything you've posted looks all right, so far … what is the error?

BRPocock ( 2015-07-29 16:16:06 +0000 )edit

Hi BRPocock, Thanks for looking into this issue. If there is nothing wrong in command "git checkout origin/f22" output, I expected "fedpkg local" command to build kernel. But it has thrown error as follows:

[kanda@localhost kernel]$ fedpkg local Could not execute local: Repo in inconsistent state: HEAD is a detached symbolic reference as it points to '359ba4a5a5d81afae63c91ddc2661772966442ee'

I am new to fedora and also for kernel build. So I am sure I might be missing somthing. Any help is a big help.

Regards, Kanda

kandasamy ( 2015-07-30 03:32:04 +0000 )edit

1 answer

Sort by » oldest newest most voted

answered 2015-07-30 07:19:39 +0000

geforce gravatar image

updated 2015-07-30 07:32:30 +0000

Try using the local branch name instead.

Use this command to switch branches

fedpkg switch-branch f22


git checkout f22

then try creating your branch

git checkout -b new_branch_name

It works here ok

$ git checkout master 
Switched to branch 'master'
Your branch is behind 'origin/master' by 8 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)
[leigh@pc-main kernel]$ git pull
Updating 45a3161..b6e2727
 ...rt-ACPI-video-change-acpi-video-brightnes.patch | 42 -----------
 kdbus.patch                                        | 87 ++++++++++++++++++++++
 kernel.spec                                        | 23 ++++--
 sources                                            |  4 +-
 4 files changed, 107 insertions(+), 49 deletions(-)
 delete mode 100644 Revert-Revert-ACPI-video-change-acpi-video-brightnes.patch
[leigh@pc-main kernel]$ git checkout f22
Switched to branch 'f22'
Your branch is up-to-date with 'origin/f22'.
[leigh@pc-main kernel]$ git checkout -b leigh_f22
Switched to a new branch 'leigh_f22'
[leigh@pc-main kernel]$ fedpkg --dist f22 local

Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.3advzJ
+ umask 022
+ cd /home/leigh/Desktop/kernel
+ patch_command='patch -p1 -F1 -s'
edit flag offensive delete link more


Hi Leigh,

It is working.

Thanks a lot, Kanda

kandasamy ( 2015-07-31 05:48:24 +0000 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Use your votes!

  • Use the 30 daily voting points that you get!
  • Up-vote well framed questions that provide enough information to enable people provide answers.
  • Thank your helpers by up-voting their comments and answers. If a question you asked has been answered, accept the best answer by clicking on the checkbox on the left side of the answer.
  • Down-voting might cost you karma, but you should consider doing so for incorrect or clearly detrimental questions and answers.

Question Tools

1 follower


Asked: 2015-07-29 12:54:44 +0000

Seen: 889 times

Last updated: Jul 30 '15