Silent booting Linux from u-boot

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





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








5















For security reasons I have to boot Linux from u-boot with all output hidden (silently) until a password is entered. I've configured uBoot to do this correctly using the CONFIG_AUTOBOOT_KEYED macro and can successfully boot silently.



The issue I am having is that when uBoot boots the Linux kernel and silent mode is enabled, it passes console= as part of the bootargs to Linux kernel. This is fine for silent booting, but I can't seem to find a way to re-enable the console again after bootup.



I've also tried to boot normally and append loglevel=0 to the kernal bootargs which works for silent bootup, but again I cannot re-enable the console. I've tried:



dmesg -n 4


and



klogd -c 4


to try to set the Kernel loglevel back to KERN_WARNING (4) without luck. These commands work properly when I boot the Kernel normally.



The best guide I've found on the matter is Silencing the boot process on blackfin.uclinux.org.



Ideally I'd like to use uBoot's silent mode where it passes console= as part of the bootargs but still take input on the console and re-enable output when the password is entered.










share|improve this question















migrated from stackoverflow.com Jul 21 '11 at 19:43


This question came from our site for professional and enthusiast programmers.


















  • An alternative to change the loglevel is to write to /proc/sys/kernel/printk. See proc(5) for details.

    – camh
    Jul 21 '11 at 22:10

















5















For security reasons I have to boot Linux from u-boot with all output hidden (silently) until a password is entered. I've configured uBoot to do this correctly using the CONFIG_AUTOBOOT_KEYED macro and can successfully boot silently.



The issue I am having is that when uBoot boots the Linux kernel and silent mode is enabled, it passes console= as part of the bootargs to Linux kernel. This is fine for silent booting, but I can't seem to find a way to re-enable the console again after bootup.



I've also tried to boot normally and append loglevel=0 to the kernal bootargs which works for silent bootup, but again I cannot re-enable the console. I've tried:



dmesg -n 4


and



klogd -c 4


to try to set the Kernel loglevel back to KERN_WARNING (4) without luck. These commands work properly when I boot the Kernel normally.



The best guide I've found on the matter is Silencing the boot process on blackfin.uclinux.org.



Ideally I'd like to use uBoot's silent mode where it passes console= as part of the bootargs but still take input on the console and re-enable output when the password is entered.










share|improve this question















migrated from stackoverflow.com Jul 21 '11 at 19:43


This question came from our site for professional and enthusiast programmers.


















  • An alternative to change the loglevel is to write to /proc/sys/kernel/printk. See proc(5) for details.

    – camh
    Jul 21 '11 at 22:10













5












5








5


3






For security reasons I have to boot Linux from u-boot with all output hidden (silently) until a password is entered. I've configured uBoot to do this correctly using the CONFIG_AUTOBOOT_KEYED macro and can successfully boot silently.



The issue I am having is that when uBoot boots the Linux kernel and silent mode is enabled, it passes console= as part of the bootargs to Linux kernel. This is fine for silent booting, but I can't seem to find a way to re-enable the console again after bootup.



I've also tried to boot normally and append loglevel=0 to the kernal bootargs which works for silent bootup, but again I cannot re-enable the console. I've tried:



dmesg -n 4


and



klogd -c 4


to try to set the Kernel loglevel back to KERN_WARNING (4) without luck. These commands work properly when I boot the Kernel normally.



The best guide I've found on the matter is Silencing the boot process on blackfin.uclinux.org.



Ideally I'd like to use uBoot's silent mode where it passes console= as part of the bootargs but still take input on the console and re-enable output when the password is entered.










share|improve this question
















For security reasons I have to boot Linux from u-boot with all output hidden (silently) until a password is entered. I've configured uBoot to do this correctly using the CONFIG_AUTOBOOT_KEYED macro and can successfully boot silently.



The issue I am having is that when uBoot boots the Linux kernel and silent mode is enabled, it passes console= as part of the bootargs to Linux kernel. This is fine for silent booting, but I can't seem to find a way to re-enable the console again after bootup.



I've also tried to boot normally and append loglevel=0 to the kernal bootargs which works for silent bootup, but again I cannot re-enable the console. I've tried:



dmesg -n 4


and



klogd -c 4


to try to set the Kernel loglevel back to KERN_WARNING (4) without luck. These commands work properly when I boot the Kernel normally.



The best guide I've found on the matter is Silencing the boot process on blackfin.uclinux.org.



Ideally I'd like to use uBoot's silent mode where it passes console= as part of the bootargs but still take input on the console and re-enable output when the password is entered.







kernel boot






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 9 at 15:16









Rui F Ribeiro

41.9k1483142




41.9k1483142










asked Jul 21 '11 at 14:29









sbtkd85sbtkd85

32328




32328




migrated from stackoverflow.com Jul 21 '11 at 19:43


This question came from our site for professional and enthusiast programmers.









migrated from stackoverflow.com Jul 21 '11 at 19:43


