How to make mkinitcpio busybox ash to source /etc/profile?

Multi tool use
Multi tool use

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











up vote
1
down vote

favorite












Arch Linux /usr/lib/initcpio/busybox is owned by package mkinitcpio-busybox 1.27.2-1 and is configured low on features, for example CONFIG_FEATURE_USE_INITTAB is not set.



In a custom initramfs, containing that busybox, I managed to get ssh network logins that do source /etc/profile working. Also there is an ash shell prompt visible on the VGA monitor.



However that "vga" shell doesn't source /etc/profile.
Q:Difference between Login Shell and Non-Login Shell? makes me think that this shell is not a login shell.
That shell is started by /init:



exec setsid sh -c 'exec sh </dev/tty1 >/dev/tty1 2>&1'


Regression:



  • exec setsid sh -c 'exec sh -i </dev/tty1 >/dev/tty1 2>&1'

  • exec setsid sh -c 'exec sh - </dev/tty1 >/dev/tty1 2>&1'

  • exec setsid sh -c 'exec -sh </dev/tty1 >/dev/tty1 2>&1'

How to make this busybox ash shell to source /etc/profile and/or make it an (auto) login shell?







share|improve this question


























    up vote
    1
    down vote

    favorite












    Arch Linux /usr/lib/initcpio/busybox is owned by package mkinitcpio-busybox 1.27.2-1 and is configured low on features, for example CONFIG_FEATURE_USE_INITTAB is not set.



    In a custom initramfs, containing that busybox, I managed to get ssh network logins that do source /etc/profile working. Also there is an ash shell prompt visible on the VGA monitor.



    However that "vga" shell doesn't source /etc/profile.
    Q:Difference between Login Shell and Non-Login Shell? makes me think that this shell is not a login shell.
    That shell is started by /init:



    exec setsid sh -c 'exec sh </dev/tty1 >/dev/tty1 2>&1'


    Regression:



    • exec setsid sh -c 'exec sh -i </dev/tty1 >/dev/tty1 2>&1'

    • exec setsid sh -c 'exec sh - </dev/tty1 >/dev/tty1 2>&1'

    • exec setsid sh -c 'exec -sh </dev/tty1 >/dev/tty1 2>&1'

    How to make this busybox ash shell to source /etc/profile and/or make it an (auto) login shell?







    share|improve this question
























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      Arch Linux /usr/lib/initcpio/busybox is owned by package mkinitcpio-busybox 1.27.2-1 and is configured low on features, for example CONFIG_FEATURE_USE_INITTAB is not set.



      In a custom initramfs, containing that busybox, I managed to get ssh network logins that do source /etc/profile working. Also there is an ash shell prompt visible on the VGA monitor.



      However that "vga" shell doesn't source /etc/profile.
      Q:Difference between Login Shell and Non-Login Shell? makes me think that this shell is not a login shell.
      That shell is started by /init:



      exec setsid sh -c 'exec sh </dev/tty1 >/dev/tty1 2>&1'


      Regression:



      • exec setsid sh -c 'exec sh -i </dev/tty1 >/dev/tty1 2>&1'

      • exec setsid sh -c 'exec sh - </dev/tty1 >/dev/tty1 2>&1'

      • exec setsid sh -c 'exec -sh </dev/tty1 >/dev/tty1 2>&1'

      How to make this busybox ash shell to source /etc/profile and/or make it an (auto) login shell?







      share|improve this question














      Arch Linux /usr/lib/initcpio/busybox is owned by package mkinitcpio-busybox 1.27.2-1 and is configured low on features, for example CONFIG_FEATURE_USE_INITTAB is not set.



      In a custom initramfs, containing that busybox, I managed to get ssh network logins that do source /etc/profile working. Also there is an ash shell prompt visible on the VGA monitor.



      However that "vga" shell doesn't source /etc/profile.
      Q:Difference between Login Shell and Non-Login Shell? makes me think that this shell is not a login shell.
      That shell is started by /init:



      exec setsid sh -c 'exec sh </dev/tty1 >/dev/tty1 2>&1'


      Regression:



      • exec setsid sh -c 'exec sh -i </dev/tty1 >/dev/tty1 2>&1'

      • exec setsid sh -c 'exec sh - </dev/tty1 >/dev/tty1 2>&1'

      • exec setsid sh -c 'exec -sh </dev/tty1 >/dev/tty1 2>&1'

      How to make this busybox ash shell to source /etc/profile and/or make it an (auto) login shell?









      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 24 '17 at 16:34

























      asked Dec 24 '17 at 15:36









      Pro Backup

      1,91452853




      1,91452853




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          Conventionally, a shell acts as a login shell if it is invoked with a command name beginning with -. exec -sh would work is you had an executable called -sh in the path. BusyBox ash also supports the -l option, so you can run sh -l.



          When you log in, the login program (or sshd, or whatever is handling the login) takes care of running the user's shell with a leading - in the command name (the command name doesn't have to be the same as the name of the executable, it's just a very common convention which login violates on purpose). Here, “whatever is handling the login” is your mini-script, so you have to take care of it.






          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: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            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%2f412821%2fhow-to-make-mkinitcpio-busybox-ash-to-source-etc-profile%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            2
            down vote



            accepted










            Conventionally, a shell acts as a login shell if it is invoked with a command name beginning with -. exec -sh would work is you had an executable called -sh in the path. BusyBox ash also supports the -l option, so you can run sh -l.



            When you log in, the login program (or sshd, or whatever is handling the login) takes care of running the user's shell with a leading - in the command name (the command name doesn't have to be the same as the name of the executable, it's just a very common convention which login violates on purpose). Here, “whatever is handling the login” is your mini-script, so you have to take care of it.






            share|improve this answer
























              up vote
              2
              down vote



              accepted










              Conventionally, a shell acts as a login shell if it is invoked with a command name beginning with -. exec -sh would work is you had an executable called -sh in the path. BusyBox ash also supports the -l option, so you can run sh -l.



              When you log in, the login program (or sshd, or whatever is handling the login) takes care of running the user's shell with a leading - in the command name (the command name doesn't have to be the same as the name of the executable, it's just a very common convention which login violates on purpose). Here, “whatever is handling the login” is your mini-script, so you have to take care of it.






              share|improve this answer






















                up vote
                2
                down vote



                accepted







                up vote
                2
                down vote



                accepted






                Conventionally, a shell acts as a login shell if it is invoked with a command name beginning with -. exec -sh would work is you had an executable called -sh in the path. BusyBox ash also supports the -l option, so you can run sh -l.



                When you log in, the login program (or sshd, or whatever is handling the login) takes care of running the user's shell with a leading - in the command name (the command name doesn't have to be the same as the name of the executable, it's just a very common convention which login violates on purpose). Here, “whatever is handling the login” is your mini-script, so you have to take care of it.






                share|improve this answer












                Conventionally, a shell acts as a login shell if it is invoked with a command name beginning with -. exec -sh would work is you had an executable called -sh in the path. BusyBox ash also supports the -l option, so you can run sh -l.



                When you log in, the login program (or sshd, or whatever is handling the login) takes care of running the user's shell with a leading - in the command name (the command name doesn't have to be the same as the name of the executable, it's just a very common convention which login violates on purpose). Here, “whatever is handling the login” is your mini-script, so you have to take care of it.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Dec 24 '17 at 18:02









                Gilles

                506k12010031529




                506k12010031529






















                     

                    draft saved


                    draft discarded


























                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f412821%2fhow-to-make-mkinitcpio-busybox-ash-to-source-etc-profile%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    WItreKU8 j4X,i ZUjd8hcHh,dwtl,ZyoRy6,Hj,H4m6WwOGx JAj,hTPvuy
                    uozGjM5yZ Hn8w9,4CIH3xTU5e2btl4a pfiqmhjO q,RZUf7QqboZ05ldl2 2sMrsjpyI bh4

                    Popular posts from this blog

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

                    How many registers does an x86_64 CPU actually have?

                    Displaying single band from multi-band raster using QGIS