You are not logged in.

#1 2015-11-23 01:37:32

ozitraveller
Member
From: Less is More! Devuan powered!
Registered: 2015-10-01
Posts: 32
Website

DIY Distro - Debian/Devuan Live-Build

I've created a live-build development environment for those
interested in how to make there own distro using Debian/Devuan Live-Build.
Live-Build 4.x has been used, which supports Debian Jessie.

The first place to start is with the manual and the manpages. I suggest
that the manpages lb_config.1.txt and lb_clean.1.txt, should be looked
at first, after reading the manual.

I've also used live-boot.7.txt if using -bootappend-live in lb config.

https://debian-live.alioth.debian.org/l … al.en.html
http://manpages.debian.org/cgi-bin/man. … ive-config
http://manpages.debian.org/cgi-bin/man. … =live-boot
http://manpages.debian.org/cgi-bin/man. … live-tools

http://manpages.ubuntu.com/manpages/one … an.1..html

Overview

This Debian/Devuan Live-Build demonstration will endeavour to provide the reader
with the basics of Live-Build and some essential commands necessary to use it to create an installable/live iso.

For the purposes of this demonstration and to keep it simple, the target
desktop environment will be:

  1. both graphical and text installers

  2. installable from live session

  3. Jwm - Joe's Window Manager http://www.joewing.net/projects/jwm/

  4. 64 bit

  5. small set of applications


Requirements

This example uses Debian/Devuan Jessie as the build environment

Step 1. Install live-build on Star or Debian/Devuan Jessie

sudo apt-get install live-build live-manual
      
/usr/share/doc/live-manual/

Step 2. Setup

Open a terminal window in your home directory and run the following commands:

wget -c "http://sourceforge.net/projects/linnix/files/diy-debian.tar.gz"
tar -zxvf diy-debian.tar.gz
cd diy-distro
sudo ./menu

or

wget -c "http://sourceforge.net/projects/linnix/files/diy-devuan.tar.gz"
tar -zxvf diy-devuan.tar.gz
cd diy-distro
sudo ./menu

Main directory structure

diy-distro
├── diy-build
└── diy-source

Sub-directories

diy-build
├── auto
├── config
└── local
diy-source
├── auto <--------- build, clean, config scripts
└── config
    ├── apt
    ├── archives
    ├── bootloaders
    │   └── isolinux
    ├── hooks
    ├── includes.binary 
    ├── includes.chroot
    │   ├── etc
    │   │   ├── dpkg
    │   │   ├── lightdm
    │   │   ├── live     <--------- live user setup
    │   │   └── skel     <--------- skeleton /home directory
    │   └── usr
    │       ├── bin
    │       ├── lib
    │       ├── local
    │       └── share
    ├── includes.installer <--------- installer preseed.cfg file and logo/theme update for the graphical installer
    └── package-lists <--------- lists of packages to be installed
    └── packages.chroot <--------- lpackages to be installed

packages.chroot: Packages that are inside this
directory will be automatically installed into the live system during
build - you do not need to specify them elsewhere.


DIY Menu

~~~~~~~~~~~~~~~~~~~~~
     M A I N - M E N U
    ~~~~~~~~~~~~~~~~~~~~~        Build version [8.2]

    s. Setup
    r. Remove
    u. Update
    b. Build
    p. Purge

    q. Quit

Enter choice or q :

Build version [8.2]:
    This the current Debian/Devuan version number. See Update below.

Setup:
    creates a clean diy-build directory and all the directories required for live-build.
    Copies the default: build, clean and config files into the auto directory.

    WARNING: diy-build directory is deleted in the process, if it exists

    NOTE : The diy-build diectory is owned by root.  If the permissions in the build folder
           aren't root the build will fail or be corrupt.

Remove:
    Removes the diy-build directory.

    N.B. if Build has been run, then Purge should be done before Remove.

Update:
    Copies contents of diy-source into diy-build, and updates the files with version number inside
    that are in /config/includes.chroot/etc/
   
    See _VERSION=8.2 in the menu script, change this to suit.
   
    I find it easier to work with files/directories I own, which are in the diy-source directory.
    It's up to you whether you do it my way or not.

Build:
    Runs the build script in diy-build, which runs lb clean, lb config and lb build.

    The build can be run in a separate terminal window, see build() in the script.

Purge:
    removes everything, including all caches. The config directory is kept.

    sudo lb clean --purge

    lb clean, is responsible for cleaning up after a system is built. It
    removes the build directories, and removes some other files including
    stage files, and any detritus left behind by other live-build commands.



Important
    It is important to check the build log after the build, which can be found in diy-build.
    This will help in resolving any build errors.

