Discussion:
bug in installpkg 12.1?
(too old to reply)
Frank Boehm
2008-12-10 12:35:13 UTC
Permalink
my system is a slackware-12.1

wanted to install slackware-12.1 in a new directory

| ***@sif: /var/www/htdocs/pub/slackware/slackware-12.1/slackware/x # export ROOT=/tmp/dummy
| ***@sif: /var/www/htdocs/pub/slackware/slackware-12.1/slackware/x # mkdir /tmp/dummy
| ***@sif: /var/www/htdocs/pub/slackware/slackware-12.1/slackware/x # installpkg *misc-misc*.tgz
| Installing package font-misc-misc-1.0.0-noarch-3 ([REC])...
| PACKAGE DESCRIPTION:
| font-misc-misc: font-misc-misc
| font-misc-misc:
| font-misc-misc: font-misc-misc is part of X11.
| font-misc-misc:
| font-misc-misc: For more information about the X.Org Foundation (the providers of the
| font-misc-misc: X.Org implementation of the X Window System), see their website:
| font-misc-misc:
| font-misc-misc: http://www.x.org
| font-misc-misc:
| Executing install script for font-misc-misc-1.0.0-noarch-3...
| ./fonts.scale: fopen(w): Read-only file system
| ./fonts.dir: fopen(w): Read-only file system

according to man installpkg this should be possible:

-root /otherroot
Install using a location other than / (the default) as the root of the
filesystem to install on. In the example given, use /otherroot instead.
Setting the ROOT environment variable does the same thing.

the package is installed to /tmp/dummy, but the included install script woes,
my normal system has a ro mounted /usr partition,

I understand the error message, if I wanted to install to ROOT=/
but not with ROOT=/tmp/dummy


