diff --git a/.gitignore b/.gitignore index 8baa3d94d..4e78186cd 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,5 @@ menuconfig-script/kernel_choice_* /out/ out /pacman-*.conf +.config +menuconfig-script/channels_menuconfig-* diff --git a/.shellcheckrc b/.shellcheckrc index 7bae781b2..a654c3c16 100644 --- a/.shellcheckrc +++ b/.shellcheckrc @@ -1,5 +1,6 @@ shell=bash disable=SC1090 +disable=SC1091 disable=SC2154 disable=SC2016 disable=SC2034 diff --git a/Makefile b/Makefile index 2ed9a69fe..9f3a009f1 100644 --- a/Makefile +++ b/Makefile @@ -5,22 +5,24 @@ KERNEL := zen SHARE_OPTION := --boot-splash --comp-type "xz" --user "alter" --password "alter" --kernel "${KERNEL}" --debug --noconfirm ARCH_x86_64 := --arch x86_64 ARCH_i686 := --arch i686 -FULLBUILD := -d -g -e 1 --noconfirm +FULLBUILD := -d -g -e --noconfirm FULL_x86_64 := xfce cinnamon i3 plasma FULL_i686 := xfce lxde CURRENT_DIR := ${shell dirname $(dir $(abspath $(lastword $(MAKEFILE_LIST))))}/${shell basename $(dir $(abspath $(lastword $(MAKEFILE_LIST))))} full: - @sudo ${CURRENT_DIR}/tools/fullbuild.sh ${FULLBUILD} -m x86_64 ${FULL_x86_64} - @sudo ${CURRENT_DIR}/tools/fullbuild.sh ${FULLBUILD} -m i686 ${FULL_i686} + sudo ${CURRENT_DIR}/tools/fullbuild.sh ${FULLBUILD} -m x86_64 ${FULL_x86_64} + sudo ${CURRENT_DIR}/tools/fullbuild.sh ${FULLBUILD} -m i686 ${FULL_i686} @make clean basic-64 basic-32 cinnamon-64 cinnamon-32 gnome-64 i3-64 i3-32 lxde-64 lxde-32 plasma-64 releng-32 releng-64 serene-64 serene-32 xfce-64 xfce-32 xfce-pro-64: - $(eval CHANNEL=${shell echo ${@} | cut -d '-' -f 1}) - $(eval ARCHITECTURE=${shell echo ${@} | cut -d '-' -f 2}) + @$(eval ARCHITECTURE=${shell echo ${@} | rev | cut -d '-' -f 1 | rev }) + @$(eval CHANNEL=${shell echo ${@} | sed "s/-${ARCHITECTURE}//g"}) + @[[ -z "${CHANNEL}" ]] && echo "Empty Channel" && exit 1 || : @case ${ARCHITECTURE} in\ "32") sudo ${CURRENT_DIR}/${BUILD_SCRIPT} ${ARGS} ${SHARE_OPTION} ${ARCH_i686} ${CHANNEL} ;;\ "64") sudo ${CURRENT_DIR}/${BUILD_SCRIPT} ${ARGS} ${SHARE_OPTION} ${ARCH_x86_64} ${CHANNEL};;\ + * ) echo "Unknown Architecture"; exit 1 ;; \ esac @make clean @@ -28,11 +30,13 @@ menuconfig/build/mconf:: @mkdir -p menuconfig/build (cd menuconfig/build ; cmake -GNinja .. ; ninja -j4 ) -menuconfig:menuconfig/build/mconf menuconfig-script/kernel_choice +menuconfig:menuconfig/build/mconf menuconfig-script/kernel_choice menuconfig-script/channel_choice @menuconfig/build/mconf menuconfig-script/rootconf menuconfig-script/kernel_choice:system/kernel-x86_64 system/kernel-i686 @${CURRENT_DIR}/tools/kernel-choice-conf-gen.sh +menuconfig-script/channel_choice: + @${CURRENT_DIR}/tools/channel-choice-conf-gen.sh build_option: @if [ ! -f .config ]; then make menuconfig ; fi diff --git a/build.sh b/build.sh index e5c149e55..09466d85c 100755 --- a/build.sh +++ b/build.sh @@ -316,7 +316,7 @@ check_bool() { } _run_cleansh(){ - bash $([[ "${bash_debug}" = true ]] && echo -n "-x" ) "${tools_dir}/clean.sh" -o -w "$(realpath "${build_dir}")" "$([[ "${debug}" = true ]] && printf "%s" "-d")" "$([[ "${noconfirm}" = true ]] && printf "%s" "-n")" "$([[ "${nocolor}" = true ]] && printf "%s" "--nocolor")" + bash "$([[ "${bash_debug}" = true ]] && echo -n "-x" || echo -n "+x")" "${tools_dir}/clean.sh" -o -w "$(realpath "${build_dir}")" "$([[ "${debug}" = true ]] && printf "%s" "-d")" "$([[ "${noconfirm}" = true ]] && printf "%s" "-n")" "$([[ "${nocolor}" = true ]] && printf "%s" "--nocolor")" } @@ -1125,7 +1125,7 @@ while true; do if [[ "${2}" = "reset" ]]; then sfs_comp_opt=() else - sfs_comp_opt=(${2}) + IFS=" " read -r -a sfs_comp_opt <<< "${2}" fi shift 2 ;; @@ -1242,7 +1242,7 @@ while true; do shift 2 ;; --tar-opts) - tar_comp_opt=(${2}) + IFS=" " read -r -a tar_comp_opt <<< "${2}" shift 2 ;; --) diff --git a/docs/jp/BUILD.md b/docs/jp/BUILD.md index ec92b6bcc..1a39de2df 100644 --- a/docs/jp/BUILD.md +++ b/docs/jp/BUILD.md @@ -42,6 +42,12 @@ sudo pacman -S --needed curl dosfstools git libburn libisofs lz4 lzo make pyalpm make menuconfig ``` +設定が完了したら以下のコマンドでビルドできます + +```bash +sudo make build +``` + ### GUIを使用する GUIで設定を行ってビルドできます。GUIには`python-gobject`が必須です。 diff --git a/menuconfig-script/rootconf b/menuconfig-script/rootconf index 4ed506ace..deedb5603 100644 --- a/menuconfig-script/rootconf +++ b/menuconfig-script/rootconf @@ -113,18 +113,26 @@ menu "Live環境の設定" config CUSTOM_PASSWD string "パスワード" endif - choice - prompt "チャンネル" - default CHANNEL_XFCE - help - "使用するチャンネルを選択します。" - config CHANNEL_XFCE - bool "Xfce" - config CHANNEL_PLASMA - bool "Kde Plasma" - config CHANNEL_LXDE - bool "lxde" - endchoice + if X64_BUILD + choice + prompt "チャンネル" + source channels_menuconfig-x86_64 + endchoice + endif + if I686_BUILD + choice + prompt "チャンネル" + source channels_menuconfig-i686 + endchoice + endif config IMAGE_OWNER string "イメージファイルの所有者名" endmenu +menu "その他ビルド設定" + config USE_CUSTOM_WORK + bool "カスタムワークディレクトリを使用する" + if USE_CUSTOM_WORK + config CUSTOM_WORKDIR + string "ワークディレクトリ" + endif +endmenu diff --git a/mkinitcpio/mkinitcpio-archiso-plymouth.conf b/mkinitcpio/mkinitcpio-archiso-plymouth.conf index 8982ffd05..b81abbfa5 100644 --- a/mkinitcpio/mkinitcpio-archiso-plymouth.conf +++ b/mkinitcpio/mkinitcpio-archiso-plymouth.conf @@ -8,6 +8,136 @@ # /etc/mkinitcpio-archiso.conf # +# MODULES +# The following modules are loaded before any boot hooks are +# run. Advanced users may wish to specify all system modules +# in this array. For instance: +# MODULES=(piix ide_disk reiserfs) +MODULES=() + +# BINARIES +# This setting includes any additional binaries a given user may +# wish into the CPIO image. This is run last, so it may be used to +# override the actual binaries included by a given hook +# BINARIES are dependency parsed, so you may safely ignore libraries +BINARIES=() + +# FILES +# This setting is similar to BINARIES above, however, files are added +# as-is and are not parsed in any way. This is useful for config files. +FILES=() + +# HOOKS +# This is the most important setting in this file. The HOOKS control the +# modules and scripts added to the image, and what happens at boot time. +# Order is important, and it is recommended that you do not change the +# order in which HOOKS are added. Run 'mkinitcpio -H ' for +# help on a given hook. +# 'base' is _required_ unless you know precisely what you are doing. +# 'udev' is _required_ in order to automatically load modules +# 'filesystems' is _required_ unless you specify your fs modules in MODULES +# Examples: +## This setup specifies all modules in the MODULES setting above. +## No raid, lvm2, or encrypted root is needed. +# HOOKS=(base) +# +## This setup will autodetect all modules for your system and should +## work as a sane default +# HOOKS=(base udev autodetect block filesystems) +# +## This setup will generate a 'full' image which supports most systems. +## No autodetection is done. +# HOOKS=(base udev block filesystems) +# +## This setup assembles a pata mdadm array with an encrypted root FS. +## Note: See 'mkinitcpio -H mdadm' for more information on raid devices. +# HOOKS=(base udev block mdadm encrypt filesystems) +# +## This setup loads an lvm2 volume group on a usb device. +# HOOKS=(base udev block lvm2 filesystems) +# +## NOTE: If you have /usr on a separate partition, you MUST include the +# usr, fsck and shutdown hooks. +HOOKS=(base udev autodetect modconf block filesystems keyboard fsck) + +# COMPRESSION +# Use this to compress the initramfs image. By default, zstd compression +# is used. Use 'cat' to create an uncompressed image. +#COMPRESSION="zstd" +#COMPRESSION="gzip" +#COMPRESSION="bzip2" +#COMPRESSION="lzma" +#COMPRESSION="xz" +#COMPRESSION="lzop" +#COMPRESSION="lz4" + +# COMPRESSION_OPTIONS +# Additional options for the compressor +#COMPRESSION_OPTIONS=() + +# MODULES +# The following modules are loaded before any boot hooks are +# run. Advanced users may wish to specify all system modules +# in this array. For instance: +# MODULES=(piix ide_disk reiserfs) +MODULES=() + +# BINARIES +# This setting includes any additional binaries a given user may +# wish into the CPIO image. This is run last, so it may be used to +# override the actual binaries included by a given hook +# BINARIES are dependency parsed, so you may safely ignore libraries +BINARIES=() + +# FILES +# This setting is similar to BINARIES above, however, files are added +# as-is and are not parsed in any way. This is useful for config files. +FILES=() + +# HOOKS +# This is the most important setting in this file. The HOOKS control the +# modules and scripts added to the image, and what happens at boot time. +# Order is important, and it is recommended that you do not change the +# order in which HOOKS are added. Run 'mkinitcpio -H ' for +# help on a given hook. +# 'base' is _required_ unless you know precisely what you are doing. +# 'udev' is _required_ in order to automatically load modules +# 'filesystems' is _required_ unless you specify your fs modules in MODULES +# Examples: +## This setup specifies all modules in the MODULES setting above. +## No raid, lvm2, or encrypted root is needed. +# HOOKS=(base) +# +## This setup will autodetect all modules for your system and should +## work as a sane default +# HOOKS=(base udev autodetect block filesystems) +# +## This setup will generate a 'full' image which supports most systems. +## No autodetection is done. +# HOOKS=(base udev block filesystems) +# +## This setup assembles a pata mdadm array with an encrypted root FS. +## Note: See 'mkinitcpio -H mdadm' for more information on raid devices. +# HOOKS=(base udev block mdadm encrypt filesystems) +# +## This setup loads an lvm2 volume group on a usb device. +# HOOKS=(base udev block lvm2 filesystems) +# +## NOTE: If you have /usr on a separate partition, you MUST include the +# usr, fsck and shutdown hooks. 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 +# Use this to compress the initramfs image. By default, zstd compression +# is used. Use 'cat' to create an uncompressed image. +#COMPRESSION="zstd" +#COMPRESSION="gzip" +#COMPRESSION="bzip2" +#COMPRESSION="lzma" COMPRESSION="xz" +#COMPRESSION="lzop" +#COMPRESSION="lz4" + +# COMPRESSION_OPTIONS +# Additional options for the compressor COMPRESSION_OPTIONS=(--check=crc32 --threads=8) diff --git a/mkinitcpio/mkinitcpio-archiso.conf b/mkinitcpio/mkinitcpio-archiso.conf index d3f34e9c2..d1f65f457 100644 --- a/mkinitcpio/mkinitcpio-archiso.conf +++ b/mkinitcpio/mkinitcpio-archiso.conf @@ -8,6 +8,69 @@ # /etc/mkinitcpio-archiso.conf # +# MODULES +# The following modules are loaded before any boot hooks are +# run. Advanced users may wish to specify all system modules +# in this array. For instance: +# MODULES=(piix ide_disk reiserfs) +MODULES=() + +# BINARIES +# This setting includes any additional binaries a given user may +# wish into the CPIO image. This is run last, so it may be used to +# override the actual binaries included by a given hook +# BINARIES are dependency parsed, so you may safely ignore libraries +BINARIES=() + +# FILES +# This setting is similar to BINARIES above, however, files are added +# as-is and are not parsed in any way. This is useful for config files. +FILES=() + +# HOOKS +# This is the most important setting in this file. The HOOKS control the +# modules and scripts added to the image, and what happens at boot time. +# Order is important, and it is recommended that you do not change the +# order in which HOOKS are added. Run 'mkinitcpio -H ' for +# help on a given hook. +# 'base' is _required_ unless you know precisely what you are doing. +# 'udev' is _required_ in order to automatically load modules +# 'filesystems' is _required_ unless you specify your fs modules in MODULES +# Examples: +## This setup specifies all modules in the MODULES setting above. +## No raid, lvm2, or encrypted root is needed. +# HOOKS=(base) +# +## This setup will autodetect all modules for your system and should +## work as a sane default +# HOOKS=(base udev autodetect block filesystems) +# +## This setup will generate a 'full' image which supports most systems. +## No autodetection is done. +# HOOKS=(base udev block filesystems) +# +## This setup assembles a pata mdadm array with an encrypted root FS. +## Note: See 'mkinitcpio -H mdadm' for more information on raid devices. +# HOOKS=(base udev block mdadm encrypt filesystems) +# +## This setup loads an lvm2 volume group on a usb device. +# HOOKS=(base udev block lvm2 filesystems) +# +## NOTE: If you have /usr on a separate partition, you MUST include the +# usr, fsck and shutdown hooks. 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 +# Use this to compress the initramfs image. By default, zstd compression +# is used. Use 'cat' to create an uncompressed image. +#COMPRESSION="zstd" +#COMPRESSION="gzip" +#COMPRESSION="bzip2" +#COMPRESSION="lzma" COMPRESSION="xz" +#COMPRESSION="lzop" +#COMPRESSION="lz4" + +# COMPRESSION_OPTIONS +# Additional options for the compressor COMPRESSION_OPTIONS=(--check=crc32 --threads=8) diff --git a/mkinitcpio/mkinitcpio-plymouth.conf b/mkinitcpio/mkinitcpio-plymouth.conf index f9cbcb4a2..e20bad062 100644 --- a/mkinitcpio/mkinitcpio-plymouth.conf +++ b/mkinitcpio/mkinitcpio-plymouth.conf @@ -8,7 +8,6 @@ # /etc/mkinitcpio.conf # -# vim:set ft=sh # MODULES # The following modules are loaded before any boot hooks are # run. Advanced users may wish to specify all system modules @@ -62,15 +61,15 @@ FILES=() HOOKS=(base udev plymouth autodetect modconf block filesystems keyboard fsck) # COMPRESSION -# Use this to compress the initramfs image. By default, gzip compression +# Use this to compress the initramfs image. By default, zstd compression # is used. Use 'cat' to create an uncompressed image. +#COMPRESSION="zstd" #COMPRESSION="gzip" #COMPRESSION="bzip2" #COMPRESSION="lzma" #COMPRESSION="xz" #COMPRESSION="lzop" #COMPRESSION="lz4" -#COMPRESSION="zstd" # COMPRESSION_OPTIONS # Additional options for the compressor diff --git a/mkinitcpio/mkinitcpio.conf b/mkinitcpio/mkinitcpio.conf index 131d70c2f..86801997d 100644 --- a/mkinitcpio/mkinitcpio.conf +++ b/mkinitcpio/mkinitcpio.conf @@ -8,7 +8,6 @@ # /etc/mkinitcpio.conf # -# vim:set ft=sh # MODULES # The following modules are loaded before any boot hooks are # run. Advanced users may wish to specify all system modules @@ -62,15 +61,15 @@ FILES=() HOOKS=(base udev autodetect modconf block filesystems keyboard fsck) # COMPRESSION -# Use this to compress the initramfs image. By default, gzip compression +# Use this to compress the initramfs image. By default, zstd compression # is used. Use 'cat' to create an uncompressed image. +#COMPRESSION="zstd" #COMPRESSION="gzip" #COMPRESSION="bzip2" #COMPRESSION="lzma" #COMPRESSION="xz" #COMPRESSION="lzop" #COMPRESSION="lz4" -#COMPRESSION="zstd" # COMPRESSION_OPTIONS # Additional options for the compressor diff --git a/modules/calamares/pkgbuild.any/10-alterlinux-calamares/PKGBUILD b/modules/calamares/pkgbuild.any/10-alterlinux-calamares/PKGBUILD index 503571f10..5f296f3dc 100755 --- a/modules/calamares/pkgbuild.any/10-alterlinux-calamares/PKGBUILD +++ b/modules/calamares/pkgbuild.any/10-alterlinux-calamares/PKGBUILD @@ -1,8 +1,9 @@ # Maintainer: lap1sid pkgname=alterlinux-calamares -pkgver="3.2.39" -pkgrel=1 +_reponame=alterlinux-calamares-old +pkgver="3.2.35" +pkgrel=3 _pkgrel='b2' pkgdesc='Distribution-independent installer framework' arch=('i686' 'x86_64') @@ -23,14 +24,14 @@ backup=( 'usr/share/calamares/branding/alter/branding.desc' ) -source+=("$url/archive/$pkgver-$pkgrel.tar.gz") +source+=("${url}/archive/${pkgver}-${pkgrel}.tar.gz") #source+=("$url/archive/$pkgver-$_pkgrel.tar.gz") sha256sums=('SKIP') prepare() { # rename - mv "${srcdir}/${pkgname}-${pkgver}-${pkgrel}" "${srcdir}/${pkgver}-${pkgrel}" + mv "${srcdir}/${_reponame}-${pkgver}-${pkgrel}" "${srcdir}/${pkgver}-${pkgrel}" #mv ${srcdir}/${pkgname}-${pkgver}-${_pkgrel} ${srcdir}/${pkgver}-${pkgrel} cd "${srcdir}/${pkgver}-${pkgrel}" sed -i -e 's/"Install configuration files" OFF/"Install configuration files" ON/' CMakeLists.txt diff --git a/tools/allpkglist.sh b/tools/allpkglist.sh index 110f1d8b8..34f102333 100755 --- a/tools/allpkglist.sh +++ b/tools/allpkglist.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -e +set -eu load_config() { local _file @@ -30,6 +30,7 @@ out_dir="" archs=("x86_64" "i686" "i486") stdout=false include_aur=false +pkglist=() # Parse options OPTS="a:o:hs" @@ -43,7 +44,7 @@ unset OPT OPTS OPTL while true; do case "${1}" in -a | --arch) - archs=(${2}) + IFS=" " read -ra archs <<< "${2}" shift 2 ;; -o | --out) @@ -80,56 +81,35 @@ fi load_config() { local _file for _file in "${@}"; do - if [[ -f "${_file}" ]]; then - source "${_file}" - fi - done -} - -for_module(){ - local module - for module in "${modules[@]}"; do - eval $(echo "${@}" | sed "s|{}|${module}|g") + [[ -f "${_file}" ]] && source "${_file}" done + return 0 } for arch in "${archs[@]}"; do for channel in $("${tools_dir}/channel.sh" show -a "${arch}" -b -d -k zen -f); do - modules=($( + readarray -t modules < <( load_config "${script_path}/default.conf" "${script_path}/custom.conf" - load_config "${channel_dir}/config.any" "${channel_dir}/config.${arch}" - if [[ ! -z "${include_extra+SET}" ]]; then + load_config "${channel}/config.any" "${channel}/config.${arch}" + if [[ -n "${include_extra+SET}" ]]; then if [[ "${include_extra}" = true ]]; then - modules=("share" "share-extra") + modules=("base" "share" "share-extra" "calamares" "zsh-powerline") else - modules=("share") + modules=("base" "share") fi fi - for module in "${modules[@]}"; do - dependent="${module_dir}/${module}/dependent" - if [[ -f "${dependent}" ]]; then - modules+=($(grep -h -v ^'#' "${dependent}" | tr -d "\n" )) - fi - done - unset module dependent - modules=($(printf "%s\n" "${modules[@]}" | sort | uniq)) - for_module load_config "${module_dir}/{}/config.any" "${module_dir}/{}/config.${arch}" - echo "${modules[@]}" - )) + printf "%s\n" "${modules[@]}" + ) - pkglist_opts="-a ${arch} -b -c ${channel%/} -k zen -l en --line ${modules[*]}" + pkglist_opts=(-a "${arch}" -b -c "${channel}" -k zen -l en --line "${modules[@]}") if [[ "${stdout}" = true ]]; then - pkglist+=($("${tools_dir}/pkglist.sh" ${pkglist_opts})) - if [[ "${include_aur}" = true ]]; then - pkglist+=($("${tools_dir}/pkglist.sh" --aur ${pkglist_opts})) - fi + readarray -O "${#pkglist[@]}" -t pkglist < <("${tools_dir}/pkglist.sh" "${pkglist_opts[@]}") + [[ "${include_aur}" = true ]] && readarray -O "${#pkglist[@]}" -t pkglist < <("${tools_dir}/pkglist.sh" --aur "${pkglist_opts[@]}") || true else ( - "${tools_dir}/pkglist.sh" -d ${pkglist_opts} - if [[ "${include_aur}" = true ]]; then - "${tools_dir}/pkglist.sh" --aur -d ${pkglist_opts} - fi + "${tools_dir}/pkglist.sh" -d "${pkglist_opts[@]}" + [[ "${include_aur}" = true ]] && "${tools_dir}/pkglist.sh" --aur -d "${pkglist_opts[@]}" || true ) 1> "${out_dir}/$(basename "${channel}").${arch}" fi @@ -137,6 +117,6 @@ for arch in "${archs[@]}"; do done if [[ "${stdout}" = true ]]; then - pkglist=($(printf "%s\n" "${pkglist[@]}" | sort |uniq)) + readarray -t pkglist < <(printf "%s\n" "${pkglist[@]}" | sort |uniq) printf "%s\n" "${pkglist[@]}" fi diff --git a/tools/alteriso-info.sh b/tools/alteriso-info.sh index 9b5ed064a..4c18cf295 100755 --- a/tools/alteriso-info.sh +++ b/tools/alteriso-info.sh @@ -85,29 +85,20 @@ while true; do esac done -variable_list=( - "arch" - "boot_splash" - "channel_name" - "iso_publisher" - "kernel" - "iso_application" - "password" - "username" - "iso_version" -) +variable_list=( "arch" "boot_splash" "channel_name" "iso_publisher" "kernel" "iso_application" "password" "username" "iso_version") +error=false for var in "${variable_list[@]}"; do - if [[ -z "$(eval echo '$'${var})" ]]; then + if [[ -z "$(eval echo "\$${var}")" ]]; then echo "${var} is empty" >&2 - exit 1 + error=true fi done - +[[ "${error}" = true ]] && exit 1 +unset error # Get kernel info -eval $(bash "${tools_dir}/kernel.sh" -s -c "${channel_name}" -a "${arch}" get "${kernel}") - +eval "$(bash "${tools_dir}/kernel.sh" -s -c "${channel_name}" -a "${arch}" get "${kernel}")" echo "Developer : ${iso_publisher}" echo "OS Name : ${iso_application}" diff --git a/tools/channel-choice-conf-gen.sh b/tools/channel-choice-conf-gen.sh new file mode 100755 index 000000000..63f0a99ef --- /dev/null +++ b/tools/channel-choice-conf-gen.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +script_path="$( cd -P "$( dirname "$(readlink -f "$0")" )" && cd .. && pwd )" +arch_list=( + "x86_64" + "i686" +) + +#cd "${script_path}" +for arch in "${arch_list[@]}"; do + rm -rf "${script_path}/menuconfig-script/channels_menuconfig-${arch}" + for channel in $(bash "${script_path}/tools/channel.sh" -a "${arch}" show ); do + echo "config CHANNEL_N_A_M_E_${channel}" >> "${script_path}/menuconfig-script/channels_menuconfig-${arch}" + echo -e "\tbool ${channel}" >> "${script_path}/menuconfig-script/channels_menuconfig-${arch}" + done +done diff --git a/tools/clean.sh b/tools/clean.sh index 5d1b6cdc4..a63870a37 100755 --- a/tools/clean.sh +++ b/tools/clean.sh @@ -26,7 +26,7 @@ work_dir="$( load_config "${script_path}/default.conf" load_config "${script_path}/custom.conf" cd "${script_path}" - echo "$(realpath "${work_dir}")" + realpath "${work_dir}" )" # msg_common [type] [-n] [string] @@ -62,7 +62,7 @@ umount_chroot () { "${tools_dir}/umount.sh" -d "${work_dir}" -m 3 "$([[ "${nocol # Usage: getclm # 標準入力から値を受けとり、引数で指定された列を抽出します。 -getclm() { echo "$(cat -)" | cut -d " " -f "${1}"; } +getclm() { cut -d " " -f "${1}"; } _help() { echo "usage ${0} [option]" diff --git a/tools/docker-build.sh b/tools/docker-build.sh index 2734700e6..354788ce8 100755 --- a/tools/docker-build.sh +++ b/tools/docker-build.sh @@ -14,7 +14,7 @@ EOF exit 1 fi -script_path="$(cd -P $(dirname $(readlink -f ${0})) && cd .. && pwd)" +script_path="$( cd -P "$( dirname "$(readlink -f "$0")" )" && cd .. && pwd )" _usage () { echo "usage ${0} [options]" diff --git a/tools/fullbuild.sh b/tools/fullbuild.sh index 63e7dcf00..c5fbb3c08 100755 --- a/tools/fullbuild.sh +++ b/tools/fullbuild.sh @@ -75,7 +75,7 @@ trap_exit() { build() { local _exit_code=0 _options=("${share_options[@]}") - _options+=("--arch" "${arch}" "--lang" "${lang}" "--out" "${out_dir}/${cha}/${arch}" "${cha}") + _options+=("--arch" "${arch}" "--lang" "${lang}" "--out" "${out_dir}/${cha}/${lang}" "${cha}") if [[ "${simulation}" = false ]] && [[ "${remove_cache}" = true ]]; then msg_info "Removing package cache for ${arch}" @@ -156,7 +156,7 @@ unset OPT OPTS OPTL ARGUMENT while true; do case "${1}" in -a) - share_options+=(${2}) + IFS=" " read -r -a share_options <<< "${2}" shift 2 ;; -c) @@ -172,7 +172,7 @@ while true; do shift 1 ;; -m) - architectures=(${2}) + IFS=" " read -r -a architectures <<< "${2}" shift 2 ;; -o) @@ -200,7 +200,7 @@ while true; do share_options+=("--tarball") ;; -l) - locale_list=(${2}) + IFS=" " read -r -a locale_list <<< "${2}" shift 2 ;; -w) @@ -238,7 +238,7 @@ if [[ "${all_channel}" = true ]]; then if [[ -n "${*}" ]]; then msg_error "Do not specify the channel." "1" else - channels=($("${script_path}/tools/channel.sh" -b show)) + readarray -t channels < <("${script_path}/tools/channel.sh" -b show) fi elif [[ -n "${*}" ]]; then channels=("${@}") @@ -265,9 +265,9 @@ fi fullbuild_dir="${work_dir}/fullbuild" mkdir -p "${fullbuild_dir}" -if [[ "$(find "${fullbuild_dir}" -maxdepth 1 -mindepth 1 -name "fullbuild.*" 2> /dev/null)" ]]; then +if [[ "$(find "${fullbuild_dir}" -maxdepth 1 -mindepth 1 -name "fullbuild.*" 2> /dev/null)" ]] && [[ "${noconfirm}" = false ]]; then msg_info "Do you want to reset lock files ? (y/N)" - read -n 1 _yes_or_no + read -r -n 1 _yes_or_no echo if [[ "${_yes_or_no}" = "y" ]] || [[ "${_yes_or_no}" = "Y" ]]; then find "${fullbuild_dir}" -maxdepth 1 -mindepth 1 -name "fullbuild.*" -delete 2> /dev/null @@ -279,7 +279,7 @@ share_options+=("--work" "${work_dir}") msg_info "Options: ${share_options[*]}" if [[ "${noconfirm}" = false ]]; then msg_info "Press Enter to continue or Ctrl + C to cancel." - read + read -r fi @@ -289,7 +289,7 @@ for arch in "${architectures[@]}"; do for cha in "${channels[@]}"; do for lang in "${locale_list[@]}"; do for retry_count in $(seq 1 "${retry}"); do - if [[ -n "$(cat "${script_path}/channels/${cha}/architecture" | grep -h -v ^'#' | grep -x "${arch}")" ]]; then + if grep -h -v ^'#' "${script_path}/channels/${cha}/architecture" | grep -x "${arch}" 1> /dev/null 2>&1; then build fi done diff --git a/tools/kernel.sh b/tools/kernel.sh index a8029fdfa..e477a2294 100755 --- a/tools/kernel.sh +++ b/tools/kernel.sh @@ -28,14 +28,12 @@ _help() { echo echo " Script mode usage:" echo " check Returns 0 if the check was successful, 1 otherwise." - printf ' get eval $(%s -s -a -c get )\n' "$(basename ${0})" + printf ' get eval $(%s -s -a -c get )\n' "$(basename "${0}")" } # Usage: getclm # 標準入力から値を受けとり、引数で指定された列を抽出します。 -getclm() { - echo "$(cat -)" | cut -d " " -f "${1}" -} +getclm() { cut -d " " -f "${1}"; } # Message functions msg_error() { @@ -55,7 +53,7 @@ gen_kernel_list() { else _list="${script_path}/system/kernel-${arch}" fi - for _kernel in $(grep -h -v ^'#' ${_list} | getclm 1); do + for _kernel in $(grep -h -v ^'#' "${_list}" | getclm 1); do kernellist+=("${_kernel}") done } @@ -98,15 +96,15 @@ get() { else _kernel_config_file="${script_path}/system/kernel-${arch}" fi - _kernel_name_list=($(cat "${_kernel_config_file}" | grep -h -v ^'#' | getclm 1)) + readarray -t _kernel_name_list < <(grep -h -v ^'#' "${_kernel_config_file}" | grep -v ^$ | getclm 1) _get_kernel_line() { local _kernel _count=0 for _kernel in "${_kernel_name_list[@]}"; do _count=$(( _count + 1 )) - if [[ "${_kernel}" = "${1}" ]]; then echo "${_count}"; return 0; fi + [[ "${_kernel}" = "${1}" ]] && echo "${_count}" && return 0 done echo -n "failed" - return 0 + return 1 } _kernel_line="$(_get_kernel_line "${1}")" @@ -120,7 +118,7 @@ get() { fi # カーネル設定ファイルから該当の行を抽出 - _kernel_config_line=($(cat "${_kernel_config_file}" | grep -h -v ^'#' | grep -v ^$ | head -n "${_kernel_line}" | tail -n 1)) + readarray -t _kernel_config_line < <(grep -h -v ^'#' "${_kernel_config_file}" | grep -v ^$ | head -n "${_kernel_line}" | tail -n 1 | sed -e 's/ */ /g' | tr " " "\n") # 抽出された行に書かれた設定をそれぞれの変数に代入 # ここで定義された変数のみがグローバル変数 diff --git a/tools/keyring.sh b/tools/keyring.sh index fa8d30777..a10bbd680 100755 --- a/tools/keyring.sh +++ b/tools/keyring.sh @@ -16,125 +16,42 @@ set -e script_path="$( cd -P "$( dirname "$(readlink -f "$0")" )" && cd .. && pwd )" arch="$(uname -m)" - +archlinux32_repo="http://mirror.juniorjpdj.pl/archlinux32/i486/core/" # Set pacman.conf when build alterlinux alter_pacman_conf_x86_64="${script_path}/system/pacman-x86_64.conf" alter_pacman_conf_i686="${script_path}/system/pacman-i686.conf" - -# Color echo -# usage: echo_color -b -t -d [Text] -# -# Text Color -# 30 => Black -# 31 => Red -# 32 => Green -# 33 => Yellow -# 34 => Blue -# 35 => Magenta -# 36 => Cyan -# 37 => White -# -# Background color -# 40 => Black -# 41 => Red -# 42 => Green -# 43 => Yellow -# 44 => Blue -# 45 => Magenta -# 46 => Cyan -# 47 => White -# -# Text decoration -# You can specify multiple decorations with ;. -# 0 => All attributs off (ノーマル) -# 1 => Bold on (太字) -# 4 => Underscore (下線) -# 5 => Blink on (点滅) -# 7 => Reverse video on (色反転) -# 8 => Concealed on - -echo_color() { - local backcolor - local textcolor - local decotypes - local echo_opts - local OPTIND_bak="${OPTIND}" - unset OPTIND - - echo_opts="-e" - - while getopts 'b:t:d:n' arg; do - case "${arg}" in - b) backcolor="${OPTARG}" ;; - t) textcolor="${OPTARG}" ;; - d) decotypes="${OPTARG}" ;; - n) echo_opts="-n -e" ;; - esac - done - - shift $((OPTIND - 1)) - - echo ${echo_opts} "\e[$([[ -v backcolor ]] && echo -n "${backcolor}"; [[ -v textcolor ]] && echo -n ";${textcolor}"; [[ -v decotypes ]] && echo -n ";${decotypes}")m${*}\e[m" - OPTIND=${OPTIND_bak} +# Message common function +# msg_common [type] [-n] [string] +msg_common(){ + local _msg_opts=("-a" "keyring.sh") _type="${1}" + shift 1 + [[ "${1}" = "-n" ]] && _msg_opts+=("-o" "-n") && shift 1 + _msg_opts+=("${_type}" "${@}") + "${script_path}/tools/msg.sh" "${_msg_opts[@]}" } # Show an INFO message -# $1: message string -msg_info() { - local _msg_opts="-a keyring.sh" - if [[ "${1}" = "-n" ]]; then - _msg_opts="${_msg_opts} -o -n" - shift 1 - fi - "${script_path}/tools/msg.sh" ${_msg_opts} info "${1}" -} +# ${1}: message string +msg_info() { msg_common info "${@}"; } # Show an Warning message -# $1: message string -msg_warn() { - local _msg_opts="-a keyring.sh" - if [[ "${1}" = "-n" ]]; then - _msg_opts="${_msg_opts} -o -n" - shift 1 - fi - "${script_path}/tools/msg.sh" ${_msg_opts} warn "${1}" -} - -# Show an debug message -# $1: message string -msg_debug() { - if [[ "${debug}" = true ]]; then - local _msg_opts="-a keyring.sh" - if [[ "${1}" = "-n" ]]; then - _msg_opts="${_msg_opts} -o -n" - shift 1 - fi - "${script_path}/tools/msg.sh" ${_msg_opts} debug "${1}" - fi -} +# ${1}: message string +msg_warn() { msg_common warn "${@}"; } # Show an ERROR message then exit with status -# $1: message string -# $2: exit code number (with 0 does not exit) +# ${1}: message string +# ${2}: exit code number (with 0 does not exit) msg_error() { - local _msg_opts="-a keyring.sh" - if [[ "${1}" = "-n" ]]; then - _msg_opts="${_msg_opts} -o -n" - shift 1 - fi - "${script_path}/tools/msg.sh" ${_msg_opts} error "${1}" - if [[ -n "${2:-}" ]]; then - exit ${2} - fi + msg_common error "${1}" + [[ -n "${2:-}" ]] && exit "${2}" + return 0 } # Usage: getclm # 標準入力から値を受けとり、引数で指定された列を抽出します。 -getclm() { - echo "$(cat -)" | cut -d " " -f "${1}" -} +getclm() { cut -d " " -f "${1}"; } # Show usage @@ -227,12 +144,24 @@ remove_alter_key() { } update_arch32_key() { + ! pacman -Ssq archlinux32-keyring | grep -x archlinux32-keyring 2> /dev/null 1>&2 && msg_error "Not found archlinux32-keyring on remote repository. You should install it manually." 1 pacman --noconfirm -S archlinux32-keyring pacman-key --init pacman-key --populate archlinux32 #pacman-key --refresh-keys } +new_update_arch32_key(){ + local _savedir="${HOME}/.cache" + while read -r _pkg ; do + curl -o "${_savedir}/${_pkg}" "${archlinux32_repo}/${_pkg}" + pacman -U --noconfirm "${_savedir}/${_pkg}" + rm -f "${_savedir}/${_pkg}" + done < <(curl -sL "${archlinux32_repo}" | sed "s| # 標準入力から値を受けとり、引数で指定された列を抽出します。 -getclm() { - echo "$(cat -)" | cut -d " " -f "${1}" -} +getclm() { cut -d " " -f "${1}"; } # Message functions msg_error() { @@ -48,7 +46,7 @@ gen_locale_list() { exit 1 fi local _locale - for _locale in $(grep -h -v ^'#' "${script_path}/system/locale-${arch}" | getclm 1); do + for _locale in $(grep -h -v ^'#' "${script_path}/system/locale-${arch}" | grep -v ^$ | getclm 1); do localelist+=("${_locale}") done } @@ -87,7 +85,7 @@ get() { # 選択されたロケールの設定が描かれた行番号を取得 _locale_config_file="${script_path}/system/locale-${arch}" - _locale_name_list=($(cat "${_locale_config_file}" | grep -h -v ^'#' | awk '{print $1}')) + readarray -t _locale_name_list < <(grep -h -v ^'#' "${_locale_config_file}" | grep -v ^$ | awk '{print $1}') _get_locale_line_number() { local _lang _count=0 for _lang in "${_locale_name_list[@]}"; do @@ -108,7 +106,7 @@ get() { fi # ロケール設定ファイルから該当の行を抽出 - _locale_config_line=($(cat "${_locale_config_file}" | grep -h -v ^'#' | grep -v ^$ | head -n "${_locale_line_number}" | tail -n 1)) + readarray -t _locale_config_line < <(grep -h -v ^'#' "${_locale_config_file}" | grep -v ^$ | head -n "${_locale_line_number}" | tail -n 1 | tail -n 1 | sed -e 's/ */ /g' | tr " " "\n") # 抽出された行に書かれた設定をそれぞれの変数に代入 # ここで定義された変数のみがグローバル変数 diff --git a/tools/menuconf-to-alterconf.sh b/tools/menuconf-to-alterconf.sh index 21642c1c0..eb745d8cc 100755 --- a/tools/menuconf-to-alterconf.sh +++ b/tools/menuconf-to-alterconf.sh @@ -58,7 +58,13 @@ if [[ "${CONFIG_USE_CUSTOM_PASSWD}" = "y" ]]; then buf=`grep CONFIG_CUSTOM_PASSWD .config | sed -e 's/CONFIG_CUSTOM_PASSWD/password/g' ` eval "${buf}" fi -buf=`grep CONFIG_CHANNEL_ .config | sed -e 's/=y//g' | sed -e 's/CONFIG_CHANNEL_/channel=/g'` +buf=`grep CONFIG_USE_CUSTOM_WORK .config` +eval "${buf}" +if [[ "${CONFIG_USE_CUSTOM_WORK}" = "y" ]]; then + buf=`grep CONFIG_CUSTOM_WORKDIR .config | sed -e 's/CONFIG_CUSTOM_WORKDIR/workdir/g' ` + eval "${buf}" +fi +buf=`grep CONFIG_CHANNEL_N_A_M_E_ .config | sed -e 's/=y//g' | sed -e 's/CONFIG_CHANNEL_N_A_M_E_/channel=/g'` eval "${buf,,}" if [[ $USE_CUSTOM_LANG = "true" ]]; then buf=`grep CONFIG_CUSTOM_LANGUAGE .config | sed -e 's/CONFIG_CUSTOM_LANGUAGE/language/g' ` @@ -74,6 +80,7 @@ echo build option : [[ -n "${username}" ]] && echo " Username : ${username}" [[ -n "${password}" ]] && echo " Password : ${password}" [[ -n "${channel}" ]] && echo " Channel : ${channel}" + [[ -n "${workdir}" ]] && echo " Work : ${workdir}" if [[ "${USE_CUSTOM_LANG}" = "true" ]]; then argument="${argument} -l ${language}" @@ -96,5 +103,8 @@ fi if [[ -n "${out_dir}" ]]; then argument="${argument} -o '${out_dir}'" fi +if [[ -n "${workdir}" ]]; then + argument="${argument} -w '${workdir}'" +fi argument="-a ${build_arch} --noconfirm ${argument} ${channel}" echo "${argument}" > "${1}" diff --git a/tools/testpkg.sh b/tools/testpkg.sh index 88c5036c1..f36152ddb 100755 --- a/tools/testpkg.sh +++ b/tools/testpkg.sh @@ -90,12 +90,13 @@ done # パッケージ一覧 msg_debug "Getting package list ..." for arch in "${archs[@]}"; do - packages+=($("${script_path}/tools/allpkglist.sh" -s -a "${arch}")) + readarray -O "${#packages[@]}" packages < <("${script_path}/tools/allpkglist.sh" -s -a "${arch}") done # ArchLinux公式サイトからパッケージグループの一覧を取得 msg_debug "Getting group list ..." -group_list=($(curl -s https://archlinux.org/groups/ | grep "/groups/x86_64" | cut -d "/" -f 4)) +#group_list=($(curl -s https://archlinux.org/groups/ | grep "/groups/x86_64" | cut -d "/" -f 4)) +readarray -t group_list < <(pacman -Sgg | cut -d " " -f 1 | uniq) # 実行開始 for pkg in "${packages[@]}"; do diff --git a/tools/wizard.sh b/tools/wizard.sh index f27fc4932..de87c4c83 100755 --- a/tools/wizard.sh +++ b/tools/wizard.sh @@ -129,7 +129,7 @@ Function_Global_Main_wizard_language () { echo "2: 日本語 Japanese" echo echo -n ": " - read Var_Global_Wizard_Option_language + read -r Var_Global_Wizard_Option_language case "${Var_Global_Wizard_Option_language}" in 1 ) Var_Global_Wizard_Option_language=en ;; @@ -238,7 +238,7 @@ Function_Global_Main_guide_to_the_web () { Function_Global_Main_run_keyring.sh () { local Var_Local_input_yes_or_no msg_n "Alter Linuxの鍵を追加しますか?(y/N): " "Are you sure you want to add the Alter Linux key? (y/N):" - read Var_Local_input_yes_or_no + read -r Var_Local_input_yes_or_no if ${Var_Global_Wizard_Option_nobuild}; then msg \ "${Var_Local_input_yes_or_no}が入力されました。シミュレーションモードが有効化されているためスキップします。" \ @@ -272,7 +272,7 @@ Function_Global_Ask_build_arch() { echo "2: i686 (32bit)" echo -n ": " - read Var_Global_Wizard_Option_build_arch + read -r Var_Global_Wizard_Option_build_arch case "${Var_Global_Wizard_Option_build_arch}" in 1 | "x86_64" ) Var_Global_Wizard_Option_build_arch="x86_64" ;; @@ -285,7 +285,7 @@ Function_Global_Ask_build_arch() { Function_Global_Ask_plymouth () { local Var_Local_input_yes_or_no msg_n "Plymouthを有効化しますか?[no](y/N) : " "Do you want to enable Plymouth? [no] (y/N) : " - read Var_Local_input_yes_or_no + read -r Var_Local_input_yes_or_no case "${Var_Local_input_yes_or_no}" in "y" | "Y" | "yes" | "Yes" | "YES" ) Var_Global_Build_plymouth=true ;; "n" | "N" | "no" | "No" | "NO" ) Var_Global_Build_plymouth=false ;; @@ -297,7 +297,7 @@ Function_Global_Ask_plymouth () { Function_Global_Ask_japanese () { local Var_Local_input_yes_or_no msg_n "日本語を有効化しますか?[no](y/N) : " "Do you want to activate Japanese? [no] (y/N) : " - read Var_Local_input_yes_or_no + read -r Var_Local_input_yes_or_no case "${Var_Local_input_yes_or_no}" in "y" | "Y" | "yes" | "Yes" | "YES" ) Var_Global_Build_japanese=true ;; "n" | "N" | "no" | "No" | "NO" ) Var_Global_Build_japanese=false ;; @@ -324,7 +324,7 @@ Function_Global_Ask_locale() { Var_Local_count=$(( Var_Local_count + 1 )) done echo -n ": " - read Var_Local_input_locale + read -r Var_Local_input_locale set +e expr "${Var_Local_input_locale}" + 1 >/dev/null 2>&1 @@ -366,7 +366,7 @@ Function_Global_Ask_comp_type () { echo "5: xz" echo "6: zstd" echo -n ": " - read Var_Local_input_comp_type + read -r Var_Local_input_comp_type case "${Var_Local_input_comp_type}" in "1" | "gzip" ) Var_Global_Build_comp_type="gzip" ;; "2" | "lzma" ) Var_Global_Build_comp_type="lzma" ;; @@ -391,7 +391,7 @@ Function_Global_Ask_comp_option () { Function_Local_gzip_level () { msg_n "gzipの圧縮レベルを入力してください。 (1~22) : " "Enter the gzip compression level. (1~22) : " - read Var_Local_gzip_level + read -r Var_Local_gzip_level if ! [[ ${Var_Local_gzip_level} -lt 23 && ${Var_Local_gzip_level} -ge 1 ]]; then Function_Local_gzip_level return 0 @@ -402,7 +402,7 @@ Function_Global_Ask_comp_option () { "gzipのウィンドウサイズを入力してください。 (1~15) : " \ "Please enter the gzip window size. (1~15) : " - read Var_Local_gzip_window + read -r Var_Local_gzip_window if ! [[ ${Var_Local_gzip_window} -lt 15 && ${Var_Local_gzip_window} -ge 1 ]]; then Function_Local_gzip_window return 0 @@ -419,7 +419,7 @@ Function_Global_Ask_comp_option () { msg_n \ "高圧縮モードを有効化しますか? (y/N) : " \ "Do you want to enable high compression mode? (y/N) : " - read Var_Local_lz4_high_comp + read -r Var_Local_lz4_high_comp case "${Var_Local_lz4_high_comp}" in "y" | "Y" | "yes" | "Yes" | "YES" ) comp_option="-Xhc" ;; "n" | "N" | "no" | "No" | "NO" ) : ;; @@ -433,7 +433,7 @@ Function_Global_Ask_comp_option () { msg_n \ "zstdの圧縮レベルを入力してください。 (1~22) : " \ "Enter the zstd compression level. (1~22) : " - read Var_Local_zstd_level + read -r Var_Local_zstd_level if [[ ${Var_Local_zstd_level} -lt 23 && ${Var_Local_zstd_level} -ge 1 ]]; then comp_option="-Xcompression-level ${Var_Local_zstd_level}" else @@ -458,7 +458,7 @@ Function_Global_Ask_comp_option () { echo "4: lzo1x_1_15" echo "5: lzo1x_999" echo -n ": " - read Var_Local_lzo_algorithm + read -r Var_Local_lzo_algorithm case "${Var_Local_lzo_algorithm}" in "1" | "lzo1x_1") Var_Local_lzo_algorithm="lzo1x_1" @@ -486,7 +486,7 @@ Function_Global_Ask_comp_option () { local Function_Local_lzo_level Var_Local_lzo_level Function_Local_lzo_level () { msg_n "lzoの圧縮レベルを入力してください。 (1~9) : " "Enter the gzip compression level. (1~9) : " - read Var_Local_lzo_level + read -r Var_Local_lzo_level if ! [[ ${Var_Local_lzo_level} -lt 10 && ${Var_Local_lzo_level} -ge 1 ]]; then Function_Local_lzo_level return 0 @@ -519,7 +519,7 @@ Function_Global_Ask_comp_option () { Function_Global_Ask_username () { msg_n "ユーザー名を入力してください : " "Please enter your username : " - read Var_Global_Build_username + read -r Var_Global_Build_username if [[ -z "${Var_Global_Build_username}" ]]; then Function_Global_Ask_username return 0 @@ -532,10 +532,10 @@ Function_Global_Ask_password () { local Var_Local_password Var_Local_password_confirm msg_n "パスワードを入力してください : " "Please enter your password : " - read -s Var_Local_password + read -r -s Var_Local_password echo msg_n "もう一度入力して下さい : " "Type it again : " - read -s Var_Local_password_confirm + read -r -s Var_Local_password_confirm if [[ ! "${Var_Local_password}" = "${Var_Local_password_confirm}" ]]; then echo msg_error "同じパスワードが入力されませんでした。" "You did not enter the same password." @@ -576,7 +576,7 @@ Function_Global_Ask_kernel () { # 質問する echo -n ": " local Var_Local_input_kernel - read Var_Local_input_kernel + read -r Var_Local_input_kernel # 回答を解析する # 数字かどうか判定する @@ -632,7 +632,7 @@ Function_Global_Ask_channel () { Var_Local_count="$(( Var_Local_count + 1 ))" done echo -n ":" - read Var_Global_Build_channel + read -r Var_Global_Build_channel # 入力された値が数字かどうか判定する set +e @@ -677,7 +677,7 @@ Function_Global_Ask_owner () { } msg_n "イメージファイルの所有者を入力してください。: " "Enter the owner of the image file.: " - read Var_Global_iso_owner + read -r Var_Global_iso_owner if [[ $(Function_Local_check_user ${Var_Global_iso_owner}) = false ]]; then echo "ユーザーが存在しません。" Function_Global_Ask_owner @@ -698,7 +698,7 @@ Function_Global_Ask_out_dir () { msg "イメージファイルの作成先を入力して下さい。" "Enter the destination to create the image file." msg "デフォルトは ${Var_Global_Wizard_Env_script_path}/out です。" "The default is ${Var_Global_Wizard_Env_script_path}/out." echo -n ": " - read out_dir + read -r out_dir if [[ -z "${out_dir}" ]]; then out_dir="${Var_Global_Wizard_Env_script_path}/out" else @@ -727,7 +727,7 @@ Function_Global_Ask_out_dir () { Function_Global_Ask_tarball () { local Var_Local_input_yes_or_no msg_n "tarballをビルドしますか?[no](y/N) : " "Build a tarball? [no] (y/N) : " - read Var_Local_input_yes_or_no + read -r Var_Local_input_yes_or_no case "${Var_Local_input_yes_or_no}" in "y" | "Y" | "yes" | "Yes" | "YES" ) Var_Global_Build_tarball=true ;; "n" | "N" | "no" | "No" | "NO" ) Var_Global_Build_tarball=false ;; @@ -776,7 +776,7 @@ Function_Global_Ask_Confirm () { "この設定で続行します。よろしいですか? (y/N) : " \ "Continue with this setting. Is it OK? (y/N) : " local Var_Local_input_yes_or_no - read Var_Local_input_yes_or_no + read -r Var_Local_input_yes_or_no case "${Var_Local_input_yes_or_no}" in "y" | "Y" | "yes" | "Yes" | "YES" ) : ;; "n" | "N" | "no" | "No" | "NO" ) ask ;;