64studio / dibby

Generate Custom Debian images for your embedded projects
BSD 3-Clause "New" or "Revised" License
8 stars 2 forks source link

Target system could use defined mirror for apt #10

Closed danielhjames closed 5 years ago

danielhjames commented 5 years ago

Currently bootstrap/0002_minimal.sh hard codes the http://deb.debian.org/debian/ for the apt repository of the target system.

Might we have the target system pulling package updates from a different mirror to that used for the initial build, e.g. a special APT server? If so, it could be a config option.

obbardc commented 5 years ago

It should use $CONFIG_DEBOOTSTRAP_MIRROR which is set in default-config and overridden by user

danielhjames commented 5 years ago

I think that is a good solution for now. If necessary we could add something like $CONFIG_UPDATE_MIRROR later.

danielhjames commented 5 years ago

I thought I had the fix in the commit above, but it doesn't work as expected. To debug this, in bootstrap/0002_minimal.sh I added an echo of the current value of $CONFIG_DEBOOTSTRAP_MIRROR on line 32 just before the APT repo is created:

info "Setting up APT for $CONFIG_DEBOOTSTRAP_MIRROR"
# setup apt repository
# TODO configure from upstream location
cat << EOF > /etc/apt/sources.list

This appears to work for the configured mirror http://free.hands.com/debian/, but then it reverts to using the default http://deb.debian.org/debian after that:

I: dibby: running /home/daniel/64studio/git/dibby/bootstrap/0002_minimal.sh
I: dibby: Setting up APT for http://free.hands.com/debian/
Hit:1 http://deb.debian.org/debian buster InRelease
Get:2 http://deb.debian.org/debian buster/main Translation-en [5980 kB]
obbardc commented 5 years ago

Sorted in master, the only question remaining is how the user enables the security & updates repository.