Kernel Surgery in a Script

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I'm writing a bash script to install a certain development environment on a computer. In order to do this I need to enable the CONFIG_USB_ACM module in the kernel. I am doing this through:



cd ~/l4t-kernel-surgery-kernel/kernel-4.4
zcat /proc/config.gz > .config

# PART I NEED IDEAS
vim .config # change the line that says CONFIG_USB_ACM=n to CONFIG_USB_ACM=m

make clean
make prepare
make modules_prepare
make M=drivers/usb/class
...


Would it work for me to append the =m line to the end of the config file? Will that overwrite the previous setting of =n? Is there a better way to edit the file in this way from bash?










share|improve this question























  • Yeah I did, thanks for your answer btw. After closer inspection I realized that the =n line didn't even exist so I had to append it to the end of the file.
    – Sauhaarda Chowdhuri
    May 22 '17 at 17:22














up vote
0
down vote

favorite












I'm writing a bash script to install a certain development environment on a computer. In order to do this I need to enable the CONFIG_USB_ACM module in the kernel. I am doing this through:



cd ~/l4t-kernel-surgery-kernel/kernel-4.4
zcat /proc/config.gz > .config

# PART I NEED IDEAS
vim .config # change the line that says CONFIG_USB_ACM=n to CONFIG_USB_ACM=m

make clean
make prepare
make modules_prepare
make M=drivers/usb/class
...


Would it work for me to append the =m line to the end of the config file? Will that overwrite the previous setting of =n? Is there a better way to edit the file in this way from bash?










share|improve this question























  • Yeah I did, thanks for your answer btw. After closer inspection I realized that the =n line didn't even exist so I had to append it to the end of the file.
    – Sauhaarda Chowdhuri
    May 22 '17 at 17:22












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I'm writing a bash script to install a certain development environment on a computer. In order to do this I need to enable the CONFIG_USB_ACM module in the kernel. I am doing this through:



cd ~/l4t-kernel-surgery-kernel/kernel-4.4
zcat /proc/config.gz > .config

# PART I NEED IDEAS
vim .config # change the line that says CONFIG_USB_ACM=n to CONFIG_USB_ACM=m

make clean
make prepare
make modules_prepare
make M=drivers/usb/class
...


Would it work for me to append the =m line to the end of the config file? Will that overwrite the previous setting of =n? Is there a better way to edit the file in this way from bash?










share|improve this question















I'm writing a bash script to install a certain development environment on a computer. In order to do this I need to enable the CONFIG_USB_ACM module in the kernel. I am doing this through:



cd ~/l4t-kernel-surgery-kernel/kernel-4.4
zcat /proc/config.gz > .config

# PART I NEED IDEAS
vim .config # change the line that says CONFIG_USB_ACM=n to CONFIG_USB_ACM=m

make clean
make prepare
make modules_prepare
make M=drivers/usb/class
...


Would it work for me to append the =m line to the end of the config file? Will that overwrite the previous setting of =n? Is there a better way to edit the file in this way from bash?







text-processing configuration nvidia kernel-modules






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 18 at 9:27









Rui F Ribeiro

38.2k1475123




38.2k1475123










asked May 18 '17 at 1:19









Sauhaarda Chowdhuri

183




183











  • Yeah I did, thanks for your answer btw. After closer inspection I realized that the =n line didn't even exist so I had to append it to the end of the file.
    – Sauhaarda Chowdhuri
    May 22 '17 at 17:22
















  • Yeah I did, thanks for your answer btw. After closer inspection I realized that the =n line didn't even exist so I had to append it to the end of the file.
    – Sauhaarda Chowdhuri
    May 22 '17 at 17:22















Yeah I did, thanks for your answer btw. After closer inspection I realized that the =n line didn't even exist so I had to append it to the end of the file.
– Sauhaarda Chowdhuri
May 22 '17 at 17:22




Yeah I did, thanks for your answer btw. After closer inspection I realized that the =n line didn't even exist so I had to append it to the end of the file.
– Sauhaarda Chowdhuri
May 22 '17 at 17:22










1 Answer
1






active

oldest

votes

















up vote
1
down vote



accepted










zcat /proc/config.gz | sed 's/CONFIG_USB_ACM=n/CONFIG_USB_ACM=m/' > .config





share|improve this answer




















    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f365748%2fkernel-surgery-in-a-script%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote



    accepted










    zcat /proc/config.gz | sed 's/CONFIG_USB_ACM=n/CONFIG_USB_ACM=m/' > .config





    share|improve this answer
























      up vote
      1
      down vote



      accepted










      zcat /proc/config.gz | sed 's/CONFIG_USB_ACM=n/CONFIG_USB_ACM=m/' > .config





      share|improve this answer






















        up vote
        1
        down vote



        accepted







        up vote
        1
        down vote



        accepted






        zcat /proc/config.gz | sed 's/CONFIG_USB_ACM=n/CONFIG_USB_ACM=m/' > .config





        share|improve this answer












        zcat /proc/config.gz | sed 's/CONFIG_USB_ACM=n/CONFIG_USB_ACM=m/' > .config






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered May 18 '17 at 1:36









        Jeff Schaller

        36.3k952119




        36.3k952119



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f365748%2fkernel-surgery-in-a-script%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown






            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Bahrain

            Postfix configuration issue with fips on centos 7; mailgun relay