-
Notifications
You must be signed in to change notification settings - Fork 5
Home
##DIBS How-To - Installation and Usage##
DIBS is the Debian Image Build System, a script for quickly and simply creating a Debian roofs image or tarball for your embedded project.
###Prerequisites###
- Linux Debian Build Environment (Virtual Machine is fine)
- Git installed on your system (sudo apt-get install git)
-
DIBS
- Review of the README.md
###Installation### You will first need to install a couple packages on your Debian system if they are not already, deboostrap and qemu-user-static.
$ sudo apt-get install deboostrap qemu-user-static
You can now download DIBS.and enter its directory.
$ git clone https://github.com/ARMWorks/dibs.git
$ cd dibs
You are now ready to start building your Debian filesystem.
###Setup### ####Set Config File#### First you will want to set the config file to the board you are using, in this case NanoPi.
$ ./dibs.sh nanopi defconfig
On success it will say something like ${DIBS}/targets/nanopi.conf copied to nanopi.conf.
####Build Image#### This will download all the packages for your Debian image, and creates a .img file, which will be used for other commands, such as creating a tarball of the files, or mounting and editing of the files. This command make take some time as it downloads and configures everything needed.
$ ./dibs.sh nanopi build
###Usage### From here you can do several things, create your tarball or xz archive, edit the filesystem in a shell environment, even use qemu to emulate the system running (Be aware this will trigger any first boot scripts, so it is just for testing).
####Create Tar or XZ Archive#### Once the image is built, you can create a tarball or tar.xz archive from the files with in, this is useful for the NanoPi as you can extract it directly to the SD Card.
To create the tarball archive run:
$ ./dibs.sh nanopi tarball
To create the tar.xz archive run:
$ ./dibs.sh nanopi tarxz
###Customization### There is a couple ways you can customize your root filesystem image. Prior to creation, by editing the config file, or after creation using the a shell to interact with the image.
####Config file customization####
Under dibs/targets you will find *.conf file and *_overlay directories. The available configurations can be customized to your needs, or an entirely new configuration created in place of our example, nanopi.
Overlay
This directory structure houses specific files and directories you want included in the final image. You can place config files, data files, precompiled applications, what ever you like, and it will be copied into the final filesystem image.
conf files
These are shell scripts, that contain a list of Debian package to install, and a post_install() routine. You can modify the packages by adding the name to the list under the line read -r -d '' EXTRA_PACKAGES << EOF and before the second EOF. The post_install() routine is run after everything is downloaded and will execute what ever commands are there, on the filesystem. This is good if you need a file renamed from the normal Debian name, change a config file option, or what ever you can manage to do with shell script, can be done here.
####Using the Shell#### After creating the image, you can use the shell command, to interact with your image. This can be used for modifying files, creating new ones, deleting, etc.
$ ./dibs.sh nanopi shell
From here you have your normal Linux commands and functionality.
##Conclusion## DIBS is a easy to use and powerful tool for creating your own Debian OS. From the basic default set up, to customized specialty applications, with a little configuration the build process only takes a couple commands to accomplish.