2015-01-22 18:27:07 +03:00
== Архитектурно-зависимые фрагменты ==
=== Makefile ===
Достаточно воспользоваться ifeq/ifneq, сравнивая $(ARCH) с нужным:
ifeq (x86_64,$(ARCH))
EFI_LISTS := $(call tags,base efi)
endif
При необходимости сравнить с о списком ("любой x86") можно сделать так:
ifeq (,$(filter-out i586 x86_64,$(ARCH)))
use/x11/xorg: use/x11 use/x11/intel use/firmware
else
use/x11/xorg: use/x11
endif
В рецептах (shell-часть Makefile) используйте $(ARCH) или $$ARCH.
=== скрипты ===
В скриптовых хуках ({image-,}scripts.d/*) проверяйте $GLOBAL_ARCH.
2018-06-20 13:18:56 +03:00
=== списки пакетов, профили групп ===
2015-01-22 18:27:07 +03:00
Бывает так, что в списке пакетов есть смысл упоминать какой-либо из них
только для определённой архитектуры (например, wine или steam); в таких
случаях можно воспользоваться механизмом подстановки, который пословно
обрабатывает списки и в случае наличия суффикса @ARCH оставляет только
слова, в которых этот суффикс соответствует заданной архитектуре сборки.
Например, для Simply Linux в mkimage-profiles-desktop есть строчки:
2015-05-04 23:52:26 +03:00
@I586_ONLY@haspd
@X86_64_ONLY@i586-haspd
2015-01-22 18:27:07 +03:00
В случае mkimage-profiles они должны выглядеть так:
2015-05-04 23:52:26 +03:00
haspd@i586
i586-haspd@x86_64
2015-01-22 18:27:07 +03:00
2018-03-14 07:55:42 +03:00
или упрощённо (с версии 1.2.12):
haspd@IA32
2021-07-18 18:30:54 +03:00
С версии 1.3.15 поддерживается макрос E2K ("любое поколение e2k*") и
ARM (armh или aarch64), а также выборка "для любой архитектуры, кроме"
(например, @!E2K, или "@!ARM).
2019-10-23 15:31:58 +03:00
2021-11-22 21:45:15 +03:00
С версии 1.4.21 поддерживается перечисление архитектур через запятую
bin/archdep-filter: implement multi-!matching too
This has been clearly lacking while making the previous commit
but the implementation isn't that clear so let it be a separate
step.
The problem requiring the change in subsequent processors
is that these relied upon "@arch" as a flag to be inspected,
and "pkg@!arch1,arch2" on arch2 needs to take out *all* of that
fragment *including* arch1 mention as well.
Part of the cause is difference in handling: "positive" multi-match
would explode its "client" line into multiple lines to filter down
the pipeline, while "negative" multi-match *has* to keep that line
on a similarly single line (otherwise we'd end up with N-1 of those
slipping past the filter for particular architecture thus defeating
the whole purpose of "negative" matching semantics):
$ echo 'pkg@!E2K,mipsel,riscv64' |
sed -r ':loop; s/^((([^@]+@!)[^,]+)+),([a-zA-Z0-9_]+)/\1@!\4/; t loop'
pkg@!E2K@!mipsel@!riscv64
I've tried my best to test this specific change but it still might
introduce a regression in some corner case; feel free to report;
looks like there's a space for improvement in m-p's automated
tests department as well.
So now we can do:
pkg@!ARCHES1,ARCHES2,arch3,arch4
and have pkg excluded on arches mentioned; the previous approach
could only offer explicit whitelists (not that it was entirely
wrong but then again, we have both ExclusiveArch and ExcludeArch
rpmtags in our spec files).
2021-11-22 21:45:16 +03:00
после "@" или "@!":
2021-11-22 21:45:15 +03:00
LibreOffice-still@X86,aarch64,ppc64le,mipsel
bin/archdep-filter: implement multi-!matching too
This has been clearly lacking while making the previous commit
but the implementation isn't that clear so let it be a separate
step.
The problem requiring the change in subsequent processors
is that these relied upon "@arch" as a flag to be inspected,
and "pkg@!arch1,arch2" on arch2 needs to take out *all* of that
fragment *including* arch1 mention as well.
Part of the cause is difference in handling: "positive" multi-match
would explode its "client" line into multiple lines to filter down
the pipeline, while "negative" multi-match *has* to keep that line
on a similarly single line (otherwise we'd end up with N-1 of those
slipping past the filter for particular architecture thus defeating
the whole purpose of "negative" matching semantics):
$ echo 'pkg@!E2K,mipsel,riscv64' |
sed -r ':loop; s/^((([^@]+@!)[^,]+)+),([a-zA-Z0-9_]+)/\1@!\4/; t loop'
pkg@!E2K@!mipsel@!riscv64
I've tried my best to test this specific change but it still might
introduce a regression in some corner case; feel free to report;
looks like there's a space for improvement in m-p's automated
tests department as well.
So now we can do:
pkg@!ARCHES1,ARCHES2,arch3,arch4
and have pkg excluded on arches mentioned; the previous approach
could only offer explicit whitelists (not that it was entirely
wrong but then again, we have both ExclusiveArch and ExcludeArch
rpmtags in our spec files).
2021-11-22 21:45:16 +03:00
java-11-openjdk@!E2K,mipsel
2021-11-22 21:45:15 +03:00
2015-01-22 18:27:07 +03:00
Для преобразования можно воспользоваться следующей командой:
2015-05-04 23:52:26 +03:00
sed -r -e 's/@I586_ONLY@([^\t ]+)/\1@i586/g' \
-e 's/@X86_64_ONLY@([^\t ]+)/\1@x86_64/g'
2018-03-14 07:55:42 +03:00
При необходимости добавить пакет только на x86-архитектурах (неважно,
i586 или x86_64) можно воспользоваться макросом X86 (с версии 1.2.12):
xorg-drv-intel@X86
2018-06-20 13:18:56 +03:00
Аналогичная функциональность реализована для профилей установки.
2018-07-25 16:41:08 +03:00
=== загрузчики ===
Как правило, сперва понадобится доработка mkimage -- см. скрипты
tools/mki-pack-*boot -- и лишь затем профиля; см. тж. lib/boot.mk
и фичу pack.