Hello list.

First, a warning: I am basically trying to reinvent a wheel, only for my pleasure and knowledge. So, yes, there are easier ways to do the things.

Yesterday, I was experimenting with dpkg ( for my own fun, and to learn things ), especially with the parameter "--root" which change the targeted system. Or, to be more exact, to change the directories where it tries to retrieve it's own informations ( /var/lib/dpkg ) and where it tries to deploy stuff ( / ).

Note that I did not tried debootstrap(*).

What I tried to do was basically to "replace" the debian installer:

On an external hard disk:

Basic setup:
* using gparted to partition and format according to my wishes ( a portable system able to boot from kali live-cd, tail live-cd, an installed Debian testing, a partition dedicated to experimenting another linux-based distro, and a partition to boot a BSD kernel based system. Yes, probably Debian/kFreeBSD in a first time, since I have some knowledge about how Debian works, so that I would not start from void. Of course, other utility partition for /home, /tmp and /share for windows interaction, can be useful. Something odd and stupid enough to allow me to lose a lot of time in tinkering :p )
* mounted the future "/" partition on "/mnt"
* created the basic filesystem, mirroring what I have on my working system ( /root, /mnt, /boot, /var, /etc, et cetera )
* mounted partitions on their mount points

Some tinkering:
* created the dpkg's var tree: "cd /mnt; mkdir -p /var/lib/dpkg; touch /var/lib/dpkg/available; /var/lib/dpkg/status" * made an alias for dpkg so that I would not do an error: "alias dpkg=dpkg --root=/mnt"

Identifying the first set of packages to install so that things would be configured by standard dpkg's methodology: * I want dpkg to be correctly configured, not only a hand-made tree, so it is my first target. * dpkg depends on various packages ( on my testing current system ), namely: libc6, tar, libselinux1, liblzma5, libbz2-1.0, zlib1g. From those ones, I know that the one which will be need by almost all packages is libc6, so let's identify which packages it needs. * libc6's dependencies: libgcc1, which depends on libc6, gcc-4.9-base ( which depends on nothing, nice! ) but most importantly, pre-depends on multiarch-support ( which depends itself on libc6 ).

Trying to install the first set of ( 4 ) packages through dpkg:
* dpkg --root /mnt -i /var/cache/apt/archives/libc6_*.deb /var/cache/apt/archives/gcc-4.9-base_*.deb /var/cache/apt/archives/libgcc1_*.deb /var/cache/apt/archives/multiarch-support_*.deb

When it comes to libc6, dpkg report an error of being unable to find various scripts, like IIRC "/var/lib/dpkg/tmp.ci/preinst" ( in the chrooted environment, so /mnt/var/lib/dpkg/tmp.ci/preinst ). I have tried to fool dpkg by creating those files, making them empty and executable, the error is the same, so my guess is that dpkg really can find them ( since it can delete them ). Maybe a right problem? I did not at the moment tried to set the rights to 777 on /var/lib/dpkg. Setting to maximum the debugging options of dpkg did not helped at all, too ( almost no informations ) and same when I tried the --force-all option. I still did not tried to just copy stuff, which could work since I believe that it's what debootstrap does (not checked in source code, programming in bash is still very obscure for me. I might try to take a look at cdebootstrap thought, since it is written in C which is far more readable for me).

Any idea of tricks I might try or stuff I might read? In dpkg's man, it is said that package's managers which want to understand how dpkg install their packages should not refer to this man, so I guess it would be a good start to know where is stored the recommended doc for them. I'm not a package maintainer, but it sounds obvious that for this small game of mine, I need a real knowledge of dpkg.

*: I do not use debootstrap, but I perfectly know that it is made to install from a running GNU/Linux distro. I "just" want to experiment, after all, for learning. And I think that it might have some issues with my intent:
* should I use debootstrap or cdebootstrap?
* It seems it is possible to specify various list of packages to installs, but can I tweak them? Each time I install from a strictly minimal scratch, I spend some times to remove packages that I know I will not need, and to set many, many other as automatically installed. ( and only after that, I am adding packages which are really useful to me, so that I can have "really" minimal systems ) * it seems it needs the user to chroot after the bootstrap, which means the user have to be root. I do not see why it should be mandatory to be root ( with all problems it might cause ) to install a distro on an external drive.

How to specify which packages to install -- since I always remove a lot of packages after a strictly minimal Debian installation... which is made from debootstrap if I have understood correctly the few source lines of this script I have read -- ? And how could it be possible to do a remote install? How can it be used without being root? And I think those things might be avoided with dpkg. Except that... I had some issues I did not understood, of course.


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
https://lists.debian.org/f829987e5b4c53bcdee5486785f05...@neutralite.org

Reply via email to