[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: /root/packages.chroot ?



I just thought about this again earlier today and I realised what the
problem must be.

In case you're interested...

The way live-build works, although the live OS filesystem is built
completely by the end of stage 2 (the 'chroot' stage), it is not wrapped
up into a squashfs VFS until stage 4 ('binary'), and the chroot
directory continues to be used also for general build purposes in the
meantime. Every stage executes some 'chroot' scripts to prepare the
chroot for use (e.g. to apply mounts and disable daemon start/stop on
package installation), does some work, and then removes this stuff
again. Stage 4 ('binary'), before applying the chroot prep, finally
duplicates the chroot directory, to preserve its state as the final live
OS filesystem, using a copy of it rather than the real thing for stage 4
build work, including wrapping up the live OS filesystem into a squashfs
VFS image.

One of the chroot prep scripts, chroot_archives, is responsible for
configuring apt with the correct mirrors, etc; it copies local packages
from your config directory into the chroot, and sets up a local package
mirror to make them available to apt. It then writes a list of your
local packages into the chroot/root/packages.list file. During the
'chroot' stage (building your live OS filesystem), other packages are
added to this list by various scripts, and then they are all finally
installed (including your local packages) by the chroot_install-packages
script, which does in fact delete this list file when it's done. At the
end of the 'chroot' stage, as with all stages, the chroot prep is
undone, though while some prep is simply removed, other stuff like
chroot_archives is designed to leave the chroot in a suitable state to
be used as the live OS filesystem, so chroot_archives removal replaces
the build ('chroot') mirror config with the live ('binary') config.

The problem is that in between completing the live OS filesystem in
stage 2 and placing a copy to one side in stage 4, we have stage 3
('Installer'). Here the chroot prep is reapplied, thus recreating the
list (and the local package mirror). When the prep is removed at the end
of stage 3, one thing that isn't done in the chroot_archives removal is
to ensure that this list file is removed. I presume that this issue just
didn't occur to Daniel when he broken off the installer code into it's
own stage (out of the binary stage) during development of version 4.x
(there previously was no need for chroot_archives removal to delete this
file).

So, the short term fix is to add removal of this file in chroot_archives
removal, though an additional fix there is also required to prevent it
incorrectly skipping lots of removal code when chroot and binary mirrors
are identical (an issue brought to my attention over the past couple of
months, which I have a temporary patch for, but haven't submitted yet).
I'll get on to issuing bug reports and patches for them into the bug
tracker.

The longer term fix is to restructure how live-build works, to separate
the current dual use of the 'chroot'. I have been working on this and
other general improvements on and off over the past couple months in a
local restructuring branch, which so far has accumulated about ~50
commits. (So I have about ~125 in total across all of my live-build work
waiting to be finished and reviewed by Daniel (maintainer)).


On 21/01/2015 21:47, David Ansart wrote:
> Thanks for your answer
>
> Le 21/01/2015 21:05, jnqnfe a écrit :
>> I have no answer to you currently as to why it exists in your final
>> build, it should have been deleted. If you rebuild from scratch, is it
>> still there, i.e. is this repeatable, or just a one off fluke? If it is
>> repeatable, it can be looked into further.
> Yes, it is repeatable. I use scripts (that I have regularly updated
> since Live Helper)
>
>> If it is repeatable, and without an immediate fix, there are some ways
>> you can get rid of it if you really need to:
>> 1) Use interactive mode, which, near the end of the 'chroot' stage
>> (which builds the live OS filesystem), opens up an "interactive"
>> terminal in the chroot, providing you an opportunity to delete this
>> file.
>> 2) Write a chroot hook to do it.
>> 3) Instead of simply executing 'lb build', carefully execute the
>> individual sub-stages it executes manually (i.e. 'lb bootstrap', 'lb
>> chroot', 'lb installer', 'lb binary', and 'lb source' (note, this is the
>> correct set of commands and correct sequence in 4.0.4-1, but may change
>> in future!)), and after the chroot stage has completed, manually delete
>> chroot/root/packages.chroot before proceeding with the remaining stages.
> I think I have do that already : My last script .chroot into
> "config/hooks" does "rm /root/packages.chroot", but it's failed with :
> "rm: cannot remove '/root/packages.chroot': No such file or directory"
>
> How can i help you ?
>
> David
>
>>
>>
>> On 21/01/2015 19:37, David Ansart wrote:
>>> Hi
>>>
>>> I want install a deb package (qupzilla_1.8.5_i386.deb) then i put it
>>> into config/packages.chroot/
>>>
>>> At the end of install, my Live-iso has the file /root/packages.chroot
>>> who contains the word "qupzilla".
>>> How can i delete this file /root/packages.chroot ?
>>>
>>> I use live-build 4.0.4-1
>>>
>>> thank you
>>>
>>> David
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> ---
>>> L'absence de virus dans ce courrier électronique a été vérifiée par le
>>> logiciel antivirus Avast.
>>> http://www.avast.com
>>>
>>>
>
>
> ---
> L'absence de virus dans ce courrier électronique a été vérifiée par le
> logiciel antivirus Avast.
> http://www.avast.com
>


Reply to: