From a84611d766dc31ecd4dfff14666e637832657fbc Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Wed, 19 Feb 2014 12:34:25 +1100 Subject: [PATCH] Replace security.ubuntu.com when setting mirror The current method to rewrite the mirror URL in the ubuntu element will only rewrite archive.ubuntu.com, which leaves the security URL alone. This is probably not intended for people who are creating images behind firewalls. Change-Id: I54a867e0e9d5a7c94324a5c00ff1a83b4e6e4524 --- elements/ubuntu/README.md | 4 ++-- elements/ubuntu/pre-install.d/01-set-ubuntu-mirror | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/elements/ubuntu/README.md b/elements/ubuntu/README.md index 009afe93..9fc02df8 100644 --- a/elements/ubuntu/README.md +++ b/elements/ubuntu/README.md @@ -6,5 +6,5 @@ Overrides: use the environment variable DIB\_CLOUD\_IMAGES * To download a non-default release of Ubuntu cloud images, use the environment variable DIB\_RELEASE - * To use a different mirror rather than archive.ubuntu.com, use the - environment variable DIB\_DISTRIBUTION\_MIRROR + * To use different mirrors rather than the default of archive.ubuntu.com and + security.ubuntu.com, use the environment variable DIB\_DISTRIBUTION\_MIRROR diff --git a/elements/ubuntu/pre-install.d/01-set-ubuntu-mirror b/elements/ubuntu/pre-install.d/01-set-ubuntu-mirror index 9633e9cd..a1b36494 100755 --- a/elements/ubuntu/pre-install.d/01-set-ubuntu-mirror +++ b/elements/ubuntu/pre-install.d/01-set-ubuntu-mirror @@ -6,5 +6,5 @@ DIB_DISTRIBUTION_MIRROR=${DIB_DISTRIBUTION_MIRROR:-} [ -n "$DIB_DISTRIBUTION_MIRROR" ] || exit 0 -sudo sed -ie "s&http://archive.ubuntu.com/ubuntu&$DIB_DISTRIBUTION_MIRROR&" \ +sudo sed -ie "s&http://\(archive\|security\).ubuntu.com/ubuntu&$DIB_DISTRIBUTION_MIRROR&" \ /etc/apt/sources.list