|
Translations |
Builder /
HowToCreateYourOwnGNULinuxDistributionAs part of creating gNewSense, we created our Builder which allows for the creation of a new GNU/Linux distribution based on Ubuntu Hardy. From a simple config file you can choose the name of your distribution, release, tagline and what packages you'd like to be installed/removed by default. Graphics will be automatically generated. These scripts are obviously biased towards producing gNewSense, but should provide a good base to work off. Note that there is no need to follow these steps to use gNewSense, you can download an iso from one of the Mirrors. You'll need at least 60GB of free disk space, and preferably a very fast Internet connection (you'll be pulling 40GB of data). You'll also need about 40GB of space on your mirror (which can be the same system). If you're smart with hardlinks you should be able to avoid some of the duplication. This should be run on an Ubuntu Hardy (or later) system. All commands must be run as root. If you have any queries, please drop into our IRC channel. This is still very much beta software, I haven't done a rebuild from scratch in a long time and the code has changed a good bit since. Step 1: GPG keyMore recent verions of apt require GPG signed release files in a repository to ensure the integrity of the distribution, so our first step is to create a GPG key. gpg --gen-key will let you do this. Make sure the key has a blank password. Take a note of the fingerprint of the key as you'll need it later for the config file. Step 2: Debmirror (optional)To avoid having to redownload files, I suggest creating a mirror of Ubuntu main and universe. This will take approximately an additional 40GB. debmirror --nocleanup --verbose --progress --method=http --host=ie.archive.ubuntu.com --arch=i386 \ --source --dist=hardy,hardy-security,hardy-updates,hardy-backports \ --section=main,universe --ignore-release-gpg --root=ubuntu /the/target/directory debmirror --nocleanup --verbose --progress --method=http --host=ie.archive.ubuntu.com --arch=i386 \ --nosource --dist=hardy --section=main/debian-installer \ --root=ubuntu /the/target/directory You'll also need to setup apache so you can get to the mirror via HTTP. This step is optional, but it is strongly reccommended to have a local Ubuntu mirror (for some value of local). Step 3: PackagesYou'll need a number of packages for the Builder to run properly. apt-get install reprepro debmirror build-essential apache2 subversion cdebootstrap debootstrap imagemagick apt-get install squashfs-tools netpbm syslinux bittornado fakeroot devscripts equivs sharutils svn co http://svn.gnewsense.svnhopper.net/gnewsense/builder/trunk builder cd builder There's undoubtedly packages missing from this, please let me know. Step 4: ConfigurationOpen the config file in a text editor. The settings you need to worry about most are MIRROR, RELEASE, DISTRONAME, DOMAIN, BASEDIR, and REPOAPT. Changing the others here will lead to better personalisation (as will editing other settings in the configuration file). MIRROR is either the mirror you setup in step 3, or an Ubuntu mirror. It should contain the security packages. DISTRONAME is what you want to call your distribution which should consist of only letters and numbers. RELEASE is the name of your release. Your release should be all lowercase as it will appear in paths. TAGLINE is used in the bootsplash and login screen. SIGNINGKEY is your GPG fingerprint from step 1, it should not contain any spaces. BASEDIR is the directory under which the repository, livecd and temporary files will be put. REPODST is where the mirror will be built in the filesystem ($BASEDIR/(lowercase distribution name)). REPOAPT is where the build scripts will pull packages from, so you should setup Apache to serve this. DOMAIN is used to create the default sources.list when installing. We assume an Ubuntu-like setup where you have archive.DOMAIN and security.DOMAIN and subdomains for all the country codes. RSYNC_DEST is where the generated repo and livecds should be rsynced to by a LOGOLETTER is the letter that will be your logo. META_*_{ADD,REMOVE} control what packages you'd like added and removed from the ubuntu-meta package when your meta packages are being created. *_VERSION are the numbers appended to created packages versions. You will need to increment these every time you rebuild a package. You will probably want to set these all to 1 when starting. Step 5: Generate the repository./gen-repo && ./do-update This will take a while. The repository will possibly be in an inconsistent state while this is running, which is why you only push your changes to a mirror in Step 7. Every time there's new versions upstream (e.g. security updates) re-run do-update (and debmirror if needed). If you are running a 32bit userland on a 64bit kernel, install the linux32 package and use ./gen-repo && linux32 ./do-update Step 6: Generate the LiveCD./gen-livecd The created image will be placed in $LIVECDDIR/$DISTRONAME_L-livecd-$LIVECD_VERSION.iso ./gen-cdsource ./stage-cd Will prepare a source tarball and push the iso to $REPODST/cdimage Step 7: Push your repository to a mirror and publiciseYou can now publish your repository (the dists and pool) directories as well as your LiveCD to your mirror and publicise your new distribution to the world. ./push-repo ./push-cd © Brian Brazil 2006 |