FAI_SOURCES_LIST_CLIENT

mod+linux-fai at std.com mod+linux-fai at std.com
Tue Aug 20 20:35:53 CEST 2002


I don't yet understand the structure of FAI well enough to
know how best to approach a problem I have, so I propose one
approach and ask for better alternatives.

It appears that make-fai-nfsroot just unconditionally copies
the host's /etc/apt/sources.list and /etc/fai/fai.conf to the
nfsroot before the base.tgz is created.  The problem is that I
don't necessarily want my FAI client machines to use the same
Debian mirror or Debian release that my FAI server does.

My solution was to add the following to prepare_apt()

              .
              .
              .
+    #
+    # If you'd like to override the /etc/apt/sources.list
+    # that's included in the base.tgz image you can define
+    # this variable which will be expanded in prepare_apt().
+    # Can't use the $FAI/files approach because those are
+    # processed too late for our purposes.
+    # NOTE: this is expanded with 'echo -e' so
+    #       sequences like '\n' are honored.
+    #
+    if [ "$FAI_SOURCES_LIST_CLIENT" ]; then
+        echo -e "$FAI_SOURCES_LIST_CLIENT" > $FAI_ROOT/etc/apt/sources.list
+    fi
+
    $ROOTCMD apt-get update
    $ROOTCMD apt-get check
              .
              .
              .

I define FAI_SOURCES_LIST_CLIENT in various  .var files.
Is there a better/cleaner way to do this?



More information about the linux-fai mailing list