0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Manjaro Linux kernel build

Last updated at Posted at 2021-10-23

kernelパッケージを自分でビルドする場合
linux-5.14.16に更新した時のメモ

makepkgのオプション調整

# /etc/makepkg.conf
# 並列コンパイル。数字は環境に応じて適宜調整。
MAKEFLAGS="-j3"
# ビルド時間短縮。ccacheを有効にする。複数マシンがあれば分散コンパイルdistccも活用できる。
BUILDENV=(!distcc color ccache check !sign)

manjaroがリリースしているkernelパッケージのPKGBUILDなどを取得

# PKGBUILDファイルやパッチファイルを取得
git clone --single-branch --depth=1 https://gitlab.manjaro.org/packages/core/linux514.git

パッケージのビルド。
makepkg -sでビルドに必要なパッケージのインストールも行ってくれる。

# kernelパッケージのビルド
cd linux514
makepkg -s
sudo renice -n -20 -g `ps -g -o pid,pgid,comm| grep makepkg | awk '{print $2}'`

自分で調整したい場合。
PKGBUILD内で、make menuconfigのオプション調整を行えそう。
私は標準設定で問題ないので試していませんが、調整するとしたら、次の箇所を修正すると良いと思います。
make configの行をmake oldconfig、make menuconfigで置き換えます。
makepkgコマンド実行中に、カーネルオプションの設定画面が表示されるので、自分でオプションを調整できるので、それが反映されると思います。

diff --git a/PKGBUILD b/PKGBUILD
index 06ba6bd..8bd1039 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -132,7 +132,8 @@ prepare() {
   make prepare
 
   msg "rewrite configuration"
-  yes "" | make config >/dev/null
+  make oldconfig
+  make menuconfig
 }
 
 build() {

linux514のアップグレード

# lsでファイル名補完を利用して、pacmanにファイル名を渡しています。
sudo pacman -U linux514-headers-5.14.16-1-x86_64.pkg.tar.zst
sudo pacman -U linux514-5.14.16-1-x86_64.pkg.tar.zst

memo
署名が必要な場合、自作パッケージのインストール用に、自分の鍵を信用できる鍵として登録しておく。

sudo pacman-key --send-key keyid
sudo pacman-key --recv-key keyid
sudo pacman-key --lsign-key keyid

Manjaroのカーネルパッケージを利用して、インストールする場合、Manjaro Setting Managerか、コマンドラインで導入できます。

mhwd-kernel -l
sudo mhwd-kernel -i linux514

Manjaroの主な特徴、概略や便利な機能は、次のサイトで確認できます。
https://wiki.manjaro.org/index.php/Manjaro:A_Different_Kind_of_Beast

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?