How to create a bootable system with a squashfs root












4















My goal is to be able to take a customized root file system loaded with the software I want. So far I've created a squashed filesystem using debootstrap and chroot to install the software I want on the system.



The problem I am now running in to.. whenever I boot in to the system, my user accounts that were set up in the chroot do not work. First boot everything works out, second boot I can't log in. That is baffling to me.



Any one know a reason or a place to start looking?










share|improve this question

























  • You have to keep searching for the changes you wish to make. Look at the casper scripts and initrd as well as /usr/share and in the libs.

    – Panther
    Jan 14 '12 at 15:54











  • Well I got it working. I used the live-boot & live-boot-initramfs-tools to generate an initrd and extlinux for the bootloader. Works like a charm.

    – cldfzn
    Jan 15 '12 at 22:13
















4















My goal is to be able to take a customized root file system loaded with the software I want. So far I've created a squashed filesystem using debootstrap and chroot to install the software I want on the system.



The problem I am now running in to.. whenever I boot in to the system, my user accounts that were set up in the chroot do not work. First boot everything works out, second boot I can't log in. That is baffling to me.



Any one know a reason or a place to start looking?










share|improve this question

























  • You have to keep searching for the changes you wish to make. Look at the casper scripts and initrd as well as /usr/share and in the libs.

    – Panther
    Jan 14 '12 at 15:54











  • Well I got it working. I used the live-boot & live-boot-initramfs-tools to generate an initrd and extlinux for the bootloader. Works like a charm.

    – cldfzn
    Jan 15 '12 at 22:13














4












4








4


8






My goal is to be able to take a customized root file system loaded with the software I want. So far I've created a squashed filesystem using debootstrap and chroot to install the software I want on the system.



The problem I am now running in to.. whenever I boot in to the system, my user accounts that were set up in the chroot do not work. First boot everything works out, second boot I can't log in. That is baffling to me.



Any one know a reason or a place to start looking?










share|improve this question
















My goal is to be able to take a customized root file system loaded with the software I want. So far I've created a squashed filesystem using debootstrap and chroot to install the software I want on the system.



The problem I am now running in to.. whenever I boot in to the system, my user accounts that were set up in the chroot do not work. First boot everything works out, second boot I can't log in. That is baffling to me.



Any one know a reason or a place to start looking?







boot grub2 live-usb squashfs kernel






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 11 '13 at 15:13







cldfzn

















asked Jan 14 '12 at 14:13









cldfzncldfzn

101126




101126













  • You have to keep searching for the changes you wish to make. Look at the casper scripts and initrd as well as /usr/share and in the libs.

    – Panther
    Jan 14 '12 at 15:54











  • Well I got it working. I used the live-boot & live-boot-initramfs-tools to generate an initrd and extlinux for the bootloader. Works like a charm.

    – cldfzn
    Jan 15 '12 at 22:13



















  • You have to keep searching for the changes you wish to make. Look at the casper scripts and initrd as well as /usr/share and in the libs.

    – Panther
    Jan 14 '12 at 15:54











  • Well I got it working. I used the live-boot & live-boot-initramfs-tools to generate an initrd and extlinux for the bootloader. Works like a charm.

    – cldfzn
    Jan 15 '12 at 22:13

















You have to keep searching for the changes you wish to make. Look at the casper scripts and initrd as well as /usr/share and in the libs.

– Panther
Jan 14 '12 at 15:54





You have to keep searching for the changes you wish to make. Look at the casper scripts and initrd as well as /usr/share and in the libs.

– Panther
Jan 14 '12 at 15:54













Well I got it working. I used the live-boot & live-boot-initramfs-tools to generate an initrd and extlinux for the bootloader. Works like a charm.

– cldfzn
Jan 15 '12 at 22:13





Well I got it working. I used the live-boot & live-boot-initramfs-tools to generate an initrd and extlinux for the bootloader. Works like a charm.

