組み込み応答ファイルを使用したカスタム Alpine Linux ISO の作成

組み込み応答ファイルを使用したカスタム Alpine Linux ISO の作成

カスタム Alpine Linux ISO にファイルを追加する方法に関するガイドやドキュメントが見つかりません。私が見つけることができる最も近いものは次のとおりです。これカスタムISOイメージ生成のAlpine Wikiページmkimage

サイレントインストールスクリプトと応答ファイルをISO経由でダウンロードするのではなく、ISOに直接保存することをお勧めします。wget

ベストアンサー1

次の例を勉強した後Alpine Linuxリポジトリそしてよく読んでくださいAPKBUILD リファレンスAPKBUILDAlpineの公式wikiから2つの静的ファイルをコピーして、自分のものを正常に作成しました。/usr/bin

# Maintainer: henriquehbr <[email protected]>
pkgname=alpine.sh
pkgver=0.1.0
pkgrel=1
pkgdesc="An answerfile and automated post-install script for Alpine Linux"
url="https://git.sr.ht/~henriquehbr/alpine.sh"
arch="all"
license="GPL-3.0-or-later"
source="answerfile post-install"
options="!check"

package() {
    installation_path="$pkgdir"/usr/bin
    mkdir -p "$installation_path"
    cp -f post-install "$installation_path"
    cp -f answerfile "$installation_path"
    chmod 755 "$installation_path"/post-install
}

answerfileスクリプトはpost-install同じディレクトリにあります。APKBUILD

.apkこれをビルドするには、次のコマンドを実行してチェックサムを生成する必要があります。

abuild checksum

次に、次のようにビルドします。

abuild -r

パッケージファイルは.apkに作成されます$HOME/packages/$USER/x86_64/$pkgname-$pkgver.apk。このパスは設定/システムによって異なる場合があります。また、x86_64ここではアーキテクチャを例として使用しています。

おすすめ記事