Re: Enquiry about building a new root file system

David Lechner <[email protected]>
Newsgroups gmane.linux.debian.devel.embedded
Message-ID <[email protected]>
On 08/21/2014 08:16 PM, Jean-Christian de Rivaz wrote:
>
> Many thanks David for sharing all of this. I have found some of 
> inspiring code in your work.
I'm glad that it is helpful!
>
> I am a bit confused about the call of all *.preinst scripts between 
> the unpacking and the setting. As far as I understand the Debian 
> Policy Manual, the *.preinst scripts are to be called before the 
> unpacking, so this should be a task of multistrap but it don't seem to 
> do that (at least in multistrap 2.1.20). Or maybe I misunderstand 
> something.
The .preinst files is something that I have not yet taken the time to 
understand as well as I should yet, so you should not trust me as 
absolute expert on this. It is my understanding, though, that when 
multistrap runs, there is nothing in the chroot, so preinst scripts 
can't run before we unpack because there is no /bin/sh or any of the 
commands or programs that the scripts will use. This can cause problems, 
for example, I had to prevent the sudo.preinst script from running 
because it will delete the /etc/sudoers file that has been unpacked. 
However, looking at the sudo.preinst script, I can see that it does not 
do anything important, so it is ok that it does not run.

I think that this is the problem that the bootstrap.debian.net project 
is trying to solve, but we have not found any other problems doing it 
this way, so I have not looked into it any farther.
>
> I wonder why you don't use a local package to modify files like you 
> wants. I suspect that this will simplify your tool and will allow 
> modification on an upgrade of the system.
Yes, my goal is that any file included by brickstrap (root/ folder) will 
100% never change, otherwise it should go in a package, which I have 
done for some cases already. There are probably still a few other files 
that should be put into packages, but there are some files that don't 
make sense in packages. For example there is no reason to have fstab or 
hosts in a package. Some files are also only there so that everything 
gets configured correctly but are not included in the disk image (see 
tar-exclude file).
>
> Anyway, brickstrap is very interesting to study a working example.
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.