Commit Graph

280 Commits

Author SHA1 Message Date
Morten Linderud
a60ad80361
pacstrap: disable DownloadUser in pacman.conf
Fixes: https://gitlab.archlinux.org/archlinux/arch-install-scripts/-/issues/68

Signed-off-by: Morten Linderud <morten@linderud.pw>
2024-10-20 20:40:09 +02:00
Morten Linderud
cafd968c2a
ci: add m4
Signed-off-by: Morten Linderud <morten@linderud.pw>
2024-09-24 10:14:15 +02:00
Morten Linderud
66f37ab075
pacstrap: disable sandbox
Fixes: https://gitlab.archlinux.org/archlinux/arch-install-scripts/-/issues/68

Signed-off-by: Morten Linderud <morten@linderud.pw>
2024-09-24 10:12:41 +02:00
Morten Linderud
b4d12c1f1e
Revert "umount lazily to avoid race conditions"
This reverts commit 46a69d58e7.
2024-09-24 10:12:32 +02:00
Morten Linderud
ddb845d2fe
Revert "umount without sleep, as umount -l detaches inmediately"
This reverts commit c2065454b4.
2024-09-24 10:12:19 +02:00
Morten Linderud
2767ea5b5e
Merge remote-tracking branch 'origin/merge-requests/60'
* origin/merge-requests/60:
  umount without sleep, as umount -l detaches inmediately
  umount lazily to avoid race conditions
2024-04-07 20:04:36 +02:00
Morten Linderud
edb5576afd
Merge remote-tracking branch 'origin/merge-requests/61'
* origin/merge-requests/61:
  doc: remove footer
  tree-wide: add SPDX headers and shebang
  tree-wide: remove vim config
  editorconfig: we use 2 spaces for shell script indentation
  github: remove CI
2024-04-07 20:03:05 +02:00
Mike Yuan
8736a1b7d5
doc: remove footer
The information it provides is completely outdated
and pretty much irrelevant these days.
2024-04-07 00:30:43 +08:00
Mike Yuan
becff9f3e3
tree-wide: add SPDX headers and shebang 2024-04-07 00:30:43 +08:00
Mike Yuan
3561b8fe2a
tree-wide: remove vim config
Nowadays we've got a proper .editorconfig,
let's make it the only source of truth and
avoid the burden of keeping everything in sync.
2024-04-07 00:30:43 +08:00
Mike Yuan
f28810a3be
editorconfig: we use 2 spaces for shell script indentation 2024-04-07 00:30:43 +08:00
Mike Yuan
33a894f409
github: remove CI
The project has been migrated to Arch Linux GitLab.
2024-04-07 00:30:42 +08:00
Alberto Salvia Novella
c2065454b4 umount without sleep, as umount -l detaches inmediately 2024-02-16 18:14:23 +01:00
Alberto Salvia Novella
46a69d58e7 umount lazily to avoid race conditions 2024-01-18 02:15:09 +01:00
Morten Linderud
22493153c7
Merge remote-tracking branch 'origin/pull/57'
* origin/pull/57:
  arch-chroot: bind mount over a /etc/resolv.conf symlink
2023-09-09 15:14:59 +02:00
Morten Linderud
efad4f1881
Merge remote-tracking branch 'origin/pull/58'
* origin/pull/58:
  common: fix unshare chroot /dev symlinks
2023-09-09 15:09:02 +02:00
Сашка724ая
dbef490b03
common: fix unshare chroot /dev symlinks
Fixes invalid symlink paths for /dev/fd, /dev/stderr, /dev/stdin, /dev/stdout in arch-chroot when run in unshare mode.

Signed-off-by: Aleksandr Ksenofontov <github@sashok724.net>
2023-09-05 10:26:55 +10:00
nl6720
4d3aec66b8
arch-chroot: bind mount over a /etc/resolv.conf symlink
Use mount's a -c/--no-canonicalize option to ensure the bind mount to
/etc/resolv.conf in the chroot directory is mounted correctly.
This avoids issues when the chroot's /etc/resolv.conf is a symlink.

Bump required util-linux version to 2.39 which supports the new mount
API.

