2 script_path=`dirname $0`
6 machine_arch=$(uname -m)
10 echo "You must set one arg!" 1>&2
13 #build.shのオプションに使う変数を設定
14 buf=`grep CONFIG_I686_BUILD .config`
16 if [[ $CONFIG_I686_BUILD = "y" ]]; then
19 buf=`grep CONFIG_KERNEL_N_A_M_E_ .config | sed -e 's/=y//g' | sed -e 's/CONFIG_KERNEL_N_A_M_E_/kernel=/g'`
21 buf=`grep CONFIG_ENABLE_PLYMOUTH .config | sed -e 's/y/true/g' | sed -e 's/CONFIG_ENABLE_PLYMOUTH/plymouth/g'`
23 buf=`grep CONFIG_ENABLE_JAPANESE .config | sed -e 's/y/true/g' | sed -e 's/CONFIG_ENABLE_JAPANESE/japanese/g'`
25 buf=`grep CONFIG_SFS_CMP_ .config | sed -e 's/=y//g' | sed -e 's/CONFIG_SFS_CMP_/comp_type=/g'`
27 buf=`grep CONFIG_USE_SFS_OPTION .config | sed -e 's/y/true/g'`
29 if [[ $CONFIG_USE_SFS_OPTION ]]; then
30 if [[ $comp_type = "zstd" ]]; then
31 buf=`grep CONFIG_ZSTD_COMP_LVL .config`
33 comp_option="-Xcompression-level ${CONFIG_ZSTD_COMP_LVL}"
35 if [[ $comp_type = "gzip" ]]; then
36 buf=`grep CONFIG_GZIP_SFS_ .config`
38 comp_option="-Xcompression-level ${CONFIG_GZIP_SFS_COMP_LVL} -Xwindow-size ${CONFIG_GZIP_SFS_WIN_SIZE}"
40 if [[ $comp_type = "lz4" ]]; then
41 buf=`grep CONFIG_LZ4_HIGH_COMP .config`
43 if [[ $CONFIG_LZ4_HIGH_COMP = "y" ]]; then
48 buf=`grep CONFIG_USE_CUSTOM_USERNAME .config`
50 if [[ $CONFIG_USE_CUSTOM_USERNAME = "y" ]]; then
51 buf=`grep CONFIG_CUSTOM_USERNAME .config | sed -e 's/CONFIG_CUSTOM_USERNAME/username/g' `
54 buf=`grep CONFIG_USE_CUSTOM_PASSWD .config`
56 if [[ $CONFIG_USE_CUSTOM_PASSWD = "y" ]]; then
57 buf=`grep CONFIG_CUSTOM_PASSWD .config | sed -e 's/CONFIG_CUSTOM_PASSWD/password/g' `
60 buf=`grep CONFIG_CHANNEL_ .config | sed -e 's/=y//g' | sed -e 's/CONFIG_CHANNEL_/channel=/g'`
65 [[ -n "${japanese}" ]] && echo " Japanese : ${japanese}"
66 [[ -n "${plymouth}" ]] && echo " Plymouth : ${plymouth}"
67 [[ -n "${kernel}" ]] && echo " kernel : ${kernel}"
68 [[ -n "${comp_type}" ]] && echo " Compression method : ${comp_type}"
69 [[ -n "${comp_option}" ]] && echo "Compression options : ${comp_option}"
70 [[ -n "${username}" ]] && echo " Username : ${username}"
71 [[ -n "${password}" ]] && echo " Password : ${password}"
72 [[ -n "${channel}" ]] && echo " Channel : ${channel}"
74 if [[ ${japanese} = true ]]; then
75 argument="${argument} -j"
77 if [[ ${plymouth} = true ]]; then
78 argument="${argument} -b"
80 if [[ -n ${comp_type} ]]; then
81 argument="${argument} -c ${comp_type}"
83 if [[ -n ${kernel} ]]; then
84 argument="${argument} -k ${kernel}"
86 if [[ -n "${username}" ]]; then
87 argument="${argument} -u '${username}'"
89 if [[ -n ${password} ]]; then
90 argument="${argument} -p '${password}'"
92 if [[ -n ${out_dir} ]]; then
93 argument="${argument} -o '${out_dir}'"
95 argument="-a ${build_arch} --noconfirm ${argument} ${channel}"