{"id":749,"date":"2021-07-31T12:15:38","date_gmt":"2021-07-31T11:15:38","guid":{"rendered":"https:\/\/tollana.d-tor.org\/notes-to-self\/?p=749"},"modified":"2021-07-31T12:15:38","modified_gmt":"2021-07-31T11:15:38","slug":"custom-kernel-build","status":"publish","type":"post","link":"https:\/\/tollana.d-tor.org\/notes-to-self\/?p=749","title":{"rendered":"Custom kernel build"},"content":{"rendered":"\n<p>Turns out that building a custom kernel for ArchLinux isn&#8217;t as easy as it seems. Just changing $pkgver in the official PKGBUILD doesn&#8217;t work, because it doesn&#8217;t fetch the sources from the official git tree, but from a clone on github. Here&#8217;s how to do it as of 2021-07-31:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Change pkgbase to e.g. linux-ryzen<\/li><li>Change pkgver to the version you want to compile<\/li><\/ol>\n\n\n\n<p>Then change the sources array to:<\/p>\n\n\n\n<p><code>\"$_srcname::git+https:\/\/git.kernel.org\/pub\/scm\/linux\/kernel\/git\/stable\/linux.git#tag=v${pkgver}\"<\/code><\/p>\n\n\n\n<p>This will clone the stable source tree HEAD. To checkout a specific version, add the following to prepare() after cd $_srcname:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>echo \"Checking out $_srctag\"\ngit checkout \"v${pkgver}\"<\/code><\/pre>\n\n\n\n<p>If you want to save some time, remove make htmldocs from build() and the equivalent from pkgname() at the bottom.<\/p>\n\n\n\n<p>Share and enjoy!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Turns out that building a custom kernel for ArchLinux isn&#8217;t as easy as it seems. Just changing $pkgver in the official PKGBUILD doesn&#8217;t work, because it doesn&#8217;t fetch the sources from the official git tree, but from a clone on github. Here&#8217;s how to do it as of 2021-07-31: Change pkgbase to e.g. linux-ryzen Change &hellip; <a href=\"https:\/\/tollana.d-tor.org\/notes-to-self\/?p=749\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Custom kernel build<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[127,105],"class_list":["post-749","post","type-post","status-publish","format-standard","hentry","category-arch-linux","tag-kernel","tag-ryzen"],"_links":{"self":[{"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=\/wp\/v2\/posts\/749","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=749"}],"version-history":[{"count":1,"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=\/wp\/v2\/posts\/749\/revisions"}],"predecessor-version":[{"id":750,"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=\/wp\/v2\/posts\/749\/revisions\/750"}],"wp:attachment":[{"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=749"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=749"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tollana.d-tor.org\/notes-to-self\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=749"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}