mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Bob van Manen" <bobm75@gmail.com>
To: "Satish Eerpini" <eerpini@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Kernel Installer
Date: Sun, 3 Aug 2008 22:03:35 -0700	[thread overview]
Message-ID: <88652ca70808032203t39eef690of589bdef15dc2618@mail.gmail.com> (raw)
In-Reply-To: <93655eb70808031350q16a5765bk3125e53bd042ba0e@mail.gmail.com>

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/
>

      parent reply	other threads:[~2008-08-04  5:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-03 20:50 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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=88652ca70808032203t39eef690of589bdef15dc2618@mail.gmail.com \
    --to=bobm75@gmail.com \
    --cc=eerpini@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®