cu Frank
--
A budget is just a method of worrying before you spend money, as well
as afterward.
Jerry Peters
2008-12-10 21:45:23 UTC
Permalink
Post by Frank Boehm
my system is a slackware-12.1
wanted to install slackware-12.1 in a new directory
| Installing package font-misc-misc-1.0.0-noarch-3 ([REC])...
| font-misc-misc: font-misc-misc
| font-misc-misc: font-misc-misc is part of X11.
| font-misc-misc: For more information about the X.Org Foundation (the providers of the
| font-misc-misc: http://www.x.org
| Executing install script for font-misc-misc-1.0.0-noarch-3...
| ./fonts.scale: fopen(w): Read-only file system
| ./fonts.dir: fopen(w): Read-only file system
-root /otherroot
Install using a location other than / (the default) as the root of the
filesystem to install on. In the example given, use /otherroot instead.
Setting the ROOT environment variable does the same thing.
the package is installed to /tmp/dummy, but the included install script woes,
my normal system has a ro mounted /usr partition,
I understand the error message, if I wanted to install to ROOT=/
but not with ROOT=/tmp/dummy
cu Frank
Not installpkg, but the font installation scripts have an absolute
path in them.
I remember having the same problem when I installed 12.1 to a
different set of partitions from my 11.0 system. I had to manually run
the various X font utilities.

Jerry
Frank Boehm
2008-12-11 08:26:48 UTC
Permalink
Post by Jerry Peters
Not installpkg, but the font installation scripts have an absolute
path in them.
I remember having the same problem when I installed 12.1 to a
different set of partitions from my 11.0 system. I had to manually run
the various X font utilities.
I do have a RO /usr right after installation and normal startup scripts
never got a chance to write/update font information. X won't start and
it took some time to find the cause.

IIRC this worked in older slackware versions, I just didn't expect this
behaviour of installpkg. Thought of a chroot for installation, but never
verified this idea. Now I make a chroot after automated installations
and call the X setup scripts by hand.

cu Frank
--
Common sense is the collection of prejudices acquired by age eighteen.
-- Albert Einstein
Frank Boehm
2008-12-11 11:39:41 UTC
Permalink
Post by Frank Boehm
verified this idea. Now I make a chroot after automated installations
and call the X setup scripts by hand.
use the source, patched my installpkg, can use a new option

-chroot (will chroot to $ROOT before calling the
included /install/doinst.sh of a package)

my problem is solved, the font packages are now called with this option
within my automated install skripts, slackware installation does have
all needed by then

my diff created with
diff --unified installpkg.orig installpkg | tee ../installpkg.diff

apply with
patch < installpkg.diff

-----------------------------------------------------------------------
--- installpkg.orig 2007-12-22 00:28:51.000000000 +0100
+++ installpkg 2008-12-11 11:43:50.000000000 +0100
@@ -77,6 +77,8 @@

options: -warn (warn if files will be overwritten, but do not install)
-root /mnt (install someplace else, like /mnt)
+ -chroot (will chroot to \$ROOT before calling the
+ included /install/doinst.sh of a package)
-infobox (use dialog to draw an info box)
-menu (confirm package installation with a menu, unless
the priority is [required] or ADD)
@@ -143,6 +145,9 @@
elif [ "$1" = "-ask" ]; then
ALWAYSASK="yes"
shift 1
+ elif [ "$1" = "-chroot" ]; then
+ CHROOT="yes"
+ shift 1
elif [ "$1" = "-tagfile" ]; then
if [ -r "$2" ]; then
USERTAGFILE="$2"
@@ -446,7 +451,14 @@
if [ "$MODE" = "install" ]; then
echo "Executing install script for $shortname..."
fi
- ( cd $ROOT/ ; sh install/doinst.sh -install; )
+
+ if [ "$CHROOT" = "yes" ]; then
+ echo "Executing install script with chroot $ROOT"
+ ( chroot $ROOT/ sh install/doinst.sh -install; )
+ else
+ ( cd $ROOT/ ; sh install/doinst.sh -install; )
+ fi
+
fi
# Clean up the mess...
if [ -d $ROOT/install ]; then
-----------------------------------------------------------------------

seems to be working now, my install script will use the extra option
-chroot for packages of series x

my resulting image is working now out of the box

might be a good idea to automate this chroot, if sh and tar can be found
within $ROOT

puzzled me for some time, thanks for the help


cu Frank
--
"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe trying
to produce bigger and better idiots. So far, the Universe is winning."
(Rich Cook)
Robby Workman
2008-12-14 03:27:20 UTC
Permalink
Post by Frank Boehm
Post by Frank Boehm
verified this idea. Now I make a chroot after automated installations
and call the X setup scripts by hand.
use the source, patched my installpkg, can use a new option
-chroot (will chroot to $ROOT before calling the
included /install/doinst.sh of a package)
my problem is solved, the font packages are now called with this option
within my automated install skripts, slackware installation does have
all needed by then
Hrm, sorry for the late reply on this, but you got good information
already... :)

I won't swear to this at the moment, but it seems like all of those
X-related setup scripts are order-dependent, i.e. the first package
that gets installed shouldn't be the first setup script run. That
would be why the postinstalls check for absolute paths to decide
whether they should run or not. That's also why the setup menu
(run pkgtool to see what I'm talking about) has a section to run
them after the entire installation is finished.

Bear in mind that I probably have some details incorrect and/or missing
in all of that, but from memory, I think it's close :-)

-RW
Jerry Peters
2008-12-14 21:07:36 UTC
Permalink
Post by Robby Workman
Post by Frank Boehm
Post by Frank Boehm
verified this idea. Now I make a chroot after automated installations
and call the X setup scripts by hand.
use the source, patched my installpkg, can use a new option
-chroot (will chroot to $ROOT before calling the
included /install/doinst.sh of a package)
my problem is solved, the font packages are now called with this option
within my automated install skripts, slackware installation does have
all needed by then
Hrm, sorry for the late reply on this, but you got good information
already... :)
I won't swear to this at the moment, but it seems like all of those
X-related setup scripts are order-dependent, i.e. the first package
that gets installed shouldn't be the first setup script run. That
would be why the postinstalls check for absolute paths to decide
whether they should run or not. That's also why the setup menu
(run pkgtool to see what I'm talking about) has a section to run
them after the entire installation is finished.
Bear in mind that I probably have some details incorrect and/or missing
in all of that, but from memory, I think it's close :-)
-RW
From my recollection the post-install scripts needed $ROOT added to
various paths, especially the target directory paths.
This only crops up if you're installing packages from another working
system into a new set of partitions.

Jerry

Loading...