FS#70234 - [mkinitcpio][deps]`mkinitcpio` actually requires `sed`, which is not in dependency list.
Attached to Project:
Arch Linux
Opened by yw662 (yw662) - Tuesday, 30 March 2021, 14:12 GMT
Last edited by Giancarlo Razzolini (grazzolini) - Wednesday, 31 March 2021, 13:23 GMT
Opened by yw662 (yw662) - Tuesday, 30 March 2021, 14:12 GMT
Last edited by Giancarlo Razzolini (grazzolini) - Wednesday, 31 March 2021, 13:23 GMT
|
Details
Description:
If `mkinitcpio` is installed without `sed`, preset files will not be generated correctly, due to [libalpm/scripts/mkinitcpio-install](https://git.archlinux.org/mkinitcpio.git/tree/libalpm/scripts/mkinitcpio-install) requires sed at line 25, which is used to generate preset files: ```bash sed "s|%PKGBASE%|${pkgbase}|g" /usr/share/mkinitcpio/hook.preset \ | install -Dm644 /dev/stdin "$preset" ``` This is not sever in most cases since sed is required by `base`, which is usually installed before `mkinitcpio`. But if a user decide to not install `base`, this can be a problem. Additional info: * package version(s) * config and/or log files etc. * link to upstream bug report, if any Steps to reproduce: * When installing archlinux, do not install `base` or `sed` on pacstrap, or, on a device without `sed` and `mkinitcpio` installed, * install (or pacstrap) `mkinitcpio` (and linux) * Take a look at `/etc/mkinitcpio.d/linux.preset` (or /mnt/etc/mkinitcpio.d/linux.preset), it will be empty. |
This task depends upon
Closed by Giancarlo Razzolini (grazzolini)
Wednesday, 31 March 2021, 13:23 GMT
Reason for closing: Won't implement
Wednesday, 31 March 2021, 13:23 GMT
Reason for closing: Won't implement
The fix is simple though:
At /PKGBUILD, line 11 or 12, add 'sed' somewhere.
I am just using it as an example, without any implication that arch should support it or not.
However, mkinitcpio does require sed anyway :-).
I absolutely promise you in very certain terms that you'll be deeply unhappy in the long run if you try to actually use a system without it installed and that system is something other than a customized embedded OS with your handpicked, stripped down software on a read-only image baked onto an appliance, which you know a priori does not and *will not ever in the future* introduce local administrator scripts which assume POSIX.
The portability assumptions of "sed is installed on all Linux and Unix-like systems" has well thought out roots, and there is a reason it is included in the (mandatory for support, if you don't like it you pick up the pieces) base metapackage. Is there something wrong with the base metapackage that you don't want to use it?
Furthermore, sed is a requirement of glibc, due to /usr/bin/locale-gen, but for obvious reasons cannot both depend on glibc and have glibc depend on it.
Nevertheless, glibc does indeed invisibly depend on it (via base), so you cannot just assume that if you uninstall mkinitcpio it is safe to uninstall sed. You will end up with every glibc update deleting all locales on your system, then failing to create new ones with the error message
en_US.UTF-8...locale-gen: line 38: sed: command not found
and immediate exit due to set -e, otherwise the next line would be:
[error] cannot open locale definition file `-c': No such file or directory
Might I ask why you are intentionally pacstrap'ing systems with deliberately broken locales?
This is mkinitcpio's pactree today:
mkinitcpio
├─gawk provides awk
│ ├─bash provides sh
│ │ ├─readline
│ │ │ ├─glibc
│ │ │ │ ├─linux-api-headers provides linux-api-headers>=4.10
│ │ │ │ ├─tzdata
│ │ │ │ └─filesystem
│ │ │ │ └─iana-etc
│ │ │ ├─ncurses
│ │ │ │ ├─glibc
│ │ │ │ └─gcc-libs
│ │ │ │ └─glibc provides glibc>=2.27
│ │ │ └─ncurses provides libncursesw.so=6-64
│ │ ├─readline provides libreadline.so=8-64
│ │ ├─glibc
│ │ └─ncurses
│ ├─glibc
│ └─mpfr
│ └─gmp provides gmp>=5.0
│ ├─gcc-libs
│ └─bash provides sh
├─mkinitcpio-busybox provides mkinitcpio-busybox>=1.19.4-2
│ ├─glibc
│ └─libxcrypt
│ └─glibc
├─kmod
│ ├─glibc
│ ├─zlib
│ │ └─glibc
│ ├─openssl
│ │ └─glibc
│ ├─xz
│ │ └─bash provides sh
│ └─zstd
│ ├─glibc
│ ├─gcc-libs
│ ├─zlib
│ ├─xz
│ └─lz4
│ └─glibc
├─util-linux provides util-linux>=2.23
│ ├─pam
│ │ ├─glibc
│ │ ├─libtirpc
│ │ │ └─krb5
│ │ │ ├─glibc
│ │ │ ├─e2fsprogs
│ │ │ │ ├─bash provides sh
│ │ │ │ └─util-linux-libs
│ │ │ ├─e2fsprogs provides libss.so=2-64
│ │ │ ├─e2fsprogs provides libcom_err.so=2-64
│ │ │ ├─libldap
│ │ │ │ ├─libsasl
│ │ │ │ │ └─openssl
│ │ │ │ └─e2fsprogs
│ │ │ └─keyutils
│ │ │ ├─glibc
│ │ │ └─bash provides sh
│ │ ├─pambase
│ │ ├─audit
│ │ │ ├─glibc
│ │ │ ├─krb5
│ │ │ └─libcap-ng
│ │ │ └─glibc
│ │ ├─audit provides libaudit.so=1-64
│ │ ├─libxcrypt
│ │ └─libxcrypt provides libcrypt.so=2-64
│ ├─shadow
│ │ ├─pam
│ │ ├─acl
│ │ │ ├─attr
│ │ │ │ └─glibc
│ │ │ └─attr provides libattr.so
│ │ ├─acl provides libacl.so=1-64
│ │ ├─audit
│ │ ├─audit provides libaudit.so=1-64
│ │ ├─libcap-ng
│ │ ├─libcap-ng provides libcap-ng.so
│ │ ├─libxcrypt
│ │ └─libxcrypt provides libcrypt.so=2-64
│ ├─coreutils
│ │ ├─glibc
│ │ ├─acl
│ │ ├─attr
│ │ ├─gmp
│ │ ├─libcap
│ │ │ ├─glibc
│ │ │ └─pam
│ │ └─openssl
│ ├─systemd-libs
│ │ ├─glibc
│ │ ├─libcap
│ │ ├─libgcrypt
│ │ │ └─libgpg-error
│ │ │ ├─glibc
│ │ │ └─bash provides sh
│ │ ├─libp11-kit
│ │ │ ├─glibc
│ │ │ ├─libtasn1
│ │ │ │ └─glibc
│ │ │ └─libffi
│ │ │ └─glibc
│ │ ├─lz4
│ │ ├─xz
│ │ └─zstd
│ ├─systemd-libs provides libsystemd.so=0-64
│ ├─systemd-libs provides libudev.so=1-64
│ ├─libcap-ng
│ ├─libxcrypt
│ ├─libxcrypt provides libcrypt.so=2-64
│ ├─util-linux-libs
│ ├─file provides libmagic.so=1-64
│ │ ├─glibc
│ │ ├─zlib
│ │ ├─xz
│ │ ├─bzip2
│ │ │ ├─glibc
│ │ │ └─bash provides sh
│ │ ├─libseccomp
│ │ │ └─glibc
│ │ └─libseccomp provides libseccomp.so=2-64
│ ├─ncurses provides libncursesw.so=6-64
│ └─readline provides libreadline.so=8-64
├─libarchive
│ ├─acl
│ ├─acl provides libacl.so=1-64
│ ├─bzip2
│ ├─expat
│ │ └─glibc
│ ├─lz4
│ ├─openssl
│ ├─xz
│ ├─zlib
│ └─zstd
├─coreutils
├─bash
├─diffutils
│ ├─glibc
│ └─bash
├─findutils
│ ├─glibc
│ └─bash provides sh
├─grep
│ ├─glibc
│ └─pcre
│ ├─gcc-libs
│ ├─readline
│ ├─zlib
│ ├─bzip2
│ └─bash
├─filesystem provides filesystem>=2011.10-1
├─zstd
└─systemd
├─acl
├─acl provides libacl.so=1-64
├─bash
├─cryptsetup
│ ├─device-mapper
│ │ ├─glibc
│ │ ├─systemd-libs
│ │ └─systemd-libs provides libudev.so=1-64
│ ├─device-mapper provides libdevmapper.so=1.02-64
│ ├─openssl
│ ├─popt
│ │ └─glibc
│ ├─util-linux-libs
│ ├─util-linux-libs provides libuuid.so=1-64
│ ├─json-c
│ │ └─glibc
│ ├─json-c provides libjson-c.so=5-64
│ ├─argon2
│ │ └─glibc
│ └─argon2 provides libargon2.so=1-64
├─cryptsetup provides libcryptsetup.so=12-64
├─dbus
│ ├─systemd-libs
│ ├─expat
│ ├─audit
│ ├─systemd-libs provides libsystemd.so=0-64
│ └─audit provides libaudit.so=1-64
├─iptables
│ ├─libnftnl
│ │ └─libmnl
│ │ └─glibc
│ ├─libpcap
│ │ ├─glibc
│ │ ├─libnl
│ │ │ └─glibc
│ │ ├─bash provides sh
│ │ └─dbus provides libdbus-1.so=3-64
│ ├─libnfnetlink
│ │ └─glibc
│ ├─libnetfilter_conntrack
│ │ ├─libnfnetlink
│ │ └─libmnl
│ └─bash
├─kbd
│ ├─glibc
│ └─pam
├─kmod
├─kmod provides libkmod.so=2-64
├─hwids
├─libcap
├─libcap provides libcap.so=2-64
├─libgcrypt
├─libxcrypt
├─libxcrypt provides libcrypt.so=2-64
├─systemd-libs
├─libidn2
│ └─libunistring
│ └─glibc
├─lz4
├─pam
├─libelf
│ ├─gcc-libs
│ ├─bzip2 provides libbz2.so=1.0-64
│ ├─curl provides libcurl.so=4-64
│ │ ├─ca-certificates
│ │ │ └─ca-certificates-mozilla
│ │ │ └─ca-certificates-utils provides ca-certificates-utils>=20181109-3
│ │ │ ├─bash
│ │ │ ├─coreutils
│ │ │ ├─findutils
│ │ │ └─p11-kit provides p11-kit>=0.23.19
│ │ │ ├─libp11-kit provides libp11-kit=0.23.22-1
│ │ │ ├─coreutils
│ │ │ ├─libp11-kit provides libp11-kit.so=0-64
│ │ │ └─systemd-libs provides libsystemd.so=0-64
│ │ ├─krb5
│ │ ├─libssh2
│ │ │ ├─openssl
│ │ │ └─zlib
│ │ ├─libssh2 provides libssh2.so=1-64
│ │ ├─openssl
│ │ ├─zlib
│ │ ├─libpsl
│ │ │ ├─libidn2
│ │ │ ├─libidn2 provides libidn2.so=0-64
│ │ │ └─libunistring
│ │ ├─libpsl provides libpsl.so=5-64
│ │ ├─libnghttp2
│ │ │ └─glibc
│ │ ├─libidn2
│ │ ├─libidn2 provides libidn2.so=0-64
│ │ └─zstd
│ ├─xz
│ ├─zlib
│ └─zstd
├─libseccomp
├─libseccomp provides libseccomp.so=2-64
├─util-linux
├─util-linux-libs provides libblkid.so=1-64
├─util-linux-libs provides libmount.so=1-64
├─xz
├─pcre2
│ ├─gcc-libs
│ ├─readline
│ ├─zlib
│ ├─bzip2
│ └─bash
├─audit
├─audit provides libaudit.so=1-64
├─libp11-kit
├─libp11-kit provides libp11-kit.so=0-64
└─openssl