Commit Graph

3806 Commits

Author SHA1 Message Date
Lyndon Brown 2d7ff4934d improve stagefiles encapsulation
- added and used Stagefiles_dir()
 - added and used Stagefile_exists()

pretty self explanatory.

Gbp-Dch: Short
2020-05-02 14:49:45 +01:00
Lyndon Brown b20979334c caching: output error on invalid action param
for bootstrap, the check is moved to the case statement for greater
robustness, and for consistency with other scripts.

Gbp-Dch: Ignore
2020-05-02 14:04:12 +01:00
Lyndon Brown da1fab1161 output error for incorrect action in chroot prep scripts
...alongside printing usage (which is perhaps unnecessary), so that it is
actually clear to users that a problem occurred, and what.

and capture it before option processing of remaining args.

Gbp-Dch: Ignore
2020-05-02 13:46:41 +01:00
Lyndon Brown 5f318c5a44 tidy up Echo_breakage()
- it's only used by the debootstrap script after alternatives were dropped
   long ago, so let's move it, avoiding it being loaded for everything
   else.
 - there's no need to pass printing another message through it.
 - there's little point in making the sid distinction if you happen to
   decide to build sid, it's a given that it's less stable than stable.

really, is there any need for this at all?

Gbp-Dch: Ignore
2020-05-02 13:06:17 +01:00
Lyndon Brown d7d0798e46 debootstrap: remove useless obtaining debootstrap verbose help strings
Gbp-Dch: Ignore
2020-05-02 12:54:22 +01:00
Lyndon Brown 1c74927fe5 config: simplify mode default
all roads lead to debian

i was waiting to get to the work on properly tackling the mode stuff, but
let's just tidy this now...

Gbp-Dch: Ignore
2020-05-02 12:41:35 +01:00
Lyndon Brown f78001144b move and rename Common_config_files()
for better encapsulation, and for consistency with other config file
handling functions in the new location.

