FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Development

 
 
LinkBack Thread Tools
 
Old 02-03-2009, 02:49 PM
Xavier
 
Default install scripts in core

On Tue, Feb 3, 2009 at 4:27 PM, Allan McRae <allan@archlinux.org> wrote:
> glibc, db and shadow do not use post_install so they do not test the need
> for bash. However, both readline and pam do use post_install so it appears
> they are running. Why is that? Because the package do not actually include
> the install script due to lack of install line in their PKGBUILD.

Ahah I see, that is quite funny.
If the scriptlets are not needed / used, it would be better to remove
them to avoid more confusion.
 
Old 02-03-2009, 02:57 PM
Allan McRae
 
Default install scripts in core

Allan McRae wrote:

Xavier wrote:
On Mon, Feb 2, 2009 at 6:24 PM, Aaron Griffin
<aaronmgriffin@gmail.com> wrote:


The way pacman calls the scriptlets, it actually uses the shell from
the _parent_ system. I know this for a fact, because Dan and I
investigated, added checks for bash in the chroot, then realized it
didn't matter and reverted it.

Are you _sure_ it's bash failing like you suspect? What happens if you
just install vi and library deps in a chroot and try to run things
manually?




I am not sure why we are talking about bash here, the shell used is
/bin/sh which can be any shells, right?
Are you sure the shell from the parent system is used? I could not
find this documented anywhere.
How do you explain that installing bash or adding a sh->dash symlink
inside the chroot helps then?

To Allan : did you find any scriptlets which actually worked without
bash installed? Even the most basic scriptlet not doing anything does
not work here.



In short, No. But why am I getting no install scriptlet errors when I
install all of base you might ask... Well, that was doing my head in
and here is the answer.
Doing a "pamcan -r somedir -S base" installs the following programs
who have install scriptlet (according to ABS) before bash:

glibc,readline, db, pam, shadow

glibc, db and shadow do not use post_install so they do not test the
need for bash. However, both readline and pam do use post_install so
it appears they are running. Why is that? Because the package do not
actually include the install script due to lack of install line in
their PKGBUILD.
All my tests with dummy packages with post_install scripts doing
simple things like "return 0" or even nothing do not work unless bash
is installed. So it looks like we are really using the bash on the
_child_ system, not the parent. Which would make sense (how do you
chroot to the child system and still access the parents bash?).




And here is my plan to fix this.
- Remove the post_install script from readline - it is installed before
tex-info anyway due to readline -> bash -> gzip -> tex-info. I'd give
texinfo a dep on 'sh' in case the bash->gzip link ever breaks.
- All packages (at least in core) with an install script must depend on
'sh' and programs needed to run their install script functions (see
start of thread).


We run into a problem if any dep of bash needs a pre/post_install.
These packages currently are kernel-headers, tzdata, glibc, ncurses, and
readline. Now wait for Dan to point out that dash has no deps so could
be our default sh... which is why I suggest depending on 'sh' rather
than bash.


Allan
 
Old 02-03-2009, 03:09 PM
Aaron Griffin
 
Default install scripts in core

On Tue, Feb 3, 2009 at 9:27 AM, Allan McRae <allan@archlinux.org> wrote:
> So it looks like we are really using the bash on the _child_ system, not
> the parent. Which would make sense (how do you chroot to the child system
> and still access the parents bash?).

Dan, did we stop using popen? Or are we forking now?
http://projects.archlinux.org/?p=pacman.git;a=commit;h=9558639d8009483fbf422b138 d020745986f82f1
 
Old 02-03-2009, 03:18 PM
Xavier
 
Default install scripts in core

On Tue, Feb 3, 2009 at 5:09 PM, Aaron Griffin <aaronmgriffin@gmail.com> wrote:
> On Tue, Feb 3, 2009 at 9:27 AM, Allan McRae <allan@archlinux.org> wrote:
>> So it looks like we are really using the bash on the _child_ system, not
>> the parent. Which would make sense (how do you chroot to the child system
>> and still access the parents bash?).
>
> Dan, did we stop using popen? Or are we forking now?
> http://projects.archlinux.org/?p=pacman.git;a=commit;h=9558639d8009483fbf422b138 d020745986f82f1
>

This code did not change. pacman forks a process and run popen in the child.
I tried to look up documentation about popen and could not find
anything about using the shell of the parent system.
 
Old 02-03-2009, 03:47 PM
Xavier
 
Default install scripts in core

On Tue, Feb 3, 2009 at 2:08 AM, Allan McRae <allan@archlinux.org> wrote:
>
> I am fairly sure that these install scripts seem to need bash on the *child*
> system.
> lilo, vi, mlocate (after add coreutils dep) and fakeroot all fail to run
> their post install script with their current dependencies. Pulling in bash
> to the chroot before them makes it work. Bash pulls in ncurses and readline
> as well, but just adding these does not fix the problem. So whatever the
> cause, having bash in the child system seems to fix it. For vi, mlocate and
> fakeroot, I think the "echo" line is causing it. No idea with lilo...
>
> This occurs both with "pacman -r" and "mkarchroot".
>

Just for clarifying, this can easily be reproduced by anyone.
Just do
# pacman -Sr /path/to/chroot <pkg>
where pkg is one of the failing packages : lilo, vi, mlocate, fakeroot

I used a quick hack to play with different scriptlets : edit one of
the above packages directly (for example by opening the pkg.tar.gz in
vim) to modify the .INSTALL scriptlet, and install the modified
package with # pacman -Ur /path/to/chroot /path/to/modifiedpkg

But I suppose the main goal is to have a successful base install with
no scriptlets error, so this is the main test to get working :
# pacman -Sr /path/to/chroot base
 

Thread Tools




All times are GMT. The time now is 04:44 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org