{"id":3017,"date":"2021-02-23T07:14:26","date_gmt":"2021-02-22T22:14:26","guid":{"rendered":"http:\/\/matoken.org\/blog\/?p=3017"},"modified":"2021-02-23T07:15:18","modified_gmt":"2021-02-22T22:15:18","slug":"memo-of-self-building-linux-kernel-5-11","status":"publish","type":"post","link":"https:\/\/matoken.org\/blog\/2021\/02\/23\/memo-of-self-building-linux-kernel-5-11\/","title":{"rendered":"Linux Kernel 5.11 \u3092\u30bb\u30eb\u30d5\u30d3\u30eb\u30c9\u3057\u305f\u30e1\u30e2"},"content":{"rendered":"<div id=\"preamble\">\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>Linux Kernel 5.11 \u304c\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u307e\u3057\u305f\uff0e<\/p>\n<\/div>\n<div class=\"ulist\">\n<ul>\n<li><a href=\"https:\/\/lkml.org\/lkml\/2021\/2\/14\/244\">LKML: Linus Torvalds: Linux 5.11<\/a><\/li>\n<\/ul>\n<\/div>\n<div class=\"admonitionblock note\">\n<table  class=\" table table-hover\" >\n<tbody>\n<tr>\n<td class=\"icon\">\n<div class=\"title\">Note<\/div>\n<\/td>\n<td class=\"content\">\n<a href=\"https:\/\/www.fsfla.org\/pipermail\/linux-libre\/2021-February\/003417.html\">GNU Linux-libre 5.11 \u3082\u51fa\u3066\u3044\u308b :)<\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div class=\"paragraph\">\n<p><a href=\"https:\/\/kernelnewbies.org\/Linux_5.11#File_systems\">F2FS\u306e\u5727\u7e2e\u5468\u308a\u3082\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u304c\u3042\u308b\u3088\u3046<\/a>\u306a\u306e\u3067\u8a66\u3057\u3066\u307f\u305f\u304f\u306a\u308a\u307e\u3057\u305f\uff0e\u3068\u3044\u3046\u3053\u3068\u3067\u30bb\u30eb\u30d5\u30d3\u30eb\u30c9\u3057\u305f\u3089\u3053\u308c\u307e\u3067\u51fa\u306a\u304b\u3063\u305f\u30a8\u30e9\u30fc\u304c\u51fa\u305f\u306e\u3067\u30e1\u30e2\u3057\u3066\u304a\u304d\u307e\u3059\uff0e<\/p>\n<\/div>\n<div class=\"admonitionblock warning\">\n<table  class=\" table table-hover\" >\n<tbody>\n<tr>\n<td class=\"icon\">\n<div class=\"title\">Warning<\/div>\n<\/td>\n<td class=\"content\">\nDebian sid amd64\u306e <code>5.10.0-3-amd64<\/code> \u74b0\u5883\u3067\u30d3\u30eb\u30c9\u3057\u307e\u3057\u305f\uff0eLinux 5.9\u306f\u30d3\u30eb\u30c9\u3057\u305f\u3053\u3068\u304c\u3042\u308b\u3051\u308c\u3069\uff0cLinux 5.10\u306f\u30d3\u30eb\u30c9\u3057\u305f\u3053\u3068\u306e\u306a\u3044\u74b0\u5883\u3067\u3059\uff0e<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_linux_5_11_build\u6642\u306b\u30a8\u30e9\u30fc_btf_tmp_vmlinux_btf_pahole_pahole_is_not_available\">Linux 5.11 build\u6642\u306b\u30a8\u30e9\u30fc( <code>BTF: .tmp_vmlinux.btf: pahole (pahole) is not available<\/code> )<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-shell\" data-lang=\"shell\">$ make -j`nproc` bindeb-pkg\n\u301c\u7701\u7565\u301c\nBTF: .tmp_vmlinux.btf: pahole (pahole) is not available\nFailed to generate BTF for vmlinux\nTry to disable CONFIG_DEBUG_INFO_BTF\n\u301c\u7701\u7565\u301c\n$ grep CONFIG_DEBUG_INFO_BTF .\/.config\nCONFIG_DEBUG_INFO_BTF=y<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p><code>CONFIG_DEBUG_INFO_BTF<\/code> \u3092\u7121\u52b9\u306b\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u304c\uff0c <code>dwarves<\/code> \u30d1\u30c3\u30b1\u30fc\u30b8\u3067DWARF utilities\u3092\u5c0e\u5165\u3059\u308b\u3068\u3053\u3067\u89e3\u6c7a\u3057\u307e\u3057\u305f\uff0e<\/p>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-shell\" data-lang=\"shell\">$ sudo apt install dwarves<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"paragraph\">\n<p>\u305d\u306e\u4ed6\uff0cDKMS\u3067\u306eVirtualBox module\u306e\u30d3\u30eb\u30c9\u3082\u5931\u6557\u3057\u307e\u3057\u305f\uff0e\u3053\u308c\u306fVirtualBox\u306e\u5bfe\u5fdc\u5f85\u3061\u304b\u306a\u3068\u601d\u3044\u307e\u3059\uff0e<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\uff0c\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u611f\u3058\u3067\u5927\u4e08\u592b\u305d\u3046\u3067\u3059\uff0e<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_linux_5_11\u306e\u30d3\u30eb\u30c9\">Linux 5.11\u306e\u30d3\u30eb\u30c9<\/h2>\n<div class=\"sectionbody\">\n<div class=\"listingblock\">\n<div class=\"title\">\u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u5c0e\u5165<\/div>\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-shell\" data-lang=\"shell\">$ sudo apt install build-essential linux-source bc kmod cpio flex libncurses5-dev libelf-dev libssl-dev dwarves<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"title\">\u30bd\u30fc\u30b9\u306e\u5165\u624b\uff0c\u78ba\u8a8d\u3068\u5c55\u958b<\/div>\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-shell\" data-lang=\"shell\">$ wget https:\/\/cdn.kernel.org\/pub\/linux\/kernel\/v5.x\/linux-5.11.tar.xz \\\nhttps:\/\/cdn.kernel.org\/pub\/linux\/kernel\/v5.x\/linux-5.11.tar.sign <b class=\"conum\">(1)<\/b>\n$ unxz .\/linux-5.11.tar.xz <b class=\"conum\">(2)<\/b>\n$ gpg --verify .\/linux-5.11.tar.sign <b class=\"conum\">(3)<\/b>\ngpg: assuming signed data in '.\/linux-5.11.tar'\ngpg: Signature made Mon 15 Feb 2021 06:11:32 PM JST\ngpg:                using RSA key 647F28654894E3BD457199BE38DBBDC86092693E\ngpg: Good signature from \"Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;\" [unknown]\ngpg:                 aka \"Greg Kroah-Hartman (Linux kernel stable release signing key) &lt;greg@kroah.com&gt;\" [undefined]\ngpg:                 aka \"Greg Kroah-Hartman &lt;gregkh@kernel.org&gt;\" [unknown]\ngpg: WARNING: This key is not certified with a trusted signature!\ngpg:          There is no indication that the signature belongs to the owner.\nPrimary key fingerprint: 647F 2865 4894 E3BD 4571  99BE 38DB BDC8 6092 693E\n$ tar tvf .\/linux-5.11.tar | lv <b class=\"conum\">(4)<\/b>\n$ tar xf .\/linux-5.11.tar <b class=\"conum\">(5)<\/b>\n$ cd linux-5.11<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"colist arabic\">\n<ol>\n<li>source\u3068\u7f72\u540d\u3092\u5165\u624b<\/li>\n<li>\u89e3\u51cd<\/li>\n<li>\u7f72\u540d\u78ba\u8a8d(\u7f72\u540d\u306f<a href=\"https:\/\/www.kernel.org\/category\/signatures.html\">\u3053\u3061\u3089<\/a>\u3067\u78ba\u8a8d)<\/li>\n<li>\u30a2\u30fc\u30ab\u30a4\u30d6\u78ba\u8a8d<\/li>\n<li>\u30a2\u30fc\u30ab\u30a4\u30d6\u5c55\u958b<\/li>\n<\/ol>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"title\">config\u30d5\u30a1\u30a4\u30eb\u306e\u7528\u610f\u3068\u30d3\u30eb\u30c9<\/div>\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-shell\" data-lang=\"shell\">$ cp \/boot\/config-`uname -r` .\/.config <b class=\"conum\">(1)<\/b>\n$ yes \"\" | make oldconfig <b class=\"conum\">(2)<\/b>\n$ tar xf ..\/linux_5.10.9-1.debian.tar.xz debian\/certs\/ <b class=\"conum\">(3)<\/b>\n$ time make -j`nproc` bindeb-pkg <b class=\"conum\">(4)<\/b>\n  :\ndpkg-deb: building package 'linux-libc-dev' in '..\/linux-libc-dev_5.11.0-1_amd64.deb'.\ndpkg-deb: building package 'linux-image-5.11.0' in '..\/linux-image-5.11.0_5.11.0-1_amd64.deb'.\ndpkg-deb: building package 'linux-image-5.11.0-dbg' in '..\/linux-image-5.11.0-dbg_5.11.0-1_amd64.deb'.\n dpkg-genbuildinfo --build=binary\n dpkg-genchanges --build=binary &gt;..\/linux-5.11.0_5.11.0-1_amd64.changes\ndpkg-genchanges: info: binary-only upload (no source code included)\n dpkg-source --after-build .\ndpkg-buildpackage: info: binary-only upload (no source included)\n$ ls -1s ..\/linux*.deb <b class=\"conum\">(5)<\/b>\n  7932 ..\/linux-headers-5.11.0_5.11.0-1_amd64.deb\n728724 ..\/linux-image-5.11.0-dbg_5.11.0-1_amd64.deb\n 52136 ..\/linux-image-5.11.0_5.11.0-1_amd64.deb\n  1124 ..\/linux-libc-dev_5.11.0-1_amd64.deb\n$ sudo apt install ..\/linux-image-5.11.0_5.11.0-1_amd64.deb ..\/linux-libc-dev_5.11.0-1_amd64.deb ..\/linux-headers-5.11.0_5.11.0-1_amd64.deb <b class=\"conum\">(6)<\/b><\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"colist arabic\">\n<ol>\n<li>\u73fe\u5728\u306ekernel config\u3092\u30b3\u30d4\u30fc\u3059\u308b<\/li>\n<li>\u65b0\u3057\u3044\u8a2d\u5b9a\u3092\u65e2\u5b9a\u5024\u3067\u8a2d\u5b9a<\/li>\n<li>Debian\u306ekernel source\u304b\u3089\u8a3c\u660e\u66f8\u3092\u30b3\u30d4\u30fc(\u82e5\u3057\u304f\u306f <code>CONFIG_SYSTEM_TRUSTED_KEYS=\"\"<\/code> \u3059\u308b)<\/li>\n<li>cpu\u6570\u3092\u6307\u5b9a\u3057\u3066\u30d3\u30eb\u30c9\u958b\u59cb<\/li>\n<li>\u51fa\u6765\u4e0a\u304c\u3063\u305f\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u78ba\u8a8d<\/li>\n<li>\u51fa\u6765\u4e0a\u304c\u3063\u305f\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u5c0e\u5165<\/li>\n<\/ol>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"title\">Machine Owner Key(MOK)\u3067\u7f72\u540d\u3059\u308b(\u30bb\u30ad\u30e5\u30a2\u30d6\u30fc\u30c8\u3092\u6709\u52b9\u306b\u3057\u3066\u3044\u308b\u5834\u5408\u306b\u306e\u307f\u5fc5\u8981\u306a\u51e6\u7406)<\/div>\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-shell\" data-lang=\"shell\">$ sudo sbsign --key ~\/MOK.priv --cert ~\/MOK.pem \/boot\/vmlinuz-5.11.0 --output vmlinuz-5.11.0 <b class=\"conum\">(1)<\/b>\n$ sudo mv .\/vmlinuz-5.11.0 \/boot\/vmlinuz-5.11.0\n$ find \/lib\/modules\/5.11.0\/updates\/dkms\/ -type f | xargs -n1 sudo .\/scripts\/sign-file sha256 ~\/MOK.priv ~\/MOK.der <b class=\"conum\">(2)<\/b><\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"colist arabic\">\n<ol>\n<li>kernel\u306b\u7f72\u540d<\/li>\n<li>DKMS\u3067\u4f5c\u6210\u3057\u305fmodule\u306b\u7f72\u540d<\/li>\n<\/ol>\n<\/div>\n<div class=\"paragraph\">\n<p>\u3053\u306e\u3042\u305f\u308a\u306e\u51e6\u7406\u306f\u81ea\u52d5\u5316\u3067\u304d\u308b\u3068\u601d\u3046\u3093\u3060\u3051\u3069\u672a\u78ba\u8a8d\uff0e<br \/>\nMOK\u306e\u4f5c\u6210\u3084\uff0c\u30bb\u30ad\u30e5\u30a2\u30d6\u30fc\u30c8\u306b\u3064\u3044\u3066\u306f\u4ee5\u4e0b\u306e\u30da\u30fc\u30b8\u304c\u53c2\u8003\u306b\u306a\u308b\uff0e<\/p>\n<\/div>\n<div class=\"ulist\">\n<ul>\n<li><a href=\"https:\/\/wiki.debian.org\/SecureBoot\">SecureBoot &#8211; Debian Wiki<\/a><\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"_\u74b0\u5883\">\u74b0\u5883<\/h2>\n<div class=\"sectionbody\">\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-shell\" data-lang=\"shell\">$ dpkg-query -W build-essential linux-source bc kmod cpio flex libncurses5-dev libelf-dev libssl-dev dwarves sbsign\ntool\nbc      1.07.1-2+b2\nbuild-essential 12.9\ncpio    2.13+dfsg-4\ndwarves 1.20-1\nflex    2.6.4-8\nkmod    28-1\nlibelf-dev:amd64        0.183-1\nlibncurses5-dev:amd64   6.2+20201114-2\nlibssl-dev:amd64        1.1.1j-1\nlinux-source    5.10.13-1\nsbsigntool      0.9.2-2\n$ lsb_release -dr\nDescription:    Debian GNU\/Linux bullseye\/sid\nRelease:        unstable\n$ uname -mr\n5.10.0-3-amd64 x86_64<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"listingblock\">\n<div class=\"title\">\u518d\u8d77\u52d5\u5f8c<\/div>\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-shell\" data-lang=\"shell\">$ uname -mr\n5.11.0 x86_64<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Linux Kernel 5.11 \u304c\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u307e\u3057\u305f\uff0e LKML: Linus Torvalds: Linux 5.11 Note GNU Linux-libre 5.11 \u3082\u51fa\u3066\u3044\u308b :) F2FS\u306e\u5727\u7e2e\u5468\u308a\u3082\u30a2\u30c3 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"webmentions_disabled_pings":false,"webmentions_disabled":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[7,6,199],"tags":[599,275],"class_list":["post-3017","post","type-post","status-publish","format-standard","hentry","category-debian-linux","category-linux","category-sid","tag-kernel","tag-linux"],"_links":{"self":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/3017","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/comments?post=3017"}],"version-history":[{"count":0,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/posts\/3017\/revisions"}],"wp:attachment":[{"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/media?parent=3017"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/categories?post=3017"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/matoken.org\/blog\/wp-json\/wp\/v2\/tags?post=3017"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}