Wednesday 24 February 2016

Spin your own Debian

Today, we’re going to look at creating a custom Debian ISO using the Debian Live Systems project. With the project and website, you can create your own custom version of the distro to deploy as you wish around an office or in your own home. The benefit of creating your own spin is the ability to include specific packages that are relevant to your needs, have it work on specific architectures, and generally make it much more suited to your needs.

We’ll be using the online tools to create this custom image but they’re very similar to the ones that exist within Debian, which will enable you to create your own spin once you decide to go a little more hardcore and edit it from the distro itself.

1. Find the builder

For this tutorial we will be using the Debian Live System builder. This is not only software that you can actually use on Debian, but also it has been applied to a web service. We are going to use the web version of this, which makes the setup slightly easier to parse and generally understand. You can have a look at it by heading over to the following address: http://live-systems.org.

Spin your own Debian

2. Start the build

From this page you can read up on the range of different uses for the software, including development info and old versions of the build software and images used in it. For now, we are actually interested in building a distro, so click on the Build tab that’s located on the top bar and select the Debian option to get to the interface where we can customise the build to our liking.

3. Select an image type

After putting in your email address, you have a selection of image types to use. ISO is a pure image of the distro, able to be used for live booting from a CD or USB device only. Netboot is the kind generally used in net booting, which is over the network live boot/installation. Isohybrid combines both CD ISO live booting with the ability to use it to live boot off other live mediums (such as a USB stick), separate CD ISO and HDD(/USB) images and a compressed version. Isohybrid works for most situations.

Spin your own Debian

4. Type of Debian

You have a bit of choice on what kind of distro you can create for the ISO. You can select between Debian Testing (currently Stretch) and Sid for the image – Sid is the unstable image and you should probably stick with Testing. Otherwise, you can also choose the desktop environment to be used by default by the system – there’s a wide variety, along with having the option for no desktop at all.

5. Default package choice

You can set the ISO to have certain packages installed as part of the default package list using the ‘cgipackages.list.chroot’ field. All you need to do is add the package names to the list separated by a space – ensure you get the exact package names correct though, so perhaps check the spelling in a standard live booting Debian before you add it to the list. There’s a limit of 255 characters, so make sure to add only the essentials.

6. Architecture choice

Choosing whether to have a 32 or 64-bit ISO is entirely dependant on the use cases you have planned. A 32-bit ISO (i386) will be more universal, working fine on older systems as well. This can be good for general troubleshooting or maintenance. For getting the most out of a system though, a 64-bit ISO (amd64) is preferable. You can always go back and create a second ISO with a different architecture if you desire, though.

Spin your own Debian

7. More architecture choices

As well as a basic architecture choice, you can drill down into the sub-architectures to better optimise your distro for the task you need it for within linux-flavours. If you’re doing 64-bit, the standard amd64 is all you really need to concern yourself with. For 32-bit/x86 builds, there are many more choices. For much older processors 486 will work, but won’t be able to make full use of their power. In addition, 686 won’t work on older tech, but it will work on all modern machines. Choose 686-pae if you want to properly use 4 GB of RAM as well.

Spin your own Debian

8. Chroot filesystem

The root filesystem that you actually boot from can be modified in the chroot-filesystem option, right above the linux-flavours that we just talked about. It’s set by default to SquashFS, which is the current standard, but if you need it to be another filesystem type for older or different machines, you can choose ext2 or plain.

9. Extra boot options

In the advanced binary options we can start adding extra options for our specific use cases. You can mostly keep these at their defaults, but there are a few options you could feasibly change to get the most out of it. First of all is the ‘bootappend-live’ option: this enables you to add any extra boot options to the distro you’re creating. Setting a resolution, running in software rendering and any other boot option you’d want can all be added here.

10. Choose a bootloader

Live systems tend to use syslinux for live booting, although it can depend on what kind of images are in the ISO. Multiple arch or kernel versions are easier to launch via GRUB. We won’t be able to do that in this image, but if you’re having problems booting then you could always try building the image with the different bootloader. For now, we recommend using syslinux and then changing it to GRUB if it’s not working in your specific use cases.

Spin your own Debian

11. Choose installer type

There are three choices for the installer in the ISO. First of all, you can have none and it just boots into a live environment. Secondly, you can have it as an option other than live-booting, so that you can go straight into installing the image if you know it’s exactly what you want. Lastly, the live option provides for a live install from the live environment. We’re choosing live, as it enables us to use the distro and then install without rebooting.

12. ISO options

The ISO labelled options are all for just labelling the ISO in your own way. You can leave these be and it won’t affect anything, or change them if you plan to distribute your version of Debian and want some extra info to be in there. The volume will appear on the actual ISO name, with the application being used as the name of the distro elsewhere.

13. Final binary options

Finally, you can set a few extra options such as whether or not memtest is included in the ISO, and the location to look for the Netboot ISOs for booting with the net-path and net-server is available to tweak. These last few you won’t need to change for a normal ISO, but if you’re making a netbooting distro then you’ll have to make sure you have the infrastructure set up and know what needs to be added to these fields.

14. Source files

If you also want a source version of the distro once it is made, you can set the source option to true. By default, this will create a TAR file with the source of the distro, but that can be changed to a couple different options if you wish. For the time being you can keep it set to false, but in the future if you find that you need the source separately, it is definitely a good idea to keep this option in mind.

15. Build your distro

Double-check everything one last time and then click submit. You’ll be presented with your options as a run-down, so you can try to remember them, and two links that you can use. One will let you check the process of the build, while the other is the link to the actual ISO itself. The process to build is supposed to take up to an hour, but in our tests it did take longer. Remember to download all the files you want as soon as possible because they will be deleted after 24 hours.

Spin your own Debian

16. Use your image

Once you get notified that your image is ready, download it and anything else that you want. Load it into a virtual machine or onto a live-booting medium and then check out your new distro. Make sure that any packages you wanted have installed by looking in the menus, and that you have the right architectures and options in the build itself.

17. Install your image

If you plan to install this distro on your system then you can do so from inside the live environment, as we selected that option during the build. If you’re having problems with it, try the other install options in the build until it works as planned. You can also use a command line and graphical installer from the boot menu if you want to skip live boot.

18. Use your Debian!

Once you’ve checked to make sure your new image is working, you can start using it properly. As Debian updates, so too will the system you have, and you can get zsync ISOs to use in updating if you don’t have access to the Internet. You can also freely distribute it as you wish, as it’s also free software licensed under the GPL. 



from Linux User & Developer – the Linux and FOSS mag for a GNU generation http://ift.tt/24oLrHm
via IFTTT

No comments:

Post a Comment

Amazon

Donate

Donate Towards More Raspberry PI's for Projects