How to copy/paste list of commands with chroot

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











up vote
0
down vote

favorite
1












I want to create a script that executes the following commands, one after the other. The problem is the chroot command: everything after that command is not copied into the chroot environment as I want it. It is just copied into the normal terminal and executes after I exit from the chroot. Any ideas how to achieve this?



mkdir $HOME/live_boot
sudo debootstrap
--arch=amd64
--variant=minbase
stretch $HOME/live_boot/chroot
http://ftp.ch.debian.org/debian/
sudo chroot $HOME/live_boot/chroot
echo "TESTDEBIAN" > /etc/hostname
apt-get update &&
apt-get install -y --no-install-recommends
xserver-xorg-input-all xserver-xorg-video-fbdev xorg
linux-image-amd64 live-boot nano vim network-manager






share|improve this question

























    up vote
    0
    down vote

    favorite
    1












    I want to create a script that executes the following commands, one after the other. The problem is the chroot command: everything after that command is not copied into the chroot environment as I want it. It is just copied into the normal terminal and executes after I exit from the chroot. Any ideas how to achieve this?



    mkdir $HOME/live_boot
    sudo debootstrap
    --arch=amd64
    --variant=minbase
    stretch $HOME/live_boot/chroot
    http://ftp.ch.debian.org/debian/
    sudo chroot $HOME/live_boot/chroot
    echo "TESTDEBIAN" > /etc/hostname
    apt-get update &&
    apt-get install -y --no-install-recommends
    xserver-xorg-input-all xserver-xorg-video-fbdev xorg
    linux-image-amd64 live-boot nano vim network-manager






    share|improve this question























      up vote
      0
      down vote

      favorite
      1









      up vote
      0
      down vote

      favorite
      1






      1





      I want to create a script that executes the following commands, one after the other. The problem is the chroot command: everything after that command is not copied into the chroot environment as I want it. It is just copied into the normal terminal and executes after I exit from the chroot. Any ideas how to achieve this?



      mkdir $HOME/live_boot
      sudo debootstrap
      --arch=amd64
      --variant=minbase
      stretch $HOME/live_boot/chroot
      http://ftp.ch.debian.org/debian/
      sudo chroot $HOME/live_boot/chroot
      echo "TESTDEBIAN" > /etc/hostname
      apt-get update &&
      apt-get install -y --no-install-recommends
      xserver-xorg-input-all xserver-xorg-video-fbdev xorg
      linux-image-amd64 live-boot nano vim network-manager






      share|improve this question













      I want to create a script that executes the following commands, one after the other. The problem is the chroot command: everything after that command is not copied into the chroot environment as I want it. It is just copied into the normal terminal and executes after I exit from the chroot. Any ideas how to achieve this?



      mkdir $HOME/live_boot
      sudo debootstrap
      --arch=amd64
      --variant=minbase
      stretch $HOME/live_boot/chroot
      http://ftp.ch.debian.org/debian/
      sudo chroot $HOME/live_boot/chroot
      echo "TESTDEBIAN" > /etc/hostname
      apt-get update &&
      apt-get install -y --no-install-recommends
      xserver-xorg-input-all xserver-xorg-video-fbdev xorg
      linux-image-amd64 live-boot nano vim network-manager








      share|improve this question












      share|improve this question




      share|improve this question








      edited May 9 at 14:58









      Kusalananda

      102k13199315




      102k13199315









      asked May 9 at 14:53









      Alice Delia

      12




      12




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote













          chroot accepts passing a command, so I would put the relevant commands into a script an run this script as a chroot argument.






          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%2f442797%2fhow-to-copy-paste-list-of-commands-with-chroot%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
            1
            down vote













            chroot accepts passing a command, so I would put the relevant commands into a script an run this script as a chroot argument.






            share|improve this answer

























              up vote
              1
              down vote













              chroot accepts passing a command, so I would put the relevant commands into a script an run this script as a chroot argument.






              share|improve this answer























                up vote
                1
                down vote










                up vote
                1
                down vote









                chroot accepts passing a command, so I would put the relevant commands into a script an run this script as a chroot argument.






                share|improve this answer













                chroot accepts passing a command, so I would put the relevant commands into a script an run this script as a chroot argument.







                share|improve this answer













                share|improve this answer



                share|improve this answer











                answered May 9 at 15:17









                tonioc

                1,11457




                1,11457






















                     

                    draft saved


                    draft discarded


























                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f442797%2fhow-to-copy-paste-list-of-commands-with-chroot%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    Peggy Mitchell

                    Palaiologos

                    The Forum (Inglewood, California)