Для --convert добавлены запасные пути для конфигов ядра

master 0.1_rc2
Mike Khiretskiy 9 years ago
parent 65f2a12ab6
commit 8c8a1a1e59

@ -16,7 +16,7 @@
PATH=/lib/rc/bin:$PATH
TEXTDOMAIN=cl_kernel
CL_KERNEL_VERSION=0.1_rc1
CL_KERNEL_VERSION=0.1_rc2
DESCRIPTION=$"Kernel building tool"
DEFAULT_KERNEL_DIRECTORY=/usr/src/linux
SRC_DIRECTORY=/usr/src
@ -322,6 +322,33 @@ einfo_tail() {
TAILOUT+=( "$*" )
}
# получить содержимое текущего конфига
# .config в директории исходного кода ядра
# /boot/config-
# /proc/config.gz
get_old_config() {
local source_config="${KERNEL_DIR}/.config"
local boot_config="/boot/config-$(uname -r)"
local proc_config="/proc/config.gz"
if [[ -f $source_config ]]
then
config=$source_config
elif [[ -f $boot_config ]]
then
config=$boot_config
cp $config $NEW_CONFIG
elif [[ -f $proc_config ]]
then
config=$proc_config
zcat $proc_config >$NEW_CONFIG
fi
if [[ -n $config ]]
then
einfo $"Will be used $config kernel configuration"
else
eerror $"Failed to get current kernel configuration"
fi
}
######################
# Обработать параметры
@ -446,6 +473,8 @@ TEMPLATE_NAME="${LOCAL_TEMPLATES_DIR}/${TEMPLATE_NAME_ARCH_PREFIX}${PV2}"
# Подготовка новой конфигурации ядра
####################################
CONFIG_GZ=/proc/config.gz
if [[ -n $CREATE_NEW ]]
then
ebegin $"Preparing the current kernel configuration"
@ -454,8 +483,11 @@ then
${PV_OLD:-${PV}} >$NEW_CONFIG
eend
else
ebegin $"Applying the current kernel configuration"
eend
if [[ -n $OTHER_ARCH ]]
then
eerror $"--convert is uncompatible with --march"
fi
get_old_config
fi
######################################
@ -477,7 +509,7 @@ eend
###########################################
# Изменение конфигурации ядра пользователем
###########################################
(cd $KERNEL_DIR; [[ -n ${KERNEL_OLD_DIR} ]] && KCONFIG_CONFIG=$(basename $NEW_CONFIG) make oldconfig;KCONFIG_CONFIG=$(basename $NEW_CONFIG) make -s nconfig) || true
(cd $KERNEL_DIR; [[ -n ${KERNEL_OLD_DIR} || -z ${CREATE_NEW} ]] && KCONFIG_CONFIG=$(basename $NEW_CONFIG) make oldconfig;KCONFIG_CONFIG=$(basename $NEW_CONFIG) make -s nconfig) || true
###########################
# Создание шаблона

@ -23,7 +23,7 @@ msgid ""
" --kver-old [VERSION] specify the kernel version for new options ('list' for displaying possible values)\n"
" --convert migrate .config from the kernel directory to templates\n"
" -s, --skip-build do not build the kernel after configuration\n"
" --march [ARCH] kernel architecture\n"
" --march [ARCH] kernel architecture (x86 or x86_64)\n"
" --safemode create an additional initrd with all modules (only for calculate-sources)\n"
" --help display this help and exit\n"
""
@ -46,48 +46,54 @@ msgstr ""
#: ../cl-kernel:286
msgid "Kernel configuration file not found"
msgstr ""
#: ../cl-kernel:381
#: ../cl-kernel:347
msgid "Will be used $config kernel configuration"
msgstr ""
#: ../cl-kernel:349
msgid "Failed to get current kernel configuration"
msgstr ""
#: ../cl-kernel:410
msgid "Kernel directory ${check_dir} not found"
msgstr ""
#: ../cl-kernel:382
#: ../cl-kernel:411
msgid "Kernel directory ${check_dir} has no full sources"
msgstr ""
#: ../cl-kernel:394
#: ../cl-kernel:423
msgid "--safemode available for calculate-sources only"
msgstr ""
#: ../cl-kernel:399
#: ../cl-kernel:428
msgid "--safemode unavailable without dracut"
msgstr ""
#: ../cl-kernel:407
#: ../cl-kernel:436
msgid "Failed to create the kernel template directory"
msgstr ""
#: ../cl-kernel:449
#: ../cl-kernel:480
msgid "Preparing the current kernel configuration"
msgstr ""
#: ../cl-kernel:455
msgid "Applying the current kernel configuration"
#: ../cl-kernel:488
msgid "--convert is uncompatible with --march"
msgstr ""
#: ../cl-kernel:464
#: ../cl-kernel:498
msgid "Preparing the basic kernel configuration"
msgstr ""
#: ../cl-kernel:495
#: ../cl-kernel:529
msgid "The kernel configuration has not changed"
msgstr ""
#: ../cl-kernel:500
#: ../cl-kernel:534
msgid "Backing up the template"
msgstr ""
#: ../cl-kernel:504
#: ../cl-kernel:538
msgid "Failed to create a backup directory"
msgstr ""
#: ../cl-kernel:518
#: ../cl-kernel:552
msgid "Creating the template"
msgstr ""
#: ../cl-kernel:521
#: ../cl-kernel:555
msgid "Skipping the empty template"
msgstr ""
#: ../cl-kernel:556
#: ../cl-kernel:590
msgid "Kernel build time: "
msgstr ""
#: ../cl-kernel:571
#: ../cl-kernel:605
msgid "All done!"
msgstr ""

@ -67,7 +67,8 @@ msgstr ""
"répertoire du noyau vers les modèles\n"
" -s, --skip-build ne pas compiler le noyau après la "
"configuration\n"
" --march [АРХИТЕКТУРА] spécifier l'architecture du noyau (x86 ou x86_64)\n"
" --march [АРХИТЕКТУРА] spécifier l'architecture du noyau (x86 ou "
"x86_64)\n"
" --safemode créer un fichier initrd additionnel avec tous "
"les modules (option réservée à calculate-sources)\n"
" --help afficher cette aide et quitter\n"
@ -97,63 +98,71 @@ msgstr "Impossible d'appliquer les modèles"
msgid "Kernel configuration file not found"
msgstr "Fichier de configuration introuvable"
#: ../cl-kernel:381
#: ../cl-kernel:347
msgid "Will be used $config kernel configuration"
msgstr ""
#: ../cl-kernel:349
msgid "Failed to get current kernel configuration"
msgstr ""
#: ../cl-kernel:410
msgid "Kernel directory ${check_dir} not found"
msgstr "Répertoire du noyau, ${check_dir}, introuvable"
#: ../cl-kernel:382
#: ../cl-kernel:411
msgid "Kernel directory ${check_dir} has no full sources"
msgstr ""
"Le répertoire du noyau, ${check_dir}, ne contient pas de sources complètes"
#: ../cl-kernel:394
#: ../cl-kernel:423
msgid "--safemode available for calculate-sources only"
msgstr "L'option --safemode n'est disponible que pour calculate-sources"
#: ../cl-kernel:399
#: ../cl-kernel:428
msgid "--safemode unavailable without dracut"
msgstr "L'option --safemode requiert dracut"
#: ../cl-kernel:407
#: ../cl-kernel:436
msgid "Failed to create the kernel template directory"
msgstr "Impossible de créer le répertoire des modèles"
#: ../cl-kernel:449
#: ../cl-kernel:480
msgid "Preparing the current kernel configuration"
msgstr "Préparation de la configuration courante"
#: ../cl-kernel:455
msgid "Applying the current kernel configuration"
msgstr "Validation de la configuration courante"
#: ../cl-kernel:488
msgid "--convert is uncompatible with --march"
msgstr ""
#: ../cl-kernel:464
#: ../cl-kernel:498
msgid "Preparing the basic kernel configuration"
msgstr "Préparation de la configuration de base"
#: ../cl-kernel:495
#: ../cl-kernel:529
msgid "The kernel configuration has not changed"
msgstr "La configuration du noyau n'a pas été modifiée"
#: ../cl-kernel:500
#: ../cl-kernel:534
msgid "Backing up the template"
msgstr "Sauvegarde d'une copie du modèle"
#: ../cl-kernel:504
#: ../cl-kernel:538
msgid "Failed to create a backup directory"
msgstr "Impossible de créer le répertoire des copies"
#: ../cl-kernel:518
#: ../cl-kernel:552
msgid "Creating the template"
msgstr "Création du modèle"
#: ../cl-kernel:521
#: ../cl-kernel:555
msgid "Skipping the empty template"
msgstr "Omission du modèle vide"
#: ../cl-kernel:556
#: ../cl-kernel:590
msgid "Kernel build time: "
msgstr "Temps de compilation du noyau : "
#: ../cl-kernel:571
#: ../cl-kernel:605
msgid "All done!"
msgstr "C'est fait !"