Gbp-Dch: Ignore
2020-05-02 02:38:26 +01:00
Lyndon Brown 69dc8c21cb bootloaders: tweak default splash text to avoid overlap
the default grub config has a quirk of using the syslinux splash when
present, which as a sidenote i believe is because only the syslinux script
has the code for converting an SVG (i've not researched to confirm).

the problem is that the default splash is such, with the text listing
package versions used, that this overlaps with the menu title in grub.

i've tweaked the "built on" and package details text to reduce its size
(bumped the line-height up slightly though) to avoid the overlap.

this was a pain in the *** to get done. inkscape likes to crash at the
slightest little thing like clicking on interface controls; each time it
saves it seems to swap a bunch of stuff in the file which can make a
hugely messy diff, i had to save, close, open, change, undo, and save
again, just to get a sain diff; and numerous times testing different sizes
and such in actual builds (rather than separate conversions) some of the
package detail lines would for some unknown reason decide to end up on the
same line as another, wth...

anyway, i've finally managed to get a new revision successfully created
and it seems bug free wrt. that same line issue to me, both converting
outside of live-build (in my sid host), and within a buster build. the size
of the text changed seems closer to the size of the actual menu entries
(there's no need for it to be bigger), and now is nicely clear of the menu
title.

Gbp-Dch: Short
2020-05-02 02:09:38 +01:00
Lyndon Brown d4a1e110ed syslinux: updated SVG for splash
opening the file in inkscape resulted in a dialog explaining that inkscape
used to work on a 90 DPI basis but switched to 96 DPI for better
compatibility reasons, and wanted to convert the file.

this is simply the result of it having done the conversion.

it advised that for documents not intended to be printed that there should
be no noticeable difference. i checked the output and it seems identical
to before. i tried to look at the actual diff, but it's a lot of noise,
most of which is just reordering, and i gave up, since the output looks
identical i'm not going to worry.

Gbp-Dch: Ignore
2020-05-02 00:02:31 +01:00
Lyndon Brown 1892f97ce6 grub2: fix missed vga= consistency adjustment
Gbp-Dch: Ignore
2020-05-01 22:36:10 +01:00
Lyndon Brown 6ebac9cc5b grub2: fix duplicate live entries
in tweaking a previous commit to remove some excessive change before
submission, i mistakenly identified the part of the sed replacement
restored here as being unnecessary to its functionality, but in fact it is.
without it the placeholder is not actually removed.

the lack of removal of the placeholder meant that you ended up with
duplicate copies of the live menu entries.

Gbp-Dch: Ignore
2020-05-01 22:02:31 +01:00
Lyndon Brown 578dbee516 bootloaders: change 'Advanced options' to 'Utilities'
more fitting now that we've moved the advanced installer entries
out to a different submenu, leaving just memtest (and HDT on
syslinux).

the advanced.cfg file is also renamed to utilities.cfg in the syslinux
case, but in a backwards compatible way of moving the user advanced.cfg
file over the new one, if the user provides a file with the old name.
alternatively we could just leave the old name in place, but that would be
a little odd.

Gbp-Dch: Short
2020-05-01 12:38:04 +02:00
Lyndon Brown d22c1f177d grub2: fix vga= consistency
- most entries used vga=788 rather than vga=normal (which are equivalent)
 - the syslinux menu uses 788 exclusively
 - so do the official install discs

Gbp-Dch: Short
2020-05-01 12:37:36 +02:00
Lyndon Brown 375ff465e5 grub2: tiny label consistency tweak
as per style in official Debian install discs

Gbp-Dch: Ignore
2020-05-01 12:05:35 +02:00
johnraff 0e5d0483e5 Replace 'which' with 'command -v' to test for the existance of an executable
This is considered to be more robust.

Two instances remain:

scripts/build/chroot_archives, line 257:
if [ "${LB_APT}" = "aptitude" ] && [ ! $(Chroot chroot "which aptitude") ]
The command is run inside a chroot where the environment might be special,
and would need further testing.

manpages/Makefile, line 42:
@if [ ! -x "$$(which po4a 2>/dev/null)" ]; \
I am insufficiently familiar with makefile syntax to edit this.
2020-05-01 09:59:11 +00:00
Lyndon Brown fd18d46e0e grub2|loopback: avoid perl for live entry creation, use temp file
instead of cramming the live entries into a string via a layer of functions
for terminating entries with newlines, which we then have to run through
perl to tweak the newlines for correct use with sed... let's write the
entries to a temp file, then use that file in the sed replacement.

the helper functions injecting newlines to the end of entries as they were
built into a long string have obviously become unnecessary and so were
removed. one function was renamed for reasons of consistency and clarity.

the file is initially deleted before use for reasons of wanting to bullet
proof the codebase to work properly under conditions of recovering from
failure/cancellation, `--force` re-running and such.

this removes the last use of perl.

Gbp-Dch: Short
2020-05-01 09:40:40 +00:00
Lyndon Brown 2c1af527fd config: fix wrong variable name
Gbp-Dch: Ignore
2020-05-01 08:57:44 +00:00
Lyndon Brown a72e7daaf7 config: only try to load FILE.ARCH and FILE.DIST if non-empty strings
to thus avoid trying to load `FILE.`

Gbp-Dch: Ignore
2020-05-01 08:57:44 +00:00
Lyndon Brown 61aa3239c5 config: remove junk config loading code
support for this has not existed since v2.0~a24-1 !!

until 4d22ca948a (v2.0~a24-1), `PROGRAM` was
defined as `PROGRAM="$(basename ${0})"`. then this commit simply got rid
of the definition.

it then flipped back and forth a bit in a few ways, but always sticking
to a simple fixed "live-build" type string after that commit, as it has
been ever since.

the code removed here has thus been junk since then, and the documentation
corrected here out of date since then.

the checking of `LB_CONFIG` is also possibly junk, but i know too little
about it. it was introduced in v1.0~a43-1 in commit
705a4178e7 with a changelog entry of
"Centraly evaluate LH_CONFIG for custom configuration file."

Gbp-Dch: Short
2020-05-01 08:57:44 +00:00
Lyndon Brown 72321c2b9b config: optimise --ignore-system-defaults
Gbp-Dch: Ignore
2020-04-30 19:37:51 +01:00
Lyndon Brown b4156e146f workaround checkbashisms mistake
it reported: "possible bashism in scripts/build/binary_loopback_cfg line 284 (should be '.', not 'source')"

which is clearly a misidentification.

Gbp-Dch: Ignore
2020-04-30 11:57:47 +01:00
Lyndon Brown 9d5665c627 syslinux: fix errors re-running under `--force`
robustification is required to not just `--force` but recovery from failure
or user cancellation.

Gbp-Dch: Short
2020-04-30 07:52:37 +01:00
Lyndon Brown 82f0acb091 grub2|loopback: fix theme issues for submenus
also enables greater flexibility for users to override more aspects of
theme separate from menu entries, and similarly the initial config details
separate from the menu entries. (with the recent change to merge user files
with the defaults rather than replace them, users can pick which of these
individual components they wish to customise.

identical to change as sent in to Kali and accepted by Raphaël.

Gbp-Dch: Short
2020-04-30 07:36:51 +01:00
Lyndon Brown 96ade65e65 grub2: fix lost pre-prepared files detail
partly lost in some adjustments that were made to the submitted work,
which was focused on restoring the 'start installer' entry.

there is no need for dynamic setting of these two `source` imports in the
default file, in fact user modifications should also use the fixed import
commands in future.

note that the old placeholders however remain replaced, which inject
precisely this string, for backwards compatibility.

Gbp-Dch: Ignore
2020-04-30 07:10:08 +01:00
Lyndon Brown 647dcb7aed bootstrap_cache: fix failure condition
during testing i encountered an unexpected error resulting from the
following condition:
 - bootstrap was cached
 - cache of bootstrap packages was empty (from playing with `lb clean`)
 - installer was not none|live

everything works fine up until the main installer script, which comes to
an abrupt halt with an error due to the missing cached bootstrap packages
that it wants to copy.

this situation is easy to unintentionally create, as i managed to do.

here we catch the failure condition, correcting for it.

this is done by checking for the missing cached packages when restoring
the bootstrap from the cache, and skipping this if the packages were
missing, thus forcing the bootstrap to be rebuilt. the packages should
then be found within the cache, allowing the installer stage to complete
successfully.

of course the bootstrap stage will only cache the packages if caching is
enabled, but if caching is disabled and installer enabled, the config
validation will catch that, reporting that problem.

Gbp-Dch: Short
2020-04-30 06:20:52 +01:00
Lyndon Brown 51903da073 init: warn if auto script exists but is not executable 2020-04-30 05:07:02 +00:00
Lyndon Brown a8a6addaf5 loopback: tidy formatting
Gbp-Dch: Ignore
2020-04-29 20:08:39 +01:00
Lyndon Brown 1374e82e24 frontend: fix passing along global args
trying to use `lb --debug config` for instance did not output debug info
unlike `lb config --debug`.

Gbp-Dch: Ignore
2020-04-29 19:03:58 +01:00
Lyndon Brown 80d9c93de9 selinux: fix output consistency
install mode was silent when selinux was not enabled, whilst remove mode
always output a "Begin unmounting..." message. this makes both modes silent
when selinux is not enabled.

this also happens to fix an unintended side effect of
d79c96232b whereby a warning subsequently
was always emitted in remove mode when selinux was not in use, which was
not ideal.

Gbp-Dch: Short
2020-04-29 13:17:50 +00:00
Lyndon Brown 931f42fa39 manpages: more formatting fixes
make variables and options in descriptions bold

Gbp-Dch: Ignore
2020-04-29 10:34:54 +01:00
Lyndon Brown 4f765f3fc0 manpages: fix outdated --distribution description
it does not depend upon --mode, it simply defaults to 'buster'.

Gbp-Dch: Ignore
2020-04-29 10:34:54 +01:00
Lyndon Brown 7149307e07 manpages: clarify --breakpoints
Gbp-Dch: Ignore
2020-04-29 10:34:54 +01:00
Lyndon Brown a0c7db9759 manpages: clarify and correct --binary-images description
including correction of default for all architectures being fat32 not fat16
and the sparc difference no longer being relevant.

Gbp-Dch: Ignore
2020-04-29 10:34:54 +01:00
Lyndon Brown 4f82210d11 manpages: tiny clarifications and tweaks
not worth listing the specifics

mostly the following though:
 - "(comma or space separated)" -> "(a comma or space separated list)"
 - quoting values

Gbp-Dch: Ignore
2020-04-29 10:34:42 +01:00
Lyndon Brown 9c7e8dec72 manpages: fix formatting mistakes
shortoptions also emboldened

Gbp-Dch: Ignore
2020-04-29 10:31:40 +01:00
Lyndon Brown e9a88e5201 manpages: tiny correction
"all (applicable)" -> "all"

this needed adjusting after 38a5aed0dc

don't want to confuse users

Gbp-Dch: Ignore
2020-04-29 10:31:40 +01:00
Lyndon Brown 20c43a0eb8 manpages: fix typos
"whould" -> "would"
"build" -> "built"

Gbp-Dch: Ignore
2020-04-29 10:31:40 +01:00
Lyndon Brown d2f9344b66 manpages: fix typo
"bugreport" -> "bug report"

i won't bother changing the dates just for this one.

Gbp-Dch: Ignore
2020-04-29 10:31:25 +01:00
Lyndon Brown 29ab2459c8 a couple tiny doc fixes
Gbp-Dch: Ignore
2020-04-29 10:27:16 +01:00
Lyndon Brown 6a5d42d569 fix auto file handling regression
b4598b234c mistakenly stopped passing along
options to auto files.

Gbp-Dch: Ignore
2020-04-28 15:12:35 +01:00
Lyndon Brown 997a7f73f9 config: remove redundant validation check
this is already covered by the check above it

Gbp-Dch: Ignore
2020-04-26 12:55:18 +00:00
Lyndon Brown 70c0aa4075 manpages: fix typo
"Sor" -> "So"

Gbp-Dch: Ignore
2020-04-25 12:03:49 +02:00
Raphaël Hertzog 624e79eb8f Do not overwrite splash.png if the user has provided it
The unconditional SVG to PNG conversion could overwrite a splash.png
provided by the user. Ensure we don't overwrite such a file. But we
still remove the SVG file as syslinux is not able to make use of it.
2020-04-25 10:49:35 +02:00
Raphaël Hertzog 103daf9f7c Make librsvg2-bin dependency unconditional for syslinux
We do provide a splash.svg by default so the check will always return
true unless the user has forked live-build... thus the check is
pointless.
2020-04-25 10:46:26 +02:00
jnqnfe 24c2b3e119 syslinux: deduplicate common files
there are several files of which identical duplicate copies are held in:
 - share/bootloaders/extlinux
 - share/bootloaders/pxelinux
 - share/bootloaders/isolinux
 - share/bootloaders/syslinux

it is a pain to maintain this from a development standpoint, having to
copy modified config files into the other directories each time changes
are made and mistakes have been made before due to this.

this creates a new folder share/bootloaders/syslinux_common and moves them
to this new directory.

it also expands the binary_syslinux stage to use it, with it now
constructing the installed set of bootloader files as follows:
 1. copy {LB_DIR}/bootloaders/syslinux_common
 2. copy {LB_DIR}/bootloaders/{syslinux|isolinux|extlinux|pxelinux} on top
 3. copy config/bootloaders/syslinux_common on top
 4. copy config/bootloaders/{syslinux|isolinux|extlinux|pxelinux} on top

note, to explain part of the binary_syslinux change, instead of just
copying the correct bootloader folder full of the files, we now make the
target bootloader specific directory, then copy the contents of source
directories into it.

Gbp-Dch: Short
2020-04-24 18:50:37 +01:00
Raphaël Hertzog 34a72caf49 Synchronize syslinux menu structure with the grub-pc one
* Use same menu labels
* Use same hotkeys
* Get rid of a nested menu that is not present in grub
* Add "menu title" statement to hide the caret of the hotkey (^)
2020-04-24 18:57:03 +02:00
Lyndon Brown 47b0a623dd syslinux: fix lack of top level install option
0bf9d2d390 expanded the set of install
options, whilst also moving them all to a submenu.

it has since been raised that this is not actually what is wanted, that
having an entry for the most common install option is wanted at the top
level, like currently with grub2.

this adds such an entry.

Gbp-Dch: Short
2020-04-24 15:38:55 +00:00
Raphaël Hertzog c6428f44e3 Use correct variable name to detect removal step
Due to this mistake, the helpers were not called in reverse order
during the removal step. This lead to things like "apt update" failing
because a broken /etc/resolv.conf has been restored before the call
to "chroot_archives remove".

Gbp-Dch: Ignore
2020-04-24 17:09:10 +02:00
Lyndon Brown 41ca745b6c syslinux: fix missing hotkeys
for some reason the syslinux folder one had these but not the others.
probably a result of having four separate copies of the files and this
part of the past change to expand the install menus failed to be
duplicated.

Gbp-Dch: Short
2020-04-24 14:43:20 +00:00
Raphaël Hertzog e7df05cd29 Replace "Help" calls with "Man" and get rid of Help 2020-04-24 16:39:10 +02:00