This question came from our site for professional and enthusiast programmers.














  • An alternative to change the loglevel is to write to /proc/sys/kernel/printk. See proc(5) for details.

    – camh
    Jul 21 '11 at 22:10

















  • An alternative to change the loglevel is to write to /proc/sys/kernel/printk. See proc(5) for details.

    – camh
    Jul 21 '11 at 22:10
















An alternative to change the loglevel is to write to /proc/sys/kernel/printk. See proc(5) for details.

– camh
Jul 21 '11 at 22:10





An alternative to change the loglevel is to write to /proc/sys/kernel/printk. See proc(5) for details.

– camh
Jul 21 '11 at 22:10










1 Answer
1






active

oldest

votes


















1














If anyone else runs into this issue I never found a good fix. I ended up hacking both u-boot and the linux kernel serial driver and basically checking if the password had been entered. If it had, I allowed the code to run normally. If it hadn't I just returned from the functions so that nothing was actually printed out on the console.



For Kernel I edited the receive_chars() function to look for the password (input) and transmit_chars() to mask output. I had u-boot pass the password in as part of the bootargs. If it was null, then the password was already entered and we ignored the special code. If it was a value, then we grabbed input chars via receive_chars() and compare them to the stored string from bootargs.



In u-boot I just used the CONFIG_AUTOBOOT_KEYED and associated default macros for the password entry. I then changed common/cmd_bootm.c to not call fixup_silent_linux() to mask the console= value and let the kernel deal with it as stated above.



Hopefully this helps someone else.






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',
    autoActivateHeartbeat: false,
    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%2f17162%2fsilent-booting-linux-from-u-boot%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









    1














    If anyone else runs into this issue I never found a good fix. I ended up hacking both u-boot and the linux kernel serial driver and basically checking if the password had been entered. If it had, I allowed the code to run normally. If it hadn't I just returned from the functions so that nothing was actually printed out on the console.



    For Kernel I edited the receive_chars() function to look for the password (input) and transmit_chars() to mask output. I had u-boot pass the password in as part of the bootargs. If it was null, then the password was already entered and we ignored the special code. If it was a value, then we grabbed input chars via receive_chars() and compare them to the stored string from bootargs.



    In u-boot I just used the CONFIG_AUTOBOOT_KEYED and associated default macros for the password entry. I then changed common/cmd_bootm.c to not call fixup_silent_linux() to mask the console= value and let the kernel deal with it as stated above.



    Hopefully this helps someone else.






    share|improve this answer



























      1














      If anyone else runs into this issue I never found a good fix. I ended up hacking both u-boot and the linux kernel serial driver and basically checking if the password had been entered. If it had, I allowed the code to run normally. If it hadn't I just returned from the functions so that nothing was actually printed out on the console.



      For Kernel I edited the receive_chars() function to look for the password (input) and transmit_chars() to mask output. I had u-boot pass the password in as part of the bootargs. If it was null, then the password was already entered and we ignored the special code. If it was a value, then we grabbed input chars via receive_chars() and compare them to the stored string from bootargs.



      In u-boot I just used the CONFIG_AUTOBOOT_KEYED and associated default macros for the password entry. I then changed common/cmd_bootm.c to not call fixup_silent_linux() to mask the console= value and let the kernel deal with it as stated above.



      Hopefully this helps someone else.






      share|improve this answer

























        1












        1








        1







        If anyone else runs into this issue I never found a good fix. I ended up hacking both u-boot and the linux kernel serial driver and basically checking if the password had been entered. If it had, I allowed the code to run normally. If it hadn't I just returned from the functions so that nothing was actually printed out on the console.



        For Kernel I edited the receive_chars() function to look for the password (input) and transmit_chars() to mask output. I had u-boot pass the password in as part of the bootargs. If it was null, then the password was already entered and we ignored the special code. If it was a value, then we grabbed input chars via receive_chars() and compare them to the stored string from bootargs.



        In u-boot I just used the CONFIG_AUTOBOOT_KEYED and associated default macros for the password entry. I then changed common/cmd_bootm.c to not call fixup_silent_linux() to mask the console= value and let the kernel deal with it as stated above.



        Hopefully this helps someone else.






        share|improve this answer













        If anyone else runs into this issue I never found a good fix. I ended up hacking both u-boot and the linux kernel serial driver and basically checking if the password had been entered. If it had, I allowed the code to run normally. If it hadn't I just returned from the functions so that nothing was actually printed out on the console.



        For Kernel I edited the receive_chars() function to look for the password (input) and transmit_chars() to mask output. I had u-boot pass the password in as part of the bootargs. If it was null, then the password was already entered and we ignored the special code. If it was a value, then we grabbed input chars via receive_chars() and compare them to the stored string from bootargs.



        In u-boot I just used the CONFIG_AUTOBOOT_KEYED and associated default macros for the password entry. I then changed common/cmd_bootm.c to not call fixup_silent_linux() to mask the console= value and let the kernel deal with it as stated above.



        Hopefully this helps someone else.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Aug 5 '11 at 18:02









        sbtkd85sbtkd85

        32328




        32328



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f17162%2fsilent-booting-linux-from-u-boot%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