@ -95,62 +95,70 @@ msgstr "Не удалось применить шаблоны ядра"
msgid "Kernel configuration file not found"
msgstr "Файл конфигурации ядра не найден"
#: ../cl-kernel:381
#: ../cl-kernel:347
msgid "Will be used $config kernel configuration"
msgstr "Будет использован $config с конфигурацией ядра"
#: ../cl-kernel:349
msgid "Failed to get current kernel configuration"
msgstr "Не удалось получить текущую конфигурацию ядра"
#: ../cl-kernel:410
msgid "Kernel directory ${check_dir} not found"
msgstr "Директория ядра ${check_dir} не найдена"
#: ../cl-kernel:382
#: ../cl-kernel:411
msgid "Kernel directory ${check_dir} has no full sources"
msgstr "Директория ядра ${check_dir} не содержит всего исходного кода"
#: ../cl-kernel:394
#: ../cl-kernel:423
msgid "--safemode available for calculate-sources only"
msgstr "--safemode доступен только для calculate-sources"
#: ../cl-kernel:399
#: ../cl-kernel:428
msgid "--safemode unavailable without dracut"
msgstr "--safemode недоступен без dracut"
#: ../cl-kernel:407
#: ../cl-kernel:436
msgid "Failed to create the kernel template directory"
msgstr "Не удалось создать директорию для шаблонов ядра"
#: ../cl-kernel:449
#: ../cl-kernel:480
msgid "Preparing the current kernel configuration"
msgstr "Подготовка текущей конфигурации ядра"
#: ../cl-kernel:455
msgid "Applying the current kernel configuration"
msgstr "Использование текущей конфигурации ядра"
#: ../cl-kernel:488
msgid "--convert is uncompatible with --march"
msgstr "--convert не совместим с --march"
#: ../cl-kernel:464
#: ../cl-kernel:498
msgid "Preparing the basic kernel configuration"
msgstr "Подготовка базовой конфигурации ядра"
#: ../cl-kernel:495
#: ../cl-kernel:529
msgid "The kernel configuration has not changed"
msgstr "Конфигурация ядра не изменилась"
#: ../cl-kernel:500
#: ../cl-kernel:534
msgid "Backing up the template"
msgstr "Резервное копирование шаблона"
#: ../cl-kernel:504
#: ../cl-kernel:538
msgid "Failed to create a backup directory"
msgstr "Не удалось создать директорию для резервных копий"
#: ../cl-kernel:518
#: ../cl-kernel:552
msgid "Creating the template"
msgstr "Создание шаблона"
#: ../cl-kernel:521
#: ../cl-kernel:555
msgid "Skipping the empty template"
msgstr "Пропуск пустого шаблона"
#: ../cl-kernel:556
#: ../cl-kernel:590
msgid "Kernel build time: "
msgstr "Время сборки ядра: "
#: ../cl-kernel:571
#: ../cl-kernel:605
msgid "All done!"
msgstr "Все готово!"

Loading…
Cancel
Save