Page 1 of 1

How did the DD developer cut down Debian to such a small size?

Posted: Mon Aug 08, 2022 9:18 am
by miltonx

I have always been enchanted with this - how did the DebianDog developers cut down Debian Live to such a small size?

Is there some automation tool like woof-CE? Or is it a purely manual process, handpicking those bare minimum files for the file system?

If it is a manual process, Could you describe how it is done? Is there any reference list prescribing which files should be kept and which discarded?


Re: How did the DD developer cut down Debian to such a small size?

Posted: Mon Aug 08, 2022 3:57 pm
by fredx181
miltonx wrote: Mon Aug 08, 2022 9:18 am

I have always been enchanted with this - how did the DebianDog developers cut down Debian Live to such a small size?

Several things, to name a few:
- man and doc files not included (but can be included with option in mklive build script see below)
- locale files not included by default (but can be included with option in mklive build script see also below)
- compression of 01-filesystem.squashfs is xz (for most DD versions), gzip compression would give a much larger size
- not included are *big* packages such as libreoffice, gimp etc...
- custom programs included are often very small, shell scripts or similar such as scripts based on gtkdialog or yad.
Note that later versions of dd are bigger than earlier versions (Linux grows! Kernel, firmware (and more) is larger in size).

Is there some automation tool like woof-CE? Or is it a purely manual process, handpicking those bare minimum files for the file system?

Yes, build script, but very different from woof-CE, can be found in this forum section, build system for e.g. Buster, Bullseye, Bookworm mklive-.... script)


Re: How did the DD developer cut down Debian to such a small size?

Posted: Tue Aug 09, 2022 1:51 am
by miltonx
fredx181 wrote: Mon Aug 08, 2022 3:57 pm

Yes, build script, but very different from woof-CE, can be found in this forum section, build system for e.g. Buster, Bullseye, Bookworm mklive-.... script)

I browsed past the mklive description page several times and ignored the possibility that the answer would be lying there. Now it will supply quite a few days of good reading. Thanks! And the demo.gif is real nice.


Re: How did the DD developer cut down Debian to such a small size?

Posted: Wed Aug 24, 2022 10:08 am
by miltonx
fredx181 wrote: Mon Aug 08, 2022 3:57 pm

Yes, build script, but very different from woof-CE, can be found in this forum section, build system for e.g. Buster, Bullseye, Bookworm mklive-.... script)

I read the bullseye mklive script and took some lines from it, to test installing a minimal debian. Since I'm trying to make a cut-down debian instead of a dog/pupppy, I did not use your original mklive script. Basically I did this:

Code: Select all

debootstrap --no-check-gpg --arch=amd64 --variant=minbase --include=apt-transport-https,ca-certificates bullseye chroot http://.....
mount --bind /proc chroot/proc
#mount --bind /tmp chroot/tmp
mount --bind /dev chroot/dev
mount --bind /sys chroot/sys
mount -t devpts devpts chroot/dev/pts
echo -en "`cat /etc/resolv.conf`" > chroot/etc/resolv.conf
chroot chroot
export HOME=/root
export LC_ALL=C
apt-get update
passwd root
addgroup fuse
addgroup wheel
adduser spot --gecos ",,," --disabled-password 2> /dev/null
passwd spot
usermod -a -G sudo,cdrom,disk,audio,video,plugdev,fuse,wheel spot
apt-get install whiptail keyboard-configuration sysvinit-core elogind xz-utils cryptsetup cryptsetup-bin gnupg dirmngr apt-utils wget elogind libelogind0 libpam-elogind udev --yes
apt-get install wget net-tools ifupdown wireless-tools sysvinit-core xserver-xorg-core xserver-xorg psmisc fuse x11-utils x11-xserver-utils dbus-x11 busybox sudo mawk xinit xterm pciutils usbutils file rsync dosfstools alsa-utils pm-utils xdotool wmctrl desktop-file-utils mime-support cryptsetup-bin squashfs-tools fakeroot xserver-xorg-input-evdev pv xserver-xorg-input-synaptics ntfs-3g nano xserver-xorg-video-intel curl gettext-base fdisk mtools openbox

