ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: "Ivan A. Melnikov" <iv@altlinux.org>
To: ALT Linux Team development discussions <devel@lists.altlinux.org>
Subject: Re: [devel] Определение целевой архитектуры в mkimage и m-p
Date: Wed, 2 Oct 2019 13:46:10 +0400
Message-ID: <20191002094610.vdbz7af2xul7gt3r@titan.localdomain> (raw)
In-Reply-To: <ac71a197-a88d-18dc-5844-7a6bbddc42c4@gmail.com>

On Wed, Oct 02, 2019 at 12:16:19PM +0300, Leonid Krivoshein wrote:
> 
> 
> 02.10.2019 9:43, Антон Мидюков пишет:
> > 02.10.2019 13:38, Ivan A. Melnikov пишет:
> > > On Wed, Oct 02, 2019 at 12:06:58AM +0300, Leonid Krivoshein wrote:
> > > > Коллеги, приветствую!
> > > > 
> > > > Простой вопрос: как в процессе сборки образа отличить целевую
> > > > архитектуру:
> > > > x86_64, aarm64 или powerpc? Могу я полагаться на $(uname -m) или
> > > > есть более
> > > > кошерная переменная? И что там конкретно должно быть, на всякий?
> > > Полагаться на $(uname -m) нельзя -- образы часто собираются через
> > > qemu-user на x86_64, особенно для arm* и mipsel.
> > > 
> > > Если Вы про mkimage-profiles, то там есть переменная $(ARCH), или
> > > $GLOBAL_ARCH во всяких image-scripts.d. Примеры использования, и,
> > > соответственно, что там может быть, несложно на git grep'ать.
> > В mkimage-profiles не проблема. Леонид хочет в mkimage сделать проверку
> > архитектур. Но там, вроде, проверка архитектур ни где не делается.
> > 
> 
> Скрипт отрабатывает в чруте собираемого образа. По большому счёту не так
> важно, будет он частью mkimage, частью m-p или попадёт туда как-то иначе.
> Потому что в конечном итоге его вызовет mkimage. И, как я подозреваю,
> вызовет он его, предварительно почистив окружение. Поэтому и спрашиваю...

В m-p проще (и правильнее наверное) использовать $GLOBAL_ARCH, она
создаётся и прокидывается куда нужно; вне m-p вполне можно воспользоваться
$(rpm --eval '%_host_cpu'), видел в паре мест, должно работать хорошо.

Ещё можно скрипт в пакет запаковать, правильный для каждой архитектуры,
а в профиле просто добавить пакет ;D

--
  wbr,
    iv m.


  parent reply	other threads:[~2019-10-02  9:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-01 23:44 ` Alexey V. Vissarionov
2019-10-02  6:38 ` Ivan A. Melnikov
2019-10-02  6:43   ` Антон Мидюков
2019-10-02  9:46       ` Ivan A. Melnikov [this message]
2019-10-02 10:06         ` Alexey Gladkov

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=20191002094610.vdbz7af2xul7gt3r@titan.localdomain \
    --to=iv@altlinux.org \
    --cc=devel@lists.altlinux.org \
    /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 Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/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 devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git