Discussion:
[Grml] Typo or missing feature and a basic question
ha
2014-03-03 11:09:53 UTC
Permalink
I'm new to grml so please excuse me if this on wrong list or similar.

Recently I've tried to install debian using grml and I found something
that could be a typo:
Line 136 of config file:
# Run scripts from /etc/debootstrap/pre-scripts/ after setting up chroot.
Shouldn't it state "/etc/debootstrap/scripts/" ?

In config file I've found extrapackages, but on the man page of
grml-debootstrap there is no option extrapackages. Is this
intentionally? This option is not implemented or simply not documented?

Additionally , I would be grateful for a help on how to use scripts from
"scripts" direcotry. My plan was to add a script to compile a program
(for instance dwm), however I was unable to achieve this. I'm unsure if
this is feasible at all, and whether I'm positioned at the right
directory (or how to check that). I invoked command with the -d flag:
grml-debootstrap -d FILE

Finally, I have troubles at debugging debootstrap stages. If someone
would show me how to do that, perhaps I could solve the previous problem
by myself. I've read somewhere about install_notes file that could be
used for this, but I haven't found much on it - assuming that I
understood that correctly.

Thanks in advance.
Andreas "Jimmy" Gredler
2014-03-03 22:19:56 UTC
Permalink
Post by ha
I'm new to grml so please excuse me if this on wrong list or similar.
You're pefectly right.
Post by ha
Recently I've tried to install debian using grml and I found something
# Run scripts from /etc/debootstrap/pre-scripts/ after setting up chroot.
Shouldn't it state "/etc/debootstrap/scripts/" ?
Yes, thank you. This typo was already fixed but did not yet make it into
the stable repository. A new grml-debootstrap package is available in
the grml-testing repository.
Post by ha
In config file I've found extrapackages, but on the man page of
grml-debootstrap there is no option extrapackages. Is this
intentionally? This option is not implemented or simply not documented?
The man page lists /etc/debootstrap/extrapackages/ in the FILES section
and describes its purpose. But there is no option to switch off
installing extra packages. This is by intention. You can always set the
variables before calling debootstrap, e.g.:
EXTRAPACKAGES='no' grml-deboostrap ...
(or just leave the extrapackages directory empty)
Post by ha
Additionally , I would be grateful for a help on how to use scripts from
"scripts" direcotry. My plan was to add a script to compile a program
(for instance dwm), however I was unable to achieve this. I'm unsure if
this is feasible at all, and whether I'm positioned at the right
grml-debootstrap -d FILE
Scripts in the scripts directory are executed after the chroot was built
and exited. I think you are looking for
/etc/debootstrap/chroot-scripts/. Scripts in this directory are executed
in the chroot, which is basically your new Debian installation.
Post by ha
Finally, I have troubles at debugging debootstrap stages. If someone
would show me how to do that, perhaps I could solve the previous problem
by myself. I've read somewhere about install_notes file that could be
used for this, but I haven't found much on it - assuming that I
understood that correctly.
You can have a look at grml-debootstrap itself, which is a shell script.
There you're gonna see in which order the functions are called. I think
in your case the relevant information is, that grml-debootstrap calls
debootstrap to build a chroot and calls the script
/etc/debootstrap/chroot-script which setups additional stuff in the
chroot. So if you want to modidy your new Debian installation you should
do it in the chroot. The other scripts are run before the chroot is
created and after the scripts exits from the chroot. HTH