Fixes https://github.com/archlinux/arch-install-scripts/issues/55
Related to https://github.com/util-linux/util-linux/issues/2370
2023-08-11 14:42:18 +03:00
Morten Linderud
a5b772db02
genfstab: ensure swap devices adhere to -f
Signed-off-by: Morten Linderud <morten@linderud.pw>
2023-05-26 17:01:25 +02:00
Morten Linderud
8ef909063c
Merge remote-tracking branch 'origin/pull/51'
* origin/pull/51:
  pacstrap: silence "only applied to the deepest dir"
  arch-chroot: split variable declaration and assignment
  Add gitlab-ci based on the mkinitcpio one
  Add .editorconfig, from mkinitcpio
  tests: silence "referenced but not assigned" warnings
  tests: remove non-applicable ${1} handling
  common: split genfstab only helpers
  common: quote all arguments
  common: disable shellcheck SC2059
  common: remove unused msg2()
  common: remove unused is_array()
2023-05-05 22:10:12 +02:00
Emil Velikov
3abde514b4 pacstrap: silence "only applied to the deepest dir"
Shellcheck warns that only the deepest directory created will have the
requested permissions. That's fine - this is exactly what we want.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2023-05-03 13:46:34 +01:00
Emil Velikov
abef18a432 arch-chroot: split variable declaration and assignment
As suggested by shellcheck:

In arch-chroot line 164:
  local src=$(resolve_link /etc/resolv.conf)
        ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values.

In arch-chroot line 165:
  local dest=$(resolve_link "$chrootdir/etc/resolv.conf" "$chrootdir")
        ^--^ SC2155 (warning): Declare and assign separately to avoid masking return values.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2023-05-03 13:46:34 +01:00
Emil Velikov
45a2073e33 Add gitlab-ci based on the mkinitcpio one
The in-tree config was seemingly never tested, since it fails loudly.
Copy/paste the mkinitcpio one and drop the non-applicable bat/coverage
sections.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2023-05-03 13:46:34 +01:00
Emil Velikov
d05e136ac2 Add .editorconfig, from mkinitcpio
Direct copy from mkinitcpio.

Note that the in-tree code-base consistently uses 2 space and redoing
that will be done at misc later point.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2023-05-03 13:46:34 +01:00
Emil Velikov
12733c86cb tests: silence "referenced but not assigned" warnings
The optstring* helpers do the assignment, which isn't particularly easy
for shellcheck to deduce. So silence the warnings.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2023-05-03 13:46:34 +01:00
Emil Velikov
3d05834dba tests: remove non-applicable ${1} handling
The arg was never set. Furthermore as-is shellcheck cannot realistically
evaluate the included source.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2023-05-03 13:46:34 +01:00
Emil Velikov
0c848b83b5 common: split genfstab only helpers
v2: drop warning and msg from fstab-helpers

v3: drop m4 -> sed conversion

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2023-05-03 13:46:15 +01:00
Emil Velikov
9f5888d4f2 common: quote all arguments
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2023-05-01 11:32:26 +01:00
Emil Velikov
b4490d003e common: disable shellcheck SC2059
As the inline comment says, the arguments are the actual modifiers.
Shout out to YHNdnzj for spotting this o/

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2023-05-01 11:32:26 +01:00
Emil Velikov
c239649760 common: remove unused msg2()
The function has been unused ever since it was introduced

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2023-05-01 11:32:26 +01:00
Emil Velikov
77e0895696 common: remove unused is_array()
The function hasn't been in use for a number of years.

Cc: Dave Reisner <dreisner@archlinux.org>
Fixes: b240f6e ("common: declare pseudofs types as hash")
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2023-05-01 11:32:26 +01:00
Morten Linderud
77c3cc7c1b
Merge remote-tracking branch 'origin/pull/50'
* origin/pull/50:
  arch-chroot: add option to preserve the chroot resolv.conf
2023-04-02 01:24:25 +02:00
Emil Velikov
aeaecf5ae5 arch-chroot: add option to preserve the chroot resolv.conf
There is a comprehensive inline comment about why we're touching the
chroot resolv.conf. Although it does not consider the cases where:
 - the link may be broken for specific reasons, and/or
 - working resolver within the chroot is not wanted

