mirror of
https://git.launchpad.net/livecd-rootfs
synced 2025-06-17 13:12:42 +00:00
Merge remote-tracking branch 'patviafore/use_ftpmaster_instead_of_archive_in_binary_hooks' into ubuntu/master
This commit is contained in:
commit
f53a681d8a
6
debian/changelog
vendored
6
debian/changelog
vendored
@ -1,10 +1,16 @@
|
|||||||
livecd-rootfs (2.700) UNRELEASED; urgency=medium
|
livecd-rootfs (2.700) UNRELEASED; urgency=medium
|
||||||
|
|
||||||
|
[ David Krauser ]
|
||||||
* buildd: produce kernel and initrd as separate artifacts
|
* buildd: produce kernel and initrd as separate artifacts
|
||||||
* buildd: call update-initramfs for all installed kernels
|
* buildd: call update-initramfs for all installed kernels
|
||||||
We only have one kernel installed, so we don't need to
|
We only have one kernel installed, so we don't need to
|
||||||
specify an explicit version.
|
specify an explicit version.
|
||||||
|
|
||||||
|
[ Patrick Viafore ]
|
||||||
|
* Replace archive.ubuntu.com and security.ubuntu.com with launchpad
|
||||||
|
mirrors. This is only done inside a build context, and the original
|
||||||
|
sources.list file is restored at the end of the build
|
||||||
|
|
||||||
-- David Krauser <david.krauser@canonical.com> Tue, 20 Oct 2020 15:00:38 -0400
|
-- David Krauser <david.krauser@canonical.com> Tue, 20 Oct 2020 15:00:38 -0400
|
||||||
|
|
||||||
livecd-rootfs (2.699) hirsute; urgency=medium
|
livecd-rootfs (2.699) hirsute; urgency=medium
|
||||||
|
@ -87,6 +87,42 @@ mount_image() {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
use_lp_archives_in_sourceslist(){
|
||||||
|
# Use the build environment apt mirror during the build,
|
||||||
|
# for both archive and security.
|
||||||
|
# live-build does this in the chroot (lb_chroot_archives)
|
||||||
|
# but not for the binary hooks
|
||||||
|
#
|
||||||
|
# To restore the sourceslist back to the original, call
|
||||||
|
# recover_sourceslist
|
||||||
|
|
||||||
|
mountpoint="${1}"
|
||||||
|
MOUNTPOINT_BACKUP_SOURCES_LIST="sources.list.tmp"
|
||||||
|
. config/bootstrap # For the LB_MIRROR_* variables
|
||||||
|
cp -a "${mountpoint}/etc/apt/sources.list" "${MOUNTPOINT_BACKUP_SOURCES_LIST}"
|
||||||
|
sed -i "s#http://archive.ubuntu.com/ubuntu#${LB_PARENT_MIRROR_CHROOT}#g" \
|
||||||
|
"${mountpoint}/etc/apt/sources.list"
|
||||||
|
sed -i "s#http://security.ubuntu.com/ubuntu#${LB_PARENT_MIRROR_CHROOT}#g" \
|
||||||
|
"${mountpoint}/etc/apt/sources.list"
|
||||||
|
|
||||||
|
sha256sum "${mountpoint}/etc/apt/sources.list" > sources.list.sha
|
||||||
|
}
|
||||||
|
|
||||||
|
recover_sourceslist(){
|
||||||
|
# Remove the build environment apt mirror from the image
|
||||||
|
|
||||||
|
# Check that the sources.list has not changed. If it has changed then the
|
||||||
|
# binary hook has modified the file that will be discarded. If the build
|
||||||
|
# fails here the binary hook needs to alter sources.list.tmp and regenerate
|
||||||
|
# sources.list.sha
|
||||||
|
|
||||||
|
mountpoint="${1}"
|
||||||
|
sha256sum --check sources.list.sha
|
||||||
|
|
||||||
|
mv "${MOUNTPOINT_BACKUP_SOURCES_LIST}" "${mountpoint}/etc/apt/sources.list"
|
||||||
|
unset MOUNTPOINT_BACKUP_SOURCES_LIST
|
||||||
|
}
|
||||||
|
|
||||||
setup_mountpoint() {
|
setup_mountpoint() {
|
||||||
local mountpoint="$1"
|
local mountpoint="$1"
|
||||||
|
|
||||||
@ -109,6 +145,7 @@ setup_mountpoint() {
|
|||||||
cp /etc/resolv.conf "$mountpoint/etc/resolv.conf"
|
cp /etc/resolv.conf "$mountpoint/etc/resolv.conf"
|
||||||
mv "$mountpoint/etc/nsswitch.conf" nsswitch.conf.tmp
|
mv "$mountpoint/etc/nsswitch.conf" nsswitch.conf.tmp
|
||||||
sed 's/systemd//g' nsswitch.conf.tmp > "$mountpoint/etc/nsswitch.conf"
|
sed 's/systemd//g' nsswitch.conf.tmp > "$mountpoint/etc/nsswitch.conf"
|
||||||
|
use_lp_archives_in_sourceslist "${mountpoint}"
|
||||||
chroot "$mountpoint" apt-get update
|
chroot "$mountpoint" apt-get update
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -125,6 +162,7 @@ teardown_mountpoint() {
|
|||||||
mount --make-private $submount
|
mount --make-private $submount
|
||||||
umount $submount
|
umount $submount
|
||||||
done
|
done
|
||||||
|
recover_sourceslist "${mountpoint}"
|
||||||
mv resolv.conf.tmp "$mountpoint/etc/resolv.conf"
|
mv resolv.conf.tmp "$mountpoint/etc/resolv.conf"
|
||||||
mv nsswitch.conf.tmp "$mountpoint/etc/nsswitch.conf"
|
mv nsswitch.conf.tmp "$mountpoint/etc/nsswitch.conf"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user