– cldfzn
Jan 15 '12 at 22:13










3 Answers
3






active

oldest

votes


















8














To get a working system with a squashfs filesystem:



sudo apt-get install live-boot live-boot-initramfs-tools extlinux
sudo update-initramfs -u


Create a squashfs file from a bootstrapped or running ubuntu filesystem with whatever packages you want available. https://help.ubuntu.com/community/LiveCDCustomizationFromScratch provides good instructions for creating a debootstrapped system to build on. Format the target drive with ext2/3/4 and enable the bootable flag. Create the folder layout on the target drive and install extlinux:



mkdir -p ${TARGET}/boot/extlinux ${TARGET}/live
extlinux -i ${TARGET}/boot/extlinux
dd if=/usr/lib/syslinux/mbr.bin of=/dev/sdX #X is the drive letter
cp /boot/vmlinuz-$(uname -r) ${TARGET}/boot/vmlinuz
cp /boot/initrd.img-$(uname -r) ${TARGET}/boot/initrd
cp filesystem.squashfs ${TARGET}/live


Create ${TARGET}/boot/extlinux/extlinux.conf with the following contents:



DEFAULT Live
LABEL Live
KERNEL /boot/vmlinuz
APPEND initrd=/boot/initrd boot=live toram=filesystem.squashfs
TIMEOUT 10
PROMPT 0


Now you should be able to boot from the target drive in to your squashed system.






