33
Comment:
|
7182
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
= Packages stuck with Schroot = | ||<tablestyle="float:right;font-size:0.5em;margin:0 0 5em 5em;"style="padding:0.5em;"> {{attachment:debian-cage.png}} || = PACKAGES STUCK WITH SCHROOT = Allows you to configure '''chroots''' without requiring root credentials. For a better knowledge on the subject: [[https://wiki.debian.org/Schroot | wiki.debian.org/Schroot]] [[https://wiki.debian.org/Debootstrap | wiki.debian.org/Debootstrap]] == Starting prison for packages == {{attachment:jail.png}} To start the installations, we will download the following packages: ||<#ADADAC -4 style="border: medium none ;-moz-border-radius-bottomleft: 30px ;"> # apt install debootstrap schroot|| Once installed, we will edit the "'''/etc/schroot/schroot.conf'''" file. ||<#ADADAC -4 style="border: medium none ;-moz-border-radius-bottomleft: 30px ;"> # cp /etc/schroot/schroot.conf /etc/schroot/schroot.conf.old|| ||<#ADADAC -4 style="border: medium none ;-moz-border-radius-bottomleft: 30px ;"> # '''editor''' /etc/schroot/schroot.conf|| {*} '''editor''' = ''your favorite text editor: nano, vim, mcedit, etc ...'' In this model, we will do this in the '''amd64''' architecture, but you can change or create it in the '''i386''' architecture. Copy and paste into the file. ||<#EAE5DA -4 style="border: medium none ;-moz-border-radius-bottomleft: 30px ;"> [unstable-amd64]<<BR>> description=debian unstable amd64<<BR>> type=directory<<BR>> directory=/srv/chroot/unstable-amd64<<BR>> users='''your-username'''<<BR>> root-groups=root<<BR>> preserve-environment=true<<BR>>|| === 1. Installing the Debian base in the cage === {{attachment:schroot.png}} ||<#ADADAC -4 style="border: medium none ;-moz-border-radius-bottomleft: 30px ;"> # mkdir -p /srv/chroot/unstable-amd64|| ||<#ADADAC -4 style="border: medium none ;-moz-border-radius-bottomleft: 30px ;"> # debootstrap --arch amd64 unstable /srv/chroot/unstable-amd64 https://deb.debian.org/debian|| === 2. Entering the cage === ||<#ADADAC -4 style="border: medium none ;-moz-border-radius-bottomleft: 30px ;"> # chroot /srv/chroot/unstable|| ||<#ADADAC -4 style="border: medium none ;-moz-border-radius-bottomleft: 30px ;"> # echo proc /proc proc defaults 0 0 >> /etc/fstab|| ||<#ADADAC -4 style="border: medium none ;-moz-border-radius-bottomleft: 30px ;"> # echo mount /proc >> /etc/bash.bashrc|| After these settings, type "'''exit'''" or press "'''Ctrl+D'''" to close everything. == Confirming that the configured prison is correct == ||<#ADADAC -4 style="border: medium none ;-moz-border-radius-bottomleft: 30px ;"> '''user@debian: ~$''' schroot -l<<BR>> chroot:unstable-amd64<<BR>>|| === Entering prison as a user: === ||<#ADADAC -4 style="border: medium none ;-moz-border-radius-bottomleft: 30px ;"> '''user@debian:~$''' schroot -c unstable-amd64|| === Entering private prison: (root) === ||<#ADADAC -4 style="border: medium none ;-moz-border-radius-bottomleft: 30px ;"> '''user@debian:~$''' schroot -c unstable-amd64 -u root|| = Basic Debian packaging configurations = ''Thanks to [[https://wiki.debian.org/Eriberto | Eriberto]] and I recommend everyone to access this link https://debianet.com.br (Portuguese - Brazil) for more details on how to package your software in Debian.'' We will do root access in the "'''schroot'''" configured to install some important packages for Debian packaging. ||<#ADADAC -4 style="border: medium none ;-moz-border-radius-bottomleft: 30px ;"> '''user@debian:~$''' schroot -c unstable-amd64 -u root|| {*} '''editor''' = ''your favorite text editor: nano, vim, mcedit, etc...'' === 1. Adjusting the "/etc/bash.bashrc" file === ||<#ADADAC -4 style="border: medium none ;-moz-border-radius-bottomleft: 30px ;"> '''(unstable-amd64)root@debian:~#''' '''editor''' /etc/bash.bashrc|| Insert at the end of the file /etc/bash.bashrc ||<#EAE5DA -4 style="border: medium none ;-moz-border-radius-bottomleft: 30px ;"> alias ls="ls --color=auto"<<BR>> alias tree="tree -aC"<<BR>> alias debuildsa="dpkg-buildpackage -sa -k'''0987654321ABC1234567890DFG0987654321HIJL'''" --> your GPG key.<<BR>> alias uscan="uscan --verbose --report"<<BR>> alias apt-cache="LANG=C apt-cache"<<BR>> alias man="LANG=C man"<<BR>> export DEBFULLNAME="'''put-your-full-name'''"<<BR>> export DEBEMAIL="'''put-your-email'''"<<BR>> export EDITOR="'''put-your-favorite-text-editor'''"<<BR>> export QUILT_PATCHES="debian/patches"<<BR>> export QUILT_DIFF_ARGS="--no-timestamps --no-index -pab"<<BR>> export QUILT_REFRESH_ARGS="--no-timestamps --no-index -pab"<<BR>> mount /proc<<BR>>|| Save and close. === 2. Adjusting the "/etc/apt/sources.list" file === ||<#ADADAC -4 style="border: medium none ;-moz-border-radius-bottomleft: 30px ;"> '''(unstable-amd64)root@debian:~#''' '''editor''' /etc/apt/sources.list|| Edit the file, duplicate the existing line and change the beginning of the second line from "'''deb'''" to "'''deb-src'''". The end result will be: ||<#EAE5DA -4 style="border: medium none ;-moz-border-radius-bottomleft: 30px ;"> deb https://deb.debian.org/debian unstable main<<BR>> deb-src https://deb.debian.org/debian unstable main<<BR>>|| Save, close and update: ||<#ADADAC -4 style="border: medium none ;-moz-border-radius-bottomleft: 30px ;"> '''(unstable-amd64)root@debian:~#''' apt update && apt upgrade|| We can now install additional procedures for Debian packaging. ||<#ADADAC -4 style="border: medium none ;-moz-border-radius-bottomleft: 30px ;"> '''(unstable-amd64)root@debian:~#''' apt install autopkgtest blhc devscripts dh-make dput-ng how-can-i-help locales quilt renameutils spell splitpatch tree|| ||<#ADADAC -4 style="border: medium none ;-moz-border-radius-bottomleft: 30px ;"> '''(unstable-amd64)root@debian:~#''' dpkg-reconfigure locales tzdata|| ||<#ADADAC -4 style="border: medium none ;-moz-border-radius-bottomleft: 30px ;"> '''(unstable-amd64)root@debian:~#''' apt autoremove && apt autoclean|| === 3. Adjusting the "/etc/lintianrc" file === ||<#ADADAC -4 style="border: medium none ;-moz-border-radius-bottomleft: 30px ;"> '''(unstable-amd64)root@debian:~#''' '''editor''' /etc/lintianrc|| Enable the following lines: ||<#EAE5DA -4 style="border: medium none ;-moz-border-radius-bottomleft: 30px ;"> display-info = yes<<BR>> pedantic = yes<<BR>> display-experimental = yes<<BR>> color = auto<<BR>>|| === 4. Enabling the GPG key to sign packages === Edit the "'''/etc/devscripts.conf'''" file and enter your GPG key on the '''DEBSIGN_KEYID''' line and activate. ||<#ADADAC -4 style="border: medium none ;-moz-border-radius-bottomleft: 30px ;"> '''(unstable-amd64)root@debian:~#''' '''editor''' /etc/devscripts.conf|| ||<#ADADAC -4 style="border: medium none ;-moz-border-radius-bottomleft: 30px ;"> DEBSIGN_KEYID=0987654321ABC1234567890DFG0987654321HIJL|| Save and close. With that, schroot is ready for Debian packaging and you don't need to be root to get the job done. ---- This wiki is a support and documentation resource for the [[https://www.debian.org | Debian]] project. You are free to make improvements and corrections to this published content. |
|
PACKAGES STUCK WITH SCHROOT
Allows you to configure chroots without requiring root credentials.
For a better knowledge on the subject:
Starting prison for packages
To start the installations, we will download the following packages:
# apt install debootstrap schroot |
Once installed, we will edit the "/etc/schroot/schroot.conf" file.
# cp /etc/schroot/schroot.conf /etc/schroot/schroot.conf.old |
# editor /etc/schroot/schroot.conf |
editor = your favorite text editor: nano, vim, mcedit, etc ...
In this model, we will do this in the amd64 architecture, but you can change or create it in the i386 architecture.
Copy and paste into the file.
[unstable-amd64] |
1. Installing the Debian base in the cage
# mkdir -p /srv/chroot/unstable-amd64 |
# debootstrap --arch amd64 unstable /srv/chroot/unstable-amd64 https://deb.debian.org/debian |
2. Entering the cage
# chroot /srv/chroot/unstable |
# echo proc /proc proc defaults 0 0 >> /etc/fstab |
# echo mount /proc >> /etc/bash.bashrc |
After these settings, type "exit" or press "Ctrl+D" to close everything.
Confirming that the configured prison is correct
user@debian: ~$ schroot -l |
Entering prison as a user:
user@debian:~$ schroot -c unstable-amd64 |
Entering private prison: (root)
user@debian:~$ schroot -c unstable-amd64 -u root |
Basic Debian packaging configurations
Thanks to Eriberto and I recommend everyone to access this link https://debianet.com.br (Portuguese - Brazil) for more details on how to package your software in Debian.
We will do root access in the "schroot" configured to install some important packages for Debian packaging.
user@debian:~$ schroot -c unstable-amd64 -u root |
editor = your favorite text editor: nano, vim, mcedit, etc...
1. Adjusting the "/etc/bash.bashrc" file
(unstable-amd64)root@debian:~# editor /etc/bash.bashrc |
Insert at the end of the file /etc/bash.bashrc
alias ls="ls --color=auto" |
Save and close.
2. Adjusting the "/etc/apt/sources.list" file
(unstable-amd64)root@debian:~# editor /etc/apt/sources.list |
Edit the file, duplicate the existing line and change the beginning of the second line from "deb" to "deb-src". The end result will be:
deb https://deb.debian.org/debian unstable main |
Save, close and update:
(unstable-amd64)root@debian:~# apt update && apt upgrade |
We can now install additional procedures for Debian packaging.
(unstable-amd64)root@debian:~# apt install autopkgtest blhc devscripts dh-make dput-ng how-can-i-help locales quilt renameutils spell splitpatch tree |
(unstable-amd64)root@debian:~# dpkg-reconfigure locales tzdata |
(unstable-amd64)root@debian:~# apt autoremove && apt autoclean |
3. Adjusting the "/etc/lintianrc" file
(unstable-amd64)root@debian:~# editor /etc/lintianrc |
Enable the following lines:
display-info = yes |
4. Enabling the GPG key to sign packages
Edit the "/etc/devscripts.conf" file and enter your GPG key on the DEBSIGN_KEYID line and activate.
(unstable-amd64)root@debian:~# editor /etc/devscripts.conf |
DEBSIGN_KEYID=0987654321ABC1234567890DFG0987654321HIJL |
Save and close. With that, schroot is ready for Debian packaging and you don't need to be root to get the job done.
This wiki is a support and documentation resource for the Debian project. You are free to make improvements and corrections to this published content.