From 4343bc8d270dfff583efdec0740492f142b997b7 Mon Sep 17 00:00:00 2001 From: Andrea Brancaleoni Date: Wed, 24 Jun 2015 23:54:11 +0200 Subject: [PATCH] New package: mkinitcpio-18 --- srcpkgs/mkinitcpio-encrypt | 1 + srcpkgs/mkinitcpio-lvm2 | 1 + srcpkgs/mkinitcpio-mdadm | 1 + srcpkgs/mkinitcpio-udev | 1 + .../mkinitcpio/files/11-dm-initramfs.rules | 3 + .../mkinitcpio/files/69-dm-lvm-metad.rules | 93 + srcpkgs/mkinitcpio/files/encrypt_hook | 139 ++ srcpkgs/mkinitcpio/files/encrypt_install | 44 + srcpkgs/mkinitcpio/files/kernel-hook-postinst | 15 + srcpkgs/mkinitcpio/files/kernel-hook-postrm | 13 + srcpkgs/mkinitcpio/files/lvm.conf | 1587 +++++++++++++++++ srcpkgs/mkinitcpio/files/lvm2_hook | 12 + srcpkgs/mkinitcpio/files/lvm2_install | 34 + srcpkgs/mkinitcpio/files/mdadm_hook | 49 + srcpkgs/mkinitcpio/files/mdadm_install | 46 + srcpkgs/mkinitcpio/files/mdadm_udev_install | 25 + srcpkgs/mkinitcpio/files/udev_hook | 20 + srcpkgs/mkinitcpio/files/udev_install | 27 + ...onditional-leading-to-spurious-error.patch | 39 + .../patches/default-to-runit-init.patch | 25 + srcpkgs/mkinitcpio/template | 67 + 21 files changed, 2242 insertions(+) create mode 120000 srcpkgs/mkinitcpio-encrypt create mode 120000 srcpkgs/mkinitcpio-lvm2 create mode 120000 srcpkgs/mkinitcpio-mdadm create mode 120000 srcpkgs/mkinitcpio-udev create mode 100644 srcpkgs/mkinitcpio/files/11-dm-initramfs.rules create mode 100644 srcpkgs/mkinitcpio/files/69-dm-lvm-metad.rules create mode 100644 srcpkgs/mkinitcpio/files/encrypt_hook create mode 100644 srcpkgs/mkinitcpio/files/encrypt_install create mode 100644 srcpkgs/mkinitcpio/files/kernel-hook-postinst create mode 100644 srcpkgs/mkinitcpio/files/kernel-hook-postrm create mode 100644 srcpkgs/mkinitcpio/files/lvm.conf create mode 100644 srcpkgs/mkinitcpio/files/lvm2_hook create mode 100644 srcpkgs/mkinitcpio/files/lvm2_install create mode 100644 srcpkgs/mkinitcpio/files/mdadm_hook create mode 100644 srcpkgs/mkinitcpio/files/mdadm_install create mode 100644 srcpkgs/mkinitcpio/files/mdadm_udev_install create mode 100644 srcpkgs/mkinitcpio/files/udev_hook create mode 100644 srcpkgs/mkinitcpio/files/udev_install create mode 100644 srcpkgs/mkinitcpio/patches/avoid-compound-conditional-leading-to-spurious-error.patch create mode 100644 srcpkgs/mkinitcpio/patches/default-to-runit-init.patch create mode 100644 srcpkgs/mkinitcpio/template diff --git a/srcpkgs/mkinitcpio-encrypt b/srcpkgs/mkinitcpio-encrypt new file mode 120000 index 00000000000..dd6b17ac57d --- /dev/null +++ b/srcpkgs/mkinitcpio-encrypt @@ -0,0 +1 @@ +mkinitcpio \ No newline at end of file diff --git a/srcpkgs/mkinitcpio-lvm2 b/srcpkgs/mkinitcpio-lvm2 new file mode 120000 index 00000000000..dd6b17ac57d --- /dev/null +++ b/srcpkgs/mkinitcpio-lvm2 @@ -0,0 +1 @@ +mkinitcpio \ No newline at end of file diff --git a/srcpkgs/mkinitcpio-mdadm b/srcpkgs/mkinitcpio-mdadm new file mode 120000 index 00000000000..dd6b17ac57d --- /dev/null +++ b/srcpkgs/mkinitcpio-mdadm @@ -0,0 +1 @@ +mkinitcpio \ No newline at end of file diff --git a/srcpkgs/mkinitcpio-udev b/srcpkgs/mkinitcpio-udev new file mode 120000 index 00000000000..dd6b17ac57d --- /dev/null +++ b/srcpkgs/mkinitcpio-udev @@ -0,0 +1 @@ +mkinitcpio \ No newline at end of file diff --git a/srcpkgs/mkinitcpio/files/11-dm-initramfs.rules b/srcpkgs/mkinitcpio/files/11-dm-initramfs.rules new file mode 100644 index 00000000000..d2c16732452 --- /dev/null +++ b/srcpkgs/mkinitcpio/files/11-dm-initramfs.rules @@ -0,0 +1,3 @@ +# needed with new udev/mkinitcpio and as implemented in dracut: +# +SUBSYSTEM=="block", KERNEL=="dm-[0-9]*", ACTION=="add|change", OPTIONS="db_persist" diff --git a/srcpkgs/mkinitcpio/files/69-dm-lvm-metad.rules b/srcpkgs/mkinitcpio/files/69-dm-lvm-metad.rules new file mode 100644 index 00000000000..c032108b46b --- /dev/null +++ b/srcpkgs/mkinitcpio/files/69-dm-lvm-metad.rules @@ -0,0 +1,93 @@ +# Copyright (C) 2012 Red Hat, Inc. All rights reserved. +# +# This file is part of LVM2. + +# 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 +# used as LVM PVs are processed (ID_FS_TYPE="LVM2_member" or "LVM1_member"). + +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. +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" +ENV{ID_FS_TYPE}="$env{.ID_FS_TYPE_NEW}" +ENV{LVM_PV_GONE}=="1", GOTO="lvm_scan" + +# Only process devices already marked as a PV - this requires blkid to be called before. +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- symlink for each PV +ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-id/lvm-pv-uuid-$env{ID_FS_UUID_ENC}" + +# If the PV is a special device listed below, scan only if the device is +# properly activated. These devices are not usable after an ADD event, +# but they require an extra setup and they are ready after a CHANGE event. +# Also support coldplugging with ADD event but only if the device is already +# properly activated. +# This logic should be eventually moved to rules where those particular +# devices are processed primarily (MD and loop). + +# DM device: +KERNEL!="dm-[0-9]*", GOTO="next" +ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}=="1", ENV{DM_ACTIVATION}=="1", GOTO="lvm_scan" +GOTO="lvm_end" + +# MD device: +LABEL="next" +KERNEL!="md[0-9]*", GOTO="next" +IMPORT{db}="LVM_MD_PV_ACTIVATED" +ACTION=="add", ENV{LVM_MD_PV_ACTIVATED}=="1", GOTO="lvm_scan" +ACTION=="change", ENV{LVM_MD_PV_ACTIVATED}!="1", TEST=="md/array_state", ENV{LVM_MD_PV_ACTIVATED}="1", GOTO="lvm_scan" +ACTION=="add", KERNEL=="md[0-9]*p[0-9]*", GOTO="lvm_scan" +ENV{LVM_MD_PV_ACTIVATED}!="1", ENV{SYSTEMD_READY}="0" +GOTO="lvm_end" + +# Loop device: +LABEL="next" +KERNEL!="loop[0-9]*", GOTO="next" +ACTION=="add", ENV{LVM_LOOP_PV_ACTIVATED}=="1", GOTO="lvm_scan" +ACTION=="change", ENV{LVM_LOOP_PV_ACTIVATED}!="1", TEST=="loop/backing_file", ENV{LVM_LOOP_PV_ACTIVATED}="1", GOTO="lvm_scan" +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) +LABEL="next" +ACTION!="add", GOTO="lvm_end" + +LABEL="lvm_scan" + +# The table below summarises the situations in which we reach the LABEL="lvm_scan". +# 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). +# +# | 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" + +LABEL="lvm_end" diff --git a/srcpkgs/mkinitcpio/files/encrypt_hook b/srcpkgs/mkinitcpio/files/encrypt_hook new file mode 100644 index 00000000000..819c4cf60fe --- /dev/null +++ b/srcpkgs/mkinitcpio/files/encrypt_hook @@ -0,0 +1,139 @@ +#!/usr/bin/ash + +run_hook() { + modprobe -a -q dm-crypt >/dev/null 2>&1 + [ "${quiet}" = "y" ] && CSQUIET=">/dev/null" + + # Get keyfile if specified + ckeyfile="/crypto_keyfile.bin" + if [ -n "$cryptkey" ]; then + IFS=: read ckdev ckarg1 ckarg2 </dev/null 2>&1 + umount /ckey + ;; + *) + # Read raw data from the block device + # ckarg1 is numeric: ckarg1=offset, ckarg2=length + dd if="$resolved" of="$ckeyfile" bs=1 skip="$ckarg1" count="$ckarg2" >/dev/null 2>&1 + ;; + esac + fi + [ ! -f ${ckeyfile} ] && echo "Keyfile could not be opened. Reverting to passphrase." + fi + + if [ -n "${cryptdevice}" ]; then + DEPRECATED_CRYPT=0 + IFS=: read cryptdev cryptname cryptoptions <&2 + ;; + esac + done + + if resolved=$(resolve_device "${cryptdev}" ${rootdelay}); then + if cryptsetup isLuks ${resolved} >/dev/null 2>&1; then + [ ${DEPRECATED_CRYPT} -eq 1 ] && warn_deprecated + dopassphrase=1 + # If keyfile exists, try to use that + if [ -f ${ckeyfile} ]; then + if eval cryptsetup --key-file ${ckeyfile} open --type luks ${resolved} ${cryptname} ${cryptargs} ${CSQUIET}; then + dopassphrase=0 + else + echo "Invalid keyfile. Reverting to passphrase." + fi + fi + # Ask for a passphrase + if [ ${dopassphrase} -gt 0 ]; then + echo "" + echo "A password is required to access the ${cryptname} volume:" + + #loop until we get a real password + while ! eval cryptsetup open --type luks ${resolved} ${cryptname} ${cryptargs} ${CSQUIET}; do + sleep 2; + done + fi + if [ -e "/dev/mapper/${cryptname}" ]; then + if [ ${DEPRECATED_CRYPT} -eq 1 ]; then + export root="/dev/mapper/root" + fi + else + err "Password succeeded, but ${cryptname} creation failed, aborting..." + exit 1 + fi + elif [ -n "${crypto}" ]; then + [ ${DEPRECATED_CRYPT} -eq 1 ] && warn_deprecated + msg "Non-LUKS encrypted device found..." + if echo "$crypto" | awk -F: '{ exit(NF == 5) }'; then + err "Verify parameter format: crypto=hash:cipher:keysize:offset:skip" + err "Non-LUKS decryption not attempted..." + return 1 + fi + exe="cryptsetup open --type plain $resolved $cryptname $cryptargs" + IFS=: read c_hash c_cipher c_keysize c_offset c_skip <. + # Replace this subsection name with a custom tag name. + # Multiple subsections like this can be created. + # The '@' prefix for tags is optional. + # This subsection can contain host_list, which is a + # list of machine names. If the name of the local + # machine is found in host_list, then the name of + # this subsection is used as a tag and is applied + # to the local machine as a 'host tag'. + # If this subsection is empty (has no host_list), then + # the subsection name is always applied as a 'host tag'. + # Example: + # The host tag foo is given to all hosts, and the host tag + # bar is given to the hosts named machine1 and machine2. + # tags { foo { } bar { host_list = [ "machine1", "machine2" ] } } + # This configuration section has variable name. + # This configuration section does not have a default value defined. + # tag { + + # Configuration option tags//host_list. + # A list of machine names. + # These machine names are compared to the nodename + # returned by uname(2). If the local machine name + # matches an entry in this list, the name of the + # subsection is applied to the machine as a 'host tag'. + # This configuration option does not have a default value defined. + # host_list = "" + # } +# } diff --git a/srcpkgs/mkinitcpio/files/lvm2_hook b/srcpkgs/mkinitcpio/files/lvm2_hook new file mode 100644 index 00000000000..65de7bd2fdd --- /dev/null +++ b/srcpkgs/mkinitcpio/files/lvm2_hook @@ -0,0 +1,12 @@ +#!/usr/bin/ash + +run_earlyhook() { + mkdir /run/lvm + lvmetad +} + +run_cleanuphook() { + kill $(cat /run/lvmetad.pid) +} + +# vim: set ft=sh ts=4 sw=4 et: diff --git a/srcpkgs/mkinitcpio/files/lvm2_install b/srcpkgs/mkinitcpio/files/lvm2_install new file mode 100644 index 00000000000..49430074fb8 --- /dev/null +++ b/srcpkgs/mkinitcpio/files/lvm2_install @@ -0,0 +1,34 @@ +#!/usr/bin/bash + +build() { + local mod + for mod in dm-mod dm-snapshot dm-mirror dm-cache dm-cache-mq; do + add_module "$mod" + done + + add_binary "/usr/bin/lvm" + add_binary "/usr/bin/lvmetad" + add_binary "/usr/bin/dmsetup" + add_binary "/usr/bin/cache_check" + add_binary "/usr/bin/cache_dump" + add_binary "/usr/bin/cache_metadata_size" + add_binary "/usr/bin/cache_repair" + add_binary "/usr/bin/cache_restore" + add_file "/usr/lib/udev/rules.d/10-dm.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/udev/rules.d/11-dm-lvm.rules" + add_file "/usr/lib/initcpio/udev/69-dm-lvm-metad.rules" "/usr/lib/udev/rules.d/69-dm-lvm-metad.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/conf/lvm.conf" "/etc/lvm/lvm.conf" + + add_runscript +} + +help() { + cat </dev/null + + if [ -n "$md" ]; then + echo 'DEVICE partitions' >"$mdconfig" + for i in $(cat /proc/cmdline); do + case $i in + # raid + md=[0-9]*,/*) + device=${i%%,*} + device=${device/=/} + array=${i#*,} + echo "ARRAY /dev/$device devices=$array" + ;; + # partitionable raid + md=d[0-9]*,/*) + device=${i%%,*} + device=${device/=/_} + array=${i#*,} + echo "ARRAY /dev/$device devices=$array" + ;; + # raid UUID + md=[0-9]*,[0-9,a-fA-F]*) + device=${i%%,*} + device=${device/=/} + array=${i#*,} + echo "ARRAY /dev/$device UUID=$array" + ;; + # partitionable raid UUID + md=d[0-9]*,[0-9,a-fA-F]*) + device=${i%%,*} + device=${device/=/_} + array=${i#*,} + echo "ARRAY /dev/$device UUID=$array" + ;; + esac + done >>"$mdconfig" + fi + + # assemble everything + [ -s "$mdconfig" ] && /usr/bin/mdassemble +} + +# vim: set ft=sh ts=4 sw=4 et: diff --git a/srcpkgs/mkinitcpio/files/mdadm_install b/srcpkgs/mkinitcpio/files/mdadm_install new file mode 100644 index 00000000000..7390509fab3 --- /dev/null +++ b/srcpkgs/mkinitcpio/files/mdadm_install @@ -0,0 +1,46 @@ +#!/bin/bash + +build() { + add_checked_modules -f 'dm-' 'drivers/md/*' + + # check if a custom mdadm.conf exists + if grep -q ^ARRAY /etc/mdadm.conf; then + echo "Custom /etc/mdadm.conf file will be used in initramfs for assembling arrays." + add_file "/etc/mdadm.conf" + fi + add_binary "/usr/bin/mdassemble" + add_file "/usr/lib/udev/rules.d/63-md-raid-arrays.rules" + + add_runscript +} + +help() { + cat <,dev0,dev1,...,devn + md=,uuid +- for partitionable raid arrays with persistent superblocks: + md=d,dev0,dev1,...,devn + md=d,uuid + +Parameters: +- = the number of the md device: + 0 means md0, 1 means md1, ... +- : e.g. /dev/hda1,/dev/hdc1,/dev/sda1,/dev/sdb1 + or 0900878d:f95f6057:c39a36e9:55efa60a +Examples: +- md=d0,/dev/sda3,/dev/sda4 md=d1,/dev/hda1,/dev/hdb1 + This will setup 2 md partitionable arrays. +- md=0,/dev/sda3,/dev/sda4 md=1,/dev/hda1,/dev/hdb1 + This will setup 2 md arrays with persistent superblocks. +HELPEOF +} + +# vim: set ft=sh ts=4 sw=4 et: diff --git a/srcpkgs/mkinitcpio/files/mdadm_udev_install b/srcpkgs/mkinitcpio/files/mdadm_udev_install new file mode 100644 index 00000000000..c01cbaf2499 --- /dev/null +++ b/srcpkgs/mkinitcpio/files/mdadm_udev_install @@ -0,0 +1,25 @@ +#!/bin/bash + +build() { + add_checked_modules -f 'dm-' 'drivers/md/*' + + # check if a custom mdadm.conf exists + if grep -qw ^ARRAY "$BASEDIR/etc/mdadm.conf"; then + echo "Custom /etc/mdadm.conf file will be used in initramfs for assembling arrays." + add_file "/etc/mdadm.conf" + fi + + add_binary "/usr/bin/mdadm" + add_file "/usr/lib/udev/rules.d/63-md-raid-arrays.rules" + add_file "/usr/lib/udev/rules.d/64-md-raid-assembly.rules" +} + +help() { + cat < +Date: Mon, 4 Aug 2014 08:31:37 -0400 +Subject: [mkinitcpio] [PATCH] avoid compound conditional leading to spurious + "errors" + +As seen: + +https://bbs.archlinux.org/viewtopic.php?id=185204 +https://bbs.archlinux.org/viewtopic.php?id=185265 +--- + functions | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/functions b/functions +index 20bbffe..362d07b 100644 +--- a/functions ++++ b/functions +@@ -423,11 +423,15 @@ add_full_dir() { + + for f in "$1"/*; do + if [[ -L $f ]]; then +- [[ $f = $filter ]] && add_symlink "$f" "$(readlink "$f")" ++ if [[ $f = $filter ]]; then ++ add_symlink "$f" "$(readlink "$f")" ++ fi + elif [[ -d $f ]]; then + add_full_dir "$f" + elif [[ -f $f ]]; then +- [[ $f = $filter ]] && add_file "$f" ++ if [[ $f = $filter ]]; then ++ add_file "$f" ++ fi + fi + done + fi +-- +2.1.0 + diff --git a/srcpkgs/mkinitcpio/patches/default-to-runit-init.patch b/srcpkgs/mkinitcpio/patches/default-to-runit-init.patch new file mode 100644 index 00000000000..a1a89d03a2d --- /dev/null +++ b/srcpkgs/mkinitcpio/patches/default-to-runit-init.patch @@ -0,0 +1,25 @@ +From 6a100b4a4a709f177f383988079a2a3c3ada08b8 Mon Sep 17 00:00:00 2001 +From: Andrea Brancaleoni +Date: Thu, 25 Jun 2015 01:59:58 +0200 +Subject: [PATCH] default to runit-init + +--- + init | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/init b/init +index 4891ed8..7534d23 100644 +--- a/init ++++ b/init +@@ -2,7 +2,7 @@ + + udevd_running=0 + mount_handler=default_mount_handler +-init=/sbin/init ++init=/usr/bin/runit-init + rd_logmask=0 + + . /init_functions +-- +2.4.4 + diff --git a/srcpkgs/mkinitcpio/template b/srcpkgs/mkinitcpio/template new file mode 100644 index 00000000000..f82a6c08aa3 --- /dev/null +++ b/srcpkgs/mkinitcpio/template @@ -0,0 +1,67 @@ +# Template file for 'mkinitcpio' +pkgname=mkinitcpio +version=18 +revision=1 +noarch=yes +build_style=gnu-makefile +depends="busybox-static bsdcpio" +short_desc="Next generation of initramfs creation" +maintainer="Andrea Brancaleoni " +license="GPL-2" +homepage="https://wiki.archlinux.org/index.php/Mkinitcpio" +distfiles="https://sources.archlinux.org/other/$pkgname/$pkgname-$version.tar.gz" +checksum=187bdeeade08996010fbff480ccc91e47722d275c22fd6feb4a4b63061e9fc22 + +conf_files="/etc/mkinitcpio.conf" + +patch_args="-Np1" + +post_install() { + ln -s /usr/bin/busybox.static $DESTDIR/usr/lib/initcpio/busybox + + vinstall ${FILESDIR}/kernel-hook-postinst 755 etc/kernel.d/post-install 20-mkinitcpio + vinstall ${FILESDIR}/kernel-hook-postrm 755 etc/kernel.d/post-remove 20-mkinitcpio +} + +mkinitcpio-udev_package() { + depends="${sourcepkg}>=${version}_${revision} eudev" + short_desc+=" - udev support" + pkg_install() { + vinstall ${FILESDIR}/udev_hook 644 usr/lib/initcpio/hooks udev + vinstall ${FILESDIR}/udev_install 644 usr/lib/initcpio/install udev + } +} + +mkinitcpio-lvm2_package() { + depends="${sourcepkg}>=${version}_${revision} lvm2 thin-provisioning-tools" + short_desc+=" - lvm2 support" + conf_files="/usr/lib/initcpio/conf/lvm.conf" + pkg_install() { + vinstall ${FILESDIR}/lvm2_hook 644 usr/lib/initcpio/hooks lvm2 + vinstall ${FILESDIR}/lvm2_install 644 usr/lib/initcpio/install lvm2 + for RULES in ${FILESDIR}/*.rules; do + vinstall $RULES 644 usr/lib/initcpio/udev $(basename $RULES) + done + vinstall ${FILESDIR}/lvm.conf 644 usr/lib/initcpio/conf + } +} + +mkinitcpio-encrypt_package() { + depends="${sourcepkg}>=${version}_${revision} + ${sourcepkg}-lvm2>=${version}_${revision} cryptsetup" + short_desc+=" - encrypt support" + pkg_install() { + vinstall ${FILESDIR}/encrypt_hook 644 usr/lib/initcpio/hooks encrypt + vinstall ${FILESDIR}/encrypt_install 644 usr/lib/initcpio/install encrypt + } +} + +mkinitcpio-mdadm_package() { + depends="${sourcepkg}>=${version}_${revision} mdadm" + short_desc+=" - mdadm support" + pkg_install() { + vinstall ${FILESDIR}/mdadm_hook 644 usr/lib/initcpio/hooks mdadm + vinstall ${FILESDIR}/mdadm_install 644 usr/lib/initcpio/install mdadm + vinstall ${FILESDIR}/mdadm_udev_install 644 usr/lib/initcpio/install mdadm_udev + } +}