greets Jimmy
ha
2014-03-04 12:50:08 UTC
Permalink
Post by Andreas "Jimmy" Gredler
Post by ha
I'm new to grml so please excuse me if this on wrong list or similar.
You're pefectly right.
Post by ha
Recently I've tried to install debian using grml and I found something
# Run scripts from /etc/debootstrap/pre-scripts/ after setting up chroot.
Shouldn't it state "/etc/debootstrap/scripts/" ?
Yes, thank you. This typo was already fixed but did not yet make it into
the stable repository. A new grml-debootstrap package is available in
the grml-testing repository.
Post by ha
In config file I've found extrapackages, but on the man page of
grml-debootstrap there is no option extrapackages. Is this
intentionally? This option is not implemented or simply not documented?
The man page lists /etc/debootstrap/extrapackages/ in the FILES section
and describes its purpose. But there is no option to switch off
installing extra packages. This is by intention. You can always set the
EXTRAPACKAGES='no' grml-deboostrap ...
(or just leave the extrapackages directory empty)
Post by ha
Additionally , I would be grateful for a help on how to use scripts from
"scripts" direcotry. My plan was to add a script to compile a program
(for instance dwm), however I was unable to achieve this. I'm unsure if
this is feasible at all, and whether I'm positioned at the right
grml-debootstrap -d FILE
Scripts in the scripts directory are executed after the chroot was built
and exited. I think you are looking for
/etc/debootstrap/chroot-scripts/. Scripts in this directory are executed
in the chroot, which is basically your new Debian installation.
Ok. Consider that the chroot target directory is mounted ant
/mnt/target/, and /mnt/config/ is a directory contianig configuration
files, among others config file, and chroot-scrips/ directory.
Now, let's invoke grml-debootstrap with -d flag, e.g. grml-debootstrap
-d /mnt/config. Now, my root directory (/) is /mnt/target/ actually, so
/mnt/config/ is unreachable, but nevertheless /mnt/config/chroot-scripts
are still going to be invoked, right? However, I should not reference
any file from /mnt/config in them, as anything there is unreachable.
Therefore, (for example) to compile some source code I should copy
relevant files from /mnt/config/ to /mnt/target/ in advance? Perhaps
this could be done with pre-scripts? Did I get this right? It's not like
/mnt/config passed with the -d flag is mounted (or copied) to
/etc/debootstrap where the default configuration residues.
Post by Andreas "Jimmy" Gredler
Post by ha
Finally, I have troubles at debugging debootstrap stages. If someone
would show me how to do that, perhaps I could solve the previous problem
by myself. I've read somewhere about install_notes file that could be
used for this, but I haven't found much on it - assuming that I
understood that correctly.
You can have a look at grml-debootstrap itself, which is a shell script.
There you're gonna see in which order the functions are called. I think
in your case the relevant information is, that grml-debootstrap calls
debootstrap to build a chroot and calls the script
/etc/debootstrap/chroot-script which setups additional stuff in the
chroot. So if you want to modidy your new Debian installation you should
do it in the chroot. The other scripts are run before the chroot is
created and after the scripts exits from the chroot. HTH
greets Jimmy
Yes, it helps. Thanks.
In addition, I would ask is there a common way to log the output/error
of the (grml-)debootstrap procedure, to see at which stage exactly a
warning or an error occurred?
Andreas "Jimmy" Gredler
2014-03-15 00:14:00 UTC
Permalink
I'm sorry for the delay, I thought I had already answered :(
Post by ha
Post by Andreas "Jimmy" Gredler
Scripts in the scripts directory are executed after the chroot was
built and exited. I think you are looking for
/etc/debootstrap/chroot-scripts/. Scripts in this directory are
executed in the chroot, which is basically your new Debian
installation.
Ok. Consider that the chroot target directory is mounted ant
/mnt/target/, and /mnt/config/ is a directory contianig configuration
files, among others config file, and chroot-scrips/ directory. Now,
let's invoke grml-debootstrap with -d flag, e.g. grml-debootstrap -d
/mnt/config. Now, my root directory (/) is /mnt/target/ actually, so
/mnt/config/ is unreachable, but nevertheless
/mnt/config/chroot-scripts are still going to be invoked, right?
Yes, everything regarding those config files is copied to /mnt/target
Post by ha
However, I should not reference any file from /mnt/config in them, as
anything there is unreachable. Therefore, (for example) to compile
some source code I should copy relevant files from /mnt/config/ to
/mnt/target/ in advance?
No, you don't need to (see below)
Post by ha
Perhaps this could be done with pre-scripts? Did I get this right?
It's not like /mnt/config passed with the -d flag is mounted (or
copied) to /etc/debootstrap where the default configuration
residues.
Yes, it is, but not the whole directory. So you could put your files to
the chroot-scripts directory or extra-packages directory and it will be
copied to /mnt/target/etc/debootstrap/.
You can also create directories like /etc/debootstrap/usr/local and they
will be copied. Please have a look at the man page, section
CUSTOMIZATION, to get more details.
Post by ha
Yes, it helps. Thanks. In addition, I would ask is there a common way
to log the output/error of the (grml-)debootstrap procedure, to see
at which stage exactly a warning or an error occurred?
I'm not sure if I understand your question correctly. You mean beside
just piping the output to a file?

greets Jimmy

Loading...