OSDN Git Service

[Update]: Compatible with build on Docker
authorYang Niao <yangniao23@gmail.com>
Wed, 12 Feb 2020 09:06:20 +0000 (18:06 +0900)
committerYang Niao <yangniao23@gmail.com>
Wed, 12 Feb 2020 09:06:20 +0000 (18:06 +0900)
.gitignore
Dockerfile [new file with mode: 0644]
README.md
docker-build.sh [new file with mode: 0755]
mkinitcpio/archiso/mkinitcpio-plymouth.conf
mkinitcpio/archiso/mkinitcpio.conf

index b739055..de27a40 100644 (file)
@@ -11,3 +11,4 @@
 
 pkg/
 src/
+out/
diff --git a/Dockerfile b/Dockerfile
new file mode 100644 (file)
index 0000000..67b4459
--- /dev/null
@@ -0,0 +1,8 @@
+FROM archlinux:latest
+RUN echo 'Server = https://mirrors.cat.net/archlinux/$repo/os/$arch' > /etc/pacman.d/mirrorlist
+RUN pacman -Syyu --noconfirm
+RUN pacman -S git archiso arch-install-scripts --noconfirm
+RUN git clone https://github.com/SereneTeam/alterlinux.git alterlinux/
+WORKDIR /alterlinux
+RUN git checkout dev
+CMD ["./build.sh", "-c", "zstd"]
index afbc5b0..5e45370 100644 (file)
--- a/README.md
+++ b/README.md
@@ -30,7 +30,16 @@ AURに無いソフトウェアのソースコードは以下にあります。
 
 
 ## ビルド
-ArchLinux環境でビルドする必要があります。  
+dockerがインストール済みのLinux環境で行ってください。
+
+```bash
+git clone https://github.com/SereneTeam/alterlinux.git
+cd alterlinux
+sudo ./docker-build.sh
+```
+
+以下は実機でビルドを行う場合の手順です。
+ArchLinux環境でビルドする必要があります。
 事前に`archiso`パッケージをインストールしておいてください。
 
 ```bash
@@ -41,25 +50,29 @@ cd alterlinux
 
 ### build.shのオプション
 
+#### Dockerでビルドする場合
+DockerfileのCMD欄を書き換えることでオプションが選べます。
+
 #### 基本
 そのまま実行してください。デフォルトパスワードは`alter`です。Plymouthは無効化されています。
 
 #### オプション
 - Plymouthを有効化する : `-b`
 - パスワードを変更する : `-p <password>`
+- squashfsの圧縮方式  : `-c <gzip, xz, zstd>(option)`
 
-例 : Plymouthを有効化し、パスワードを`ilovearch`に変更する。
+例 : Plymouthを有効化し、パスワードを`ilovearch`に変更する。squashfsはレベル22のzstdで圧縮する。
 
 ```bash
-./build.sh -b -p 'ilovealter'
+./build.sh -b -p 'ilovealter' -c zstd -t "-Xcompression-level 22"
 ```
 
 
 #### Plymouthについて
-`build.sh`に`-b`をつけるとPlymouthが有効化されます。  
+`build.sh`に`-b`をつけるとPlymouthが有効化されます。
 ただし、現在Plymouthを有効化した状態だとインストール後に正常に起動しない問題が確認されています。
 
 #### ライブ環境でのパスワード
-デフォルトのパスワードは`alter`です。  
-`build.sh`に`-p [password]`とすることでパスワードを変更できます。  
-オプション無しでパスワードを変更する場合は`build.sh`の`password`の値を変更してください。
\ No newline at end of file
+デフォルトのパスワードは`alter`です。
+`build.sh`に`-p [password]`とすることでパスワードを変更できます。
+オプション無しでパスワードを変更する場合は`build.sh`の`password`の値を変更してください。
diff --git a/docker-build.sh b/docker-build.sh
new file mode 100755 (executable)
index 0000000..1d84a9e
--- /dev/null
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+set -e
+
+if [[ $UID != 0 ]]; then
+    echo "You have to run this as root." 1>&2
+    exit 1
+fi
+
+if ! type docker >/dev/null 2>&1; then
+    echo "You have to install docker." 1>&2
+    exit 1
+fi
+
+SCRIPT_DIR=$(cd $(dirname $0); pwd)
+cd $SCRIPT_DIR
+docker build -t alterlinux-build:latest .
+docker run -t --privileged -v $SCRIPT_DIR/out:/alterlinux/out alterlinux-build
index 200ce5b..7a4145e 100644 (file)
@@ -1,2 +1,3 @@
 HOOKS=(base udev plymouth memdisk archiso_shutdown archiso archiso_loop_mnt archiso_pxe_common archiso_pxe_nbd archiso_pxe_http archiso_pxe_nfs archiso_kms block filesystems keyboard)
 COMPRESSION="xz"
+COMPRESSION_OPTIONS=(--check=crc32 -threads=8)
index c04f1dc..b12aaa4 100644 (file)
@@ -1,2 +1,3 @@
 HOOKS=(base udev memdisk archiso_shutdown archiso archiso_loop_mnt archiso_pxe_common archiso_pxe_nbd archiso_pxe_http archiso_pxe_nfs archiso_kms block filesystems keyboard)
 COMPRESSION="xz"
+COMPRESSION_OPTIONS=(--check=crc32 -threads=8)