(gunzipとcpio)を使用してカーネルファイルを解凍し、一部のファイルを上書きし、すべてを再圧縮して作成されたファイルは起動しません。

(gunzipとcpio)を使用してカーネルファイルを解凍し、一部のファイルを上書きし、すべてを再圧縮して作成されたファイルは起動しません。

タイトルが示すように、私はgunzipとcpioを使ってカーネルファイルを解凍し(最初のファイルはinitrd.img-5.10.0-18-amd64.gzと仮定します)、いくつかのファイルを上書きしてすべてを再パッケージ化しようとしています。問題は、生成された新しいカーネルファイルが起動できないことです。誰かが私が理由を理解するのを助けることができますか?サイズも違います。私がやりたいことは、Ubuntu 22.04のCUBICをホストOSとして使用し、Debian 11を次のように使用して新しいプロファイル、ロゴ、およびイメージセットでDebian 11 ISOイメージをカスタマイズしようとしたときにinitrd.img *ファイルの内容を変更するです。 CUBICの「訪問者」。私が下したコマンドは次のとおりです。

mkdir /home/ziomario/Scrivania/PassT-Cubic/kernels
mkdir /home/ziomario/Scrivania/PassT-Cubic/kernels/unzipped
mkdir /home/ziomario/Scrivania/PassT-Cubic/kernels/unzipped/initrd.img-5.10.0-18-amd64

cd /home/ziomario/Scrivania/PassT-Cubic/kernels/

gunzip -k initrd.img-5.10.0-18-amd64.gz

mkdir /home/ziomario/Scrivania/PassT-Cubic/kernels/unzipped/initrd.img-5.10.0-18-amd64

cpio -idv < initrd.img-5.10.0-18-amd64 -D /home/ziomario/Scrivania/PassT-Cubic/kernels/unzipped/initrd.img-5.10.0-18-amd64


mkdir -p usr/share/plymouth/
mkdir -p usr/share/plymouth/themes/homeworld/

cp /usr/share/plymouth/debian-logo.png usr/share/plymouth/

cp /usr/share/plymouth/themes/homeworld/debian.png usr/share/plymouth/themes/homeworld/

cp /usr/share/plymouth/themes/homeworld/logo.png usr/share/plymouth/themes/homeworld/


cp usr/share/plymouth/debian-logo.png /home/ziomario/Scrivania/PassT-Cubic/kernels/unzipped/initrd.img-5.10.0-18-amd64/usr/share/plymouth/

cp usr/share/plymouth/themes/homeworld/debian.png /home/ziomario/Scrivania/PassT-Cubic/kernels/unzipped/initrd.img-5.10.0-18-amd64/usr/share/plymouth/themes/homeworld

cp usr/share/plymouth/themes/homeworld/logo.png /home/ziomario/Scrivania/PassT-Cubic/kernels/unzipped/initrd.img-5.10.0-18-amd64/usr/share/plymouth/themes/homeworld

cd /home/ziomario/Scrivania/PassT-Cubic/kernels/unzipped/initrd.img-5.10.0-18-amd64

find . -print -depth | cpio -o > ../../initrd.img-5.10.0-18-amd64

find: warning: you have specified the global option -depth after the  argument
-print, but global options are not positional, i.e., -depth  affects tests
specified before it as well as those specified after it.   Please specify global
options before other arguments.

893621 blocks

cd ../..

gzip initrd.img-5.10.0-18-amd64

CUBICを使用して新しいISOイメージを「焼いて」起動するデフォルトのカーネルを選択した後、結果のカーネルファイルが起動できないことがわかりました。実際には、オリジナルよりもサイズが大きいです。仮想マシンで起動しようとしたときに報告されたエラーは次のとおりです。

https://ibb.co/rm5WRSz

理由はわかりません。カーネルファイルの中では、すべてが大丈夫に見えます。 Googleドライブに間違ったファイルを入れました。たぶんあなたの隣で試してみたいですか?非常に便利なサポートに感謝します。

https://drive.google.com/drive/folders/16z5INJTSB3YcpzE980q9eqRIRVG02-JH?usp=sharing

とにかく報告されたエラーは次のとおりです。https://ibb.co/rm5WRSz

ベストアンサー1

解決策は次のとおりです。

find . -depth | cpio --create --format='newc' > ../../initrd.img-5.10.0-19-amd64

おすすめ記事