public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* Adding additional apt repositories during the build
@ 2018-11-09 10:17 Benedikt Niedermayr
  2018-11-09 10:53 ` Maxim Yu. Osipov
  0 siblings, 1 reply; 2+ messages in thread
From: Benedikt Niedermayr @ 2018-11-09 10:17 UTC (permalink / raw)
  To: isar-users

[-- Attachment #1: Type: text/plain, Size: 1657 bytes --]

Hi guys,

I wanted to add additional repositories at the beginning of the build 
(e.g for installing docker-ce) and I tried to add it to the 
"DISTRO_APT_KEYS" variable.

But doing that way debootstrap doesn't seem to work anymore:

| I: Retrieving InRelease
| I: Retrieving Release
| I: Retrieving Release.gpg
| I: Checking Release signature
| E: Release signed by unknown key (key id EF0F382A1A7B6500)
| WARNING: exit code 1 from a shell command.


I think the default gpg keyring gets overwritten.

Do you have any proposals or clean solutions for this?


For now I implemented a little hack to get things to work.

Maybe we need a functionality in Isar which works like a hook based 
mechanism, so we can add those

to the initial build step when bootstrapping the rootfs.


isar-bootstrap-host.bbappend & isar-bootstrap-target.bbappend:

do_bootstrap_append() {
     sudo install -v -m755 ${WORKDIR}/custom-setup.sh ${ROOTFSDIR}/
     sudo flock "${ISAR_BOOTSTRAP_LOCK}"-c "\
         set -e
         export DISTRO_SUITE="${@get_distro_suite(d, True)}"
         export DISTRO_ARCH="${DISTRO_ARCH}"
         chroot "${ROOTFSDIR}" /custom-setup.sh
     "
     sudo rm -f ${ROOTFSDIR}/custom-setup.sh
}
custom-setup.sh:
GPG_URL="https://download.docker.com/linux/debian/gpg"
apt-get install --no-install-recommends -y curl apt-transport-https 
ca-certificates curl gnupg2 software-properties-common
curl -fsSL $GPG_URL |apt-key add -
echo "deb [arch=$DISTRO_ARCH] https://download.docker.com/linux/debian \
$DISTRO_SUITE stable"|\
tee /etc/apt/sources.list.d/docker.list
apt-get update -y
Regards
Benedikt


[-- Attachment #2: Type: text/html, Size: 5178 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Adding additional apt repositories during the build
  2018-11-09 10:17 Adding additional apt repositories during the build Benedikt Niedermayr
@ 2018-11-09 10:53 ` Maxim Yu. Osipov
  0 siblings, 0 replies; 2+ messages in thread
From: Maxim Yu. Osipov @ 2018-11-09 10:53 UTC (permalink / raw)
  To: Benedikt Niedermayr, isar-users

Hi Benedikt,

On 11/9/18 1:17 PM, 'Benedikt Niedermayr' via isar-users wrote:
> Hi guys,
> 
> I wanted to add additional repositories at the beginning of the build 
> (e.g for installing docker-ce) and I tried to add it to the 
> "DISTRO_APT_KEYS" variable.
> 
> But doing that way debootstrap doesn't seem to work anymore:
> 
> | I: Retrieving InRelease
> | I: Retrieving Release
> | I: Retrieving Release.gpg
> | I: Checking Release signature
> | E: Release signed by unknown key (key id EF0F382A1A7B6500)
> | WARNING: exit code 1 from a shell command.
> 
> 
> I think the default gpg keyring gets overwritten.
> 
> Do you have any proposals or clean solutions for this?

Yes, this is a known problem (I absolutely agree that this 
DISTRO_APT_KEYS is confusing) and I plan to fix it in a next couple of 
weeks.

Thanks for your proposal - I'll think if installation of keys could be
done with less "hooky" way.

Regards,
Maxim.

> 
> For now I implemented a little hack to get things to work.
> 
> Maybe we need a functionality in Isar which works like a hook based 
> mechanism, so we can add those
> 
> to the initial build step when bootstrapping the rootfs.
> 
> 
> isar-bootstrap-host.bbappend & isar-bootstrap-target.bbappend:
> 
> do_bootstrap_append() {
>      sudo install -v -m755 ${WORKDIR}/custom-setup.sh ${ROOTFSDIR}/
>      sudo flock "${ISAR_BOOTSTRAP_LOCK}"-c "\
>          set -e
>          export DISTRO_SUITE="${@get_distro_suite(d, True)}"
>          export DISTRO_ARCH="${DISTRO_ARCH}"
>          chroot "${ROOTFSDIR}" /custom-setup.sh
>      "
>      sudo rm -f ${ROOTFSDIR}/custom-setup.sh
> }
> custom-setup.sh:
> GPG_URL="https://download.docker.com/linux/debian/gpg"
> apt-get install --no-install-recommends -y curl apt-transport-https 
> ca-certificates curl gnupg2 software-properties-common
> curl -fsSL $GPG_URL |apt-key add -
> echo "deb [arch=$DISTRO_ARCH] https://download.docker.com/linux/debian \
> $DISTRO_SUITE stable"|\
> tee /etc/apt/sources.list.d/docker.list
> apt-get update -y
> Regards
> Benedikt
> 
> -- 
> You received this message because you are subscribed to the Google 
> Groups "isar-users" group.
> To unsubscribe from this group and stop receiving emails from it, send 
> an email to isar-users+unsubscribe@googlegroups.com 
> <mailto:isar-users+unsubscribe@googlegroups.com>.
> To post to this group, send email to isar-users@googlegroups.com 
> <mailto:isar-users@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/isar-users/42954dda-cc28-4cf4-e1fe-a3b1b636a4a3%40googlemail.com 
> <https://groups.google.com/d/msgid/isar-users/42954dda-cc28-4cf4-e1fe-a3b1b636a4a3%40googlemail.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.


-- 
Maxim Osipov
ilbers GmbH
Maria-Merian-Str. 8
85521 Ottobrunn
Germany
+49 (151) 6517 6917
mosipov@ilbers.de
http://ilbers.de/
Commercial register Munich, HRB 214197
General Manager: Baurzhan Ismagulov

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-09 10:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-09 10:17 Adding additional apt repositories during the build Benedikt Niedermayr
2018-11-09 10:53 ` Maxim Yu. Osipov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox