11#! /usr/bin/env bash
22set -e
33
4- # #--------------------Additional settings--------------------##
5- # # Uncomment the settings you want to use
6-
7- # # Build with i686
8- # build_arch="i686"
9-
10- # # Build with x86_64
11- # build_arch="x86_64"
12-
13- # #-----------------------------------------------------------##
14-
15-
164nobuild=false
175script_path=" $( cd -P " $( dirname " $( readlink -f " $0 " ) " ) " && cd .. && pwd ) "
186
197machine_arch=" $( uname -m) "
8+ build_arch=" ${machine_arch} "
209
2110# Pacman configuration file used only when checking packages.
2211pacman_conf=" ${script_path} /system/pacman-${machine_arch} .conf"
@@ -233,6 +222,49 @@ function remove_dependencies () {
233222}
234223
235224
225+ function select_arch() {
226+ local yn
227+ local details
228+ local ask_arch
229+ msg_n " アーキテクチャを指定しますか? (y/N) : " " Do you want to specify the architecture? (y/N)"
230+ read yn
231+ case ${yn} in
232+ y | Y | yes | Yes | YES ) details=true ;;
233+ n | N | no | No | NO ) details=false ;;
234+ * ) select_comp_type; return 0 ;;
235+ esac
236+
237+ function ask_arch () {
238+ local ask
239+ msg \
240+ " アーキテクチャを選択して下さい " \
241+ " Please select an architecture."
242+ msg \
243+ " 注意:このウィザードでは正式にサポートされているアーキテクチャのみ選択可能です。" \
244+ " Note: Only officially supported architectures can be selected in this wizard."
245+ echo
246+ echo " 1: x86_64 (64bit)"
247+ echo " 2: i686 (32bit)"
248+ echo -n " : "
249+
250+ read ask
251+
252+ case " ${ask} " in
253+ 1 | " x86_64" ) build_arch=" x86_64" ;;
254+ 2 | " i686" ) build_arch=" i686" ;;
255+ * ) ask_arch ;;
256+ esac
257+ }
258+
259+ if [[ ${details} = true ]]; then
260+ ask_arch
261+ else
262+ build_arch=" ${machine_arch} "
263+ fi
264+
265+ return 0
266+ }
267+
236268function enable_plymouth () {
237269 local yn
238270 msg_n " Plymouthを有効化しますか?[no](y/N) : " " Do you want to enable Plymouth? [no] (y/N) : "
@@ -725,6 +757,7 @@ function generate_argument () {
725757# 上の質問の関数を実行
726758function ask () {
727759 enable_japanese
760+ select_arch
728761 enable_plymouth
729762 select_kernel
730763 select_comp_type
@@ -743,6 +776,7 @@ function lastcheck () {
743776 msg " 以下の設定でビルドを開始します。" " Start the build with the following settings."
744777 echo
745778 [[ -n " ${japanese} " ]] && echo " Japanese : ${japanese} "
779+ [[ -n " ${build_arch} " ]] && echo " Architecture : ${build_arch} "
746780 [[ -n " ${plymouth} " ]] && echo " Plymouth : ${plymouth} "
747781 [[ -n " ${kernel} " ]] && echo " kernel : ${kernel} "
748782 [[ -n " ${comp_type} " ]] && echo " Compression method : ${comp_type} "
0 commit comments