Bas van der Vlies wrote:
> Hello,
> 
>   first i want to say thanks for the debian packages in the new version 
> :-D. Saves a lot of work!
> 
> In our cluster we have now mixed nodes i386 and x86_64. Now if we enabled 
> bittorrent then there is now flavor included as with eg rsync and the 
> installation will fail for X86_64 machines because the boel_binaries.tar.gz 
> is i386.
> 
> {{{
> bittorrent_get_file ${TORRENTS_DIR}/${bittorrent_tarball}.torrent 
> ${BOEL_BINARIES_DIR}
> 
> CMD="rsync -av ${IMAGESERVER}::boot/${ARCH}/${FLAVOR}/boel_binaries.tar.gz 
> ${BOEL_BINARIES_DIR}"
> }}}
> 
> Is this a bug or feature?

Well.. I'd like to say that it's a feature, but it seems more a bug... :-)

Anyway, the patch below (untested) should fix this problem.

-Andrea

---

Index: sbin/si_installbtimage
===================================================================
--- sbin/si_installbtimage      (revision 4164)
+++ sbin/si_installbtimage      (working copy)
@@ -170,24 +170,36 @@
 my $ARCH = (uname())[4];
 $ARCH =~ s/i.86/i386/;
 
-my $boel_binaries = "$TARBALL_DIR/boel_binaries.tar.gz";
-print "Preparing torrent file for BOEL binaries...\n";
-# Create the symbolic link into the image directory.
-symlink($config->autoinstall_boot_dir() . '/' . $ARCH .
-    '/standard/boel_binaries.tar.gz', $boel_binaries) 
-    if (! -e $boel_binaries);
-# Make .torrent file.
-if ($maketorrent =~ "btmakemetafile") {
-    system "$maketorrent $boel_binaries 
http://$image_server:$tracker_port/announce --target 
$TORRENT_DIR/boel_binaries.tar.gz.torrent";
+# Get all the available boel_binaries (for all the supported architectures).
+my @archs_dir;
+if (opendir(DIR, $config->autoinstall_boot_dir())) {
+     @archs_dir = grep {!/^\.$|^\.\.$/} readdir(DIR);
 } else {
-    system "$maketorrent http://$image_server:$tracker_port/announce 
$boel_binaries --target $TORRENT_DIR/boel_binaries.tar.gz.torrent";
+    die("error: couldn't open " . $config->autoinstall_boot_dir() . "\n");
 }
-if ($?) {
-    die "ERROR: cannot create BOEL binaries torrent file!\n";
+foreach my $arch (@archs_dir) {
+    print "Preparing torrent file for BOEL binaries for $arch...\n";
+    my $boel_binaries = $config->autoinstall_boot_dir() . '/' . $arch .
+                        '/standard/boel_binaries.tar.gz';
+    my $boel_binaries_link = "${TARBALL_DIR}/${arch}-boel_binaries.tar.gz";
+    # Create a symlink into the image directory.
+    if ((-e $boel_binaries) && (! -e $boel_binaries_link)) {
+        symlink($boel_binaries, $boel_binaries_link);
+    }
+    # Make .torrent file.
+    if ($maketorrent =~ "btmakemetafile") {
+        system "$maketorrent $boel_binaries_link 
http://$image_server:$tracker_port/announce --target 
$TORRENT_DIR/$arch-boel_binaries.tar.gz.torrent";
+    } else {
+        system "$maketorrent http://$image_server:$tracker_port/announce 
$boel_binaries_link --target $TORRENT_DIR/$arch-boel_binaries.tar.gz.torrent";
+    }
+    if ($?) {
+        print STDERR "ERROR: cannot create BOEL binaries torrent file for 
$arch! skipping it.\n";
+        next;
+    }
+    # symlink is required by old versions of BitTorrent.
+    symlink($boel_binaries_link, $TORRENT_DIR . "/" . 
basename($boel_binaries_link));
+    print "done.\n";
 }
-# symlink is required by old versions of BitTorrent.
-symlink($boel_binaries, $TORRENT_DIR . "/" . basename($boel_binaries));
-print "done.\n";
 
 # Starting first image seeder.
 print "Starting first image server seeder...\n";
Index: initrd_source/skel/etc/init.d/functions
===================================================================
--- initrd_source/skel/etc/init.d/functions     (revision 4164)
+++ initrd_source/skel/etc/init.d/functions     (working copy)
@@ -652,11 +652,12 @@
 
         # Download BOEL binaries from peers
         bittorrent_tarball="boel_binaries.tar.gz"
-        logmsg "Start downloading ${bittorrent_tarball} using bittorrent"
+        logmsg "Start downloading ${bittorrent_tarball} (${ARCH}) using 
bittorrent"
         logmsg ""
         logmsg "--> INFO: remember to start 
/etc/init.d/systemimager-server-bittorrent on the image server!"
         logmsg ""
-        bittorrent_get_file ${TORRENTS_DIR}/${bittorrent_tarball}.torrent 
${BOEL_BINARIES_DIR}
+        bittorrent_get_file 
${TORRENTS_DIR}/${ARCH}-${bittorrent_tarball}.torrent ${BOEL_BINARIES_DIR}
+        cd ${BOEL_BINARIES_DIR} && mv ${ARCH}-${bittorrent_tarball} 
${bittorrent_tarball}
         unset bittorrent_tarball
 
     elif [ ! -z $FLAMETHROWER_DIRECTORY_PORTBASE ]; then

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
sisuite-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sisuite-users

Reply via email to