Hi everyone, I'm _proposing_ this patch to support snapshots.debian.org in live-build. I think this may be of Debian CUT interest also, to build their live image. Uses cases ---------- This patch is very usefull to: 1. debug testing and sid (and squeeze), building a live image and comparing differences and bugs in packages in any date available in snapshots.debian.org. 2. if a package is broken/bugged recently, build a live image from an earlier date and pin the package to prevent its upgrade. 3. build live images with live-installer when daily debian-installer is broken/not build by setting the date that have a sucessfull d-i build. Also, this would make possible for Debian CUT to build live images of their rolling release, with little patch: lb_binary_debian-installer URL should be changed from d-i.debian.org/daily-images to alioth.debian.org/~gilbert-guest/snapshots/ and some function to choose the correct installer added to debian-snapshots.sh, and maybe more, did not test. Info/doc -------- I did not document the patch in the man pages, but the draft for docs should be something like: --mode debian-snapshots to enable debian-snapshots mode (will use latest archive snapshot available). --debian-snapshots-date YYYYMMDD empty (or not set) to use latest archive snapshot, or a valid date in snapshots.debian.org URL. It chooses the same date for d-i/live-installer, will warn if no daily d-i is available for that date. Examples -------- 1. Build a wheezy image as wheezy was of today, and is "frozen" (will not track latest wheezy repos) in today's date (this is the default, binary mirror is snapshots.debian.org date): lb config --mode debian-snapshots -d wheezy sudo lb build 2. Build a wheezy image as wheezy was in 15 April, and is "frozen" (will not track latest wheezy repos) in that date (this is the default, binary mirror is snapshots.debian.org date): lb config --mode debian-snapshots -d wheezy \ --debian-snapshot-date 20120415 sudo lb build The resulting image should have wheezy as of the date and its sources.list will have it too. 3. Build a wheezy image from a earlier date state, but make the final image track the normal wheezy repos (to allow latest packages installtions): lb config --mode debian-snapshots -d wheezy \ --debian-snapshot-date 20120415 \ --mirror-binary http://ftp.debian.org/debian sudo lb build The resulting image would be built as in that date but any packages upgrades or installs would be from latest testing/wheezy. 4. Build a wheezy image with live-installer (if debian-installer was built on that date and is available). There is no daily d-i available in 15 April, but there is one in 20120101 (see http://d-i.debian.org/daily-images/amd64/ for available d-i builds). This is good to track both d-i bugs and release bugs. lb config --mode debian-snapshots -d wheezy \ --debian-snapshot-date 20120101 --debian-installer live \ --debian-installer-distribution daily sudo lb build With live-installer, the installed to disk sources.list will be, by default because live-installer is daily, tracking the latest wheezy/sid repositories. 5. Build a wheezy image, with installer, and with a "frozen" installed to disk system (that will track snapshots.debian.org after install and not get upgrades until sources.list is updated): SNAP_DATE="20120101" lb config --mode debian-snapshots -d wheezy \ --debian-snapshot-date $SNAP_DATE --debian-installer live \ --debian-installer-distribution daily # override debian-installer default installed to disk sources.list mkdir -p config/binary_debian-installer cat > config/binary_debian-installer/preseed.cfg << EOF d-i apt-setup/local0/repository string http://snapshot.debian.org/archive/debian/$SNAP_DATE stable main contrib non-free d-i mirror/country string manual d-i mirror/country seen true d-i mirror/http/hostname string snapshot.debian.org d-i mirror/http/hostname seen true d-i mirror/http/directory string /archive/debian/$SNAP_DATE d-i mirror/http/directory seen true d-i mirror/http/proxy string d-i mirror/http/proxy seen true EOF sudo lb build The examples are for wheezy, but can be adapted to sid. For stable/squeeze the installer will be the existing stable d-i at the date (6.0.x). Review ------ That's all I can think of right now. I must say, again, that this is very usefull to track testing/unstable and d-i bugs and also to workaround them with package pinning. Please review the patch for "incongruencies", typos that i may have missed, wrong variable names (debian-snapshots or snapshots-debian?) or wrong approach. I've made this a live-build --mode option, it may not be best or desired approach, considering that it makes using backports with snapshots impossible. Nevertheless I think this patch could be a good starting point to the final patch. Sorry for this long email. Cheers Rui Miguel P. Bernardo (1): support snapshots.debian.org in live-build functions/debian-snapshots.sh | 65 ++++++++++++++++++++++++++++++ functions/defaults.sh | 38 +++++++++++++++++ scripts/build/lb_binary_debian-installer | 5 +++ scripts/build/lb_chroot_apt | 10 +++++ scripts/build/lb_config | 14 ++++++- 5 files changed, 130 insertions(+), 2 deletions(-) create mode 100644 functions/debian-snapshots.sh -- 1.7.10
Attachment:
0001-support-snapshots.debian.org-in-live-build.patch
Description: Binary data