grml-debootstrap.git
16 months agoRelease new version 0.101 v0.101
Michael Prokop [Fri, 25 Nov 2022 16:13:12 +0000 (17:13 +0100)]
Release new version 0.101

16 months agoMerge remote-tracking branch 'origin/pr/196'
Michael Prokop [Fri, 25 Nov 2022 13:33:35 +0000 (14:33 +0100)]
Merge remote-tracking branch 'origin/pr/196'

16 months agoMerge remote-tracking branch 'origin/pr/202'
Michael Prokop [Fri, 25 Nov 2022 13:32:00 +0000 (14:32 +0100)]
Merge remote-tracking branch 'origin/pr/202'

16 months agoMerge remote-tracking branch 'origin/pr/201'
Michael Prokop [Fri, 25 Nov 2022 13:31:55 +0000 (14:31 +0100)]
Merge remote-tracking branch 'origin/pr/201'

16 months agoUse "errors=remount-ro" fstab option only within supported filesystems
Michael Prokop [Fri, 25 Nov 2022 08:04:31 +0000 (09:04 +0100)]
Use "errors=remount-ro" fstab option only within supported filesystems

Also XFS doesn't support the errors=remount-ro option, but instead of
disabling the option for file systems that don't support it, let's
only enable it for the once that support it (according to linux's
source).

Thanks: Chris Hofstaedtler for the bug report
Closes: https://github.com/grml/grml-debootstrap/issues/199

16 months agoEnsure to have filesystem tools installed
Michael Prokop [Fri, 25 Nov 2022 10:48:06 +0000 (11:48 +0100)]
Ensure to have filesystem tools installed

When installing to an XFS root partition, update-initramfs complains:

| update-initramfs: Generating /boot/initrd.img-5.10.0-19-amd64
| W: /sbin/fsck.xfs doesn't exist, can't install to initramfs

Let's make sure to have the according filesystem package available.

FTR, no need for handling ext* + e2fsprogs, as this is available anyways
due to `Priority: required`.

Also, the "--filesystem jfs" isn't supported by default (as mkfs.jfs
expects user input unless invoked with -q, something we might wanna
automate in the future?), but someone can prepare it manually and
install it to the mounted file system, so let's also handle this.

Thanks: Chris Hofstaedtler for the bug report
Closes: https://github.com/grml/grml-debootstrap/issues/200

17 months agopacker: update Grml ISO to 2022.11-rc1
Michael Prokop [Tue, 15 Nov 2022 10:18:33 +0000 (11:18 +0100)]
packer: update Grml ISO to 2022.11-rc1

FTR, grml_iso_checksum = sha1sum and we need to use
http://download.grml.org/devel/ as download directory,
as 2022.11-rc1 is not yet a stable release.

17 months agopacker: add support for Debian/bookworm
Michael Prokop [Tue, 15 Nov 2022 10:18:23 +0000 (11:18 +0100)]
packer: add support for Debian/bookworm

21 months agoMake dracut images reproducible and use long form of --no-hostonly
Daniel Winzen [Sun, 3 Jul 2022 12:08:32 +0000 (14:08 +0200)]
Make dracut images reproducible and use long form of --no-hostonly

21 months agoAdd option to pass extra options to initrd generator
Daniel Winzen [Sun, 3 Jul 2022 12:07:10 +0000 (14:07 +0200)]
Add option to pass extra options to initrd generator

21 months agoAdd dracut support
Daniel Winzen [Fri, 1 Jul 2022 20:05:34 +0000 (22:05 +0200)]
Add dracut support

2 years agoRelease new version 0.100 v0.100
Michael Prokop [Mon, 24 Jan 2022 16:17:53 +0000 (17:17 +0100)]
Release new version 0.100

2 years agoMerge remote-tracking branch 'origin/pr/190'
Michael Prokop [Tue, 7 Dec 2021 07:55:34 +0000 (08:55 +0100)]
Merge remote-tracking branch 'origin/pr/190'

2 years agoVMs: create partition with alignment starting at 4MiB + ending at 100%
Michael Prokop [Mon, 6 Dec 2021 16:19:40 +0000 (17:19 +0100)]
VMs: create partition with alignment starting at 4MiB + ending at 100%

Our partition creation process inside VMs used parted with "mkpart
primary ext4 2M -1", which could end up with unaligned partitions (as
reported in #185):

| (parted) mkpart primary ext4 2M -1
| Warning: The resulting partition is not properly aligned for best performance: 3906s % 4096s != 0s

This depends on the I/O settings of the underlying storage.

The mkpart start at "2M" is interpreted as 2 Megabyte (2000000 bytes or
3906 sectors) from the disk start.  The end "-1" is interpreted as 1
Megabyte (1000000 bytes or 1953 sectors) before the disk end.

On the other hand, "2MiB" is interpreted as 2 Mebibyte (2097152 bytes or
4096 sectors) from the disk start, and "100%" is interpreted as the disk
end.

Quoting from https://www.gnu.org/software/parted/manual/html_node/unit.html:

