The following patch causes the d-i build process to output an
initrd.list file beside each initrd listing the packages it contains and
the versions of each package. What do people think - should I commit
this? I think it would be very useful for:

  * figuring out what versions of everything went into the initrd part
    of a given image without having to find and read through build logs,
    which is our only way of doing this at the moment and is a
    nightmare;

  * arranging for debian-cd to exclude packages already in the initrd
    automatically rather than using its current manually-maintained
    exclude-udebs thing;

  * allowing third parties building d-i-based images to work out which
    set of packages is sufficient.

Index: config/dir
===================================================================
--- config/dir  (revision 16700)
+++ config/dir  (working copy)
@@ -53,6 +53,7 @@
 
 # The files we may want to have in dest/
 INITRD = $(SOME_DEST)/$(EXTRANAME)initrd.gz
+INITRD_LIST = $(SOME_DEST)/$(EXTRANAME)initrd.list
 KERNEL = $(foreach name,$(KERNELNAME),$(SOME_DEST)/$(EXTRANAME)$(name))
 BOOT = $(SOME_DEST)/$(EXTRANAME)boot.img$(GZIPPED)
 ROOT = $(SOME_DEST)/$(EXTRANAME)root.img$(GZIPPED)
@@ -63,6 +64,7 @@
 
 # some intersting files in tmp/ we may need
 TEMP_INITRD = $(TEMP)/initrd.gz
+TEMP_INITRD_LIST = $(TEMP)/initrd.list
 TEMP_KERNEL = $(foreach name,$(KERNELNAME),$(TEMP)/$(name))
 TEMP_BOOT = $(TEMP)/boot.img
 TEMP_ROOT = $(TEMP)/root.img
Index: Makefile
===================================================================
--- Makefile    (revision 16700)
+++ Makefile    (working copy)
@@ -312,6 +312,9 @@
        done
        sort -n < $(TEMP)/diskusage.txt > $(TEMP)/diskusage.txt.new && \
                mv $(TEMP)/diskusage.txt.new $(TEMP)/diskusage.txt
+       grep-dctrl -nsPackage,Version '' $(TREE)/var/lib/dpkg/status | \
+               perl -nle '$$p = $$_; $$v = <>; chomp $$v; <>; print "$$p $$v"' | \
+               sort > $(TEMP_INITRD_LIST)
 
        # Clean up after dpkg.
        rm -rf $(DPKGDIR)/updates
@@ -572,8 +575,9 @@
 # Create the images for dest/. Those are the targets called from config.
 #
 # Create a compressed image of the root filesystem by way of genext2fs.
-$(INITRD): $(TEMP_INITRD)
+$(INITRD): $(TEMP_INITRD) $(TEMP_INITRD_LIST)
        install -m 644 -D $< $@
+       install -m 644 -D $(TEMP_INITRD_LIST) $(INITRD_LIST)
        ./update-manifest $@ $(MANIFEST-INITRD)
 
 $(TEMP_INITRD): $(STAMPS)tree-$(targetstring)-stamp
@@ -600,6 +604,8 @@
        esac
        gzip -v9f $(TEMP)/initrd
 
+$(TEMP_INITRD_LIST): $(STAMPS)tree-$(targetstring)-stamp
+
 # raw kernel images
 $(KERNEL): TEMP_REAL_KERNEL = $(TEMP)/$(shell echo ./$@ |sed 
's,$(SOME_DEST)/$(EXTRANAME),,')
 $(KERNEL):

-- 
Colin Watson                                  [EMAIL PROTECTED]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to