Debian Live に挑戦してみる。
簡単、簡単と思ったけれどもいろいろエラーが出たのでいろいろトライした記録。
資料
公式
https://live-team.pages.debian.net/live-manual/
環境
- 母艦 Debian 12 Testing
- 作業アカウント root
今回は安直に root で作業することにしました。
事前準備
# apt-get install live-build
もしかしたら live-boot もいるかも?
以前は live-helper となってましたが変わっているみたいですね。
# mkdir livemake
# cd livemake
設定のコピー
既存のサンプルからコピーして使ってみることにします。
# mkdir auto
# cp -a /usr/share/doc/live-build/examples/auto .
auto/config は以下のようになってました。
#!/bin/sh
set -e
lb config noauto \
"${@}"
ビルドとエラー
ここからは lb コマンドを使うようです。
# lb
E: Missing sub-command
live-build - Utility to build live systems
Usage:
lb {clean|config|build}
lb [-h|--help]
lb [-u|--usage]
lb [-v|--version]
Try "lb --help" for more information.
build してみます。
# lb config
# lb build
エラーが出た
[2024-06-30 08:42:35] lb chroot_install-packages install
P: Begin installing packages (install pass)...
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package firmware-linux is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'firmware-linux' has no installation candidate
E: An unexpected failure occurred, exiting...
P: Begin unmounting filesystems...
P: Saving caches...
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
エラーと解決
auto/config を以下のようにして non-free なファームウェアを利用できるようにする。
#!/bin/sh
set -e
lb config noauto \
--archive-areas "main contrib non-free non-free-firmware" \
"${@}"
再度
# lb build
iso ファイルができる。
# ls -alh
total 269M
drwxr-xr-x 9 nanbuwks nanbuwks 4.0K Jun 30 10:38 .
drwxr-xr-x 3 nanbuwks nanbuwks 4.0K Jun 30 08:30 ..
drwxr-xr-x 2 nanbuwks nanbuwks 4.0K Jun 30 10:38 .build
drwxr-xr-x 2 root root 4.0K Jun 30 10:33 auto
drwxr-xr-x 7 root root 4.0K Jun 30 10:35 binary
-rw-r--r-- 1 root root 933 Jun 30 10:38 binary.modified_timestamps
-rw-r--r-- 1 root root 68K Jun 30 10:38 build.log
drwxr-xr-x 7 root root 4.0K Jun 30 10:12 cache
drwxr-xr-x 17 root root 4.0K Jun 30 10:38 chroot
-rw-r--r-- 1 root root 1.1M Jun 30 10:35 chroot.files
-rw-r--r-- 1 root root 5.0K Jun 30 10:35 chroot.packages.install
-rw-r--r-- 1 root root 5.0K Jun 30 10:35 chroot.packages.live
drwxr-xr-x 20 nanbuwks nanbuwks 4.0K Jun 30 10:35 config
-rw-r--r-- 1 root root 18K Jun 30 10:38 live-image-amd64.contents
-rw-r--r-- 1 root root 1.1M Jun 30 10:35 live-image-amd64.files
-rw-r--r-- 1 root root 265M Jun 30 10:35 live-image-amd64.hybrid.iso
-rw-r--r-- 1 root root 928K Jun 30 10:38 live-image-amd64.hybrid.iso.zsync
-rw-r--r-- 1 root root 5.0K Jun 30 10:35 live-image-amd64.packages
drwxr-xr-x 3 nanbuwks nanbuwks 4.0K Jun 30 08:34 local
起動してみる
これを使って起動してみました。
CUIの画面です。一応 Live システムを通して作ることができました。
これからいろいろとインストールしていきます。
トラブルシューティング
とにかくわけのわからないエラーが起こりまくる印象。
同じコンフィグレーションはずなのに通ったり通らなかったり作った iso サイズが一致しなかったり。
時間はかかるけれども
# lb clean
する習慣を付けたほうがいいかも。
firmware-linux エラー
記事の本文の内容の適用でいったんは動きましたが、 lb clean 後エラーが再発し、上記を改めて行ってもうまくいかなくなりました。
以下のようにして対処。
https://github.com/tjcw/screensavers/blob/bookworm/patches/ を見て、
/usr/lib/live/build/chroot_firmware
の以下をコメントアウト
# Manually add firmware-linux meta package if available
if [ $(apt-cache show "^firmware-linux$" 2> /dev/null | grep "^Package:" | wc -l) -eq 1 ]
then
FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} firmware-linux"
fi
/usr/lib/live/build/installer_debian-installer
の以下の箇所をコメントアウト
# Manually add firmware-linux meta package if available
if [ $(apt-cache show "^firmware-linux$" 2> /dev/null | grep "^Package:" | wc -l) -eq 1 ]
then
FIRMWARE_PACKAGES="${FIRMWARE_PACKAGES} firmware-linux"
fi
このあと
# lb clean
# lb config
します。
vmlinux や initrd が無いエラー
以下のように解決したけれど、多分コンフィグレーションを見直した方がいいやつ。
P: Begin install linux-image...
cp: cannot stat 'chroot/boot/vmlinuz-*': No such file or directory
E: An unexpected failure occurred, exiting...
P: Begin unmounting filesystems...
P: Saving caches...
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
うーん? よくわからないけどこうしてみました。
# chroot chroot
# ls boot
# apt-get install linux-image-amd64
# ls boot
System.map-5.10.0-30-amd64 config-5.10.0-30-amd64 initrd.img-5.10.0-30-amd64 vmlinuz-5.10.0-30-amd64
# exit
後で試したらこれでもいいかな?
# cp /boot/vmlinuz-* chroot/boot/
# cp /boot/initrd.img chroot/boot/
live-build ツールのインストール
# apt install live-build
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
libcairo-gobject2 : Depends: libcairo2 (= 1.18.0-3+b1) but 1.16.0-7 is to be installed
Depends: libglib2.0-0t64 (>= 2.68.0) but it is not installable
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
と出たので
# apt --fix--broken install
とすると X がクラッシュして GUI が動かなくなった。
これは Stageing で動かしていたためで、Debian Live をつくるには Testing でないとダメなようだ。