share|improve this answer































    3














    This question was solved by the OP:




    Well I got it working. I used the live-boot &
    live-boot-initramfs-tools to generate an initrd and extlinux for the
    bootloader. Works like a charm.







    share|improve this answer

































      0














      No longer works in 18.04.1:



      user@myhost:~$ sudo apt-get install live-boot live-boot-initramfs-tools extlinux
      Reading package lists... Done
      Building dependency tree
      Reading state information... Done
      E: Unable to locate package live-boot
      E: Unable to locate package live-boot-initramfs-tools
      E: Unable to locate package extlinux
      user@myhost:~$


      Please advice






      share|improve this answer








      New contributor




      J Doe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.
















      • 1





        If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review

        – waltinator
        7 hours ago











      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "89"
      };
      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: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      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%2faskubuntu.com%2fquestions%2f95392%2fhow-to-create-a-bootable-system-with-a-squashfs-root%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      8














      To get a working system with a squashfs filesystem:



      sudo apt-get install live-boot live-boot-initramfs-tools extlinux
      sudo update-initramfs -u


      Create a squashfs file from a bootstrapped or running ubuntu filesystem with whatever packages you want available. https://help.ubuntu.com/community/LiveCDCustomizationFromScratch provides good instructions for creating a debootstrapped system to build on. Format the target drive with ext2/3/4 and enable the bootable flag. Create the folder layout on the target drive and install extlinux:



      mkdir -p ${TARGET}/boot/extlinux ${TARGET}/live
      extlinux -i ${TARGET}/boot/extlinux
      dd if=/usr/lib/syslinux/mbr.bin of=/dev/sdX #X is the drive letter
      cp /boot/vmlinuz-$(uname -r) ${TARGET}/boot/vmlinuz
      cp /boot/initrd.img-$(uname -r) ${TARGET}/boot/initrd
      cp filesystem.squashfs ${TARGET}/live


      Create ${TARGET}/boot/extlinux/extlinux.conf with the following contents:



      DEFAULT Live
      LABEL Live
      KERNEL /boot/vmlinuz
      APPEND initrd=/boot/initrd boot=live toram=filesystem.squashfs
      TIMEOUT 10
      PROMPT 0


      Now you should be able to boot from the target drive in to your squashed system.






      share|improve this answer




























        8














        To get a working system with a squashfs filesystem:



        sudo apt-get install live-boot live-boot-initramfs-tools extlinux
        sudo update-initramfs -u


        Create a squashfs file from a bootstrapped or running ubuntu filesystem with whatever packages you want available. https://help.ubuntu.com/community/LiveCDCustomizationFromScratch provides good instructions for creating a debootstrapped system to build on. Format the target drive with ext2/3/4 and enable the bootable flag. Create the folder layout on the target drive and install extlinux:



        mkdir -p ${TARGET}/boot/extlinux ${TARGET}/live
        extlinux -i ${TARGET}/boot/extlinux
        dd if=/usr/lib/syslinux/mbr.bin of=/dev/sdX #X is the drive letter
        cp /boot/vmlinuz-$(uname -r) ${TARGET}/boot/vmlinuz
        cp /boot/initrd.img-$(uname -r) ${TARGET}/boot/initrd
        cp filesystem.squashfs ${TARGET}/live


        Create ${TARGET}/boot/extlinux/extlinux.conf with the following contents:



        DEFAULT Live
        LABEL Live
        KERNEL /boot/vmlinuz
        APPEND initrd=/boot/initrd boot=live toram=filesystem.squashfs
        TIMEOUT 10
        PROMPT 0


        Now you should be able to boot from the target drive in to your squashed system.






        share|improve this answer


























          8












          8








          8







          To get a working system with a squashfs filesystem:



          sudo apt-get install live-boot live-boot-initramfs-tools extlinux
          sudo update-initramfs -u


          Create a squashfs file from a bootstrapped or running ubuntu filesystem with whatever packages you want available. https://help.ubuntu.com/community/LiveCDCustomizationFromScratch provides good instructions for creating a debootstrapped system to build on. Format the target drive with ext2/3/4 and enable the bootable flag. Create the folder layout on the target drive and install extlinux:



          mkdir -p ${TARGET}/boot/extlinux ${TARGET}/live
          extlinux -i ${TARGET}/boot/extlinux
          dd if=/usr/lib/syslinux/mbr.bin of=/dev/sdX #X is the drive letter
          cp /boot/vmlinuz-$(uname -r) ${TARGET}/boot/vmlinuz
          cp /boot/initrd.img-$(uname -r) ${TARGET}/boot/initrd
          cp filesystem.squashfs ${TARGET}/live


          Create ${TARGET}/boot/extlinux/extlinux.conf with the following contents:



          DEFAULT Live
          LABEL Live
          KERNEL /boot/vmlinuz
          APPEND initrd=/boot/initrd boot=live toram=filesystem.squashfs
          TIMEOUT 10
          PROMPT 0


          Now you should be able to boot from the target drive in to your squashed system.






          share|improve this answer













          To get a working system with a squashfs filesystem:



          sudo apt-get install live-boot live-boot-initramfs-tools extlinux
          sudo update-initramfs -u


          Create a squashfs file from a bootstrapped or running ubuntu filesystem with whatever packages you want available. https://help.ubuntu.com/community/LiveCDCustomizationFromScratch provides good instructions for creating a debootstrapped system to build on. Format the target drive with ext2/3/4 and enable the bootable flag. Create the folder layout on the target drive and install extlinux:



          mkdir -p ${TARGET}/boot/extlinux ${TARGET}/live
          extlinux -i ${TARGET}/boot/extlinux
          dd if=/usr/lib/syslinux/mbr.bin of=/dev/sdX #X is the drive letter
          cp /boot/vmlinuz-$(uname -r) ${TARGET}/boot/vmlinuz
          cp /boot/initrd.img-$(uname -r) ${TARGET}/boot/initrd
          cp filesystem.squashfs ${TARGET}/live


          Create ${TARGET}/boot/extlinux/extlinux.conf with the following contents:



          DEFAULT Live
          LABEL Live
          KERNEL /boot/vmlinuz
          APPEND initrd=/boot/initrd boot=live toram=filesystem.squashfs
          TIMEOUT 10
          PROMPT 0


          Now you should be able to boot from the target drive in to your squashed system.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jun 11 '13 at 15:12









          cldfzncldfzn

          101126




          101126

























              3














              This question was solved by the OP:




              Well I got it working. I used the live-boot &
              live-boot-initramfs-tools to generate an initrd and extlinux for the
              bootloader. Works like a charm.







              share|improve this answer






























                3














                This question was solved by the OP:




                Well I got it working. I used the live-boot &
                live-boot-initramfs-tools to generate an initrd and extlinux for the
                bootloader. Works like a charm.







                share|improve this answer




























                  3












                  3








                  3







                  This question was solved by the OP:




                  Well I got it working. I used the live-boot &
                  live-boot-initramfs-tools to generate an initrd and extlinux for the
                  bootloader. Works like a charm.







                  share|improve this answer















                  This question was solved by the OP:




                  Well I got it working. I used the live-boot &
                  live-boot-initramfs-tools to generate an initrd and extlinux for the
                  bootloader. Works like a charm.








                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  answered Apr 15 '12 at 21:26


























                  community wiki





                  coversnail
























                      0














                      No longer works in 18.04.1:



                      user@myhost:~$ sudo apt-get install live-boot live-boot-initramfs-tools extlinux
                      Reading package lists... Done
                      Building dependency tree
                      Reading state information... Done
                      E: Unable to locate package live-boot
                      E: Unable to locate package live-boot-initramfs-tools
                      E: Unable to locate package extlinux
                      user@myhost:~$


                      Please advice






                      share|improve this answer








                      New contributor




                      J Doe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.
















                      • 1





                        If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review

                        – waltinator
                        7 hours ago
















                      0














                      No longer works in 18.04.1:



                      user@myhost:~$ sudo apt-get install live-boot live-boot-initramfs-tools extlinux
                      Reading package lists... Done
                      Building dependency tree
                      Reading state information... Done
                      E: Unable to locate package live-boot
                      E: Unable to locate package live-boot-initramfs-tools
                      E: Unable to locate package extlinux
                      user@myhost:~$


                      Please advice






                      share|improve this answer








                      New contributor




                      J Doe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.
















                      • 1





                        If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review

                        – waltinator
                        7 hours ago














                      0












                      0








                      0







                      No longer works in 18.04.1:



                      user@myhost:~$ sudo apt-get install live-boot live-boot-initramfs-tools extlinux
                      Reading package lists... Done
                      Building dependency tree
                      Reading state information... Done
                      E: Unable to locate package live-boot
                      E: Unable to locate package live-boot-initramfs-tools
                      E: Unable to locate package extlinux
                      user@myhost:~$


                      Please advice






                      share|improve this answer








                      New contributor




                      J Doe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.










                      No longer works in 18.04.1:



                      user@myhost:~$ sudo apt-get install live-boot live-boot-initramfs-tools extlinux
                      Reading package lists... Done
                      Building dependency tree
                      Reading state information... Done
                      E: Unable to locate package live-boot
                      E: Unable to locate package live-boot-initramfs-tools
                      E: Unable to locate package extlinux
                      user@myhost:~$


                      Please advice







                      share|improve this answer








                      New contributor




                      J Doe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.









                      share|improve this answer



                      share|improve this answer






                      New contributor




                      J Doe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.









                      answered 9 hours ago









                      J DoeJ Doe

                      1




                      1




                      New contributor




                      J Doe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.





                      New contributor





                      J Doe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.






                      J Doe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.








                      • 1





                        If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review

                        – waltinator
                        7 hours ago














                      • 1





                        If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review

                        – waltinator
                        7 hours ago








                      1




                      1





                      If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review

                      – waltinator
                      7 hours ago





                      If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review

                      – waltinator
                      7 hours ago


















                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Ask Ubuntu!


                      • 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%2faskubuntu.com%2fquestions%2f95392%2fhow-to-create-a-bootable-system-with-a-squashfs-root%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

                      GameSpot

                      connect to host localhost port 22: Connection refused

                      Getting a Wifi WPA2 wifi connection