From b337e72ead1e9a6620dfc503c6992df672276e1c Mon Sep 17 00:00:00 2001 From: Michael Shigorin Date: Mon, 3 Jun 2013 12:03:23 +0400 Subject: [PATCH] initial init feature This one is finally there and should help reduce the systemd-induced mess in package lists and specifications. --- conf.d/regular.mk | 5 ++-- conf.d/test.mk | 6 ++--- features.in/init/README | 11 ++++++++ features.in/init/config.mk | 14 +++++++++++ .../init/rootfs/image-scripts.d/90-init | 25 +++++++++++++++++++ features.in/slinux/config.mk | 2 +- features.in/systemd/README | 4 +-- features.in/systemd/config.mk | 5 ++-- .../live/image-scripts.d/20-systemd-locale | 4 --- .../systemd/stage2/image-scripts.d/50-fstab | 4 --- lib/ve.mk | 8 ++++-- pkg.in/lists/systemd | 4 +++ pkg.in/lists/sysvinit | 3 +++ 13 files changed, 74 insertions(+), 21 deletions(-) create mode 100644 features.in/init/README create mode 100644 features.in/init/config.mk create mode 100755 features.in/init/rootfs/image-scripts.d/90-init delete mode 100755 features.in/systemd/live/image-scripts.d/20-systemd-locale delete mode 100755 features.in/systemd/stage2/image-scripts.d/50-fstab create mode 100644 pkg.in/lists/systemd create mode 100644 pkg.in/lists/sysvinit diff --git a/conf.d/regular.mk b/conf.d/regular.mk index d2440a35..7a208542 100644 --- a/conf.d/regular.mk +++ b/conf.d/regular.mk @@ -19,7 +19,7 @@ distro/.regular-base: distro/.regular-bare +vmguest +live \ # DE base target # TODO: use/plymouth/live when luks+plymouth is done, see also #28255 distro/.regular-desktop: distro/.regular-base \ - use/systemd use/syslinux/ui/gfxboot use/firmware/laptop use/efi/refind + use/syslinux/ui/gfxboot use/firmware/laptop use/efi/refind +systemd @$(call add,LIVE_PACKAGES,fuse-exfat) @$(call add,LIVE_LISTS,domain-client) @$(call add,THE_BRANDING,bootloader) @@ -27,7 +27,8 @@ distro/.regular-desktop: distro/.regular-base \ distro/.regular-gtk: distro/.regular-desktop use/x11/lightdm/gtk +plymouth; @: -distro/regular-icewm: distro/.regular-base use/x11/lightdm/gtk +icewm +distro/regular-icewm: distro/.regular-base use/init/sysv \ + use/x11/lightdm/gtk +icewm @$(call add,LIVE_LISTS,$(call tags,regular icewm)) @$(call set,KFLAVOURS,un-def) diff --git a/conf.d/test.mk b/conf.d/test.mk index 85ca3db7..ab9a1e0d 100644 --- a/conf.d/test.mk +++ b/conf.d/test.mk @@ -6,7 +6,7 @@ ifeq (distro,$(IMAGE_CLASS)) distro/syslinux-auto: distro/.init use/hdt use/syslinux/timeout/1; @: distro/syslinux-noescape: distro/syslinux-auto use/syslinux/noescape.cfg; @: -distro/live-systemd: distro/.base use/live/base use/systemd; @: +distro/live-systemd: distro/.base use/live/base +systemd; @: distro/live-plymouth: distro/.live-base use/plymouth/live; @: distro/live-isomd5sum: distro/.base use/live/base use/isomd5sum @@ -26,7 +26,7 @@ distro/razorqt-kz: distro/regular-razorqt @$(call set,GLOBAL_BOOT_LANG,kk_KZ) @$(call add,LIVE_PACKAGES,hunspell-kk) -distro/server-systemd: distro/server-mini use/systemd +distro/server-systemd: distro/server-mini +systemd @$(call set,KFLAVOURS,std-def) distro/server-test: distro/server-mini use/relname @@ -42,7 +42,7 @@ distro/server-ovz-netinst: distro/.base sub/stage1 use/stage2 \ @$(call add,SYSLINUX_CFG,netinstall2) distro/desktop-luks: distro/icewm use/luks; @: -distro/desktop-systemd: distro/icewm use/systemd; @: +distro/desktop-systemd: distro/icewm +systemd; @: distro/desktop-plymouth: distro/icewm +plymouth; @: distro/live-mate-systemd: distro/live-mate use/systemd use/live/install; @: distro/server-efi: distro/server-mini use/efi/debug; @: diff --git a/features.in/init/README b/features.in/init/README new file mode 100644 index 00000000..24cfc093 --- /dev/null +++ b/features.in/init/README @@ -0,0 +1,11 @@ +Эта фича определяет систему инициализации, которая будет использована +в пользовательской среде (livecd, установленный дистрибутив, vm). +Она не влияет на состав инсталятора и rescue-образа. + +Обратите внимание: как и с use/bootloader/%, в силу особенностей make +переключение в каждую позицию возможно лишь один раз, далее эта цель +считается достигнутой и при последующих вызовах не отрабатывает. + +См. тж.: +http://altlinux.org/sysvinit +http://altlinux.org/systemd diff --git a/features.in/init/config.mk b/features.in/init/config.mk new file mode 100644 index 00000000..a93ba651 --- /dev/null +++ b/features.in/init/config.mk @@ -0,0 +1,14 @@ ++sysvinit: use/init/sysv; @: ++systemd: use/init/systemd; @: + +use/init: + @$(call add_feature) + @$(call add,THE_LISTS,$$(INIT_TYPE)) + +use/init/sysv: use/init + @$(call set,INIT_TYPE,sysvinit) + +### i-f should be dropped as soon as rootfs scripts are effective there +use/init/systemd: use/init + @$(call set,INIT_TYPE,systemd) + @$(call add,BASE_PACKAGES,installer-feature-systemd-stage3) diff --git a/features.in/init/rootfs/image-scripts.d/90-init b/features.in/init/rootfs/image-scripts.d/90-init new file mode 100755 index 00000000..6e6ee9a2 --- /dev/null +++ b/features.in/init/rootfs/image-scripts.d/90-init @@ -0,0 +1,25 @@ +#!/bin/sh + +# the part below relates to systemd as init specifically +rpm -q systemd-sysvinit || exit 0 + +# file str [str...] +# NB: str is also treated as a regex, +# be careful if you copy the function +sub() { + local file="$1" + shift + for i in "$@"; do + grep -q "^$i" "$file" || echo "$i" >> "$file" + done +} + +# tune make-initrd +sub /etc/initrd.mk 'FEATURES += systemd' 'MODULES_PRELOAD += autofs4' + +# don't allow systemd to set LANG (see also #27408) +sub /etc/locale.conf 'LANG=' + +# aufs2 root is rw in reality; but don't bother if there's a record already +grep -q '[[:space:]]/[[:space:]]' /etc/fstab || + sub /etc/fstab '/dev/root / auto defaults 0 0' diff --git a/features.in/slinux/config.mk b/features.in/slinux/config.mk index bec3cbc6..764f9f50 100644 --- a/features.in/slinux/config.mk +++ b/features.in/slinux/config.mk @@ -15,6 +15,6 @@ use/slinux: use/x11/xfce use/x11/gdm2.20 @$(call add,THE_LISTS,$(call tags,base l10n)) @$(call set,META_VOL_SET,Simply Linux) -use/slinux/full: use/isohybrid use/slinux use/systemd +wireless \ +use/slinux/full: use/isohybrid use/slinux +systemd +wireless \ use/branding/complete use/x11/drm use/x11/3d-proprietary @$(call add,THE_PACKAGES,apt-conf-sisyphus) diff --git a/features.in/systemd/README b/features.in/systemd/README index 821ca23a..824715b2 100644 --- a/features.in/systemd/README +++ b/features.in/systemd/README @@ -1,2 +1,2 @@ -Эта фича заменяет в базовой системе sysvinit на systemd; -см. тж. http://www.altlinux.org/systemd +Эта фича заменяла в базовой системе sysvinit на systemd; +в настоящее время является устаревшей, см. ../init/ diff --git a/features.in/systemd/config.mk b/features.in/systemd/config.mk index 5555f99d..4d590f85 100644 --- a/features.in/systemd/config.mk +++ b/features.in/systemd/config.mk @@ -1,4 +1,3 @@ -use/systemd: +use/systemd: use/init/systemd @$(call add_feature) - @$(call add,COMMON_PACKAGES,systemd systemd-units systemd-sysvinit) - @$(call add,COMMON_PACKAGES,installer-feature-systemd-stage3 chkconfig) + @$(warning deprecated, see init feature) diff --git a/features.in/systemd/live/image-scripts.d/20-systemd-locale b/features.in/systemd/live/image-scripts.d/20-systemd-locale deleted file mode 100755 index 002fc10c..00000000 --- a/features.in/systemd/live/image-scripts.d/20-systemd-locale +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -# Don't allow systemd to set LANG. - -echo 'LANG=' >/etc/locale.conf diff --git a/features.in/systemd/stage2/image-scripts.d/50-fstab b/features.in/systemd/stage2/image-scripts.d/50-fstab deleted file mode 100755 index 7fae3a64..00000000 --- a/features.in/systemd/stage2/image-scripts.d/50-fstab +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -efu -# aufs2 root is rw in reality - -echo "/dev/root / auto defaults 0 0" >>/etc/fstab diff --git a/lib/ve.mk b/lib/ve.mk index b6d1aa2a..7b4605f5 100644 --- a/lib/ve.mk +++ b/lib/ve.mk @@ -10,9 +10,13 @@ ifeq (ve,$(IMAGE_CLASS)) ve/.bare: profile/bare @$(call add,BASE_PACKAGES,basesystem) +# add those +ve/.base: ve/.bare + @$(call add,BASE_PACKAGES,etcnet apt) + # no "vzctl enter" -ve/bare: ve/.bare - @$(call add,BASE_PACKAGES,sysvinit etcnet apt) +ve/bare: ve/.base + @$(call add,BASE_PACKAGES,sysvinit) # /dev/pty and friends start here ve/base: ve/bare diff --git a/pkg.in/lists/systemd b/pkg.in/lists/systemd new file mode 100644 index 00000000..59b3f2d2 --- /dev/null +++ b/pkg.in/lists/systemd @@ -0,0 +1,4 @@ +systemd +systemd-units +systemd-sysvinit +chkconfig diff --git a/pkg.in/lists/sysvinit b/pkg.in/lists/sysvinit new file mode 100644 index 00000000..a8d076c6 --- /dev/null +++ b/pkg.in/lists/sysvinit @@ -0,0 +1,3 @@ +sysvinit +sysklogd +interactivesystem