From: Sergey Vlasov <vsu@altlinux.ru>
To: devel-kernel@altlinux.ru
Subject: Re: [d-kernel] Q: разноплатформенные конфиги для kernel-image
Date: Sat, 16 Apr 2005 21:07:28 +0400
Message-ID: <20050416170728.GD30505@procyon.home> (raw)
In-Reply-To: <20050416151304.GD16229@lrn.ru>
[-- Attachment #1: Type: text/plain, Size: 2592 bytes --]
On Sat, Apr 16, 2005 at 07:13:04PM +0400, Anton D. Kachalov wrote:
> Поднимаю ещё раз вопрос о том, как быть со сборкой ядра из одного spec'а
> для разных архитектур?
> Могу предложить вариант, основанный на макросах.
>
> 1. инклуд конфигов в спек:
>
> %add_source_config i586
> %add_source_config athlon
> %add_source_config x86_64
Тут смешаны в одну кучу архитектура и оптимизация. В принципе можно
собрать и 32-разрядное ядро с оптимизацией под Athlon-64 (CONFIG_MK8).
Да и у x86_64 сейчас есть CONFIG_MK8 (-march=k8) и CONFIG_MPSC
(-march=nocona).
> что должно добавить:
> SourceN: config-%kernel_base_version-%flavour.i586
> Source(N+1): config-%kernel_base_version-%flavour.athlon
> Source(N+2): config-%kernel_base_version-%flavour.x86_64
>
> 2. секция build, копирование конфига
>
> вместо %__cp -vf %SOURCE1 arch/%base_arch/defconfig используем:
> %copy_kernel_source_config
>
> этот макрос должен сделать проверку на наличие конфига
> config-%kernel_base_version-%flavour.%base_arch и если есть, скопировать в
> arch/%base_arch/defconfig
>
> Вопрос: что делать, если конфиг не найден? Т.е. если я решил собрать ядро
> с --target=i686 вместо --target=i586? Делать symlink'и на конфиги и
> паковать?
Ну в принципе можно попытаться и подкорректировать тип процессора в
конфиге. Надо строить какую-то таблицу (%arch) -> (%base_arch,
CONFIG_Mxxx). Правда, в разных версиях ядер набор доступных
CONFIG_Mxxx может быть разным, но можно писать туда несколько
вариантов.
#!/bin/sh
base_arch="$1"
cpu_types=$(sed -ne '/prompt[[:space:]]\+"Processor family"/,/endchoice/ s/^config[[:space:]]\+\([^[:space:]]\+\)[[:space:]]*$/\1/p' < arch/"$base_arch"/Kconfig)
filter=
for cpu in $cpu_types; do
if [ "$cpu" = "$2" ]; then
echo "CONFIG_$cpu=y"
else
echo "# CONFIG_$cpu is not set"
fi
filter="$filter
/CONFIG_$cpu[=[:space:]]/d"
done
sed -e "$filter"
(2.6.x only; ещё дописать подбор поддерживаемого ядром значения из
заданного набора).
> И мне немного неясен хак:
> ### It's a hack, but a useful hack:
> cmp -s .config %SOURCE1 || %__cp -vf .config %SOURCE1
Видимо, можно его убивать - сейчас в 2.6 это копирование выполняется
каждый раз, поскольку в .config положили timestamp.
Кстати, кто-нибудь помнит, почему конфиг кладётся в
arch/%base_arch/defconfig, а не в .config с последующим запуском make
oldconfig?
> Какие ещё могут быть варианты?
>
> Со всем остальным проблем нет. Собирается на ура.
> Разумеется, перед релизом ядра, ответственные за архитектуры, обновляют
> конфиги :)
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2005-04-16 17:07 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-16 15:13 Anton D. Kachalov
2005-04-16 16:19 ` Boldin Pavel
2005-04-16 16:29 ` Anton D. Kachalov
2005-04-16 17:25 ` Boldin Pavel
2005-04-16 17:36 ` Anton D. Kachalov
2005-04-16 17:43 ` Boldin Pavel
2005-04-16 17:07 ` Sergey Vlasov [this message]
2005-04-16 17:34 ` Anton D. Kachalov
2005-04-16 18:36 ` Sergey Vlasov
2005-04-16 18:56 ` Anton D. Kachalov
2005-04-16 19:20 ` Sergey Vlasov
2005-04-17 6:11 ` Boldin Pavel
2005-04-16 19:14 ` Boldin Pavel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050416170728.GD30505@procyon.home \
--to=vsu@altlinux.ru \
--cc=devel-kernel@altlinux.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux kernel packages development
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/devel-kernel/0 devel-kernel/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 devel-kernel devel-kernel/ http://lore.altlinux.org/devel-kernel \
devel-kernel@altlinux.org devel-kernel@altlinux.ru devel-kernel@altlinux.com
public-inbox-index devel-kernel
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.devel-kernel
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git