Re: Compiling source code on FAI client
[...] 1#!/bin/bash 2 3$ROOTCMD cp -R /media/mirror/clustersoft /home/cluster 4$ROOTCMD chmod -R 777 /home/cluster/clustersoft 5$target/usr/bin/gcc $target/home/cluster/clustersoft/test.c From previous runs I learned that I have to put the keyword $target infront of the gcc command and in front of the file I would like to compile (test.c). But know, fai complains that the file stdio.h (this is file which I include in test.c) can not be found. Obviously, I should also add the keyword $target infront of any filename I call within the source-code, but this would not make any sense ... [...] Ok, just one seeming misconception: $target is not a keyword, but a simple environment variable (ah, and you should be using $FAI_ROOT, IMHO); but the solution should be pretty simple: State line 5 as $ROOTCMD gcc /home/cluster/clustersoft/test.c as $ROOTCMD expands to chroot $FAI_ROOT, which is what you need: a chroot. Best, Michael pgp0JdgZYpQpH.pgp Description: PGP signature
Re: Compiling source code on FAI client
Thanks for your tip, but I still have some difficulties. When I proceed as you described, the code will be compiled, but the output file will be written to root directory. So, I have to change the directory for compilation. I thought that something like $ROOTCMD cd /home/cluster/clustersoft $ROOTCMD gcc /home/cluster/clustersoft/test.c resp. $ROOTCMD cd /home/cluster/clustersoft $ROOTCMD gcc test.c should work, but obviously, it does not :( Any help is apreciated. Dominik Michael Tautschnig wrote: [...] 1#!/bin/bash 2 3$ROOTCMD cp -R /media/mirror/clustersoft /home/cluster 4$ROOTCMD chmod -R 777 /home/cluster/clustersoft 5$target/usr/bin/gcc $target/home/cluster/clustersoft/test.c From previous runs I learned that I have to put the keyword $target infront of the gcc command and in front of the file I would like to compile (test.c). But know, fai complains that the file stdio.h (this is file which I include in test.c) can not be found. Obviously, I should also add the keyword $target infront of any filename I call within the source-code, but this would not make any sense ... [...] Ok, just one seeming misconception: $target is not a keyword, but a simple environment variable (ah, and you should be using $FAI_ROOT, IMHO); but the solution should be pretty simple: State line 5 as $ROOTCMD gcc /home/cluster/clustersoft/test.c as $ROOTCMD expands to chroot $FAI_ROOT, which is what you need: a chroot. Best, Michael -- Dominik Bänninger Oetlingerstrasse 45 CH 4057 Basel Tel.: +41 61 381 54 13 Mob.: +41 79 600 51 75
Compiling source code on FAI client
Dear list, I am a newbie in FAI. I got my running FAI configuration space but I am looking now for a feature I could not find until now described anywhere. What I would like to do is the following: Copy some source code from the FAI server to the FAI client (this works) and then compile this source code on the FAI client (this works not :-( ). Therefore, I wrote the following script: 1#!/bin/bash 2 3$ROOTCMD cp -R /media/mirror/clustersoft /home/cluster 4$ROOTCMD chmod -R 777 /home/cluster/clustersoft 5$target/usr/bin/gcc $target/home/cluster/clustersoft/test.c From previous runs I learned that I have to put the keyword $target infront of the gcc command and in front of the file I would like to compile (test.c). But know, fai complains that the file stdio.h (this is file which I include in test.c) can not be found. Obviously, I should also add the keyword $target infront of any filename I call within the source-code, but this would not make any sense ... So, does anyone has a good idea how to solve this problem? (Of cours I could make the FAI installation and after first reboot I could run a script which would make this compilation, but I do not think that this is the meaning of FAI ). Best regards Dominik