I only installed official debian packages, not the dog packages, because at this stage I just wanna test if the system works.

I tested it using wiak's weedog boot. The debian boots fine, but after I log in I cannot startx. Error message says "no screen found".
Xorg.0.log shows several modules failed to be loaded.

I referred to my past experience of full debian installation, and again chrooted and installed these:

Code: Select all

xorg xserver-xorg-core xinit xserver-xorg-video-radeon firmware-amd-graphics libgl1-mesa-dri libglx-mesa0 mesa-vulkan-drivers xserver-xorg-video-all xserver-xorg-video-ati xserver-xorg-legacy

Rebooted, and suceeded in startx and openbox worked fine.

However, this looks like a real dirty solution. Installing all the available xorg things is against the very purpuse of making a lean debian. How to pick among these drivers? I know this is always a dilemma game between full functionality and leanness, but if we use fossapup64 as a benchmark, what is your approach?


Re: How did the DD developer cut down Debian to such a small size?

Posted: Wed Aug 24, 2022 10:55 am
by rockedge

is there a xorg-minimum package instead of the full Xorg?


Re: How did the DD developer cut down Debian to such a small size?

Posted: Wed Aug 24, 2022 2:01 pm
by fredx181
miltonx wrote:

....
..... this looks like a real dirty solution. Installing all the available xorg things is against the very purpuse of making a lean debian. How to pick among these drivers? I know this is always a dilemma game between full functionality and leanness, but if we use fossapup64 as a benchmark, what is your approach?

Don't know much about fossapup64, anyway....
The xserver-xorg-video-all package installs all xserver-xorg-video-* packages, but they can also be installed separately, for me works installing only xserver-xorg-video-intel .
------------------
EDIT: just see now that you have xserver-xorg-video-intel initially in your package list (overlooked first) so you may need probably another xserver-xorg-video-* package).
Doesn't answer your question though "How to pick among these drivers?" as I don't know.
-----------------
FYI, here's the list of 'base packages' used in the minimal configs for the mklive-scripts (pretty minimal I'd say, but works on most computers I guess). (edit; but now I think you probably noticed this list already)

Code: Select all

BASE_INSTALL="wget dash net-tools ifupdown wireless-tools sysvinit-core xserver-xorg-core xserver-xorg psmisc fuse x11-utils x11-xserver-utils dbus-x11 busybox sudo mawk xinit xterm pciutils usbutils file rsync dosfstools alsa-utils pm-utils xdotool wmctrl desktop-file-utils xdg-utils mime-support cryptsetup-bin squashfs-tools fakeroot xserver-xorg-input-evdev pv xserver-xorg-input-synaptics ntfs-3g nano xserver-xorg-video-intel acpid curl gettext-base fdisk mtools"

Doesn't include elogind packages above, as these are installed from inside mklive script itself (if no-systemd chosen) (EDIT; And some other packages also installed from mklive-script, e.g. keyboard-configuration, whiptail and more).
BTW, I'm not sure if the Debian elogind packages work OK, a while back I had problems (that in the end systemd became default init) so mklive scripts are using elogind (and related) packages taken from Devuan.


Re: How did the DD developer cut down Debian to such a small size?

Posted: Thu Aug 25, 2022 9:58 am
by miltonx
miltonx wrote: Wed Aug 24, 2022 10:08 am

I referred to my past experience of full debian installation, and again chrooted and installed these:

Code: Select all

xorg xserver-xorg-core xinit xserver-xorg-video-radeon firmware-amd-graphics libgl1-mesa-dri libglx-mesa0 mesa-vulkan-drivers xserver-xorg-video-all xserver-xorg-video-ati xserver-xorg-legacy

Rebooted, and suceeded in startx and openbox worked fine.

However, this looks like a real dirty solution. Installing all the available xorg things is against the very purpuse of making a lean debian. How to pick among these drivers? I know this is always a dilemma game between full functionality and leanness, but if we use fossapup64 as a benchmark, what is your approach?

After some research, I learned that by "apt install xorg", many of the other packages are installed as dependencies.
So, for most cases, this will probably suffice:

Code: Select all

apt-get install xorg libgl1-mesa-dri libglx-mesa0 xserver-xorg-video-all xserver-xorg-video-intel xserver-xorg-legacy

If you are aiming to use this system only on one machine, xserver-xorg-video-all & xserver-xorg-video-intel can be replaced with xserver-xorg-video-amd/radeon/intel...
And mesa-vulkan-drivers is probably only needed for high performance video cards / applications.
As for xserver-xorg-legacy, I'm not sure when it is particularly needed.


Re: How did the DD developer cut down Debian to such a small size?

Posted: Thu Aug 25, 2022 11:28 am
by wiak

Yes, it's interesting that xserver-xorg-video-all does not include xserver-xorg-video-intel. It is not a dependency, just in recommended status.
Sorry, that was Ubuntu packages I looked at (since I use that more), but guess will be same story for upstream Debian.


Re: How did the DD developer cut down Debian to such a small size?

Posted: Thu Aug 25, 2022 11:47 am
by rcrsn51
wiak wrote: Thu Aug 25, 2022 11:28 am

Yes, it's interesting that xserver-xorg-video-all does not include xserver-xorg-video-intel. It is not a dependency, just in recommended status.

That's because the vast majority of Intel machines now use the modesetting driver. Only a few machines, like some early Atoms, require the intel xorg driver.


Re: How did the DD developer cut down Debian to such a small size?

Posted: Thu Aug 25, 2022 2:40 pm
by fredx181
rcrsn51 wrote: Thu Aug 25, 2022 11:47 am
wiak wrote: Thu Aug 25, 2022 11:28 am

Yes, it's interesting that xserver-xorg-video-all does not include xserver-xorg-video-intel. It is not a dependency, just in recommended status.

That's because the vast majority of Intel machines now use the modesetting driver. Only a few machines, like some early Atoms, require the intel xorg driver.

Not sure if I understand, so if only xserver-xorg-video-intel is installed (like in the packages list for a minimal setup) it doesn't work most of the times and you get the "no screens found" error as @miltonx said above ?
EDIT: I see now https://wiki.debian.org/GraphicsCard

Intel

If your graphic card was manufactured in 2007 and newer, try uninstalling the xserver-xorg-video-intel package and use the builtin modesetting driver (xserver-xorg-core) instead.

For older devices: xserver-xorg-video-intel

So the trick may be to NOT install xserver-xorg-video-intel ?
EDIT2: For me on my old and new laptop it makes no difference having xserver-xorg-video-intel installed or not, btw.


Re: How did the DD developer cut down Debian to such a small size?

Posted: Thu Aug 25, 2022 3:14 pm
by fredx181
miltonx wrote:

As for xserver-xorg-legacy, I'm not sure when it is particularly needed.

To be honest, I can't remember what for exactly, perhaps without it there was a problem logging in from console or running startx, configuration in DebianDog for xserver-xorg-legacy in '/etc/X11/Xwrapper.config':

Code: Select all

# Xwrapper.config (Debian X Window System server wrapper configuration file)
#
# This file was generated by the post-installation script of the
# xserver-xorg-legacy package using values from the debconf database.
#
# See the Xwrapper.config(5) manual page for more information.
#
# This file is automatically updated on upgrades of the xserver-xorg-legacy
# package *only* if it has not been modified since the last upgrade of that
# package.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following command as root:
#   dpkg-reconfigure xserver-xorg-legacy
needs_root_rights=yes
allowed_users=anybody

Re: How did the DD developer cut down Debian to such a small size?

Posted: Fri Aug 26, 2022 8:50 am
by miltonx
xxx.png
xxx.png (48.26 KiB) Viewed 980 times

That's an apology for a doc.
Anyway, probably not needed in most cases.