DU4 zone development (dilos-userland)

Porting from Debian 11 (bullseye)

Install two DU4 zones (see https://dilos-dev.atlassian.net/wiki/spaces/DS/pages/3273523201 ):

Download zone

Append (add below) lines of debian’s sources into your local zone /etc/apt/sources.list

Append (add below) lines of debian’s sources into your local zone /etc/apt/sources.list

deb-src http://security.debian.org/debian-security bullseye-security/updates main contrib non-free
deb-src http://mirrors.kernel.org/debian/ bullseye-updates main contrib non-free
deb-src http://mirrors.kernel.org/debian/ bullseye-proposed-updates main contrib non-free
deb-src http://mirrors.kernel.org/debian/ bullseye-backports main contrib non-free
deb-src http://mirrors.kernel.org/debian/ bullseye main contrib non-free

add architecture:

add architecture:

sudo dpkg --add-architecture amd64

Then make it available:

update existing packages

update existing packages

sudo apt update

Install git:

install packages

install packages

sudo apt install git

Now you can download in your home any sources from bullseye using:

apt source component-name

The combination of the sources in your /etc/apt/sources.list and apt search mechanism give us the most actual version of the component you want to port.

Build zone

Install git, tools and make to start:

install packages

install packages

sudo apt install build-essential make git

Build already ported package (DilOS procedure, could be used for port verification)

Prepare build directory:

clone repo (do not forget add your public key into https://bitbucket.org/account/settings/ssh-keys)

clone repo (do not forget add your public key into https://bitbucket.org/account/settings/ssh-keys)

git clone git@bitbucket.org:dilos/du4.git

go to components directory

go to components directory

cd du4/components

Build the component:

you are ready to build your package from userland, for example: apt

you are ready to build your package from userland, for example: apt

cd apt

gmake JOBS=4 deb (JOBS is the number of parallel build processes you want to use)

After the building process is done,  you find the built package(s) in <du4>/components/${component}/build directory

Port a new package (Debian procedure)

Preinstall necessary packages:

dpkg-dev

dpkg-dev

sudo apt install dpkg-dev

Download source package from Debian:

porting gzip

porting gzip

apt source gzip

cd gzip-1.10

dpkg-checkbuilddeps

See output (for example):

dpkg-checkbuilddeps: error: Unmet build dependencies: debhelper-compat …

Try to install necessary packages from DU4 repository into your build zone

Try to install necessary packages from DU4 repository into your build zone

sudo apt install debhelper-compat …

If some package has not been found in DU4 repository it means this one shall be ported too.

When dpkg-checkbuilddeps return empty output it means all depends are installed and you can build the component.

Check if the component is correctly buildable:

Update debian/changelog:

cat changelog | less

cat changelog | less

gzip (1.10-4+deb11u1+dilos1) unstable; urgency=high

  • Build for DilOS.

-- DilOS Team dilos@dilos.org Mon, 27 Jun 2022 21:34:00 +0300

gzip (1.10-4+deb11u1) bullseye-security; urgency=high

Current date in necessary format could be gotten by:

date -R

Build binary DEB packages

Build binary DEB packages

sudo dpkg-buildpackage -b -uc -us

If it has been built successfully:

Build source packages

Build source packages

sudo dpkg-buildpackage -d -S -us -uc -sa

After that you can provide result packages to Jenkins for integration.

If build failed you shall make all necessary fixes (using quilt tool), increment the +dilos<version> and add new line in debian/changelog with short description of the fix you made.

Bug fixing

Install DU4 zone (see https://dilos-dev.atlassian.net/wiki/spaces/DS/pages/3273523201 )

Add line of DU4 sources into your local zone /etc/apt/sources.list

Add line of DU4 sources into your local zone /etc/apt/sources.list

deb-src http://10.20.60.188/dilos4 du4-unstable main contrib non-free

Then make it available:

update existing packages

update existing packages

sudo apt update

Now install git and make to start:

install packages

install packages

sudo apt install build-essential make git

Preinstall necessary packages:

dpkg-dev

dpkg-dev

sudo apt install dpkg-dev

Download source package from DU4:

porting gzip

porting gzip

apt source gzip

cd gzip-1.10

dpkg-checkbuilddeps

All next steps are the same as described above.

Using single build zone

Prepare build zone (see “Build zone”).

Download all necessary Debian sources manually:

Go to https://packages.debian.org/source/bullseye.

Enter <package-name> into “search package names“ edit box, enter the page.

Select “bullseye“, scroll down the page.

Unpack them

Unpack them

dpkg-source -x gzip_1.10-4+deb11u1.dsc

Done, you’ve downloaded and unpack original Debian 11 sources. Now you can compare the code and debian’s files with ours from DU4 sources or port them as described above.

Some notes and hints

Do not mix deb-src between DU4 and bullseye in one /etc/apt/sources.list! It will confuse apt when it shall download the sources.

Patching

Install quilt:

sudo apt install quilt

update the ~/.quiltrc:

QUILT_PATCHES=debian/patches #QUILT_NO_DIFF_INDEX=1 QUILT_NO_DIFF_TIMESTAMPS=1 QUILT_DIFF_OPTS="--show-c-function" #QUILT_REFRESH_ARGS="-p ab" QUILT_DIFF_ARGS="--color=auto" # If you want some color when using quilt diff. QUILT_PATCH_OPTS="--reject-format=unified" QUILT_COLORS="diff_hdr=1;32:diff_add=1;34:diff_rem=1;31:diff_hunk=1;33:diff_ctx=35:diff_cctx=33"

Create new patch (from sources root):

quilt new dilos.patch

Add file to patch:

quilt add dir-for-file/file.ext

Make all necessary updates with this file.

Create/update patch:

quilt refresh

Committing the component

As far as you start porting/fixing the component you shall take corresponded ticket in DU4 Jira to your owning:

type key summary assignee reporter priority status resolution created updated due
Loading...
Refresh

Open corresponded ticket and move it to status Assigned (see https://dilos-dev.atlassian.net/wiki/spaces/DS/pages/3252355073 ):

clone repo (do not forget add your public key into https://bitbucket.org/account/settings/ssh-keys)

git clone git@bitbucket.org:dilos/du4.git

go to components directory

cd du4/components

Move your Jira ticket into state “IN ANALYSYS“.

Create branch for the component (ticket name - component name):

git checkout -b d4-333-apt

Create folder for component (usually, it is name without version-revision):

mkdir apt

cd apt

Copy the original debian folder from the source (safe the attributes):

cp -a -r debian ../../du4/components/apt

Create Makefile here:

# # This file and its contents are supplied under the terms of the # Common Development and Distribution License ("CDDL"), version 1.0. # You may only use this file in accordance with the terms of version # 1.0 of the CDDL. # # A full copy of the text of the CDDL should have accompanied this # source. A copy of the CDDL is also available via the Internet at # http://www.illumos.org/license/CDDL. # # # Copyright (c) 2023 DilOS Team <dilos@dilos.org> # include ../../make-rules/shared-macros.mk COMPONENT_NAME= apt include ../../make-rules/deb_src2.mk # build: @echo "Nothing build" install: @echo "Nothing install" clean: $(RM) -r $(BUILD_DIR) # $(RM) *.changes # $(RM) *.deb clobber: clean test: $(NO_TESTS)

Add, commit and push the branch with original debian:

git add --all

git commit -m “original apt_2.2.4 from bullseye“

git push --set-upstream origin d4-333-apt

This step is important for reviewers and integrator, - they must know what exactly was changed relatively to origin!

Now you start porting process, so move your Jira ticket into “In Progress“ state selecting “Create fix” menu item.

After all necessary updating the debian/files into DilOS commit the changes:

git add --all

git commit -m “DilOS update for apt“

git push

In your browser go to https://bitbucket.org/dilos/du4/branches.

Push “Create” link in the “Pull request” column for your branch.

Check the “Delete branch“ checkbox.

Push “Create pull request“ button.

Add reviewers.

Integration (outers: without access to build server)

After getting successful build and generating source packages:

sudo dpkg-buildpackage -d -S -us -uc -sa

Copy result sources to your integrator:

scp zabbix_6.0.7+dfsg* alvano@10.20.50.182:integration

Password would be sent from integrator privately.

Integration (internals: with personal zone on build server)

Go to Jenkins VM:
ssh username@10.20.50.29

Go to Jenkins home (/ws/jenkins) and create upload dir using ticket name:

cd ../jenkins

mkdir D4-188

cd D4-188

And copy sources from your VM into this dir:

scp alvano@10.20.50.182:work/build/zabbix_6.0.7+dfsg* .

Open browser and login to Jenkins (http://10.20.60.190:8080/ci):

Select your upload menu item (in my case “upload-src-dev1“), select “Build with Parameters“ and put your dir name into “COMPONENT_NAME“ edit box:

Click “Build“ button.