debian/fixes

This commit is contained in:
Marc Beninca 2021-12-04 18:57:21 +01:00
parent cf86741fde
commit 9fe4785194
1 changed files with 81 additions and 71 deletions

View File

@ -25,18 +25,18 @@ critical base packages
decide the desired type of system
---------------------------------
* will the system run
* 64 bits?
* 32 bits?
* both?
* will the system be run by
* a physical machine?
* a virtual machine?
* a container?
* a container inside a virtual machine?
* will the system be stored
* read-write, as a file system on a dedicated partition?
* read-only, as a single file loaded in RAM at boot time?
* will the system run
* 64 bits?
* 32 bits?
* both?
* will the system be run by
* a physical machine?
* a virtual machine?
* a container?
* a container inside a virtual machine?
* will the system be stored
* read-write, as a file system on a dedicated partition?
* read-only, as a single file loaded in RAM at boot time?
Install required tools
======================
@ -57,7 +57,7 @@ prepare the system's directory
------------------------------
* become root
* make a directory and step into it
* make root directory
.. code:: shell
@ -65,8 +65,7 @@ prepare the system's directory
.. code:: shell
mkdir -p "path"
cd "path"
mkdir '/squashfs-root'
generate the minimal base
-------------------------
@ -74,16 +73,55 @@ generate the minimal base
.. code:: shell
debootstrap \
--arch="amd64" \
--include="locales,apt-utils,dialog" \
--variant="minbase" \
"stretch" \
. \
"miroir"
--arch 'amd64' \
--variant 'minbase' \
--include 'locales,apt-utils,dialog' \
'bullseye' \
'/squashfs-root' \
'https://deb.debian.org/debian'
Configure preinstalled packages
===============================
define default locale
---------------------
* etc/default/locale
::
LANG='en_US.UTF-8'
LANGUAGE='en_US:en'
LC_CTYPE='fr_FR.UTF-8'
LC_NUMERIC='fr_FR.UTF-8'
LC_TIME='fr_FR.UTF-8'
LC_COLLATE='fr_FR.UTF-8'
LC_MONETARY='fr_FR.UTF-8'
LC_MESSAGES='en_US.UTF-8'
LC_PAPER='fr_FR.UTF-8'
LC_NAME='fr_FR.UTF-8'
LC_ADDRESS='fr_FR.UTF-8'
LC_TELEPHONE='fr_FR.UTF-8'
LC_MEASUREMENT='fr_FR.UTF-8'
LC_IDENTIFICATION='fr_FR.UTF-8'
define locales to generate
--------------------------
* etc/locale.gen
::
en_US.UTF-8 UTF-8
fr_FR.UTF-8 UTF-8
generate locales
----------------
.. code:: shell
locale-gen
define default keyboard layouts
-------------------------------
@ -97,35 +135,6 @@ define default keyboard layouts
XKBOPTIONS=""
BACKSPACE="guess"
define default locales to generate
----------------------------------
* etc/default/locale
::
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="fr_FR.UTF-8"
LC_NUMERIC="fr_FR.UTF-8"
LC_TIME="fr_FR.UTF-8"
LC_COLLATE="fr_FR.UTF-8"
LC_MONETARY="fr_FR.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="fr_FR.UTF-8"
LC_NAME="fr_FR.UTF-8"
LC_ADDRESS="fr_FR.UTF-8"
LC_TELEPHONE="fr_FR.UTF-8"
LC_MEASUREMENT="fr_FR.UTF-8"
LC_IDENTIFICATION="fr_FR.UTF-8"
* etc/locale.gen
::
en_US.UTF-8 UTF-8
fr_FR.UTF-8 UTF-8
[configure command shell](../bash/index.md)
-------------------------------------------
@ -158,19 +167,13 @@ switch into context
.. code:: shell
mount --bind /proc proc
mount --bind /sys sys
chroot .
for f in 'dev' 'dev/pts' 'proc' 'sys' ; do
mount --bind "/${f}" "/squashfs-root/${f}"
done
chroot '/squashfs-root'
.. todo:: /dev
generate locales
----------------
.. code:: shell
locale-gen
define root password
--------------------
@ -225,8 +228,8 @@ systemd-sysv sans quoi le système ne démarrera pas complètement
.. code:: shell
apt-get install -t stretch-backports "linux-image-amd64"
apt-get install "live-boot"
apt-get install -t stretch-backports 'linux-image-amd64'
apt-get install 'live-boot'
----
@ -265,12 +268,13 @@ install useful packages
less nano vim \
pciutils usbutils \
python3 \
squashfs-tools \
squashfs-tools
.. code:: shell
apt-get install -t "stretch-backports" \
debootstrap \
apt-get install \
--target-release 'bullseye-backports' \
debootstrap
install other packages
----------------------
@ -285,24 +289,25 @@ install other packages
properly switch back from context
---------------------------------
* vider le cache dAPT
* empty APT's cache
.. code:: shell
apt-get clean
* sextraire de lenvironnement
* exit the environment
.. code:: shell
exit
* démonter les liens au système hôte
* untie links to host system
.. code:: shell
umount sys
umount proc
for f in 'sys' 'proc' 'dev/pts' 'dev' ; do
umount --lazy "/squashfs-root/${f}"
done
clean up commands history
-------------------------
@ -319,4 +324,9 @@ Archive prepared file system
.. code:: shell
mksquashfs . "../name.squashfs" -comp "xz"
mksquashfs \
'/squashfs-root' \
'filesystem.squashfs' \
-b '1m' \
-comp 'zstd' \
-Xcompression-level 22