diff options
author | Daniel Baumann <daniel@debian.org> | 2011-02-14 14:32:10 +0100 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2011-03-09 19:20:43 +0100 |
commit | ebf1ea52381c1af715b8e77cf06d609a22bf4ce0 (patch) | |
tree | 6204dad935cc78f57300c6d81106514d36859ec1 /scripts | |
parent | ff807068b95f0b116338ee94a5da94823799e2aa (diff) | |
download | vyos-live-build-ebf1ea52381c1af715b8e77cf06d609a22bf4ce0.tar.gz vyos-live-build-ebf1ea52381c1af715b8e77cf06d609a22bf4ce0.zip |
Adding mirror handling for derivatives.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/build/lb_chroot_sources | 168 | ||||
-rwxr-xr-x | scripts/build/lb_source_disk | 16 |
2 files changed, 158 insertions, 26 deletions
diff --git a/scripts/build/lb_chroot_sources b/scripts/build/lb_chroot_sources index e41cf5b11..76e843f26 100755 --- a/scripts/build/lb_chroot_sources +++ b/scripts/build/lb_chroot_sources @@ -53,34 +53,70 @@ cat > chroot/etc/apt/sources.list << EOF deb ${LB_PARENT_MIRROR_CHROOT} ${LB_PARENT_DISTRIBUTION} ${LB_ARCHIVE_AREAS} EOF + if [ "${LB_DERIVATIVE}" = "true" ] + then + +cat > chroot/etc/apt/sources.list.d/${LB_MODE}.list << EOF +# /etc/apt/sources.list.d/${LB_MODE}.list + +deb ${LB_MIRROR_CHROOT} ${LB_DISTRIBUTION} ${LB_ARCHIVE_AREAS} +EOF + + fi + if [ "${LB_SOURCE}" = "true" ] then echo "deb-src ${LB_PARENT_MIRROR_CHROOT} ${LB_PARENT_DISTRIBUTION} ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list + + if [ "${LB_DERIVATIVE}" = "true" ] + then + echo "deb-src ${LB_MIRROR_CHROOT} ${LB_DISTRIBUTION} ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list + fi fi if [ "${LB_SECURITY}" = "true" ] then case "${LB_MODE}" in - ubuntu) - echo "deb ${LB_PARENT_MIRROR_CHROOT_SECURITY} ${LB_PARENT_DISTRIBUTION}-security ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list - - if [ "${LB_SOURCE}" = "true" ] + debian|progress) + if [ "${LB_PARENT_DISTRIBUTION}" != "sid" ] then - echo "deb-src ${LB_PARENT_MIRROR_CHROOT_SECURITY} ${LB_PARENT_DISTRIBUTION}-security ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list + echo "deb ${LB_PARENT_MIRROR_CHROOT_SECURITY} ${LB_PARENT_DISTRIBUTION}/updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list + + if [ "${LB_SOURCE}" = "true" ] + then + echo "deb-src ${LB_PARENT_MIRROR_CHROOT_SECURITY} ${LB_PARENT_DISTRIBUTION}/updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list + fi fi - ;; - *) - if [ "${LB_PARENT_DISTRIBUTION}" != "sid" ] && [ "${LB_PARENT_DISTRIBUTION}" != "unstable" ] + if [ "${LB_MODE}" = progress ] then - echo "deb ${LB_PARENT_MIRROR_CHROOT_SECURITY} ${LB_PARENT_DISTRIBUTION}/updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list + echo "deb ${LB_MIRROR_CHROOT_SECURITY} ${LB_DISTRIBUTION}-updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list if [ "${LB_SOURCE}" = "true" ] then - echo "deb-src ${LB_PARENT_MIRROR_CHROOT_SECURITY} ${LB_PARENT_DISTRIBUTION}/updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list + echo "deb-src ${LB_MIRROR_CHROOT_SECURITY} ${LB_DISTRIBUTION}-updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list + fi + else + if [ "${LB_DERIVATIVE}" = "true" ] + then + echo "deb ${LB_MIRROR_CHROOT_SECURITY} ${LB_DISTRIBUTION}/updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list + + if [ "${LB_SOURCE}" = "true" ] + then + echo "deb-src ${LB_MIRROR_CHROOT_SECURITY} ${LB_DISTRIBUTION}/updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list + fi fi fi ;; + + ubuntu) + echo "deb ${LB_PARENT_MIRROR_CHROOT_SECURITY} ${LB_PARENT_DISTRIBUTION}-security ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list + + if [ "${LB_SOURCE}" = "true" ] + then + echo "deb-src ${LB_PARENT_MIRROR_CHROOT_SECURITY} ${LB_PARENT_DISTRIBUTION}-security ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list + fi + ;; esac fi @@ -96,13 +132,23 @@ EOF fi ;; esac + + if [ "${LB_DERIVATIVE}" = "true" ] && [ "${LB_MIRROR_CHROOT_VOLATILE}" != "none" ] + then + echo "deb ${LB_MIRROR_CHROOT_VOLATILE} ${LB_ARENT_DISTRIBUTION}-updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list + + if [ "${LB_SOURCE}" = "true" ] + then + echo "deb-src ${LB_ARENT_MIRROR_CHROOT_VOLATILE} ${LB_ARENT_DISTRIBUTION}-updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list + fi + fi fi if [ "${LB_BACKPORTS}" = "true" ] then case "${LB_MODE}" in debian) - if [ "${LB_PARENT_DISTRIBUTION}" != "sid" ] && [ "${LB_PARENT_DISTRIBUTION}" != "unstable" ] + if [ "${LB_PARENT_DISTRIBUTION}" != "sid" ] then echo "deb ${LB_PARENT_MIRROR_CHROOT_BACKPORTS} ${LB_PARENT_DISTRIBUTION}-backports ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list @@ -113,6 +159,16 @@ EOF fi ;; esac + + if [ "${LB_DERIVATIVE}" = "true" ] && [ "${LB_MIRROR_CHROOT_BACKPORTS}" != "none" ] + then + echo "deb ${LB_MIRROR_CHROOT_BACKPORTS} ${LB_DISTRIBUTION}-backports ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list + + if [ "${LB_SOURCE}" = "true" ] + then + echo "deb-src ${LB_MIRROR_CHROOT_BACKPORTS} ${LB_DISTRIBUTION}-backports ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list + fi + fi fi # Check local sources.list @@ -411,9 +467,15 @@ EOF Chroot chroot "apt-get ${APT_OPTIONS} install aptitude" fi + # Temporary hack (FIXME) + if [ "${LB_DERIVATIVE}" = "true" ] + then + _APT="--force-yes" + fi + Apt chroot update - Apt chroot upgrade - Apt chroot dist-upgrade + Apt chroot upgrade ${_APT} + Apt chroot dist-upgrade ${_APT} # Installing keyring packages if [ -n "${LB_KEYRING_PACKAGES}" ] @@ -479,38 +541,76 @@ EOF rm -rf chroot/var/lib/apt/lists mkdir -p chroot/var/lib/apt/lists/partial + # Configure custom sources.list + cat > chroot/etc/apt/sources.list << EOF # /etc/apt/sources.list deb ${LB_PARENT_MIRROR_BINARY} ${LB_PARENT_DISTRIBUTION} ${LB_ARCHIVE_AREAS} EOF + if [ "${LB_DERIVATIVE}" = "true" ] + then + +cat > chroot/etc/apt/sources.list.d/${LB_MODE}.list << EOF +# /etc/apt/sources.list.d/${LB_MODE}.list + +deb ${LB_MIRROR_BINARY} ${LB_DISTRIBUTION} ${LB_ARCHIVE_AREAS} +EOF + + fi + if [ "${LB_SOURCE}" = "true" ] then echo "deb-src ${LB_PARENT_MIRROR_BINARY} ${LB_PARENT_DISTRIBUTION} ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list + + if [ "${LB_DERIVATIVE}" = "true" ] + then + echo "deb-src ${LB_MIRROR_BINARY} ${LB_DISTRIBUTION} ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list + fi fi if [ "${LB_SECURITY}" = "true" ] then case "${LB_MODE}" in - ubuntu) - echo "deb ${LB_PARENT_MIRROR_BINARY_SECURITY} ${LB_PARENT_DISTRIBUTION}-security ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list - - if [ "${LB_SOURCE}" = "true" ] + debian|progress) + if [ "${LB_PARENT_DISTRIBUTION}" != "sid" ] then - echo "deb-src ${LB_PARENT_MIRROR_BINARY_SECURITY} ${LB_PARENT_DISTRIBUTION}-security ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list + echo "deb ${LB_PARENT_MIRROR_BINARY_SECURITY} ${LB_PARENT_DISTRIBUTION}/updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list + + if [ "${LB_SOURCE}" = "true" ] + then + echo "deb-src ${LB_PARENT_MIRROR_BINARY_SECURITY} ${LB_PARENT_DISTRIBUTION}/updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list + fi fi - ;; - *) - if [ "${LB_PARENT_DISTRIBUTION}" != "sid" ] && [ "${LB_PARENT_DISTRIBUTION}" != "unstable" ] + if [ "${LB_MODE}" = progress ] then - echo "deb ${LB_PARENT_MIRROR_BINARY_SECURITY} ${LB_PARENT_DISTRIBUTION}/updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list + echo "deb ${LB_MIRROR_BINARY_SECURITY} ${LB_DISTRIBUTION}-updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list if [ "${LB_SOURCE}" = "true" ] then - echo "deb-src ${LB_PARENT_MIRROR_BINARY_SECURITY} ${LB_PARENT_DISTRIBUTION}/updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list + echo "deb-src ${LB_MIRROR_BINARY_SECURITY} ${LB_DISTRIBUTION}-updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list fi + else + if [ "${LB_DERIVATIVE}" = "true" ] + then + echo "deb ${LB_MIRROR_BINARY_SECURITY} ${LB_DISTRIBUTION}/updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list + + if [ "${LB_SOURCE}" = "true" ] + then + echo "deb-src ${LB_MIRROR_BINARY_SECURITY} ${LB_DISTRIBUTION}/updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list + fi + fi + fi + ;; + + ubuntu) + echo "deb ${LB_PARENT_MIRROR_BINARY_SECURITY} ${LB_PARENT_DISTRIBUTION}-security ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list + + if [ "${LB_SOURCE}" = "true" ] + then + echo "deb-src ${LB_PARENT_MIRROR_BINARY_SECURITY} ${LB_PARENT_DISTRIBUTION}-security ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list fi ;; esac @@ -528,13 +628,23 @@ EOF fi ;; esac + + if [ "${LB_DERIVATIVE}" = "true" ] && [ "${LB_MIRROR_BINARY_VOLATILE}" != "none" ] + then + echo "deb ${LB_MIRROR_BINARY_VOLATILE} ${LB_ARENT_DISTRIBUTION}-updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list + + if [ "${LB_SOURCE}" = "true" ] + then + echo "deb-src ${LB_ARENT_MIRROR_BINARY_VOLATILE} ${LB_ARENT_DISTRIBUTION}-updates ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list + fi + fi fi if [ "${LB_BACKPORTS}" = "true" ] then case "${LB_MODE}" in debian) - if [ "${LB_PARENT_DISTRIBUTION}" != "sid" ] && [ "${LB_PARENT_DISTRIBUTION}" != "unstable" ] + if [ "${LB_PARENT_DISTRIBUTION}" != "sid" ] then echo "deb ${LB_PARENT_MIRROR_BINARY_BACKPORTS} ${LB_PARENT_DISTRIBUTION}-backports ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list @@ -545,6 +655,16 @@ EOF fi ;; esac + + if [ "${LB_DERIVATIVE}" = "true" ] && [ "${LB_MIRROR_BINARY_BACKPORTS}" != "none" ] + then + echo "deb ${LB_MIRROR_BINARY_BACKPORTS} ${LB_DISTRIBUTION}-backports ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list + + if [ "${LB_SOURCE}" = "true" ] + then + echo "deb-src ${LB_MIRROR_BINARY_BACKPORTS} ${LB_DISTRIBUTION}-backports ${LB_ARCHIVE_AREAS}" >> chroot/etc/apt/sources.list.d/${LB_MODE}.list + fi + fi fi # Configure third-party repositories diff --git a/scripts/build/lb_source_disk b/scripts/build/lb_source_disk index e88a92b25..3d21223c6 100755 --- a/scripts/build/lb_source_disk +++ b/scripts/build/lb_source_disk @@ -74,8 +74,20 @@ esac if [ -n "${TRACE}" ] then - echo "$(wget -q ${LB_PARENT_MIRROR_BOOTSTRAP}/${TRACE} -O - | head -n 1)" \ - > source/.disk/archive_trace + case "${LB_DERIVATIVE}" in + true) + echo "$(echo ${LB_PARENT_MIRROR_BOOTSTRAP} | awk -F:// '{ print $2 }'): $(wget -q ${LB_PARENT_MIRROR_BOOTSTRAP}/${TRACE} -O - | head -n 1)" \ + > source/.disk/archive_trace + + echo "$(echo ${LB_MIRROR_BOOTSTRAP} | awk -F:// '{ print $2 }'): $(wget -q ${LB_MIRROR_BOOTSTRAP}/${TRACE} -O - | head -n 1)" \ + >> source/.disk/archive_trace + ;; + + false) + echo "$(wget -q ${LB_PARENT_MIRROR_BOOTSTRAP}/${TRACE} -O - | head -n 1)" \ + > source/.disk/archive_trace + ;; + esac fi case "${LB_DEBIAN_INSTALLER}" in |