Thursday, June 20, 2019

live cd - Where do I start to create my own Ubuntu derivative?




I would like to create my own Ubuntu derivative with my desktop environment of choice and my preferred set of prepackaged programs.




What base should I start with and what modifications should I start adding?



I know two possible starting points:




  • Ubuntu Core, an official set of bare necessities (which ones?) that seems suitable for creating appliance firmware or one's very own Linux distribution. Unlike JeOS that came before it, this is not a complete distribution, as it lacks a bootable image with an installer or a boot loader.


  • Ubuntu Mini Remix, a fully working Ubuntu livecd containing only the minimal set of software to make the system work; not an official Ubuntu project.


  • probably I could use Ubuntu Server or something else as a base.





Then, I need to customize my distribution. I know of the following tools:





that should allow for me to easily customize my installation media. But what if I need not just something to create a one-off remix of Ubuntu for my own enjoyment, but a maintainable project with all its trappings: I guess I need to have a set of scripts trackable by version control system, amenable for automated testing and building with some build infrastructure. That's how they build a halfway decent OS distribution, right?



How should I best start creating my own Ubuntu derivative in a way that could naturally transcend a one-off custom CD for myself, and be built in a more controlled, robust manner, like proper Ubuntu derivatives supposedly do?



An Ubuntu remix is just a meta package (like xubuntu-desktop) that depends on whatever software should be installed by default. To get the source of some existing meta *buntu desktops do:




apt-get source xubuntu-desktop
apt-get source lubuntu-desktop


This will fetch the base package of x/lubuntu. It is just a regular Debian package, it has files debian/control debian/rules etc. It can be rebuilt by doing:



apt-get build-dep xubuntu-desktop
dpkg-buildpackage -b -uc



Each architecture has its own list of files to install ("desktop-amd64", "desktop-powerpc" etc). To create your own derivative:




  • take the lubuntu/xubuntu source as a base

  • adapt it (eg. replace lubuntu with nicbuntu everywhere)

  • edit the dependency lists to add the packages you want

  • build your meta package

  • install it (dpkg -i nicbuntu.deb or gdebi nicbuntu.deb if you want to pull in dependencies)




Once you have your meta package working, you can build an installer iso image. There are plenty of answers already explaining how to do that (this one is quite detailed).



The only extra things you need to remember to do are:




  • add your nicbuntu.deb and any packages it depends on to the iso image

  • regenerate the Packages file (apt-ftparchive, see linked answer)

  • add "nicbuntu" to the the pre-seed file (again, see linked answer)




Obviously there are a lot of specific details that you will need to get working, but basically that's all there is to it.


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...