Merge pull request #1282 from friberk/master

lvm2, mkinitcpio, man-pages rebuild
This commit is contained in:
Berk Çakar
2021-09-14 23:52:16 +03:00
committed by GitHub
20 changed files with 494 additions and 243 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ def install():
autotools.rawInstall("DESTDIR=%s" % get.installDIR())
pisitools.removeDir("/usr/lib/kernel")
pisitools.removeDir("/usr/lib/tmpfiles.d")
pisitools.removeDir("/etc/mkinitcpio.d")
pisitools.remove("/usr/lib/initcpio/install/sd-*")
pisitools.removeDir("/usr/share/libalpm")
+6
View File
@@ -0,0 +1,6 @@
#!/usr/bin/python
import os
def postInstall(fromVersion, fromRelease, toVersion, toRelease):
os.system("/sbin/mudur_tmpfiles.py /usr/lib/tmpfiles.d/mkinitcpio.conf")
@@ -4,14 +4,7 @@
# Udev rules for LVM.
#
# Scan all block devices having a PV label for LVM metadata.
# Store this information in LVMetaD (the LVM metadata daemon) and maintain LVM
# metadata state for improved performance by avoiding further scans while
# running subsequent LVM commands or while using lvm2app library.
# Also, notify LVMetaD about any relevant block device removal.
#
# This rule is essential for having the information in LVMetaD up-to-date.
# It also requires blkid to be called on block devices before so only devices
# This rule requires blkid to be called on block devices before so only devices
# used as LVM PVs are processed (ID_FS_TYPE="LVM2_member" or "LVM1_member").
SUBSYSTEM!="block", GOTO="lvm_end"
@@ -19,8 +12,7 @@ SUBSYSTEM!="block", GOTO="lvm_end"
ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="lvm_end"
# If the PV label got lost, inform lvmetad immediately.
# Detect the lost PV label by comparing previous ID_FS_TYPE value with current one.
# Detect removed PV label by comparing previous ID_FS_TYPE value with current one.
ENV{.ID_FS_TYPE_NEW}="$env{ID_FS_TYPE}"
IMPORT{db}="ID_FS_TYPE"
ENV{ID_FS_TYPE}=="LVM2_member|LVM1_member", ENV{.ID_FS_TYPE_NEW}!="LVM2_member|LVM1_member", ENV{LVM_PV_GONE}="1"
@@ -31,7 +23,6 @@ ENV{LVM_PV_GONE}=="1", GOTO="lvm_scan"
ENV{ID_FS_TYPE}!="LVM2_member|LVM1_member", GOTO="lvm_end"
ENV{DM_MULTIPATH_DEVICE_PATH}=="1", GOTO="lvm_end"
# Inform lvmetad about any PV that is gone.
ACTION=="remove", GOTO="lvm_scan"
# Create /dev/disk/by-id/lvm-pv-uuid-<PV_UUID> symlink for each PV
@@ -68,26 +59,68 @@ ACTION=="change", ENV{LVM_LOOP_PV_ACTIVATED}!="1", TEST=="loop/backing_file", EN
ENV{LVM_LOOP_PV_ACTIVATED}!="1", ENV{SYSTEMD_READY}="0"
GOTO="lvm_end"
# If the PV is not a special device listed above, scan only after device addition (ADD event)
# If the PV is not a special device listed above, scan only if necessary.
# For "systemd_background" mode, systemd takes care of this by activating
# the lvm2-pvscan@.service only once.
LABEL="next"
ACTION!="add", GOTO="lvm_end"
LABEL="lvm_scan"
# The table below summarises the situations in which we reach the LABEL="lvm_scan".
ENV{SYSTEMD_READY}="1"
# The method for invoking pvscan is selected at build time with the option
# --(enable|disable)-udev-systemd-background-jobs to "configure".
# On modern distributions with recent systemd, it's "systemd_background";
# on others, "direct_pvscan".
GOTO="direct_pvscan"
LABEL="systemd_background"
# The table below summarises the situations in which we reach the LABEL="lvm_scan"
# in the "systemd_background" case.
# Marked by X, X* means only if the special dev is properly set up.
# The artificial ADD is supported for coldplugging. We avoid running the pvscan
# on artificial CHANGE so there's no unexpected autoactivation when WATCH rule fires.
# N.B. MD and loop never actually reaches lvm_scan on REMOVE as the PV label is gone
# within a CHANGE event (these are caught by the "LVM_PV_GONE" rule at the beginning).
#
# In this case, we simply set up the dependency between the device and the pvscan
# job using SYSTEMD_ALIAS (which sets up a simplified device identifier that
# allows using "BindsTo" in the sytemd unit file) and SYSTEMD_WANTS (which tells
# systemd to start the pvscan job once the device is ready).
# We need to set these variables for both "add" and "change" events, otherwise
# systemd may loose information about the device/unit dependencies.
#
# | real ADD | real CHANGE | artificial ADD | artificial CHANGE | REMOVE
# =============================================================================
# DM | | X | X* | | X
# MD | | X | X* | |
# loop | | X | X* | |
# other | X | X | X | | X
ACTION!="remove", ENV{LVM_PV_GONE}=="1", RUN+="/usr/bin/systemd-run /usr/sbin/lvm pvscan --cache $major:$minor", GOTO="lvm_end"
ENV{SYSTEMD_ALIAS}="/dev/block/$major:$minor"
ENV{SYSTEMD_WANTS}+="lvm2-pvscan@$major:$minor.service"
GOTO="lvm_end"
# FIXME: this mode is not used and should be removed.
LABEL="direct_pvscan"
# The table below summarises the situations in which we reach the LABEL="lvm_scan"
# for the "direct_pvscan" case.
# Marked by X, X* means only if the special dev is properly set up.
# The artificial ADD is supported for coldplugging. We avoid running the pvscan
# on artificial CHANGE so there's no unexpected autoactivation when WATCH rule fires.
#
# In this case, we need to make sure that pvscan is not invoked spuriously, therefore
# we invoke it only for "add" events for "other" devices.
#
# | real ADD | real CHANGE | artificial ADD | artificial CHANGE | REMOVE
# =============================================================================
# DM | | X | X* | | X
# MD | | X | X* | |
# loop | | X | X* | |
# other | X | | X | | X
ENV{SYSTEMD_READY}="1"
RUN+="/usr/bin/lvm pvscan --background --cache --activate ay --major $major --minor $minor", ENV{LVM_SCANNED}="1"
RUN+="/usr/sbin/lvm pvscan --background --cache --activate ay --major $major --minor $minor", ENV{LVM_SCANNED}="1"
LABEL="lvm_end"
+7 -9
View File
@@ -11,7 +11,6 @@ build() {
# binaries from lvm2
add_binary "lvm"
add_binary "lvmetad"
# beinaries from device-mapper
add_binary "dmsetup"
@@ -23,15 +22,14 @@ build() {
done
# udev rules and lvm configuration
add_file "/usr/lib/udev/rules.d/10-dm.rules"
add_file "/usr/lib/udev/rules.d/11-dm-lvm.rules"
add_file "/usr/lib/udev/rules.d/13-dm-disk.rules"
add_file "/usr/lib/udev/rules.d/95-dm-notify.rules"
add_file "/usr/lib/initcpio/udev/11-dm-initramfs.rules" "/usr/lib/udev/rules.d/11-dm-initramfs.rules"
add_file "/usr/lib/initcpio/udev/69-dm-lvm-metad.rules" "/usr/lib/udev/rules.d/69-dm-lvm-metad.rules"
add_file "/lib/udev/rules.d/10-dm.rules"
add_file "/lib/udev/rules.d/11-dm-lvm.rules"
add_file "/lib/udev/rules.d/13-dm-disk.rules"
add_file "/lib/udev/rules.d/95-dm-notify.rules"
add_file "/usr/lib/initcpio/udev/11-dm-initramfs.rules" "/lib/udev/rules.d/11-dm-initramfs.rules"
add_file "/usr/lib/initcpio/udev/69-dm-lvm-metad.rules" "/lib/udev/rules.d/69-dm-lvm-metad.rules"
add_file "/etc/lvm/lvm.conf"
add_runscript
sed -i '/^\smonitoring =/s/1/0/' "${BUILDROOT}/etc/lvm/lvm.conf"
}
help() {
@@ -0,0 +1,67 @@
# vim:set ft=sh
# MODULES
# The following modules are loaded before any boot hooks are
# run. Advanced users may wish to specify all system modules
# in this array. For instance:
# MODULES=(piix ide_disk reiserfs)
MODULES=()
# BINARIES
# This setting includes any additional binaries a given user may
# wish into the CPIO image. This is run last, so it may be used to
# override the actual binaries included by a given hook
# BINARIES are dependency parsed, so you may safely ignore libraries
BINARIES=()
# FILES
# This setting is similar to BINARIES above, however, files are added
# as-is and are not parsed in any way. This is useful for config files.
FILES=()
# HOOKS
# This is the most important setting in this file. The HOOKS control the
# modules and scripts added to the image, and what happens at boot time.
# Order is important, and it is recommended that you do not change the
# order in which HOOKS are added. Run 'mkinitcpio -H <hook name>' for
# help on a given hook.
# 'base' is _required_ unless you know precisely what you are doing.
# 'udev' is _required_ in order to automatically load modules
# 'filesystems' is _required_ unless you specify your fs modules in MODULES
# Examples:
## This setup specifies all modules in the MODULES setting above.
## No raid, lvm2, or encrypted root is needed.
# HOOKS=(base)
#
## This setup will autodetect all modules for your system and should
## work as a sane default
# HOOKS=(base udev autodetect block filesystems)
#
## This setup will generate a 'full' image which supports most systems.
## No autodetection is done.
# HOOKS=(base udev block filesystems)
#
## This setup assembles a pata mdadm array with an encrypted root FS.
## Note: See 'mkinitcpio -H mdadm' for more information on raid devices.
# HOOKS=(base udev block mdadm encrypt filesystems)
#
## This setup loads an lvm2 volume group on a usb device.
# HOOKS=(base udev block lvm2 filesystems)
#
## NOTE: If you have /usr on a separate partition, you MUST include the
# usr, fsck and shutdown hooks.
HOOKS=(base udev autodetect modconf block lvm2 filesystems keyboard resume fsck)
# COMPRESSION
# Use this to compress the initramfs image. By default, gzip compression
# is used. Use 'cat' to create an uncompressed image.
#COMPRESSION="zstd"
#COMPRESSION="gzip"
#COMPRESSION="bzip2"
#COMPRESSION="lzma"
#COMPRESSION="xz"
#COMPRESSION="lzop"
#COMPRESSION="lz4"
# COMPRESSION_OPTIONS
# Additional options for the compressor
#COMPRESSION_OPTIONS=()
@@ -0,0 +1,13 @@
diff --git a/init_functions b/init_functions
index 8ad10c7..e8a88d8 100644
--- a/init_functions
+++ b/init_functions
@@ -477,6 +477,7 @@ mount_setup() {
mount -t proc proc /proc -o nosuid,noexec,nodev
mount -t sysfs sys /sys -o nosuid,noexec,nodev
mount -t devtmpfs dev /dev -o mode=0755,nosuid
+ mkdir -m 0755 /dev/pts && mount -t devpts -o gid=5,mode=620 devpts /dev/pts
mount -t tmpfs run /run -o nosuid,nodev,mode=0755
mkdir -m755 /run/initramfs
--
+14 -3
View File
@@ -19,6 +19,7 @@
<Patches>
<Patch level="1">nosystemd.patch</Patch>
<Patch level="1">gzip-default.patch</Patch>
<Patch level="1">mount-dev-pts.patch</Patch>
</Patches>
</Source>
@@ -26,6 +27,7 @@
<Name>mkinitcpio</Name>
<RuntimeDependencies>
<Dependency>busybox-mkinitcpio</Dependency>
<Dependency>lvm2</Dependency>
</RuntimeDependencies>
<Conflicts>
<Package>mkinitramfs</Package>
@@ -34,9 +36,9 @@
<Files>
<Path fileType="data">/etc/initcpio</Path>
<Path fileType="config">/etc/mkinitcpio.conf</Path>
<Path fileType="config">/etc/mkinitcpio.d</Path>
<Path fileType="executable">/usr/bin</Path>
<Path fileType="library">/usr/lib/initcpio</Path>
<Path fileType="data">/usr/lib/tmpfiles.d/mkinitcpio.conf</Path>
<Path fileType="data">/usr/share/bash-completion</Path>
<Path fileType="doc">/usr/share/doc</Path>
<Path fileType="man">/usr/share/man</Path>
@@ -57,15 +59,24 @@
<AdditionalFile owner="root" permission="0644" target="/usr/lib/initcpio/install/zfs">zfs_install</AdditionalFile>
<AdditionalFile owner="root" permission="0644" target="/usr/lib/initcpio/hooks/live">live_hook</AdditionalFile>
<AdditionalFile owner="root" permission="0644" target="/usr/lib/initcpio/install/live">live_install</AdditionalFile>
<AdditionalFile owner="root" permission="0644" target="/usr/lib/initcpio/udev/10-dm-initramfs.rules">10-dm-initramfs.rules</AdditionalFile>
<AdditionalFile owner="root" permission="0644" target="/usr/lib/initcpio/udev/70-dm-lvm-metad.rules">70-dm-lvm-metad.rules</AdditionalFile>
<AdditionalFile owner="root" permission="0644" target="/usr/lib/initcpio/udev/11-dm-initramfs.rules">11-dm-initramfs.rules</AdditionalFile>
<AdditionalFile owner="root" permission="0644" target="/usr/lib/initcpio/udev/69-dm-lvm-metad.rules">69-dm-lvm-metad.rules</AdditionalFile>
<AdditionalFile owner="root" permission="0644" target="/etc/mkinitcpio.conf">mkinitcpio.conf</AdditionalFile>
</AdditionalFiles>
<Provides>
<COMAR script="package.py">System.Package</COMAR>
<COMAR script="pakhandler.py">System.PackageHandler</COMAR>
</Provides>
</Package>
<History>
<Update release="11">
<Date>2021-09-13</Date>
<Version>30</Version>
<Comment>Rebuild</Comment>
<Name>Berk Çakar</Name>
<Email>berk2238@hotmail.com</Email>
</Update>
<Update release="10">
<Date>2021-09-13</Date>
<Version>30</Version>