Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Linux Software

Ask Slashdot: Creating a "Personal" Linux Distribution? 84

Craigthulu asks: "I would like to install Linux from the ground up without using a specific (i.e. someone else's) distribution (except a root/boot combination to get things initially copied). I want to do this so that I become intimately familiar with what exactly is on my computer rather than rely on a bunch of (probably extraneous) software packaged up by someone else. Hopefully, this completely DIY method will force me to learn everything How do I go about finding out what I need as a bare minimum? Is there a distribution that would actually meet these critieria?"
This discussion has been archived. No new comments can be posted.

Ask Slashdot: Creating a "Personal" Linux Distribution?

Comments Filter:
  • There a many mini distributions of Linux out there that contain the bare minimum of what you need to get the system up and running. You can also take a look at what is contained in the A disk set of slackware. www.linux.org [linux.org] also contains a list of distributions including a lot of the minuature one.
  • as to the problem at hand, i can't help much. i've been running debian for around six months now, and love it. i still haven't set up my printer for my system - it just works in WordPerfect under its HP LaserJet series II emulation (it's an old IBM 4019E, non postscript). i also haven't figured out debian's boot scripting process. i don't get the different run levels. i want to put things like OSS 'soundon' in my boot scripts. that's why i was reading. sounded like people might know of resources to learn about this (starting basically, and working to more advanced info) - but alas, scripts seem to be a common weak point in the understanding of their systems...

    Take a look at man update-rc.d, /etc/init.d/skeleton, and /etc/init.d/network

    The basic concept is that the 'real' init script lives in /etc/init.d, and when switching runlevels, init runs the scripts using their symlinks in /etc/rc[new runlevel number].d with either a start or stop argument depending on whether the the name starts with S or K (S == Start, K == Kill)

    For something such as soundon, you don't need to run it with 'stop', so you can either make it have do nothing for stop, or not even look, such as in the /etc/init.d/network script.

    Regarding the printer configuration, the way I've done it in debian is to use the apsfilter package along with gs-aladdin. If your printer is supported by gs-aladdin, it should be relatively painless, as there are simple scripts that run to ask you about your printer & set things up.
  • Heh. I remember SLS - they joys of buying boxes of floppies and copying disk images onto them. (-:

    Linux has come a long way since the 0.99 days!
  • I would install a full distribution (take your pick--RedHat, Debian, SuSE, Slackware...), then use that to compile everything for your personal distribution. Either put it together on a separate computer or on a different partition if you're low on spare computers. :)

    Just a warning: I started doing this, and never finished. It takes a long time. There's just a lot of grunt work to do.
  • by On Lawn ( 1073 )
    Share the wealth.... Where are these scripts?
    ^~~^~^^~~^~^~^~^^~^^~^~^~~^^^~^^~~^~~~^~ ~^~
  • its called a hobby. its no different than the people who take apart their car and put it back together. Or the people who build their own car for that matter.

    Besides, the question was not about you, it was about someone else.

    ---
  • Wouldn't a system like the FreeBSD ports be very cool to do this kind of thing?

    I'm thinking about trying that OS for the same purpose (learning more about basic OS things and the like, compiling all of your own stuff, so you know what you've got on your machine)

    NO flamewars on this subject, *please*, it is just an idea......
  • I have/had similar plans, though I still haven't gotten around to it. I planned on starting with the bootdisk HOWTO from the Linux Documentation Project [buffalostate.edu].
  • Amen,

    I'm tired of having unknown problems and not knowing where to start. Ivan for how extreme he is has a really good point. There is so much freedom from knowing everything that is going on. That to me embodies the concept of owning your own distribution, just like a well marked up textbook that you've gone over a hundred times means you finally own the textbook.

    having said that I realize it would be the beginning of unknown problems but it would also be the beginning of the end. These are things my mother doesn't need to know, but for some reason i think i do. Just stubborn too I guess.
    ^~~^~^^~~^~^~^~^^~^^~^~^~~^^^~^^~~^~~~^~~^ ~
  • I concede that starting from scratch/source is probably a very effective way to learn the details of my system. I also understand that a big advantage of open-source sw is that all the details are available for my learning should I ever need to do so. but is learning almost everything there is to know about GNU/Linux really a wise investment of my time/attention? a better investment than learning a little more about the concept of entropy, for example? or learning to waltz? a better use of my time than learn about the concept of the 'network externality' (one of the most imporant concepts in economics and helpful for understanding Microsoft. is it not better to know the basics of dentistry, psychology, consumer law, mental health (stress and the immune system, depression), and computers than to know a lot about computers and almost nothing about the other things? (I tried to pick things that most people will find useful at some time or another.)
  • If you are using i386, then FreeBSD is actually a nice place to start for a custom installation since it starts off small, and has the release engineering to enable you to actually make a distribution.

    Case in point, we had a setup which needed a large collection of custom patches to work. I added these patches to the system, checked it built, then decided I'd like a CD (like the ones Walnut Creek sells) of the result so I could install it easily). Basically all I did was check in the source into a new cvs repo, then cd /usr/src/release and type make release

    *really* easy.

  • I'm surprised there isnt a how-to or something on this. I mean, all distro's can be install in a basic form, with bare minimums, but for years now I've been discussing with friends who have been fishing out the BARE minimum from the installs and repacking the systems to just install their own preferences. I've actually begun to do this with NT even. It now installs with a modified registry, no exchange or messaging or IE, and of course defaults to my own "theme". Since I have a cdr drive, i've also packed a copy of my pqmagic and other drivers that i know i'll need for my standard working environment onto the cd. Anyone know of any pages that have info on tweaking OS's in this nature, from the pre-install stage ?

    ElecMoHwk

  • For maximum learning value, start with a libc5 system and refuse to put anything but glibc on the new partition.

    Create a partition, put in /tmp /mnt /dev /proc (any others?). Also you may need to create /bin /sbin /var /usr if no package is bold enough to do it during installation. Give /tmp the correct permissions. Run /dev/MAKEDEV in your new /dev dir. (Look at MAKEDEV for bonus points.)

    Then have a look at ftp://ftp.gnu.org/pub/gnu/. You can get most of the packages you need there (including glibc). You don't need a boot disk, you can just use lilo. Lilo, things like mount, and a few other Linuxy packages are not on the GNU site, you need to find them on ftp://metalab.unc.edu/. I remember using util-linux and smallutils (hate GNU false, which returns true when given the --version option).

    Build and install enough to get a development environment. This includes at least glibc, gcc, binutils, make, sed, sh-utils, bash, (diff?), fileutils(?), grep, gawk. I am surely forgetting some. But if I told you everything, there would be no challenge, would there?

    As someone else pointed out, most GNU packages can be installed onto a new system whose root is not mounted on /. For those that can't, you have to play games.

    If you do have a purely libc5 system to start with, you will have to figure out how to build packages that will work with your new glibc libraries. It is possible to figure out how to do this. The glibc2 faq is helpful. I did it by installing glibc2 under /usr/local on the original system and building a gcc that used it. I may have played with the gcc specs file too, I don't remember.

    Always worry about what permissions and ownership the files and directories have.

    If you get lost along the way, give up. About three weeks after my installation, when I found myself mounting /usr/X11R6 by NFS over a PLIP connection, I realized it was time to install Debian. :-)
  • Partly for the heck of it, and partly to try to learn how, so I might be better prepared to get Linux going on legacy machines, I decided to try to get a minimal Debian running on my legacy Vectra (386/16N, 8/52 MB). With only 52 MB of HD space to play with, and wanting to keep a minimal DOS partition going, I allocated 36 MB + 4 MB swap to Linux.
    // I have a shell account, which meant I could do away with almost everything related to networking and PPP; planned to use minicom. Anyhow, cleaned house in the DOS partition, backed up, defragged, and used (iirc) FIPS to keep DOS and create new partitions. FIPS has great docs, as I recall. Used DOS telecomm to d/l Debian Base images, and their root.bin and drivers disk images, and maybe their boot disk image as well. Lesson #1: Even though the sizes of the disk images seem to fit onto a floppy, *Don't* use DOS xcopy to transfer from HD to floppy! You *must* use a RaWrite! (RaWrite 3.0 didn't work on mine; there are several.) I think I kept the big Base file on HD, btw.
    Followed the Debian installation instructions, and used dselect to remove and add things I wanted. dselect is a pain; also really slow on a 16MHz 386. Try to use apt (?), a new Debian installer. Nevertheless, dselect had one redeeming feature (no, not a bug): It keeps track of all dependencies: What you else you must get but don't have. Well, give it another pat on its huge back: It can actually find the packages you're looking for, even though you had to squeeze the devil out of the original filenames for the packages. Seems that keeping ".deb" will do it, and anything reasonable is OK if it fits the MS-DOS 8.3 format. (I tried to keep key letters as well as all digits if possible; also, of course, delete all dots except that before .deb).
    Had an exhaustive look at the files (recommended!), and found what I had. I'd recommend installing Midnight Commander immediately, at this stage. Found tons of all-but-useless files in the localization area, some even in triplicate, more or less! Think I also reluctantly ditched all the man pages, saving those in .gz form. (Later, found that to read them with any degree of convenience (from mc), I had to load the whole groff package; rm'd almost all of the groff fonts and tmac (for my purposes!).) Others to remove are many keytables, variants of joe. You need to keep /devascii/ in Fonts to let mc show you [man.gz] pages. No point in trying to remove /proc/kcore; for one, you can't do it (easily, if at all); and two, it isn't taking up any HD (or RAM?) space. It's something clever to learn about. You must keep base-files, findutils, mawk, and diff, apparently.
    To get color ls, I snooped around and found the necessary stuff in root's .bashrc, iirc; copying it to the user's .bashrc seemed to work, but there are probably better ways! I was booting from floppy, and wanted to try to rearrange matters for a dual boot.
    Debian apparently omitted the support code/files for vga=ask, which I found to be a Big Drag, because I really like 50-line VGA; I can see more at once. 25-line displays are great for 6 people at once, but I'm a loner. Had an exhaustive look at the console fonts, and got rid of those that I didn't want. Found that resizecons didn't work, because the necessary videomode files were missing, but setfont could give me more lines; mc still gave me a full screen's window, as did joe. Needed to do a ^L to clean house fairly often, but that was worth the extra lines.
    Also (eventually) had good luck with gpm (mouse) and zgv, the image viewer. Didn't get minicom going yet... // Also use a Dvorak layout, normally in DOS via the MS GA0650.EXE package, an excellent piece of work; bug-free if the apps. programmers do things normally. Linux supported Dvorak very nicely. Created a set of aliases to mount and unmount my DOS partition and floppies, also "mkext2fs" on a floppy.
    Well, I got overzealous in my pruning, thinking that /libs/modules/2.0.34/ (iirc) had stuff I could delete, based on its names. Yikes! Good way to *fatally cripple* Linux! At about this time, I also installed a used '387... Anyhow, my Linux partitions are now almost useless. (I allowed a measly 4 MB for swap, figuring that was better than none.) Tomsrtbt, the Debian rescue disk, the Debian boot disk, and attempts to reinstall Debian all seem to find the existing Linux, and get stuck toward the end of the boot sequence at "INIT: version 2.xx booting". Hangs forever. I might need to redo from scratch, although pruning and reconfig. would take a while. Now that I've unwittingly sabotaged my Linux partition(s), it's really nice to know there's lread, a DOS/Win pgm. (Linuxberg): Speaks ext2fs. It lists ext2 dirs; can also read files from them into DOS (but watch long filenames!), and even write from DOS to ext2 files. Unfortunately, I probably don't have the specific files in DOS file format to fix my Linux.

  • that i think this is a really good thread. i've noticed the degridation of the posts lately, and that i'm glad there are still pleasant, helpful people who think before they comment.

    as to the problem at hand, i can't help much. i've been running debian for around six months now, and love it. i still haven't set up my printer for my system - it just works in WordPerfect under its HP LaserJet series II emulation (it's an old IBM 4019E, non postscript).

    i also haven't figured out debian's boot scripting process. i don't get the different run levels. i want to put things like OSS 'soundon' in my boot scripts. that's why i was reading. sounded like people might know of resources to learn about this (starting basically, and working to more advanced info) - but alas, scripts seem to be a common weak point in the understanding of their systems...



  • I was about to mention that one could take
    a barebones distribution of BSD as an
    example of what you need for a small
    distribution. Other examples would include
    going back and looking at the old MCC
    distributions. otherwise consider
    what tasks you need done:

    * a shell (sh compatible preferably)
    * shell utils (GNU)
    * fdisk
    * ext2 utils (mkfs, fsck)
    * editor (vi and/or emacs)
    * network utils (ifconfig, route, telnet, ping)
    * inetd/xinetd/etc
    * network server daemons (telnetd, samba, httpd,etc)
    * mail system (qmail, sendmail, postfix)
    * shared libraries (libc/glibc)
    * compiler/linker/assembler (gcc+binutils+.a's)
    * xwindows (xfree)

    that would be roughly what i would start
    with, and it shouldn't be that big.
  • ...is all you need...
  • I'd like to know how to do this as well.

  • You should have a look at the devices.txt with the kernel, as it explains the major/minor numbers to use.. And, man mknod will show you how to actually make the devices from those #'s.
  • If you've got a Debian system, you can install the altgcc package, then compile libc5 things by calling i486-linuxlibc1-gcc and i486-linuxlibc1-g++ where you would normally just call gcc. There are 'oldlibs' package sections that contain libc5 libraries, along with -altdev headers to go with them.

    I'm not sure how well other distros support this, but if you're willing to spend the time, you could maintain a libc5/libc6 development environment on your own, too.
  • This is a cool way to learn about Linux.

    I'd just get a kernel onto a blank filesystem, lilo the kernel so it boots, and then get sash and make it the init program.

    That's about as small as I can think of. You can build your system from there. Have fun.

  • What timing for this question! I just finished wedging a slackware distro (3.3) onto an ancient laptop (Gateway Nomad 486/25 4M RAM, 30M ext2 partition). Tried to roll my own for most of it, since I couldn't get any of my RH boot disks to load. Luckily, I still had a collection of old Linux CD around and found that I could get slack up and running.

    Now I have a question, since I am running a libc5 system on the laptop and running glibc on my other system, how do I compile binaries for the laptop? Do I need to just keep a copy of libc5 and compile against that? Do I need to recompile libc? What would the gcc switches be for something like this?

    Anyway, its fun when you finally get the thing breathing. I felt like Dr Frankenstein when it booted and gave me a prompt.

    Chris
  • A good starting point would be ftp.cs.Helsinki.FI/pub/Peo ple/Torvalds_Linus/v2.2/ [helsinki.fi]
  • which would be found at http://www.toms.net/rb/ [toms.net].
  • What exactly is so great that the GNU tools have that the BSD ones don't???? I've ask this to a number of people who prefer the GNU ones and they don't know the answer. The only thing I can see is that the GNU 'ls' command supports ANSI colors. (but this is a feature I don't use)


    -Confused

  • I see lots of comment about, and provision for, installing into systems with only limited RAM (such as 4 MB), but surprisingly little about installing onto HDs that have limited space. The small distribs., true, do take up minimal space, but when you want to roll your own, more or less, it seems that the big emphasis is on accommodating minimal RAM, forgetting about minimal HD space. Or, am I confusen?
  • Posted by Daniel Bendorf:

    Yeah I think there at least needs to be a distro that includes glibc 2.1, kern 2.2.x, xfree86 3.3.3.1, and updates regualry, i mean like the DAY teh stuff comes out. If anyone is interested it might me a cool project. I would like to be involved. I have tried making my own distro, but I do not have enough linux knowledge, so I have failed, twice. heh, but I will someday make a kickass distro that has 'bleeding edge' junk
  • Perhaps you'd like to run around town looking for used Macintoshes, Amigas, and Atari ST's. Then grab a copy of "LInux Roughcuts" from Red Hat. It has the old mkLinux, Yyggradsil(sp), and other Linux kernel distributions for weird architectures for about $26 at Cheap Bytes.

    And if you can't find an old Mac or Amiga lying around, there's always NetBSD or Slackware.

    Yours in pain,

    Kris

    Kriston J. Rehberg
    http://kriston.net/ [kriston.net]

  • I'd like to know how to do this as well.

    If you really want to start from scratch, start from the kernel:

    http://www.kernel.org

    from there you can get the basics, like the kernel, init, gnu utilities, and roll your own expert distribution. Most of the documentation is in the tarballs and source code itself and is quite good.

    It is a lot of work, but very educational.

  • I was somewhat interested in this a while back. What I would suggest doing is:
    • Read the Bootdisk HOWTO. Read the section on how the "Pros" do it.
    • Use an existing installation to create a boot and a root disk. Keep experimenting with this boot/root disk combo until you learn the init process pretty well.
    • Then switch over to another partition on your system - hopefully by this point it will be easy since you could just be building your boot/root disks on it from the beginning - by the time you add the lilo entry to boot that partition you should have all your bugs ironed out.
  • check the bootdisk-howto and thats most all you need to get started.
  • I'd have to agree with this. NetBSD is a nice, bare-bones system which requires you to learn quite a lot about the system. I installed it on an old 486 just for fun and ended up having quite a good time.
  • Most of the above answers seem right: it's tough and time consuming, you're better off with a second machine, you should start with a minimal install, etc.

    I just did that (over the last two weeks!) moving a very basic Slcakware 3.6 to glibc 2.1/kernel 2.2.2. I've compiled *everything* (binutils, diffutils, all kinds of libraries, Xwindows) and I _am_ quite happy with the results. So much that I'll start canning up stuff into an unofficial glibc based Slackware if and when I get the time.

    Now, the question is if it's really worth it. I mean, I _could_ have installed RedHat 5.2+updates. I'm sure I would have finished in much less time. Why did I do it? I'm stubborn as hell. And I _do_ have another machine to work on as stuff compiles into 3-4 am every night ;-) What did I earn? Lots of patience, tons of small code-hacks, and optimized binaries. Was it worth it? I do not really know. I'm happy with it, but I wouldn't advise anyone to do the same unless they had very special requirements.
  • About three years ago I installed Slackware. Since then everything I've installed has been by compiling the sources. My dist wasn't my own then, just a hacked Slackware, today it is. The minimum you need is kernel + utils (util-linux and GNU file-util and GNU text-util) + shell + make + gcc and some way to get the sources (ftp to prep.ai.mit.edu, tsx-11.mit.edu and metalab.unc.edu).

    Warning: It takes a lot of time to stay bleeding-edge this way, but if that turns you on it's the best way to stay more bleeding-edge than anybody else ;-)

    When I start to trust -mregparm in gcc I might redo it all with my own ABI ;-) ;-)



    Has it ever occurred to you that God might be a committee?
  • I havn't actually done a system myself, but I would imagine that the DIY method would require a pretty large ammount of HD space, at least while things were being compiled and setup...

    --
  • I would say that Tomsrtbt is the smallest way to start. One Floppy and building blocks for everything. Even has ftp to get those new tarballs. While meant to be a rescue system, it will go on a harddrive and allow one to start building.

  • Strictly speaking:

    find / -type f -print0 | xargs -0 grep regexp /dev/null

    The probability is low, but non-zero, that grep might otherwise receive one argument, and not prefix the output with the filename.
  • Sounds interesting... Have you ported whatever libc the *BSD systems use to Linux, that sort of thing? Might be a good way around glibc-2.1 licensing issues. Anywhere to get some info?
  • I have been having a different itch lately. I want to compile all of my own tools (ls, grep, find, etc). The current set of tools sucks, when I do bigish file system things, I always wind up with directories that I can't list or delete.

    I want to do 'grep regexp `find /` and have it work.

  • Posted by Locutus of Borg:

    speaking of making /dev entries. i'm making a linux distro fir a project for my work, how would you go about that? =|)-
    --
    Ben
    IRC: SUidRoot
  • For a Linux distribution, Slackware gets as minimal as they come. If you are comfortable with *nix systems, then {Free,Net,Open}BSD systems have good minimal installations and are about as standard as they come.
    If you are wanting to really 'Roll Your Own,' experience is probably your best bet. There are many dependencies between various libraries and system binaries which you should be aware of. For a good overview, check out FreeBSD's 'make world' which does a source-level rebuild of the base operating system.
    As a side-note, I have been working on a source-level Linux distribution based off the free *BSD systems; not a task to be taken lightly since the Linux operating system is quite fragmented when it comes to system-level binaries.
    1. Excuse me for a haphazard-howto.
    2. This presents a chicken/egg problem. "From scratch" implies from the source. To build what you need, you'll need a system with a compiler to compile the compiler needed to compile your compiler so you can compile your system. Nevertheless, this is a meaningful goal.
    3. Start with modern (glibc) based distribution. For the sake of argument (no flames, please), say RedHat. (or debian)
      1. Do the most minimal "expert" install possible and boot your machine when done.
      2. Read the rpm man page. Use 'rpm -qa' to list packages then 'rpm -e pkgname' to remove unwanted packages.
      3. Above will surely fail on dependencies. Simply remove those first. Iterate above until almost nothing is left.
      4. In order to have a baseline system, you'll need at least the following: glibc, init, initscripts, bash, mount, bzip2, gzip, tar, textutils, fileutils, sh-utils, util-linux, etc.
      5. In order to build stuff, you'll need a compiler. Install egcs/gcc (whatever x86 boxes use??), binutils, and whatever they need.
      6. If you don't want to install from a cdrom, you'll have to grab stuff from the net, so if you aren't connected, make sure that pppd is working.
    4. You'll be better off trying this if you have two linux machines networked:
      1. One "fully-loaded" with docs/readers, development tools, vi, X, etc.
      2. The other as the subject of your grim experiments.
    5. Perspective: all you really need is '/sbin/init', '/etc/inittab', '/dev' files, and whatever you want init to start.
  • This is definitely the way to do it. Just make a new partition, check it, mkfs.ext2 on it, and start hucking stuff on to it (well, I guess hucking isn't the best word to use in this case, but...) Once you have it mounted you can copy over the device files that you need, compile a kernel and bash, and try getting the kernel to boot (it will start up bash once it cannot find an init program). Then you can get an init program compiled, etc. Although setting up a distro first is much easier, it sort of defeats the whole purpose of creating your own linux/GNU system. This way you get a very up to date and highly customized system to begin with (you'll notice that this "low-level" stuff is really where distrobutions differ). The only major sticking point I found was getting a shadow password suite installed. Oh yeh, and being able to read through source code in order to find out why those cryptic error messages are being generated helps too...good luck!
  • Email me,

    I'm working on about the same thing but in concept so far. I have a computer suitable for testing/development. Also you might want to check with Rock Linux man. (Or maybe you are Rock Linux man).
    ^~~^~^^~~^~^~^~^^~^^~^~^~~^^^~^^~~^~~~^~~^~

"Beware of programmers carrying screwdrivers." -- Chip Salzenberg

Working...