From 532a964f21c0e71bcf3316f0ed1ec0530e0b6d7d Mon Sep 17 00:00:00 2001 From: kokkiemouse Date: Sun, 6 Jun 2021 09:01:26 +0900 Subject: [PATCH] fixed menuconfig? Signed-off-by: kokkiemouse --- .gitignore | 2 ++ Makefile | 4 +++- menuconfig-script/rootconf | 23 ++++++++++++----------- tools/channel-choice-conf-gen.sh | 16 ++++++++++++++++ tools/menuconf-to-alterconf.sh | 2 +- 5 files changed, 34 insertions(+), 13 deletions(-) create mode 100755 tools/channel-choice-conf-gen.sh diff --git a/.gitignore b/.gitignore index 8baa3d94..23db924f 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,5 @@ menuconfig-script/kernel_choice_* /out/ out /pacman-*.conf +.config +system/channels_menuconfig-* diff --git a/Makefile b/Makefile index 2c6dae05..bb525cb4 100644 --- a/Makefile +++ b/Makefile @@ -24,11 +24,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:system/channels_menuconfig-x86_64 system/channels_menuconfig-i686 + @${CURRENT_DIR}/tools/channel-choice-conf-gen.sh build_option: @if [ ! -f .config ]; then make menuconfig ; fi diff --git a/menuconfig-script/rootconf b/menuconfig-script/rootconf index 4ed506ac..2b65ea23 100644 --- a/menuconfig-script/rootconf +++ b/menuconfig-script/rootconf @@ -113,17 +113,18 @@ 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" + if X64_BUILD + choice + prompt "チャンネル" + source channels_menuconfig-x86_64 + endchoice + endif + if I686_BUILD + choice + prompt "チャンネル" + source channels_menuconfig-i686 + endchoice + endif endchoice config IMAGE_OWNER string "イメージファイルの所有者名" diff --git a/tools/channel-choice-conf-gen.sh b/tools/channel-choice-conf-gen.sh new file mode 100755 index 00000000..63f0a99e --- /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/menuconf-to-alterconf.sh b/tools/menuconf-to-alterconf.sh index 21642c1c..851d2bbe 100755 --- a/tools/menuconf-to-alterconf.sh +++ b/tools/menuconf-to-alterconf.sh @@ -58,7 +58,7 @@ 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_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' ` -- 2.11.0