mirror of
https://gitdl.cn/https://github.com/chakralinux/core.git
synced 2025-02-13 23:34:03 +08:00
systemd: update to 210
This commit is contained in:
parent
71e564d011
commit
0f17961edb
@ -1,7 +1,7 @@
|
|||||||
# maintainer: Fabian Kosmale <inkane@chakra-project.org>
|
# maintainer: Fabian Kosmale <inkane@chakra-project.org>
|
||||||
pkgname=systemd
|
pkgname=systemd
|
||||||
pkgver=210
|
pkgver=210
|
||||||
pkgrel=1
|
pkgrel=2
|
||||||
pkgdesc="A system and service manager for Linux"
|
pkgdesc="A system and service manager for Linux"
|
||||||
arch=('x86_64')
|
arch=('x86_64')
|
||||||
url="http://www.freedesktop.org/wiki/Software/systemd"
|
url="http://www.freedesktop.org/wiki/Software/systemd"
|
||||||
@ -29,13 +29,11 @@ install="systemd.install"
|
|||||||
options=('!libtool')
|
options=('!libtool')
|
||||||
source=("http://www.freedesktop.org/software/$pkgname/$pkgname-$pkgver.tar.xz"
|
source=("http://www.freedesktop.org/software/$pkgname/$pkgname-$pkgver.tar.xz"
|
||||||
'initcpio-hook-udev'
|
'initcpio-hook-udev'
|
||||||
'use-split-usr-path.patch'
|
|
||||||
'initcpio-install-udev'
|
'initcpio-install-udev'
|
||||||
'initcpio-install-systemd'
|
'initcpio-install-systemd'
|
||||||
'99-default.preset')
|
'99-default.preset')
|
||||||
md5sums=('a07619bb19f48164fbf0761d12fd39a8'
|
md5sums=('03efddf8c9eca36d4d590f9967e7e818'
|
||||||
'e99e9189aa2f6084ac28b8ddf605aeb8'
|
'e99e9189aa2f6084ac28b8ddf605aeb8'
|
||||||
'21572b99173a7cdeaff965e0a5e9182b'
|
|
||||||
'fb37e34ea006c79be1c54cbb0f803414'
|
'fb37e34ea006c79be1c54cbb0f803414'
|
||||||
'9027b31a875e74a45623954b3b23d09f'
|
'9027b31a875e74a45623954b3b23d09f'
|
||||||
'a1bf25da736d3719e9720b2e4caea341')
|
'a1bf25da736d3719e9720b2e4caea341')
|
||||||
@ -43,8 +41,6 @@ md5sums=('a07619bb19f48164fbf0761d12fd39a8'
|
|||||||
build() {
|
build() {
|
||||||
|
|
||||||
cd "$pkgname-$pkgver"
|
cd "$pkgname-$pkgver"
|
||||||
patch -p1 -i "$srcdir/use-split-usr-path.patch"
|
|
||||||
autoreconf
|
|
||||||
|
|
||||||
./configure \
|
./configure \
|
||||||
PYTHON=python2 \
|
PYTHON=python2 \
|
||||||
@ -53,9 +49,11 @@ build() {
|
|||||||
--localstatedir=/var \
|
--localstatedir=/var \
|
||||||
--sysconfdir=/etc \
|
--sysconfdir=/etc \
|
||||||
--enable-introspection \
|
--enable-introspection \
|
||||||
|
--enable-compat-libs \
|
||||||
--disable-gtk-doc \
|
--disable-gtk-doc \
|
||||||
--disable-audit \
|
--disable-audit \
|
||||||
--disable-ima \
|
--disable-ima \
|
||||||
|
--disable-kdbus \
|
||||||
--with-sysvinit-path= \
|
--with-sysvinit-path= \
|
||||||
--with-sysvrcnd-path= \
|
--with-sysvrcnd-path= \
|
||||||
--with-firmware-path=/usr/lib/firmware/updates:/lib/firmware/updates:/usr/lib/firmware:/lib/firmware
|
--with-firmware-path=/usr/lib/firmware/updates:/lib/firmware/updates:/usr/lib/firmware:/lib/firmware
|
||||||
@ -84,6 +82,9 @@ package() {
|
|||||||
# udevd is no longer udevd because systemd. why isn't udevadm now udevctl?
|
# udevd is no longer udevd because systemd. why isn't udevadm now udevctl?
|
||||||
ln -s ../lib/systemd/systemd-udevd "$pkgdir/usr/bin/udevd"
|
ln -s ../lib/systemd/systemd-udevd "$pkgdir/usr/bin/udevd"
|
||||||
|
|
||||||
|
# get rid of RPM macros
|
||||||
|
rm -r "$pkgdir/usr/lib/rpm"
|
||||||
|
|
||||||
# add back tmpfiles.d/legacy.conf
|
# add back tmpfiles.d/legacy.conf
|
||||||
install -m644 "systemd-$pkgver/tmpfiles.d/legacy.conf" "$pkgdir/usr/lib/tmpfiles.d"
|
install -m644 "systemd-$pkgver/tmpfiles.d/legacy.conf" "$pkgdir/usr/lib/tmpfiles.d"
|
||||||
|
|
||||||
@ -96,6 +97,14 @@ package() {
|
|||||||
install -Dm644 "$srcdir/initcpio-install-udev" "$pkgdir/usr/lib/initcpio/install/udev"
|
install -Dm644 "$srcdir/initcpio-install-udev" "$pkgdir/usr/lib/initcpio/install/udev"
|
||||||
install -Dm644 "$srcdir/initcpio-hook-udev" "$pkgdir/usr/lib/initcpio/hooks/udev"
|
install -Dm644 "$srcdir/initcpio-hook-udev" "$pkgdir/usr/lib/initcpio/hooks/udev"
|
||||||
install -Dm644 "$srcdir/initcpio-install-systemd" "$pkgdir/usr/lib/initcpio/install/systemd"
|
install -Dm644 "$srcdir/initcpio-install-systemd" "$pkgdir/usr/lib/initcpio/install/systemd"
|
||||||
|
|
||||||
|
|
||||||
|
# ensure proper permissions for /var/log/journal
|
||||||
|
chown root:systemd-journal "$pkgdir/var/log/journal"
|
||||||
|
chmod 2755 "$pkgdir/var/log/journal"
|
||||||
|
|
||||||
|
# fix pam file
|
||||||
|
sed 's|system-auth|system-login|g' -i "$pkgdir/etc/pam.d/systemd-user"
|
||||||
|
|
||||||
# Chakra specific .preset
|
# Chakra specific .preset
|
||||||
install -Dm644 "$srcdir/99-default.preset" "$pkgdir/usr/lib/systemd/system-preset/99-default.preset"
|
install -Dm644 "$srcdir/99-default.preset" "$pkgdir/usr/lib/systemd/system-preset/99-default.preset"
|
||||||
|
@ -4,35 +4,108 @@ sd_booted() {
|
|||||||
[ -e sys/fs/cgroup/systemd ]
|
[ -e sys/fs/cgroup/systemd ]
|
||||||
}
|
}
|
||||||
|
|
||||||
post_install() {
|
|
||||||
udevadm hwdb --update
|
add_privs() {
|
||||||
|
if ! setcap "$2" "$1" 2>/dev/null; then
|
||||||
|
echo "==> Warning: setcap failed, falling back to setuid root on /$1"
|
||||||
|
chmod u+s "$1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
add_journal_acls() {
|
||||||
|
# ignore errors, since the filesystem might not support ACLs
|
||||||
|
setfacl -Rnm g:wheel:rx,d:g:wheel:rx,g:adm:rx,d:g:adm:rx /var/log/journal/ 2>/dev/null
|
||||||
|
:
|
||||||
|
}
|
||||||
|
|
||||||
|
maybe_reexec() {
|
||||||
|
# don't reexec on 210-1 upgrade due to large infrastructural changes (we skipped the previous ones, so this line isn't the same as Arch's).
|
||||||
|
if [ "$(vercmp 210-1 "$2")" -eq 1 ]; then
|
||||||
|
echo ':: systemd has not been reexecuted. It is recommended that you'
|
||||||
|
echo ' reboot at your earliest convenience.'
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
if sd_booted; then
|
if sd_booted; then
|
||||||
systemctl --system daemon-reexec
|
systemctl --system daemon-reexec
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
_dir_empty() {
|
||||||
|
set -- "$1"/*
|
||||||
|
[ ! -e "$1" ] && [ ! -L "$1" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
post_common() {
|
||||||
|
systemd-machine-id-setup
|
||||||
|
|
||||||
|
add_privs usr/bin/systemd-detect-virt 'cap_dac_override,cap_sys_ptrace+ep'
|
||||||
|
|
||||||
|
udevadm hwdb --update
|
||||||
|
journalctl --update-catalog
|
||||||
|
}
|
||||||
|
|
||||||
|
_208_changes() {
|
||||||
|
chown root:systemd-journal var/log/journal
|
||||||
|
chmod 2755 var/log/journal
|
||||||
|
|
||||||
|
if [ -e var/lib/backlight ] && [ ! -e var/lib/systemd/backlight ]; then
|
||||||
|
mv -T var/lib/backlight var/lib/systemd/backlight
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -e var/lib/random-seed ] && [ ! -e var/lib/systemd/random-seed ]; then
|
||||||
|
mv -T var/lib/random-seed var/lib/systemd/random-seed
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
_209_changes() {
|
||||||
|
# attempt to preserve existing behavior
|
||||||
|
|
||||||
|
local old_rule=etc/udev/rules.d/80-net-name-slot.rules
|
||||||
|
local new_rule=etc/udev/rules.d/80-net-setup-link.rules
|
||||||
|
|
||||||
|
echo ":: Network device naming is now controlled by udev's net_setup_link"
|
||||||
|
echo " builtin. Refer to the NETWORK LINK CONFIGURATION section of the"
|
||||||
|
echo " udev manpage for a full description."
|
||||||
|
|
||||||
|
# not clear what action we can take here, so don't do anything
|
||||||
|
[[ -e $new_rule ]] && return 0
|
||||||
|
|
||||||
|
# rename the old rule to the new one so that we preserve the user's
|
||||||
|
# existing option.
|
||||||
|
if [[ -e $old_rule ]]; then
|
||||||
|
printf ':: Renaming %s to %s in order\n' "${old_rule##*/}" "${new_rule##*/}"
|
||||||
|
printf ' to preserve existing network naming behavior.\n'
|
||||||
|
mv -v "$old_rule" "$new_rule"
|
||||||
|
else
|
||||||
|
echo ':: No changes have been made to your network naming configuration.'
|
||||||
|
echo ' Interfaces should continue to maintain the same names.'
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
post_install() {
|
||||||
|
post_common "$@"
|
||||||
|
|
||||||
|
add_journal_acls
|
||||||
|
|
||||||
|
# enable getty@tty1 by default, but don't track the file
|
||||||
|
systemctl enable getty@tty1.service
|
||||||
}
|
}
|
||||||
|
|
||||||
post_upgrade() {
|
post_upgrade() {
|
||||||
udevadm hwdb --update
|
post_common "$@"
|
||||||
|
|
||||||
journalctl --update-catalog
|
maybe_reexec "$@"
|
||||||
|
|
||||||
if [ "$(pacman -Q systemd | cut -d " " -f2 | cut -d "-" -f1)" = "196" ] ; then
|
if [ "$(vercmp 210-1 "$2")" -eq 1 ]; then
|
||||||
echo -e '\e[31;46m WARNING'
|
printf '==> systemd >= 205 restructures the cgroup hierarchy and changes internal\n'
|
||||||
echo -e '\e[31;46m Systemd 197 has moved to persistent network naming, for most users this will have'
|
printf ' protocols. You should reboot at your earliest convenience.\n'
|
||||||
echo -e '\e[31;46m no effect. To check what the new name for your network device will be, run:'
|
|
||||||
echo -e '\e[31;46m hwinfo --network, and look for: Device File: xxxxx, were xxxx is your device.'
|
_208_changes
|
||||||
echo -e '\e[31;46m This will be used in /usr/lib/udev/rules.d/80-net-name-slot.rules '
|
|
||||||
echo -e '\e[31;46m If you use dhcpcd instead of networkmanager to connect, re-enable the service before rebooting'
|
add_journal_acls
|
||||||
echo -e '\e[31;46m Configuration files like conky.conf will need the new naming scheme too'
|
|
||||||
echo -e '\e[31;46m http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames \e[0m'
|
_209_changes
|
||||||
fi
|
|
||||||
|
|
||||||
if sd_booted; then
|
|
||||||
systemctl --system daemon-reexec
|
|
||||||
systemctl restart systemd-logind.service
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user