[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#703436: Multi-arch builds uses wrong UDEB_EXCLUDE



On 20/03/2013 15:46, Steve McIntyre wrote:
On Wed, Mar 20, 2013 at 10:30:55AM +0200, Robert Spencer wrote:
On 19/03/2013 18:09, Steve McIntyre wrote:

Ish. In fact, there's a deeper bug here - the udeb include/exclude
code is actually worse than you think. At the moment, we get away with
things only because the amd64 and i386 files provided with debian-cd
are identical. The code here just doesn't work properly with
multi-arch builds as there is no way to specify different files in
CONF.sh for the different arches. Equally, d-i only looks for its
include and exclude lists in one place on an install CD regardless of
architecture so there's currently no way of passing different config
for the different arches *anyway*.

As you might guess, this piece of the code hasn't been played with for
a while!

I'm thinking a better way to handle this would be to pick up on the
data files for all arches rather than just the first one, and merge
them. What do you think?

I'm not sure that I'm following you. Do you mean something like
default_netinst_udeb_include with the following in:

netcfg
ethdetect

Not quite, no. I'm thinking of keeping the per-arch include/exclude
files and merging at build time.

Understood.

And then if it's alpha include "fdisk-udeb" or amd64 or i386 include
"pcmciautils-udeb".

Alternatively if it's just the .disk/udeb_include and
.disk/udeb_exclude files you don't want duplicates in, then we can
filter them out while maintaining the order (I'm assuming the order
is important).

Filtering is fine, ordering doesn't matter at all AFAICS.

Okay, I hope the attached patch file is acceptable. It's for debian-cd 3.1.12.

The issue
that worries me more is the fact that different arches have different
lists that should go here, maybe with bad consequences if they're
wrong. Maybe I should be tweaking things in d-i too to add per-arch
control.

I think that would probably be best.

--
Robert Spencer
--- tools/start_new_disc~	2013-04-01 01:26:54.000000000 +0000
+++ tools/start_new_disc	2013-04-15 11:13:35.000000000 +0000
@@ -170,12 +170,20 @@
 
     echo "  Adding udeb/base includes/excludes"
 
+    # Check if the following has been set by CONF.sh
+    if [ -z "$UDEB_INCLUDE" ]; then
+        NO_UDEB_INCLUDE=1
+    fi
+    if [ -z "$UDEB_EXCLUDE" ]; then
+        NO_UDEB_EXCLUDE=1
+    fi
+
     for ARCH in $ARCHES
     do
         if [ $ARCH != source ] ; then
             # Netinst/businesscard CD have different
             # udeb_include and udeb_exclude files
-            if [ -z "$UDEB_INCLUDE" ] ; then
+            if [ -n "$NO_UDEB_INCLUDE" ] ; then
                 case "$INSTALLER_CD"x in
                     "1"x)
                         UDEB_INCLUDE=$DI_DATA_DIR/"$ARCH"_businesscard_udeb_include;;
@@ -186,7 +194,7 @@
                 esac
             fi
 
-            if [ -z "$UDEB_EXCLUDE" ] ; then
+            if [ -n "$NO_UDEB_EXCLUDE" ] ; then
                 case "$INSTALLER_CD"x in
                     "1"x)
                         UDEB_EXCLUDE=$DI_DATA_DIR/"$ARCH"_businesscard_udeb_exclude;;
@@ -200,14 +208,30 @@
             # Sort out the udeb include and exclude files
             if [ -n "$UDEB_INCLUDE" ] ; then
                 if [ -r "$UDEB_INCLUDE" ] ; then
-                    cat "$UDEB_INCLUDE" >> "$CDDIR/.disk/udeb_include"
+                    if [ -e "$CDDIR/.disk/udeb_include" ]; then
+                        if ! diff -q "$UDEB_INCLUDE" "$CDDIR/.disk/udeb_include"; then
+                            mv "$CDDIR"/.disk/udeb_include{,~}
+                            cat "$UDEB_INCLUDE" "$CDDIR/.disk/udeb_include~" | sort | uniq > "$CDDIR/.disk/udeb_include"
+                            rm "$CDDIR/.disk/udeb_include~" 
+                        fi
+                    else
+                        cp "$UDEB_INCLUDE" "$CDDIR/.disk/udeb_include"
+                    fi
                 else
                     echo "WARNING: Unable to read UDEB_INCLUDE file $UDEB_INCLUDE"
                 fi
             fi
             if [ -n "$UDEB_EXCLUDE" ] ; then
                 if [ -r "$UDEB_EXCLUDE" ] ; then
-                    cat "$UDEB_EXCLUDE" >> "$CDDIR/.disk/udeb_exclude"
+                    if [ -e "$CDDIR/.disk/udeb_exclude" ]; then
+                        if ! diff -q "$UDEB_EXCLUDE" "$CDDIR/.disk/udeb_exclude"; then
+                            mv "$CDDIR"/.disk/udeb_exclude{,~}
+                            cat "$UDEB_EXCLUDE" "$CDDIR/.disk/udeb_exclude~" | sort | uniq > "$CDDIR/.disk/udeb_exclude"
+                            rm "$CDDIR/.disk/udeb_exclude~" 
+                        fi
+                    else
+                        cp "$UDEB_EXCLUDE" "$CDDIR/.disk/udeb_exclude"
+                    fi
                 else
                     echo "WARNING: Unable to read UDEB_EXCLUDE file $UDEB_EXCLUDE"
                 fi

Reply to: