:: Re: [DNG] Devuan with usr merge?
Góra strony
Delete this message
Reply to this message
Autor: Didier Kryn
Data:  
Dla: dng
Nowe tematy: [DNG] Embedded devuan (was Re: Devuan with usr merge?)
Temat: Re: [DNG] Devuan with usr merge?
Le 16/11/2021 à 01:44, Florian Zieboll via Dng a écrit :
> On Mon, 15 Nov 2021 21:19:08 +0100
> Antoine via Dng <dng@???> wrote:
>> For what it's worth, I can confirm this : I ran a BeagleBoneBlack
>> build of Devuan for a while and was rather surprised one day to
>> discover that it had no kernel package installed at all. The kernel
>> and initramfs where packed into a u-boot file and once loaded, the OS
>> didn't care.
> As I use to do a minimal *.bian install on my SoC hardware, which I afterwards move to the Devuan repositories, while keeping the related original "firmware" repository, I must confess that the whole "embedded"-thing is still somewhat unclear to me, at least regarding kernel and firmware updates. I'd be more than happy to get a hint towards an honest introduction to this topic.
>

    This takes some learning by experimentation. The first lesson is to
install a Devuan distro in an empty directory which will become the root
directory of the new system. Then you can use it by the mean of chroot.
The way to install the distro in this directory is debootstrap.
Debootstrap, as its name tells, is the bootstrap of the installation of
a Debian distro. When you execute chroot, you change the whole
userspace, but you still run the same kernel. From your chroot you can
continue the install wih apt-get. There are other ways to install a
distro than debootstrap, but debootstrap is usefull to learn.

    Of course, if you want to install the distro for another
architecture, you must use debootstrap --foreign and, then you cannot
switch to it with chroot. It's a little more work and you need a kernel
and understanding how the kernel passes control to userspace.

    To compile the kernel, download a source from kernel.org, look at
howtos and readme files, prepare for a build "out of tree", start from
the config of a known kernel, like the one you are currently running,
run menuconfig (eg) and compile.

    There are a lot of tricks to learn but you can only learn them by
experimentation I cannot list all of them because I used to do that many
years ago. It's time-consuming but, after that you fill more comfortable.

    Another experiment with great fun is to just install busybox in a
chroot. Build a monolithic version of Busybox statically linked against
musl libc and "install" it with symbolic links. You get a fully
functional non-GUI Linux OS; it's simply amazing. Just Busybox + kernel
can also be the starting point of an install.

    To summarize, a linux OS needs kernel + some userspace application.
To go further, the first thing the application must do is to mount /proc
and /sys. If you have a hotplugger (eudev for Debian, mdev for Busybox),
then you should also mount /dev and /dev/pts and launch the hotplugger.
This applies if the OS is standalone; in a chroot, just mount these
/proc, /sys, /dev, /dev/pts as copies of the ones of the main OS, using
mount --bind.

    I wish to every Linux fan to live this adventure.

--     Didier