v2:
 - flip the condition check

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2023-03-29 21:28:31 +01:00
Morten Linderud
7e4e1c1bbf
Merge remote-tracking branch 'origin/pull/49'
* origin/pull/49:
  pacstrap: error out earlier, on invalid directory
  pacstrap: delay selecting chroot/unshare setup
  pacstrap: stop interleaving functions and sequential code
  pacstrap: move include_m4 after the globals
  genfstab: reshuffle while read loop
  arch-chroot: delay selecting chroot/unshare setup
  arch-chroot: stop interleaving functions and sequential code
  arch-chroot: move include_m4 after the globals
2023-03-29 20:44:23 +02:00
Morten Linderud
0feec4a50a
common: ensure /run is mounted with --make-private
udev doesn't work in the chroot which prevents some tools like lsblk to
retrieve the UUID of devices. This can be a bit problematic so instead
of having /run mounted as a tmpfs, do a bind-mound from the rootfs and
include `--make-private`.

This is similar to the previous implemention.

Fixes https://github.com/archlinux/arch-install-scripts/issues/24
Fixes https://github.com/archlinux/arch-install-scripts/pull/26
2023-03-26 20:03:51 +02:00
Emil Velikov
c72a394de7 pacstrap: error out earlier, on invalid directory
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2023-03-26 19:03:33 +01:00
Emil Velikov
8af3fa3b8e pacstrap: delay selecting chroot/unshare setup
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2023-03-26 19:03:33 +01:00
Emil Velikov
c911fbf92a pacstrap: stop interleaving functions and sequential code
Makes it easier to reason about the code.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2023-03-26 19:03:33 +01:00
Emil Velikov
6c68163d4b pacstrap: move include_m4 after the globals
After the m4 substitution, the globals end up mixed misc functions.
Just keep them at the top for legibility.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2023-03-26 19:03:33 +01:00
Emil Velikov
b07a1578d9 genfstab: reshuffle while read loop
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2023-03-26 19:03:33 +01:00
Emil Velikov
3a8e3de608 arch-chroot: delay selecting chroot/unshare setup
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2023-03-26 19:03:32 +01:00
Emil Velikov
a6765cc5c4 arch-chroot: stop interleaving functions and sequential code
Makes it easier to reason about the code.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2023-03-26 18:52:34 +01:00
Emil Velikov
7101c552a0 arch-chroot: move include_m4 after the globals
After the m4 substitution, the globals end up mixed misc functions.
Just keep them at the top for legibility.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2023-03-26 18:52:34 +01:00
Morten Linderud
f5acbb9058
Merge remote-tracking branch 'origin/pull/48'
* origin/pull/48:
  zsh: pacstrap bring it up-to date
  zsh: genfstab bring it up-to date
  zsh: arch-chroot bring it up-to date
  zsh: simplify arch-chroot and genfstab completion
  zsh: split completion into separate files
  make: move bash/zsh completions to separate directories
2023-03-26 19:41:43 +02:00
Morten Linderud
bc2a9a7cae
Merge remote-tracking branch 'origin/pull/47'
* origin/pull/47:
  make: add shellcheck target
  make: add more PHONY targets
  make: remove dummy uninstall target
2023-03-26 19:40:26 +02:00
Morten Linderud
c465332a17
Merge remote-tracking branch 'origin/pull/44'
* origin/pull/44:
  genfstab: remove atgc mount option
2023-03-26 19:40:09 +02:00
Morten Linderud
be937006c8
Merge remote-tracking branch 'origin/pull/45'
* origin/pull/45:
  ci: update differential-shellcheck
2023-03-26 19:39:46 +02:00
Emil Velikov
20a193d5b1 zsh: pacstrap bring it up-to date
Copy/pasta all the new options that have landed over the years.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2023-03-26 17:13:06 +01:00
Emil Velikov
a9768a0c45 zsh: genfstab bring it up-to date
Add the -f(ilter) and -t(ag) options. The latter being mutually
exclusive with -L/-U.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2023-03-26 17:13:06 +01:00
Emil Velikov
1ad274a58e zsh: arch-chroot bring it up-to date
Add -N (simple flag) -u (user/group), plus new directory and command
handling. The vast chunk of these are borrowed by the chroot completion,
as the inline comment indicates.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2023-03-26 17:13:06 +01:00