From f74694ae9067dcb5a66c27deca0b29b0cafd58e6 Mon Sep 17 00:00:00 2001 From: Caleb Connolly Date: Thu, 20 Feb 2025 12:23:00 +0000 Subject: [PATCH] postmarketos-base: move sshd config drop-in from base-ui Introduce a new postmarketos-base-ssh subpackage to contain this config file, since we ALWAYS want this when openssh-server-pam is installed, even if we don't have base-ui (e.g. because someone installed openssh on top of a "none" install). Signed-off-by: Caleb Connolly Part-of: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/6239 --- main/postmarketos-base-ui/APKBUILD | 4 +--- ...hd_config.d-50-postmarketos-ui-policy.conf | 1 - main/postmarketos-base/APKBUILD | 22 ++++++++++++++++--- ...hd_config.d-50-postmarketos-ui-policy.conf | 4 ++++ 4 files changed, 24 insertions(+), 7 deletions(-) delete mode 100644 main/postmarketos-base-ui/rootfs-etc-ssh-sshd_config.d-50-postmarketos-ui-policy.conf create mode 100644 main/postmarketos-base/rootfs-etc-ssh-sshd_config.d-50-postmarketos-ui-policy.conf diff --git a/main/postmarketos-base-ui/APKBUILD b/main/postmarketos-base-ui/APKBUILD index 572f603c6..cb5065805 100644 --- a/main/postmarketos-base-ui/APKBUILD +++ b/main/postmarketos-base-ui/APKBUILD @@ -1,6 +1,6 @@ # Maintainer: Clayton Craft pkgname=postmarketos-base-ui -pkgver=38 +pkgver=39 pkgrel=0 pkgdesc="Meta package for minimal postmarketOS UI base" url="https://postmarketos.org" @@ -82,7 +82,6 @@ _source644=" usr/share/mkinitfs/files/10-wireless-regdb.files " _source600=" - etc/ssh/sshd_config.d/50-postmarketos-ui-policy.conf usr/lib/NetworkManager/system-connections/USB_Networking.nmconnection " _source755=" @@ -324,7 +323,6 @@ d4b4c4fed2dee7266f6a87ae266691377593014943e2953e4cd87a59f3110f25bfb5f3f866cc8435 54620e508a5070ec8819e3661e592acfcfd26c52170b0ecc4dbbc1c61998963ce20bf9d9b051a608b76d6fc17e61c65decc16602b7d58061b9149667a968d258 rootfs-usr-share-flatpak-remotes.d-flathub.flatpakrepo 92930f027626825b027f585a9be180f8a6ebae6dc44d2cf8f9d43cce00db8cbb43c33fc341fe382abacb832ea1b6414dc4c8129d265b0258d096599b2e206a93 rootfs-usr-share-wireplumber-wireplumber.conf.d-50-bluetooth.conf 66a7a72746e822676d0ec76160e39b65c711e574a6334f3aad38c563d3104b33d0619d50b92c9201546fd81bfd10cfe0e4a59278cbcbddf20a238f6ad71c050c rootfs-usr-share-mkinitfs-files-10-wireless-regdb.files -824dd5cdd1353b0d4c43f6580572c804eaf8f165c3cc737901abdf1303412f68ac0192044e8d50773bdb3873e687d0ccddd433080f5f108ca5837db76f164dab rootfs-etc-ssh-sshd_config.d-50-postmarketos-ui-policy.conf 1b8add60574ec4644197cb93263c0653325c2e88e03673de918be5fb3280c7b81e8e97dce498850a07f2f3307771c44f3c876922e5cbd5207523ede31816296f rootfs-usr-lib-NetworkManager-system-connections-USB_Networking.nmconnection ecaa57d033a119a53a6574c27636b7c89d659d75ea48a973a6a4ff6f90e5d07202529fd489bfc9dfc7430f5b60f40612f6d5c06f7fab47e681b0a3112a874058 rootfs-etc-tinydm.d-env-wayland.d-50-sdl-wayland.sh 36e0037f6d26a99db7b47831263be610d594e2c1c4a8ee7f6fc8b41092f501d3064d80b80ddf6a82b616bd2da09aa4da896074ad9f7fd53aba7e397da4190d22 rootfs-usr-lib-NetworkManager-dispatcher.d-50-dns-filter.sh diff --git a/main/postmarketos-base-ui/rootfs-etc-ssh-sshd_config.d-50-postmarketos-ui-policy.conf b/main/postmarketos-base-ui/rootfs-etc-ssh-sshd_config.d-50-postmarketos-ui-policy.conf deleted file mode 100644 index 6ac35e318..000000000 --- a/main/postmarketos-base-ui/rootfs-etc-ssh-sshd_config.d-50-postmarketos-ui-policy.conf +++ /dev/null @@ -1 +0,0 @@ -UsePAM yes diff --git a/main/postmarketos-base/APKBUILD b/main/postmarketos-base/APKBUILD index 040e43877..adc6777e4 100644 --- a/main/postmarketos-base/APKBUILD +++ b/main/postmarketos-base/APKBUILD @@ -1,6 +1,6 @@ pkgname=postmarketos-base -pkgver=43 -pkgrel=5 +pkgver=44 +pkgrel=0 pkgdesc="Meta package for minimal postmarketOS base" url="https://postmarketos.org" arch="noarch" @@ -29,6 +29,7 @@ subpackages=" $pkgname-nftables $pkgname-nftables-openrc:nftables_openrc $pkgname-openrc + $pkgname-ssh " options="!check" @@ -48,6 +49,9 @@ _source440=" etc/sudoers etc/doas.d/10-postmarketos.conf " +_source600=" + etc/ssh/sshd_config.d/50-postmarketos-ui-policy.conf + " _source644=" etc/apk/config etc/conf.d/swapfile @@ -84,7 +88,7 @@ flatpath() { done } -source="$(flatpath $_source440 $_source644 $_source755)" +source="$(flatpath $_source440 $_source600 $_source644 $_source755)" prepare() { default_prepare @@ -98,6 +102,9 @@ package() { for i in $_source440; do install -Dm440 "$srcdir/$(flatpath "$i")" "$pkgdir/$i" done + for i in $_source600; do + install -Dm600 "$srcdir/$(flatpath "$i")" "$pkgdir/$i" + done for i in $_source644; do install -Dm644 "$srcdir/$(flatpath "$i")" "$pkgdir/$i" done @@ -132,6 +139,14 @@ nftables_openrc() { mkdir -p "$subpkgdir" } +ssh() { + install_if="$pkgname=$pkgver-r$pkgrel openssh-server-pam" + # Config file moved from there + replaces="postmarketos-base-ui" + + amove etc/ssh/sshd_config.d/50-postmarketos-ui-policy.conf +} + openrc() { install_if="$pkgname=$pkgver-r$pkgrel openrc" install="$subpkgname.post-install $subpkgname.post-upgrade" @@ -163,6 +178,7 @@ openrc() { sha512sums=" e529f5cef1f31481b577f99b8917704f2cfefb963d98bf40a14b017938e55a00134d2033f81d2cb0b8489c5e9b4a92fdc0a788013f1adb4cd46d9580c9988186 rootfs-etc-sudoers ab09e67203bb82226b0c9e600c8bc231a5c0111977b80edb355e55be101d008ac3c06798c263f0ca50e203758e1bfbf25767ad12f2654d082fb007c0411bbd1f rootfs-etc-doas.d-10-postmarketos.conf +1d2975e7e2745020f88fac639021cc9a47b477fb0390c3e146a070d98faab32c3f1c7bd1121f45a26be97301ab65c736ae0a4905d28a7251919a1994895f9c8d rootfs-etc-ssh-sshd_config.d-50-postmarketos-ui-policy.conf 224d58717f7f95851c91914753f4aefaf8964a2e62350ed898783c295c509cdadd85c325ee00baceb21ff2763ca2f4c7b1478a5638eb7d86836f91336b739376 rootfs-etc-apk-config e0d2d48b82a03239a4c0a00acaf83e00d397c23a8d7c71053d4e2a383357c22dcedef9e81b0e12a1d7514e1fdbe0bb3eb82613d18b29034a7ce5447f13c84a53 rootfs-etc-conf.d-swapfile a286c261dbab800b4bd2891c679cae1fbbf3e3169014bf7e89451961bbd3cbe0f6e34465cd1409aa4373f32ed74f38eb042b166767512be9ee7104e26cd712fa rootfs-etc-conf.d-zram-init diff --git a/main/postmarketos-base/rootfs-etc-ssh-sshd_config.d-50-postmarketos-ui-policy.conf b/main/postmarketos-base/rootfs-etc-ssh-sshd_config.d-50-postmarketos-ui-policy.conf new file mode 100644 index 000000000..3e2470a97 --- /dev/null +++ b/main/postmarketos-base/rootfs-etc-ssh-sshd_config.d-50-postmarketos-ui-policy.conf @@ -0,0 +1,4 @@ +# We use PAM for authentication so that the user environment +# is set up correctly (XDG_RUNTIME_PATH, etc). Otherwise +# things like systemctl don't work as expected +UsePAM yes