* Kernel Installer
@ 2008-08-03 20:50 Satish Eerpini
2008-08-03 21:00 ` Adrian Bunk
2008-08-04 5:03 ` Bob van Manen
0 siblings, 2 replies; 9+ messages in thread
From: Satish Eerpini @ 2008-08-03 20:50 UTC (permalink / raw)
To: linux-kernel
Hello everyone , :
i have been writing a kernel installer which may make the kernel
installation process a lot more easier for noobs , (don ask me why
noobs would like to compile a kernel) , but atleast till they learn
to do it the good way !
i have written some code which is below , well i am stuck at one thing , ...
once the .config file is set , is there any method to compute the
exact no of files that are going to be compiled ??
lack of this knowledge is clearly visible in the use of a "while(1)"
in the code below :
#include <stdio.h>
int main(int argc, char * argv[]) {
char buf[100],syscommand[100];
FILE *fp;
int i=0,j=0,k=0,l=0;
int checking_done=0;
strcpy(buf,"\0");
fflush(stdout);
strcpy(syscommand,"make -C ");
if(argc==2){
strcat(syscommand,argv[1]);
}
else{
printf("The program accepts the kernel source \n directory as
the single argument.\n Please provide necessary arguments\n");
return ;
}
printf("\n\n\t\t\t\t\t\t Kernel Installer V1.0\n\n ");
fp= popen(syscommand,"r");
do{
fscanf(fp,"%s",buf);
if(checking_done!=1){
if(strcmp(buf,"CHK")==0){
fscanf(fp,"%s",buf);
printf("\rChecking file : %-30s\t\n",buf);
}
if(strcmp(buf,"CALL")==0){
fscanf(fp,"%s",buf);
printf("\rCalling script : %s\t\n",buf);
}
}
if(strcmp(buf,"LD")==0){
fscanf(fp,"%s",buf);
printf("\rLinking File : %s\t",buf);
l++;
checking_done=1;
}
if(strcmp(buf,"CC")==0){
fscanf(fp,"%s",buf);
if(strcmp(buf,"[M]")==0){
fscanf(fp,"%s",buf);
printf("\rCompiling module (%-4d files, %-4d
modules compiled): %-60s\t",i,l,buf);
l++;
}
else
printf("\rCompiling (%-4d files, %-4d
modules compiled) : %-60s\t",i,l,buf);
i++;
switch(i%4){
case 0:
printf(" | ");
break;
case 1:
printf(" / ");
break;
case 2:
printf(" - ");
break;
case 3:
printf(" \\ ");
break;
}
for(k=0;k<j;k++)
printf("=");
printf(">");
if((i%100)==0 && i!=0){
j++;
}
checking_done=1;
}
fflush(stdout);
}while(1);
pclose(fp);
return 0;
}
there is some more work that i remain to add, like being able to start
from the kernel source , that is just provide the path to the archive
and it does everything else and so on ,
but for now i am stuck here !
Thanks
Satish
--
http://satish.playdrupal.com
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: Kernel Installer 2008-08-03 20:50 Kernel Installer Satish Eerpini @ 2008-08-03 21:00 ` Adrian Bunk [not found] ` <93655eb70808032045vd6130e9m147d3e3ae8b159b5@mail.gmail.com> 2008-08-04 5:03 ` Bob van Manen 1 sibling, 1 reply; 9+ messages in thread From: Adrian Bunk @ 2008-08-03 21:00 UTC (permalink / raw) To: Satish Eerpini; +Cc: linux-kernel On Mon, Aug 04, 2008 at 02:20:19AM +0530, Satish Eerpini wrote: > Hello everyone , : > > i have been writing a kernel installer which may make the kernel > installation process a lot more easier for noobs , (don ask me why > noobs would like to compile a kernel) , but atleast till they learn > to do it the good way ! > > i have written some code which is below , well i am stuck at one thing , ... > once the .config file is set , is there any method to compute the > exact no of files that are going to be compiled ?? >... Replacing the normal build output with something different doesn't make anything easier. Especially considering that your "once the .config file is set" seems to assume the user already configured the kernel himself... > Thanks > Satish cu Adrian -- "Is there not promise of rain?" Ling Tan asked suddenly out of the darkness. There had been need of rain for many days. "Only a promise," Lao Er said. Pearl S. Buck - Dragon Seed ^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <93655eb70808032045vd6130e9m147d3e3ae8b159b5@mail.gmail.com>]
* Re: Kernel Installer [not found] ` <93655eb70808032045vd6130e9m147d3e3ae8b159b5@mail.gmail.com> @ 2008-08-04 3:46 ` Satish Eerpini 2008-08-04 9:25 ` Tejun Heo 2008-08-04 14:03 ` Jeff Dike 0 siblings, 2 replies; 9+ messages in thread From: Satish Eerpini @ 2008-08-04 3:46 UTC (permalink / raw) To: linux-kernel > Replacing the normal build output with something different doesn't make > anything easier. > > Especially considering that your "once the .config file is set" seems to > assume the user already configured the kernel himself... > i am not just trying to replace the output , i am not a stupid to waste my weekend sitting just to replace the output :-), if u are interested , u can check out the entire TODO for the app here http://satish.playdrupal.com/?q=node/2 but in the process i am stuck at deciding the no of files that will be compiled , given that representing the entire compilation process as a progress bar , would give a clear idea of " how much is over" and "how much is left" !!! Thanks Satish -- http://satish.playdrupal.com ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Kernel Installer 2008-08-04 3:46 ` Satish Eerpini @ 2008-08-04 9:25 ` Tejun Heo [not found] ` <93655eb70808040357m2e2893c5n3deb34012d5f212b@mail.gmail.com> 2008-08-04 14:03 ` Jeff Dike 1 sibling, 1 reply; 9+ messages in thread From: Tejun Heo @ 2008-08-04 9:25 UTC (permalink / raw) To: Satish Eerpini; +Cc: linux-kernel Satish Eerpini wrote: >> Replacing the normal build output with something different doesn't make >> anything easier. >> >> Especially considering that your "once the .config file is set" seems to >> assume the user already configured the kernel himself... >> > > i am not just trying to replace the output , i am not a stupid to > waste my weekend sitting just to replace the output :-), > if u are interested , u can check out the entire TODO for the app here > http://satish.playdrupal.com/?q=node/2 > > but in the process i am stuck at deciding the no of files that will be > compiled , given that representing the entire compilation > process as a progress bar , would give a clear idea of " how much is > over" and "how much is left" !!! make -n makes make do a dry-run but kbuild is a pretty complex beast and you might have to jump through some loops to get the information you want. -- tejun ^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <93655eb70808040357m2e2893c5n3deb34012d5f212b@mail.gmail.com>]
* Re: Kernel Installer [not found] ` <93655eb70808040357m2e2893c5n3deb34012d5f212b@mail.gmail.com> @ 2008-08-04 11:00 ` Satish Eerpini [not found] ` <12fc08bc0808040658g3fda79a6r407401b2e328ebea@mail.gmail.com> 0 siblings, 1 reply; 9+ messages in thread From: Satish Eerpini @ 2008-08-04 11:00 UTC (permalink / raw) To: linux-kernel using make -n does not work well for my purpose , because with that , the neat kernel compilation output is gone , and i think it is far more work to make sense out of the entire details make -n gives . I rather came up with this idea , though i think it is more time consuming , : --> enter each directory recursively and parse the Makefile for the files that would be compiled , --> this can be done by comparing the "CONFIG_" options which have been enabled in .config --> and then should also make note of the other 'objs' being compiled for the required objects . but all this has to be done in a way which minimises the amount of CPU time the installer takes , because while we are running the make for the compilation , it itself consumes a lot of CPU cyles . (CC actually) ,........ another obstacle i have faced is recognising when the Linux image is being built , and when the compiling enters into the second stage , viz , building modules ........ but knowing the total no of modules to be compiled is simple as it is already given out by kbuild. what i need to know , is there any method by which the total no of files to be compiled can be computed internally in the kbuild process itself , ...... or the second method would be to "echo" markers (basically text messages) after each stage of the compilation which can be caught by the installer , ... but i am sure this is not the best of the methods to be followed , .......... is this possible ? On Mon, Aug 4, 2008 at 2:55 PM, Tejun Heo <tj@kernel.org> wrote: > Satish Eerpini wrote: >>> Replacing the normal build output with something different doesn't make >>> anything easier. >>> >>> Especially considering that your "once the .config file is set" seems to >>> assume the user already configured the kernel himself... >>> >> >> i am not just trying to replace the output , i am not a stupid to >> waste my weekend sitting just to replace the output :-), >> if u are interested , u can check out the entire TODO for the app here >> http://satish.playdrupal.com/?q=node/2 >> >> but in the process i am stuck at deciding the no of files that will be >> compiled , given that representing the entire compilation >> process as a progress bar , would give a clear idea of " how much is >> over" and "how much is left" !!! > > make -n makes make do a dry-run but kbuild is a pretty complex beast and > you might have to jump through some loops to get the information you want. > > -- > tejun > Thanks Satish -- http://satish.playdrupal.com ^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <12fc08bc0808040658g3fda79a6r407401b2e328ebea@mail.gmail.com>]
* Re: Kernel Installer [not found] ` <12fc08bc0808040658g3fda79a6r407401b2e328ebea@mail.gmail.com> @ 2008-08-04 21:31 ` Satish Eerpini 0 siblings, 0 replies; 9+ messages in thread From: Satish Eerpini @ 2008-08-04 21:31 UTC (permalink / raw) To: GNU Boi; +Cc: linux-kernel lot more work needs to be done , before the kernel installer would be useful for a newbie , and the GUI front end would be the major part of it ! Thanks Satish On Mon, Aug 4, 2008 at 7:28 PM, GNU Boi <kernel.boi@gmail.com> wrote: > hey man thanks as u have started a kernel installer i (we newbie) like > it ........ > > On 8/3/08, Satish Eerpini <eerpini@gmail.com> wrote: >> using make -n does not work well for my purpose , because with that , >> the neat kernel compilation output is gone , and i think it is far >> more work to make sense out of the entire details make -n gives . >> >> I rather came up with this idea , though i think it is more time consuming , >> : >> >> --> enter each directory recursively and parse the Makefile for the >> files that would be compiled , >> --> this can be done by comparing the "CONFIG_" options which have >> been enabled in .config >> --> and then should also make note of the other 'objs' being compiled >> for the required objects . >> >> but all this has to be done in a way which minimises the amount of CPU >> time the installer takes , because while we are running the make for >> the compilation , it itself consumes a lot of CPU cyles . (CC >> actually) ,........ >> >> another obstacle i have faced is recognising when the Linux image is >> being built , and when the compiling enters into the second stage , >> viz , building modules ........ but knowing the total no of modules to >> be compiled is simple as it is already given out by kbuild. >> >> what i need to know , is there any method by which the total no of >> files to be compiled can be computed internally in the kbuild process >> itself , ...... >> or the second method would be to "echo" markers (basically text >> messages) after each stage of the compilation which can be caught by >> the installer , ... but i am sure this is not the best of the methods >> to be followed , .......... >> >> is this possible ? >> >> >> On Mon, Aug 4, 2008 at 2:55 PM, Tejun Heo <tj@kernel.org> wrote: >>> Satish Eerpini wrote: >>>>> Replacing the normal build output with something different doesn't make >>>>> anything easier. >>>>> >>>>> Especially considering that your "once the .config file is set" seems to >>>>> assume the user already configured the kernel himself... >>>>> >>>> >>>> i am not just trying to replace the output , i am not a stupid to >>>> waste my weekend sitting just to replace the output :-), >>>> if u are interested , u can check out the entire TODO for the app here >>>> http://satish.playdrupal.com/?q=node/2 >>>> >>>> but in the process i am stuck at deciding the no of files that will be >>>> compiled , given that representing the entire compilation >>>> process as a progress bar , would give a clear idea of " how much is >>>> over" and "how much is left" !!! >>> >>> make -n makes make do a dry-run but kbuild is a pretty complex beast and >>> you might have to jump through some loops to get the information you want. >>> >>> -- >>> tejun >>> >> >> Thanks >> Satish >> -- >> http://satish.playdrupal.com >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in >> the body of a message to majordomo@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html >> Please read the FAQ at http://www.tux.org/lkml/ >> > -- http://satish.playdrupal.com ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Kernel Installer 2008-08-04 3:46 ` Satish Eerpini 2008-08-04 9:25 ` Tejun Heo @ 2008-08-04 14:03 ` Jeff Dike 2008-08-04 21:30 ` Satish Eerpini 1 sibling, 1 reply; 9+ messages in thread From: Jeff Dike @ 2008-08-04 14:03 UTC (permalink / raw) To: Satish Eerpini; +Cc: linux-kernel On Mon, Aug 04, 2008 at 09:16:52AM +0530, Satish Eerpini wrote: > but in the process i am stuck at deciding the no of files that will be > compiled , given that representing the entire compilation > process as a progress bar , would give a clear idea of " how much is > over" and "how much is left" !!! Look at make -n. I suspect that its output won't match reality perfectly, but it's probably good enough for a progress bar. Jeff -- Work email - jdike at linux dot intel dot com ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Kernel Installer 2008-08-04 14:03 ` Jeff Dike @ 2008-08-04 21:30 ` Satish Eerpini 0 siblings, 0 replies; 9+ messages in thread From: Satish Eerpini @ 2008-08-04 21:30 UTC (permalink / raw) To: Jeff Dike; +Cc: linux-kernel yes i have been looking at make -n . but now , collectively parsing the .config file and the Make files seems to be more useful , ... what say ? On Mon, Aug 4, 2008 at 7:33 PM, Jeff Dike <jdike@addtoit.com> wrote: > On Mon, Aug 04, 2008 at 09:16:52AM +0530, Satish Eerpini wrote: >> but in the process i am stuck at deciding the no of files that will be >> compiled , given that representing the entire compilation >> process as a progress bar , would give a clear idea of " how much is >> over" and "how much is left" !!! > > Look at make -n. I suspect that its output won't match reality > perfectly, but it's probably good enough for a progress bar. > > Jeff > > -- > Work email - jdike at linux dot intel dot com > -- http://satish.playdrupal.com ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Kernel Installer 2008-08-03 20:50 Kernel Installer Satish Eerpini 2008-08-03 21:00 ` Adrian Bunk @ 2008-08-04 5:03 ` Bob van Manen 1 sibling, 0 replies; 9+ messages in thread From: Bob van Manen @ 2008-08-04 5:03 UTC (permalink / raw) To: Satish Eerpini; +Cc: linux-kernel Hi Satish, I don't know much about the kernel build process, so I don't know whether it would work or not. But you could try running make with the -n option first to see the commands that are going to be executed. That way you can figure out how many files are going to be compiled. I hope that works for you. Regards, bob On Sun, Aug 3, 2008 at 1:50 PM, Satish Eerpini <eerpini@gmail.com> wrote: > Hello everyone , : > > i have been writing a kernel installer which may make the kernel > installation process a lot more easier for noobs , (don ask me why > noobs would like to compile a kernel) , but atleast till they learn > to do it the good way ! > > i have written some code which is below , well i am stuck at one thing , ... > once the .config file is set , is there any method to compute the > exact no of files that are going to be compiled ?? > lack of this knowledge is clearly visible in the use of a "while(1)" > in the code below : > > > > > #include <stdio.h> > > > int main(int argc, char * argv[]) { > > char buf[100],syscommand[100]; > FILE *fp; > int i=0,j=0,k=0,l=0; > int checking_done=0; > strcpy(buf,"\0"); > > fflush(stdout); > > strcpy(syscommand,"make -C "); > if(argc==2){ > strcat(syscommand,argv[1]); > } > else{ > > printf("The program accepts the kernel source \n directory as > the single argument.\n Please provide necessary arguments\n"); > return ; > } > > > > printf("\n\n\t\t\t\t\t\t Kernel Installer V1.0\n\n "); > > > fp= popen(syscommand,"r"); > do{ > > fscanf(fp,"%s",buf); > > if(checking_done!=1){ > > if(strcmp(buf,"CHK")==0){ > fscanf(fp,"%s",buf); > printf("\rChecking file : %-30s\t\n",buf); > > > } > if(strcmp(buf,"CALL")==0){ > fscanf(fp,"%s",buf); > > printf("\rCalling script : %s\t\n",buf); > > } > } > > if(strcmp(buf,"LD")==0){ > fscanf(fp,"%s",buf); > > > printf("\rLinking File : %s\t",buf); > l++; > checking_done=1; > > } > > if(strcmp(buf,"CC")==0){ > fscanf(fp,"%s",buf); > if(strcmp(buf,"[M]")==0){ > fscanf(fp,"%s",buf); > printf("\rCompiling module (%-4d files, %-4d > modules compiled): %-60s\t",i,l,buf); > l++; > } > else > printf("\rCompiling (%-4d files, %-4d > modules compiled) : %-60s\t",i,l,buf); > i++; > > switch(i%4){ > case 0: > printf(" | "); > break; > case 1: > printf(" / "); > break; > case 2: > printf(" - "); > break; > case 3: > printf(" \\ "); > break; > } > for(k=0;k<j;k++) > printf("="); > printf(">"); > > if((i%100)==0 && i!=0){ > j++; > } > > checking_done=1; > > } > fflush(stdout); > }while(1); > pclose(fp); > > return 0; > > } > > there is some more work that i remain to add, like being able to start > from the kernel source , that is just provide the path to the archive > and it does everything else and so on , > but for now i am stuck here ! > > Thanks > Satish > > -- > http://satish.playdrupal.com > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ > ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2008-08-04 21:32 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-03 20:50 Kernel Installer Satish Eerpini
2008-08-03 21:00 ` Adrian Bunk
[not found] ` <93655eb70808032045vd6130e9m147d3e3ae8b159b5@mail.gmail.com>
2008-08-04 3:46 ` Satish Eerpini
2008-08-04 9:25 ` Tejun Heo
[not found] ` <93655eb70808040357m2e2893c5n3deb34012d5f212b@mail.gmail.com>
2008-08-04 11:00 ` Satish Eerpini
[not found] ` <12fc08bc0808040658g3fda79a6r407401b2e328ebea@mail.gmail.com>
2008-08-04 21:31 ` Satish Eerpini
2008-08-04 14:03 ` Jeff Dike
2008-08-04 21:30 ` Satish Eerpini
2008-08-04 5:03 ` Bob van Manen
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox