Building a minimal Linux OS from source code

Forum Forums General Other Distros Building a minimal Linux OS from source code

  • This topic has 8 replies, 3 voices, and was last updated Feb 23-11:06 pm by Brian Masinick.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #99839
    Moderator
    Brian Masinick

      The following article from the Dev community may be of interest.
      It’s not as complicated as it may seem at first, though the code in the various components is definitely significant.
      If you’re curious, take a look. If the link is not accessible to you, contact me and I can send you the contents
      of the work.

      Building a minimal Linux OS from source code

      --
      Brian Masinick

      #99870
      Member
      andyprough
        Helpful
        Up
        0
        ::

        I like building Linux from Scratch, it’s so educational with long articles about each piece of the system as you build them and piece them together.

        #99879
        Moderator
        Brian Masinick
          Helpful
          Up
          0
          ::

          I have actually built a few systems from scratch. I’ve used Linux From Scratch at least once, Gentoo Linux as a starting point and then of course I have remastered our own distribution, though not at all from scratch.

          My findings are that as far as efficiencies gained by compiling specifically for your hardware provide negligible improvement, if any. The primary gain is learning more about the elements that go into building the software. The Dev writer did a good job explaining one method of building a basic system.

          --
          Brian Masinick

          #99882
          Member
          techore
            Helpful
            Up
            0
            ::

            I like building Linux from Scratch, it’s so educational with long articles about each piece of the system as you build them and piece them together.

            Agreed. I am very appreciative that we have alternatives from Linux from Scratch, but it is very educational.

            I have remastered our own distribution

            anticapitalista referenced build scripts, recently. I don’t particularly want to build antiX but love to review the scripts to better understand it. Where can they be found?

            #99884
            Moderator
            Brian Masinick
              Helpful
              Up
              1
              ::

              I’m not sure if everything you’re looking for is here, but antiX does have a https://gitlab.com/antiX-Linux site.
              Maybe some of the things you are interested in can be examined there.

              --
              Brian Masinick

              #99893
              Member
              techore
                Helpful
                Up
                0
                ::

                @masinick, thank you. I will take a look.

                #100497
                Member
                techore
                  Helpful
                  Up
                  0
                  ::

                  I believe this is the script being used to create antiX 22. Looks pretty cool. I need to dig into it and broaden my mind. 😛

                  https://gitlab.com/antiX-Linux/Build-iso/-/blob/master/build-iso

                  #100499
                  Moderator
                  Brian Masinick
                    Helpful
                    Up
                    0
                    ::

                    Yes, that is a very cool procedure and it utilizes many powerful features.
                    One of these “features” is the use of additional terms that make the procedure look good,
                    but these terms, or commands, are NOT standard Bash.

                    This means that there must be other scripts, alias definitions or functions defined
                    somewhere else, so in order to actually use the build-iso tool, you actually need
                    whatever additional configuration, libraries, tools, or set up conveniences that are
                    used when running build-iso.

                    Even if you put together your own build environment, you would need the complete
                    setup to actually get this tool to work.

                    My guess is that when you get into whatever environment they use, something in that
                    environment probably simplifies all that so that the keywords work properly.

                    --
                    Brian Masinick

                    #100500
                    Moderator
                    Brian Masinick
                      Helpful
                      Up
                      1
                      ::

                      I found this at https://gitlab.com/antiX-Linux/Build-iso/ as part of the README documentation
                      I’m including just a little bit here. Even with ALL of this information, I’m certain there is more to it.

                      Anyway, this provides a high level overview of the process:

                      “The work of build-iso is split up into 8 different stages.
                      When each stages is successfully completed, a stage-N.out file is
                      created in the Output/ directory. Each time build-iso is
                      run, it will start working on the first stage that lacks an
                      output file. These files also let the program pass information
                      for one stage to the next across restarts. Therefore there is
                      almost no penalty for stopping the program after each stage. If
                      there is an error condition then the penalty for stopping the
                      program, fixing the error, and then restarting the program is
                      minimized.
                      The 10 stages of processing are:
                      Gather inputs and set defaults

                      Make directories and symlinks
                      Run debootstrap
                      Prepare chroot
                      Inside of chroot
                      Finalize and clean the chroot
                      Prepare iso directory
                      Create squashfs file
                      Create iso file
                      Clean up and prepare to start over”

                      --
                      Brian Masinick

                    Viewing 9 posts - 1 through 9 (of 9 total)
                    • You must be logged in to reply to this topic.