| Parted will compute sensible ranges for the locations you specify (e.g.,
| a range of +/- 500 MB when you specify the location in “G”, and a range
| of +/- 500 KB when you specify the location in “M”) and will select the
| nearest location in this range from the one you wrote that satisfies
| constraints from both the operation, the filesystem being worked on, the
| disk label, other partitions and so on.
| [...]
| Note that as of parted-2.4, when you specify start and/or end values
| using IEC binary units like “MiB”, “GiB”, “TiB”, etc., parted treats
| those values as exact, and equivalent to the same number specified in
| bytes (i.e., with the “B” suffix), in that it provides no “helpful”
| range of sloppiness. Contrast that with a partition start request of
| “4GB”, which may actually resolve to some sector up to 500MB before or
| after that point. Thus, when creating a partition, you should prefer
| to specify units of bytes (“B”), sectors (“s”), or IEC binary units
| like “MiB”, but not “MB”, “GB”, etc.

Furthermore quoting from https://www.gnu.org/software/parted/manual/html_node/mkpart.html#FOOT2:

| Cheap flash drives will be with us for a long time to come, and, for
| them, 1MiB alignment is not enough. Use at least 4MiB-aligned
| partitions. For details, see Arnd Bergman’s article,
| http://lwn.net/Articles/428584/ and its many comments.

A better default should be usage of an IEC binary unit with a
4MiB-aligned partition, so let's switch to "4MiB 100%".

Thanks: David Gnedt for the bug report and analysis, Darshaka Pathirana and Chris Hofstaedtler for further information and feedback
Closes: grml/grml-debootstrap#185

2 years agoFix Grml repository usage
Michael Prokop [Fri, 3 Dec 2021 12:08:52 +0000 (13:08 +0100)]
Fix Grml repository usage

More recent versions of apt no longer accept unsigned repositories, and fail with:

| The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 21E0CA38EA2EA4AB
| Reading package lists... Done
| W: GPG error: http://deb.grml.org grml-stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 21E0CA38EA2EA4AB
| E: The repository 'http://deb.grml.org grml-stable InRelease' is not signed.
| N: Updating from such a repository can't be done securely, and is therefore disabled by default.
| N: See apt-secure(8) manpage for repository creation and user configuration details.

By enabling the Acquire::AllowInsecureRepositories=1 option, we can avoid this failure:

| W: GPG error: http://deb.grml.org grml-stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 21E0CA38EA2EA4AB
| W: The repository 'http://deb.grml.org grml-stable InRelease' is not signed.
| N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
| N: See apt-secure(8) manpage for repository creation and user configuration details.

While at it:

* simplify code
* don't check for "grml" inside /etc/apt/sources.list.d/grml.list,
  instead assume the file was set up as needed if it exists already
* improve apt pinning configuration:
  - no need to pin Grml *and* Debian repositories, instead let's
    set up only the Grml repository and reduce it to a pinning of 100
  - use /etc/apt/preferences.d/grml.pref instead of /etc/apt/preferences
* drop direct gpg usage, this is error prone (gpg keyservers known to be
  unavailable, we might not have gpg executable available, its code is
  fallback and untested,...)
* set up Grml's apt configuration with usage of
  "signed-by=/usr/share/keyrings/grml-archive-keyring.gpg"

Thanks: Karl Voit for the bug report
Closes: grml/grml-debootstrap#187

2 years agoDrop leftover KEYRING code
Michael Prokop [Fri, 3 Dec 2021 09:38:48 +0000 (10:38 +0100)]
Drop leftover KEYRING code

KEYRING is no longer relevant and a leftover from commit 06fc8bd266ad5.
If someone wants to customize the keyring handling of debootstrap,
this can be achieved via --debopt / DEBOOTSTRAP_OPT.

Closes: grml/grml-debootstrap#184

2 years agoRelease new version 0.99 v0.99
Michael Prokop [Mon, 23 Aug 2021 14:21:47 +0000 (16:21 +0200)]
Release new version 0.99

2 years agoBump Standards-Version to 4.6.0
Michael Prokop [Mon, 23 Aug 2021 14:21:40 +0000 (16:21 +0200)]
Bump Standards-Version to 4.6.0

2 years agoEFI support: fix for grub-install usage with efivarfs
Michael Prokop [Mon, 16 Aug 2021 19:19:20 +0000 (21:19 +0200)]
EFI support: fix for grub-install usage with efivarfs

We had to apply fixes due to efivars vs efivarfs in Debian kernel
versions >=5.10, and addressed them in commit d91d9f3ef.

Those changes were incomplete though: while efibootmgr was invoked in
the according and expected environment, invocation of grub-install
doesn't reliably work (as at that time /sys/firmware/efi/efivars is no
longer accessible).