Squashfs - better compression:

    NOTE: Already included in Devuan Live-Build

    http://www.tldp.org/HOWTO/html_single/S … TO/#whatis
    http://www.tldp.org/HOWTO/html_single/S … sqoverview
   
    auto/build
    Add this line before the lb build in the build script.
   
    export MKSQUASHFS_OPTIONS=" -no-recovery -always-use-fragments -b 1048576"
   
   
    auto/config
    Add --chroot-filesystem squashfs to lb config
   
   
    /usr/lib/live/build/binary_rootfs
    I changed the live containg -comp xz to -comp xz -Xbcj x86 -Xdict-size 75%
    about line 357

    from
    MKSQUASHFS_OPTIONS="${MKSQUASHFS_OPTIONS} -comp xz"

    to
    MKSQUASHFS_OPTIONS="${MKSQUASHFS_OPTIONS} -comp xz -Xbcj x86 -Xdict-size 75%"


Debian/Devuan differences:
1. Currently Devuan doesn't include non-free OOTB. Non-fee can be installed from
   the Welcome script.

diy-debian/devuan iso

Disclaimer: This is not intended as a clone of either crunchbang or bunsenlabs, and is only intended
as an example of Debian Live-Build.
Tips:
1. These hooks: 990-cleanup.chroot, 300-localepurge.chroot, are used to remove and resize files to make the image smaller.
2. Setup-user script is run on login from /etc/light/lightdm.conf - session-setup-script=/usr/share/diy/setup-user
3. Installer preseed used to pre-answer install questions is in /config/includes.installer. The update script copies preseed.cfg to /config/includes.binary/install so the live install can use it. Also see live-build config
--bootappend-live.
4. Setup session-manager, there is a hook session-manager_alternative.chroot and 2 files in /config/includes.chroot/usr/share/xsessions jwm.desktop, lightdm-xsession.desktop.

References:
25-06-2015 : LightDM Default Session and x-session-manager setup

Star website
Zephyr Linux

The Debian Administrator's Handbook
Installing, Step by Step

Last updates: 9 February 2016

Last edited by ozitraveller (2016-02-08 22:43:04)

Offline

#2 2015-11-23 01:40:23

hhh
Gaucho
From: High in the Custerdome
Registered: 2015-09-17
Posts: 16,032
Website

Re: DIY Distro - Debian/Devuan Live-Build

Awesome. Thanks man!


No, he can't sleep on the floor. What do you think I'm yelling for?!!!

Offline

#3 2015-11-23 01:44:27

ozitraveller
Member
From: Less is More! Devuan powered!
Registered: 2015-10-01
Posts: 32
Website

Re: DIY Distro - Debian/Devuan Live-Build

@hhh - I'll update it when I get my Devuan finished.

Offline

#4 2015-11-23 07:45:43

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,065
Website

Re: DIY Distro - Debian/Devuan Live-Build

Thanks for this ozitraveller smile

I feel obliged to advise that the setup & update scripts be read by the user before running them as root.

Offline

#5 2015-11-23 09:56:35

Snap
Member
Registered: 2015-10-02
Posts: 465

Re: DIY Distro - Debian/Devuan Live-Build

Thanks, ozi*!

Offline

#6 2015-11-23 11:33:33

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,010

Re: DIY Distro - Debian/Devuan Live-Build

@ozitraveller

And we can call it: ODIYDLB OS
aka: ozitraveller do it yourself debian live build operating system

Someday I just might try this... if... maybe... well, not sure but I'd like to.


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#7 2015-11-23 19:19:49

ozitraveller
Member
From: Less is More! Devuan powered!
Registered: 2015-10-01
Posts: 32
Website

Re: DIY Distro - Debian/Devuan Live-Build

Head_on_a_Stick wrote:

Thanks for this ozitraveller smile

I feel obliged to advise that the setup & update scripts be read by the user before running them as root.


I would agree with that, it's always good to understand what is happening.

I have new scripts I'm using now, so I drop them in the next version. They more of a menu driven style.

Offline

#8 2015-11-24 08:00:27

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,738

Re: DIY Distro - Debian/Devuan Live-Build

Head_on_a_Stick wrote:

Thanks for this ozitraveller smile

+ 1

p.s. Seriously impressed with the quality this forum has reached.

Last edited by brontosaurusrex (2015-11-24 08:10:37)

Online

#9 2015-11-24 21:15:04

ozitraveller
Member
From: Less is More! Devuan powered!
Registered: 2015-10-01
Posts: 32
Website

Re: DIY Distro - Debian/Devuan Live-Build

Thanks all! smile

Offline

#10 2016-01-08 05:31:32

ozitraveller
Member
From: Less is More! Devuan powered!
Registered: 2015-10-01
Posts: 32
Website

Re: DIY Distro - Debian/Devuan Live-Build

I'm just uploading some Devuan images to sf atm: xfce, ob, fb, if anyone is interested.

Built using live-build.

Offline

Board footer

Powered by FluxBB