GRUB installation on EFI systems without /sys/firmware/efi/efivars
present warns with (also see https://sources.debian.org/src/grub2/2.04-20/debian/patches/efi-variable-storage-minimise-writes.patch/?hl=650#L650):

| EFI variables are not supported on this system

But it returns with exit code 0. This leaves us with an incomplete and
therefore not booting GRUB EFI environment. Fix it by unmounting
/sys/firmware/efi/efivars only from within our final stage.

2 years agoInstall dbus by default
Michael Prokop [Mon, 2 Aug 2021 09:48:52 +0000 (11:48 +0200)]
Install dbus by default

Without dbus, several systemd features aren't available (e.g.
systemd-logind and its HandlePowerKey=poweroff doesn't have any effect).
We agreed to ship dbus by default, as people want usable, not minimal
systems most of the time.

Closes: grml/grml-debootstrap#102

2 years agopacker: update VBoxGuestAdditions to v6.1.22 + Grml ISO to latest stable release...
Michael Prokop [Mon, 26 Jul 2021 09:59:00 +0000 (11:59 +0200)]
packer: update VBoxGuestAdditions to v6.1.22 + Grml ISO to latest stable release (2021.07)

2 years agoRelease new version 0.98 v0.98
Michael Prokop [Fri, 9 Jul 2021 07:08:58 +0000 (09:08 +0200)]
Release new version 0.98

2 years agoFix git version detection when executing in foreign git repository
Michael Prokop [Thu, 24 Jun 2021 17:16:51 +0000 (19:16 +0200)]
Fix git version detection when executing in foreign git repository

When the working directory is a foreign git repository (other than
grml-debootstrap.git), and grml-debootstrap is invoked with the full
path pointing towards grml-debootstrap.git, then we're relying on `git
describe` output of the other (foreign) repository, which is failing and
reporting an unknown version.

Demonstration:

| % cd "$(mktemp -d)"
| % git init
| Initialized empty Git repository in /tmp/tmp.2TQO7PZPQX/.git/
| % ~/src/grml/grml-debootstrap/grml-debootstrap --version
| fatal: No names found, cannot describe anything.
|  * grml-debootstrap - version unknown
|  * Report bugs via https://github.com/grml/grml-debootstrap/ or https://grml.org/bugs/

... and also:

| % cd "$(mktemp -d)"
| % git init
| Initialized empty Git repository in /tmp/tmp.Y15j7wMMOn/.git/
| % echo foo > foo
| % git add foo ; git commit -m 'foo'
| [main (root-commit) 5d4357c] foo
|  1 file changed, 1 insertion(+)
|  create mode 100644 foo
| % git tag 0.42
| % ~/src/grml/grml-debootstrap/grml-debootstrap --version
| fatal: No annotated tags can describe '5d4357c0b5bb504e610265904619287be2c6718d'.
| However, there were unannotated tags: try --tags.
|  * grml-debootstrap - version unknown
|  * Report bugs via https://github.com/grml/grml-debootstrap/ or https://grml.org/bugs/

Thanks: Paul Menzel for the bugreport
Closes: grml/grml-debootstrap#183

2 years agoMerge remote-tracking branch 'origin/pr/177'
Michael Prokop [Fri, 4 Jun 2021 08:50:45 +0000 (10:50 +0200)]
Merge remote-tracking branch 'origin/pr/177'

2 years agoMerge remote-tracking branch 'origin/pr/176'
Michael Prokop [Fri, 4 Jun 2021 08:50:43 +0000 (10:50 +0200)]
Merge remote-tracking branch 'origin/pr/176'

2 years agoMerge remote-tracking branch 'origin/pr/175'
Michael Prokop [Fri, 4 Jun 2021 08:50:41 +0000 (10:50 +0200)]
Merge remote-tracking branch 'origin/pr/175'

2 years agoconfig: Replace em dash — by `--` for switch in comment
Paul Menzel [Thu, 3 Jun 2021 14:39:18 +0000 (16:39 +0200)]
config: Replace em dash — by `--` for switch in comment

Fixes: d88d27d7 ("drop enabled config variables from config file and use defaults")

2 years agoRemove *os-prober* from shipped packages list
Paul Menzel [Wed, 2 Jun 2021 15:49:58 +0000 (17:49 +0200)]
Remove *os-prober* from shipped packages list

This follows up on commit 9ae6b12a ("Avoid installation of os-proper in
VM environments"). *os-prober* is recommended by *grub-pc*, so do not
list it explicitly, in case alternatives arise, and the recommended
packages of *grub-pc* are adapted.

2 years agoSupport XFS in VMs by including xfs driver in grub-mkimage
Paul Menzel [Wed, 2 Jun 2021 14:18:41 +0000 (16:18 +0200)]
Support XFS in VMs by including xfs driver in grub-mkimage

Follow commit 01b5b0ff ("Support F2FS in VMs by including f2fs driver in
grub-mkimage") to support XFS. I’d say, open-coding three entries is
alright but for more entries a generic solution would be nice.

2 years agoCorrect indentation in switch statement
Paul Menzel [Wed, 2 Jun 2021 14:16:54 +0000 (16:16 +0200)]
Correct indentation in switch statement

Fixes: 01b5b0ff ("Support F2FS in VMs by including f2fs driver in grub-mkimage")

2 years agoRelease new version 0.97 v0.97
Michael Prokop [Tue, 1 Jun 2021 05:45:36 +0000 (07:45 +0200)]
Release new version 0.97

2 years agoMerge remote-tracking branch 'origin/pr/174'
Michael Prokop [Mon, 31 May 2021 07:23:36 +0000 (09:23 +0200)]
Merge remote-tracking branch 'origin/pr/174'

2 years agoEFI support: check + mount efivarfs to support Debian kernels >=5.10 mika/efivarfs
Michael Prokop [Thu, 27 May 2021 13:28:14 +0000 (15:28 +0200)]
EFI support: check + mount efivarfs to support Debian kernels >=5.10

CONFIG_EFI_VARS is no longer available since
https://salsa.debian.org/kernel-team/linux/-/commit/20146398c4599147244ed3ffc54f38d07fb8dea3
(tagged initially as debian/5.10.1-1_exp1 + shipped with kernel package
5.10.1-1~exp1 and newer, incl. 5.10.38-1 as present in current
Debian/unstable). Therefore the kernel module efivars is no longer
available on more recent Debian kernel systems.

Quoting from https://wiki.debian.org/UEFI:

| The older interface was efivars, showing files under
| /sys/firmware/efi/vars, and this is what was used by default in both
| Wheezy and Jessie.
|
| The new interface is efivarfs, which will expose things in a slightly
| different format under /sys/firmware/efi/efivars. This is the new
| preferred way of using UEFI configuration variables, and Debian switched
| to it by default from Stretch onwards.

CONFIG_EFI_VARS is no longer required, instead efivarfs seems to be
available starting with kernel v3.10 and newer (see linux.git):

| commit a9499fa7cd3fd4824a7202d00c766b269fa3bda6
| Author: Tom Gundersen <teg@jklm.no>
| Date:   Fri Feb 8 15:37:06 2013 +0000
|
|     efi: split efisubsystem from efivars
|
|     This registers /sys/firmware/efi/{,systab,efivars/} whenever EFI is enabled
|     and the system is booted with EFI.
|
|     This allows
|      *) userspace to check for the existence of /sys/firmware/efi as a way
|         to determine whether or it is running on an EFI system.
|      *) 'mount -t efivarfs none /sys/firmware/efi/efivars' without manually
|         loading any modules.
|
|     [ Also, move the efivar API into vars.c and unconditionally compile it.
|       This allows us to move efivars.c, which now only contains the sysfs
|       variable code, into the firmware/efi directory. Note that the efivars.c
|       filename is kept to maintain backwards compatability with the old
|       efivars.ko module. With this patch it is now possible for efivarfs
|       to be built without CONFIG_EFI_VARS - Matt ]

and:

| commit d68772b7c83f4b518be15ae96f4827c8ed02f684
| Author: Matt Fleming <matt.fleming@intel.com>
| Date:   Fri Feb 8 16:27:24 2013 +0000
|
|     efivarfs: Move to fs/efivarfs
|
|     Now that efivarfs uses the efivar API, move it out of efivars.c and
|     into fs/efivarfs where it belongs. This move will eventually allow us
|     to enable the efivarfs code without having to also enable
|     CONFIG_EFI_VARS built, and vice versa.
|
|     Furthermore, things like,
|
|         mount -t efivarfs none /sys/firmware/efi/efivars
|
|     will now work if efivarfs is built as a module without requiring the
|     use of MODULE_ALIAS(), which would have been necessary when the
|     efivarfs code was part of efivars.c.

Thanks to Volodymyr Fedorov + Manuel Montecelo for spotting this

2 years agoAvoid installation of os-proper in VM environments
Michael Prokop [Fri, 21 May 2021 14:35:54 +0000 (16:35 +0200)]
Avoid installation of os-proper in VM environments

os-prober is known to cause problems in certain environments,
and might cause update-grub in the chroot to hang. The os-proper
package is a recommends of the grub-common package, so let's
install grub-pc by disabling recommends.

As reported on IRC by Paul Menzel.

2 years agoBail out if architecture isn't set nor can be identified automatically
Michael Prokop [Fri, 21 May 2021 14:28:49 +0000 (16:28 +0200)]
Bail out if architecture isn't set nor can be identified automatically

If `dpkg --print-architecture` isn't available for detecting the current
architecture (e.g. on non-Debian), and neither $ARCH is set nor `--arch
...` was specified, abort and inform user about it.

Closes: grml/grml-debootstrap#173

2 years agofake-uname: fix gcc argument order and improve preloaded shared library
Michael Prokop [Thu, 29 Apr 2021 22:25:44 +0000 (00:25 +0200)]
fake-uname: fix gcc argument order and improve preloaded shared library

This includes recent changes as integrated at
https://github.com/sipwise/deployment-iso

Makefile:

- Fix gcc argument order: newer gcc versions have become more picky on
  their argument order, due to the --as-needed default, and require the
  libraries to be linked to, to be passed after the code/objects that
  use them, otherwise they will get dropped as unused. This change is
  required for compiling with gcc v10.2.1-6 as present on
  Debian/bullseye (otherwise fails to execute with `undefined symbol:
  dlsym`)
- Add `make check` target to run some basic tests
- Also get rid of *.o *.so files in clean target, adjust targets
  accordingly to always clean and then build fake-uname.so afterwards
- Mark as serial-only via .NOTPARALLEL

fake-uname.c:

- Use hidden visibility by default, and export the symbol explicitly.
- Resolve real_uname() only once.
- Return early if the real_uname() fails, to avoid acting on bogus data.
- Call dlerror() before dlsym() to clear any previous errors.
- Compute the release member size from the utsname struct instead of
  hard-coding it.
- Always NUL-terminate the relese buffer, so protect against very long
  environment strings.
- Make various variables into const.

Acked-by: Guillem Jover <gjover@sipwise.com>
Thanks: Guillem Jover

2 years agopacker: update VBoxGuestAdditions to v6.1.20
Michael Prokop [Thu, 29 Apr 2021 08:34:08 +0000 (10:34 +0200)]
packer: update VBoxGuestAdditions to v6.1.20

As present in current Debian/unstable

3 years agoRelease new version 0.96 v0.96
Michael Prokop [Mon, 19 Apr 2021 14:36:33 +0000 (16:36 +0200)]
Release new version 0.96

3 years agoUse shorter fs label for EFI partition to not break with recent dosfstools
Michael Prokop [Thu, 15 Apr 2021 16:13:40 +0000 (18:13 +0200)]
Use shorter fs label for EFI partition to not break with recent dosfstools

This used to work fine until dosfstools 4.1:

| root@grml ~ # mkfs.fat -F32 -n "EFI System Partition" /dev/loop1
| mkfs.fat 4.1 (2017-01-24)
| mkfs.fat: warning - lowercase labels might not work properly with DOS or Windows

Now with dosfstools >=4.2 it's failing though:

| root@grml ~ # mkfs.fat -F32 -n "EFI System Partition" /dev/loop1
| mkfs.fat 4.2 (2021-01-31)
| mkfs.fat: Label can be no longer than 11 characters

So instead use "EFI" as filesystem label, to not fail with newer dosfstools.

Closes: #987014
Closes: grml/grml-debootstrap#168

3 years agoRelease new version 0.95 v0.95
Michael Prokop [Fri, 22 Jan 2021 10:56:47 +0000 (11:56 +0100)]
Release new version 0.95

3 years agoMerge remote-tracking branch 'origin/pr/161'
Michael Prokop [Fri, 22 Jan 2021 10:55:14 +0000 (11:55 +0100)]
Merge remote-tracking branch 'origin/pr/161'

3 years agoF2FS filesystem doesn't support errors=remount-ro mount option
Michael Prokop [Tue, 19 Jan 2021 22:26:52 +0000 (23:26 +0100)]
F2FS filesystem doesn't support errors=remount-ro mount option

Fixes:

| [   94.941005] F2FS-fs (sda1): Unrecognized mount option "errors=remount-ro" or missing value
| mount: /: mount point not mounted or bad option

Closes: grml/grml-debootstrap#163

3 years agoSupport F2FS in VMs by including f2fs driver in grub-mkimage
Michael Prokop [Tue, 19 Jan 2021 22:18:54 +0000 (23:18 +0100)]
Support F2FS in VMs by including f2fs driver in grub-mkimage

Thanks: Paul Menzel for bugreport and bugfix
Closes: grml/grml-debootstrap#164

3 years agoDo not enable escape characters on dumb terminals
Michael Prokop [Mon, 18 Jan 2021 17:49:46 +0000 (18:49 +0100)]
Do not enable escape characters on dumb terminals

This avoids having output like follows in Jenkins console output:

| �[32;01m*�[0m grml-debootstrap [0.93] - Please recheck configuration before execution:

Closes: grml/grml-debootstrap#159

3 years agoRelease new version 0.94 v0.94
Michael Prokop [Wed, 23 Dec 2020 16:34:36 +0000 (17:34 +0100)]
Release new version 0.94

3 years agoUse bullseye as default Debian release
Michael Prokop [Wed, 23 Dec 2020 13:36:33 +0000 (14:36 +0100)]
Use bullseye as default Debian release

We want to use Debian/bullseye as default release within the
grml-debootstrap version that's going to be shipped with bullseye,
so let's be prepared for this.

FTR: *not* modifying the Travis CI related configuration files with this
change, as the unstable builds on Travis CI are known to be unreliable.
Travis CI also seems to be a dead end for us, so it's not worth putting
any further efforts into it, at least for the time being.

3 years agopacker: use latest VBoxGuestAdditions (6.1.16) + Grml stable release (2020.06)
Michael Prokop [Sat, 12 Dec 2020 15:04:26 +0000 (16:04 +0100)]
packer: use latest VBoxGuestAdditions (6.1.16) + Grml stable release (2020.06)

3 years agopacker: make template compatible with recent packer versions
Michael Prokop [Sat, 12 Dec 2020 14:51:27 +0000 (15:51 +0100)]
packer: make template compatible with recent packer versions

The packer template worked with packer v1.5.6, but fails
with more recent versions like v1.6.5.

Fixed via `packer fix debian64.json`, using packer v1.6.5.

Thanks: Darshaka Pathirana for reporting
Closes: grml/grml-debootstrap#162

3 years agoProperly handle KEEP_SRC_LIST option when set to 'no'
Michael Prokop [Fri, 4 Dec 2020 10:40:13 +0000 (11:40 +0100)]
Properly handle KEEP_SRC_LIST option when set to 'no'

If the configuration includes KEEP_SRC_LIST='no',
then it behaves as if it's set to 'yes', as we were
just checking whether it's set or not.

Closes: grml/grml-debootstrap#160

3 years agoImprove EFI detection by checking for /sys/firmware/efi
Michael Prokop [Fri, 2 Oct 2020 08:51:51 +0000 (10:51 +0200)]
Improve EFI detection by checking for /sys/firmware/efi

It might be possible that we can load the efivars module, while
/sys/firmware/efi still doesn't exist and efibootmgr then fails
to execute.

We noticed this on Hetzner's Dell PowerEdge™ R6515 DX181 server,
which was booted in BIOS mode via PXE, while the hardware itself
is EFI capable. Loading the efivars module worked there, but
invoking efibootmgr then fails, and the resulting system isn't
bootable.

Thanks: Darshaka Pathirana for reporting and feedback

3 years agoFix shellcheck issue SC2174
Michael Prokop [Thu, 3 Sep 2020 10:05:43 +0000 (12:05 +0200)]
Fix shellcheck issue SC2174

Fixes:

|    mkdir -m 0700 -p "${AUTHORIZED_KEYS_TARGET}"
|          ^-- SC2174: When used with -p, -m only applies to the deepest directory.

Closes: #158

3 years agoMerge remote-tracking branch 'origin/pr/157'
Michael Prokop [Mon, 31 Aug 2020 21:17:14 +0000 (23:17 +0200)]
Merge remote-tracking branch 'origin/pr/157'

3 years agod/rules: remove dh_make template header
Chris Hofstaedtler [Sat, 29 Aug 2020 22:44:01 +0000 (22:44 +0000)]
d/rules: remove dh_make template header

3 years agod/control: fix Vcs-Git field name
Chris Hofstaedtler [Sat, 29 Aug 2020 22:43:29 +0000 (22:43 +0000)]
d/control: fix Vcs-Git field name

3 years agod/control: Set Rules-Requires-Root: no
Chris Hofstaedtler [Sat, 29 Aug 2020 22:42:14 +0000 (22:42 +0000)]
d/control: Set Rules-Requires-Root: no

3 years agod/changelog: strip whitespace
Chris Hofstaedtler [Sat, 29 Aug 2020 22:41:41 +0000 (22:41 +0000)]
d/changelog: strip whitespace

3 years agod/control: Use debhelper-compat v13
Chris Hofstaedtler [Sat, 29 Aug 2020 22:41:06 +0000 (22:41 +0000)]
d/control: Use debhelper-compat v13

3 years agod/control: Update my name
Chris Hofstaedtler [Sat, 29 Aug 2020 22:38:13 +0000 (22:38 +0000)]
d/control: Update my name

3 years agopacker: avoid duplicate test name in debian64.bats
Michael Prokop [Tue, 9 Jun 2020 10:22:39 +0000 (12:22 +0200)]
packer: avoid duplicate test name in debian64.bats

Fixes:

| ==> virtualbox-iso: bats warning: duplicate test name(s) in /tmp/debian64.bats: test_home_directory_for_user_vagrant

3 years agopacker: use Grml 2020.06-rc1 and update VirtualBox Guest Additions
Michael Prokop [Tue, 9 Jun 2020 10:10:04 +0000 (12:10 +0200)]
packer: use Grml 2020.06-rc1 and update VirtualBox Guest Additions

While at it, drop compression_level (it's set to level 6 by default
so let's use that unless we've a good reason to choose something
different), see https://www.packer.io/docs/post-processors/vagrant/

3 years agoRelease new version 0.93 v0.93
Michael Prokop [Fri, 5 Jun 2020 12:16:01 +0000 (14:16 +0200)]
Release new version 0.93

Quoting from https://packages.qa.debian.org/g/grml-debootstrap.html

| Issues preventing migration:
| Not built on buildd: arch all binaries uploaded by mika, a new source-only upload is needed to allow migration

Sigh...

3 years agoRelease new version 0.92 v0.92
Michael Prokop [Wed, 3 Jun 2020 14:54:46 +0000 (16:54 +0200)]
Release new version 0.92

3 years agoMerge remote-tracking branch 'origin/pr/155'
Michael Prokop [Wed, 3 Jun 2020 14:44:11 +0000 (16:44 +0200)]
Merge remote-tracking branch 'origin/pr/155'

3 years agoRefactor new --sshcopyid behavior into separate cmdline option --sshcopyauth mika/gh153
Michael Prokop [Wed, 3 Jun 2020 12:16:08 +0000 (14:16 +0200)]
Refactor new --sshcopyid behavior into separate cmdline option --sshcopyauth

Related to commit 07e835eac7 and the discussion within
https://github.com/grml/grml-debootstrap/pull/153

If execution of --sshcopyid fails, then user might want to be aware of
it. So instead of implementing the copying of .ssh/authorized_keys as
fallback of --sshcopyid, let's provide it via cmdline option
--sshcopyauth.

Reviewed-by: Chris Hofstaedtler
Reviewed-by: Darshaka Pathirana
Closes: https://github.com/grml/grml-debootstrap/pull/153

3 years agoMerge remote-tracking branch 'origin/pr/153'
Michael Prokop [Wed, 3 Jun 2020 12:48:32 +0000 (14:48 +0200)]
Merge remote-tracking branch 'origin/pr/153'

3 years agoRelease new version 0.91 v0.91
Michael Prokop [Tue, 12 May 2020 15:24:11 +0000 (17:24 +0200)]
Release new version 0.91

3 years agoExecute 'wrap-and-sort -a -t -s' on debian/
Michael Prokop [Tue, 12 May 2020 15:22:41 +0000 (17:22 +0200)]
Execute 'wrap-and-sort -a -t -s' on debian/

This is much better for (code) reviews

3 years agoBump Standards-Version to 4.5.0
Michael Prokop [Tue, 12 May 2020 15:22:32 +0000 (17:22 +0200)]
Bump Standards-Version to 4.5.0

4 years agoadd .ssh/authorized_keys support for --sshcopyid
Antoine Beaupré [Tue, 25 Feb 2020 19:46:43 +0000 (14:46 -0500)]
add .ssh/authorized_keys support for --sshcopyid

We retain backwards compatibility, that is: we use keys from the agent
by default. But if unavailable, we tap into the ~/.ssh/authorized_keys
file (or whatever is specified by the $AUTHORIZED_KEYS_SOURCE
environment).

The target SSH directory can be changed with $AUTHORIZED_KEYS_TARGET.

Closes: #151

4 years agoCheck for existence of debootstrap binary after command line processing
Michael Prokop [Fri, 13 Dec 2019 13:10:19 +0000 (14:10 +0100)]
Check for existence of debootstrap binary after command line processing

When invoking grml-debootstrap as user without /usr/sbin inside $PATH,
then the debootstrap binary will not be found and executing
`grml-debootstrap --version` fails with
`debootstrap not installed`.

Closes: https://github.com/grml/grml-debootstrap/issues/147

4 years agoProvide workaround for Debian bug #918590 with lvm + udev in VM installations
Michael Prokop [Fri, 13 Dec 2019 11:13:49 +0000 (12:13 +0100)]
Provide workaround for Debian bug #918590 with lvm + udev in VM installations

We need the /run/udev bind-mount to be present also when doing VM
installations for buster and newer, otherwise the installation
takes loooong due to the:

| WARNING: Device /dev/... not initialized in udev database even after waiting 10000000 microseconds

bug. As the /run/udev bind-mount is already gone we need
to resurrect before invoking update-grub in the VM installation.

4 years agodocs: fix duplicated --efi option in usage examples
Michael Prokop [Tue, 10 Dec 2019 11:01:15 +0000 (12:01 +0100)]
docs: fix duplicated --efi option in usage examples

4 years agoRelease new version 0.90 v0.90
Michael Prokop [Tue, 22 Oct 2019 13:58:15 +0000 (15:58 +0200)]
Release new version 0.90

4 years agoBump Standards-Version to 4.4.1
Michael Prokop [Tue, 22 Oct 2019 13:57:05 +0000 (15:57 +0200)]
Bump Standards-Version to 4.4.1

4 years agoDrop debian/compat, replace with debhelper-compat
Michael Prokop [Tue, 22 Oct 2019 13:56:30 +0000 (15:56 +0200)]
Drop debian/compat, replace with debhelper-compat

Fixes package-uses-old-debhelper-compat-version lintian warning

4 years agoMerge remote-tracking branch 'origin/pr/140'
Michael Prokop [Tue, 15 Oct 2019 14:45:58 +0000 (16:45 +0200)]
Merge remote-tracking branch 'origin/pr/140'

4 years agoMerge remote-tracking branch 'origin/pr/141'
Michael Prokop [Tue, 15 Oct 2019 14:45:25 +0000 (16:45 +0200)]
Merge remote-tracking branch 'origin/pr/141'

4 years agoMerge remote-tracking branch 'origin/pr/142'
Michael Prokop [Tue, 15 Oct 2019 13:46:56 +0000 (15:46 +0200)]
Merge remote-tracking branch 'origin/pr/142'

4 years agoMerge remote-tracking branch 'origin/pr/143'
Michael Prokop [Tue, 15 Oct 2019 13:46:03 +0000 (15:46 +0200)]
Merge remote-tracking branch 'origin/pr/143'

4 years agotravis: default to buster and also use debian:buster as docker container
Michael Prokop [Wed, 21 Aug 2019 20:27:52 +0000 (22:27 +0200)]
travis: default to buster and also use debian:buster as docker container

The unstable environment seems to be flasky, though the
stretch one seems to be stable so far, let's try to update
it towards buster.

4 years ago/etc/fstab: provide header comment, pointing to man pages and systemctl daemon-reload mika/fstab
Michael Prokop [Thu, 29 Aug 2019 12:51:06 +0000 (14:51 +0200)]
/etc/fstab: provide header comment, pointing to man pages and systemctl daemon-reload

Inspired by Marc Haber's bug report #936050 and what Fedora
does with their anaconda installer.

4 years agoSupport BOOT_APPEND usage outside of VMs
Michael Prokop [Fri, 16 Aug 2019 16:36:54 +0000 (18:36 +0200)]
Support BOOT_APPEND usage outside of VMs

BOOT_APPEND works only for VMs when being invoked within
grub_install() inside main grml-debootstrap, move its
handling to chroot-script instead.

See https://github.com/grml/grml-debootstrap/issues/106

4 years agoProperly exit if GRUB installation fails mika/grub-fail
Michael Prokop [Wed, 21 Aug 2019 15:53:02 +0000 (17:53 +0200)]
Properly exit if GRUB installation fails

For example when partition table is GPT but grub installation
expects a MS-DOS partition table, then grub-install fails
but grml-debootstrap ignored this. Since the system isn't bootable
then this might go unnoticed, so properly fail as soon as grub-install
returns with exit code != 0.

4 years agotravis: ignore SC2001 which doesn't work for $CHROOT_VARIABLES handling
Michael Prokop [Wed, 21 Aug 2019 20:09:28 +0000 (22:09 +0200)]
travis: ignore SC2001 which doesn't work for $CHROOT_VARIABLES handling

SC2181 = See if you can use ${variable//search/replace} instead

This doesn't work for the $CHROOT_VARIABLES which includes
variables with strings like "/", so we can't rely on the
${variable//search/replace} approach. Quoting from
https://github.com/koalaman/shellcheck/wiki/SC2001:

| Utilizing some of the more complex capabilities of sed is
| required occasionally and it is safe to ignore SC2001.

4 years agopacker: update to grml64-full 2018.12
Michael Prokop [Fri, 12 Jul 2019 08:13:04 +0000 (10:13 +0200)]
packer: update to grml64-full 2018.12

4 years agopacker: make buster the new default Debian release
Michael Prokop [Fri, 12 Jul 2019 07:41:13 +0000 (09:41 +0200)]
packer: make buster the new default Debian release

4 years agoUse new security.debian.org repository layout for bullseye and newer
Michael Prokop [Fri, 12 Jul 2019 07:39:05 +0000 (09:39 +0200)]
Use new security.debian.org repository layout for bullseye and newer

Quoting from https://lists.debian.org/debian-devel-announce/2019/07/msg00004.html:

| over the last years we had people getting confused over <suite>-updates
| (recommended updates) and <suite>/updates (security updates).  Starting
| with Debian 11 "bullseye" we have therefore renamed the suite including
| the security updates to <suite>-security.
|
| An entry in sources.list should look like
|
|   deb http://security.debian.org/debian-security bullseye-security main
|
| For previous releases the name will not change.

4 years agopacker: support Debian 10.0 in tests
Michael Prokop [Thu, 11 Jul 2019 16:41:17 +0000 (18:41 +0200)]
packer: support Debian 10.0 in tests

Debian/buster is version "10.0".

4 years agopacker: Update VBoxGuestAdditions to v5.2.24
Michael Prokop [Thu, 11 Jul 2019 16:20:19 +0000 (18:20 +0200)]
packer: Update VBoxGuestAdditions to v5.2.24

4 years agoRelease new version 0.89 v0.89
Michael Prokop [Fri, 14 Jun 2019 12:47:14 +0000 (14:47 +0200)]
Release new version 0.89

4 years agoEnsure /etc/network exists before setting up /etc/network/interfaces mika/buster
Michael Prokop [Thu, 13 Jun 2019 09:27:45 +0000 (11:27 +0200)]
Ensure /etc/network exists before setting up /etc/network/interfaces

When grml-debootstrap is invoked with `--debopt --variant=minbase`, our
handling of /etc/network/interfaces fails, as the directory
/etc/network/ doesn't necessarily exist yet in the essential/minbase
variants (unless you explicitly install ifupdown/netbase).

Closes: #930468

4 years agoFix detection of predictable network interface names
Michael Prokop [Fri, 31 May 2019 14:41:50 +0000 (16:41 +0200)]
Fix detection of predictable network interface names

E.g. virtio drivers might have the properties ID_NET_NAME_PATH=enp0s18
and ID_NET_NAME_SLOT=ens18. If we check only for ID_NET_NAME_PATH, then
we end up with a network configuration for enp0s18, while the actual
network interface name will be ens18.

So instead look at all present network devices, iterate over them
(ignoring the virtual interfaces like bridges + vboxnet) and
check for present ID_NET_NAME_* settings, using the following precedence
(as defined in link_config_apply() of systemd/src/udev/net/link-config.c):

* ID_NET_NAME_FROM_DATABASE
* ID_NET_NAME_ONBOARD
* ID_NET_NAME_SLOT
* ID_NET_NAME_PATH
* ID_NET_NAME_MAC

Closes: #929810

5 years agoRelease new version 0.88 v0.88
Michael Prokop [Sat, 2 Mar 2019 10:27:28 +0000 (11:27 +0100)]
Release new version 0.88

5 years agodocs: fix typo mika/0.88
Michael Prokop [Sat, 2 Mar 2019 09:49:41 +0000 (10:49 +0100)]
docs: fix typo

5 years agosshcopyid option: exit if `ssh-add -L` fails to execute
Michael Prokop [Sat, 2 Mar 2019 09:40:56 +0000 (10:40 +0100)]
sshcopyid option: exit if `ssh-add -L` fails to execute

If a user requested the --sshcopyid option then it's supposed
to be run successfully, otherwise it might leave an inaccessible
system, so exit with error if execution of `ssh-add -L` fails.

While at it:

* simplify code (no need for $RC)
* don't fail if directory /root/.ssh exists already
* append keys to possibly existing /root/.ssh/authorized_keys
  file, instead of overwriting it

5 years agoMerge remote-tracking branch 'origin/pr/129'
Michael Prokop [Sat, 2 Mar 2019 09:29:47 +0000 (10:29 +0100)]
Merge remote-tracking branch 'origin/pr/129'

5 years agoMerge remote-tracking branch 'origin/pr/127'
Michael Prokop [Sat, 2 Mar 2019 09:29:42 +0000 (10:29 +0100)]
Merge remote-tracking branch 'origin/pr/127'

5 years agoAdd option --sshcopyid to authorise root login
Darshaka Pathirana [Sat, 2 Mar 2019 02:35:02 +0000 (03:35 +0100)]
Add option --sshcopyid to authorise root login

Use locally available public keys to authorise root login on the target
system.

Similar to ssh-copy-id(1) (without the -i option) it checks if `ssh-add
-L` provides any output, and if so those keys are appended to
`/root/.ssh/authorized_keys`.

Closes: grml/grml-debootstrap#128

5 years agoAdd DHCP setting for Predictable Network Interface Names
Darshaka Pathirana [Sat, 2 Mar 2019 01:22:12 +0000 (02:22 +0100)]
Add DHCP setting for Predictable Network Interface Names

Predictable Network Interface Names were missing the default
/etc/network/interfaces file when using the --defaultinterfaces option.

Added a Networking-Section in the man page to clarify how the network is
configured in the target system and fixed the documentation for the
options --vmfile and --vm. Both options automatically enable the
--defaultinterface option and not the --nointerfaces option.

Closes: grml/grml-debootstrap#126

5 years agoUpdate bug report instructions
Michael Prokop [Fri, 25 Jan 2019 10:04:14 +0000 (11:04 +0100)]
Update bug report instructions

Closes: https://github.com/grml/grml-debootstrap/pull/122
Thanks: Patrick Schleizer