Reorganize the templates directory for possible future changes.
Now every template uses its own directory. Patches, prepost* files and other related stuff are stored there. --HG-- extra : convert_revision : bbc529ef161d9a59fe13a1d54ac058f77ea05845
This commit is contained in:
111
templates/initramfs-tools/initramfs-tools-xbps.diff
Normal file
111
templates/initramfs-tools/initramfs-tools-xbps.diff
Normal file
@@ -0,0 +1,111 @@
|
||||
--- hook-functions.orig 2008-12-15 01:24:05.000000000 +0100
|
||||
+++ hook-functions 2008-12-15 01:30:55.000000000 +0100
|
||||
@@ -414,16 +414,28 @@ EOF
|
||||
|
||||
}
|
||||
|
||||
+compare_versions()
|
||||
+{
|
||||
+ local curv minv
|
||||
+
|
||||
+ curv="$(echo $1|sed 's|.||g')"
|
||||
+ minv="$(echo $2|sed 's|.||g')"
|
||||
+
|
||||
+ if [ "$curv" -lt "$minv" ]; then
|
||||
+ return 1
|
||||
+ fi
|
||||
+}
|
||||
+
|
||||
# minimal supported kernel version
|
||||
check_minkver()
|
||||
{
|
||||
- local curversion initdir DPKG_ARCH minversion cm_x tmp
|
||||
+ local curversion initdir ARCH minversion cm_x tmp
|
||||
|
||||
curversion="${1}"
|
||||
initdir="${2}"
|
||||
if [ -z "${initdir}" ]; then
|
||||
- DPKG_ARCH=$(dpkg --print-installation-architecture)
|
||||
- case ${DPKG_ARCH} in
|
||||
+ ARCH=$(uname -m)
|
||||
+ case ${ARCH} in
|
||||
ia64|hppa)
|
||||
minversion="2.6.15"
|
||||
;;
|
||||
@@ -431,7 +443,7 @@ check_minkver()
|
||||
minversion="2.6.12"
|
||||
;;
|
||||
esac
|
||||
- if dpkg --compare-versions "${curversion}" lt "${minversion}"; then
|
||||
+ if ! compare_versions "${curversion}" "${minversion}"; then
|
||||
echo "W: kernel ${curversion} too old for initramfs on ${DPKG_ARCH}" >&2
|
||||
echo "W: not generating requested initramfs for kernel ${curversion}" >&2
|
||||
exit 2
|
||||
@@ -445,7 +457,7 @@ check_minkver()
|
||||
minver=$(sed '/^MINKVER=/!d;$!d;s/^MINKVER=//;s/[[:space:]]*$//' "${initdir}/${cm_x}")
|
||||
if [ -z "${tmp}" ]; then
|
||||
continue
|
||||
- elif dpkg --compare-versions "${curversion}" lt "${minver}"; then
|
||||
+ elif ! compare_versions "${curversion}" "${minver}"; then
|
||||
echo "W: ${cm_x} hook script requires at least kernel version ${minver}" >&2
|
||||
echo "W: not generating requested initramfs for kernel ${curversion}" >&2
|
||||
exit 2
|
||||
--- mkinitramfs.orig 2009-01-07 15:14:31.000000000 +0100
|
||||
+++ mkinitramfs 2009-01-30 16:33:00.000000000 +0100
|
||||
@@ -8,8 +8,7 @@ keep="n"
|
||||
CONFDIR="/etc/initramfs-tools"
|
||||
verbose="n"
|
||||
errors_to="2>/dev/null"
|
||||
-# BUSYBOXDIR="/usr/lib/initramfs-tools/bin/"
|
||||
-BUSYBOXDIR="/bin"
|
||||
+BUSYBOXDIR="/usr/lib/initramfs-tools/bin/"
|
||||
|
||||
OPTIONS=`getopt -o d:ko:r:v --long supported-host-version:,supported-target-version: -n "$0" -- "$@"`
|
||||
|
||||
@@ -63,21 +62,6 @@ while true; do
|
||||
esac
|
||||
done
|
||||
|
||||
-# FIXME: remove after Lenny (needed for Etch linux-images)
|
||||
-if [ -n "$supported_host_version" ] || [ -n "$supported_target_version" ]; then
|
||||
- if [ -n "$supported_host_version" ]; then
|
||||
- host_upstream_version="${supported_host_version%%-*}"
|
||||
- fi
|
||||
- if [ -n "$supported_target_version" ]; then
|
||||
- target_upstream_version="${supported_target_version%%-*}"
|
||||
- if dpkg --compare-versions "$target_upstream_version" lt "2.6.12"; then
|
||||
- exit 2
|
||||
- fi
|
||||
- fi
|
||||
- echo "Depreciation warning: use ramdisk=mkinitramfs-kpkg."
|
||||
- exit 0
|
||||
-fi
|
||||
-
|
||||
# For dependency ordered mkinitramfs hook scripts.
|
||||
. /usr/share/initramfs-tools/scripts/functions
|
||||
. /usr/share/initramfs-tools/hook-functions
|
||||
@@ -164,7 +148,7 @@ fi
|
||||
DESTDIR="$(mktemp -t -d mkinitramfs_XXXXXX)" || exit 1
|
||||
__TMPCPIOGZ="$(mktemp -t mkinitramfs-OL_XXXXXX)" || exit 1
|
||||
|
||||
-DPKG_ARCH=`dpkg --print-installation-architecture`
|
||||
+DPKG_ARCH=`uname -m`
|
||||
|
||||
# Export environment for hook scripts.
|
||||
#
|
||||
@@ -272,12 +256,9 @@ fi
|
||||
copy_exec /sbin/modprobe /sbin
|
||||
copy_exec /sbin/depmod /sbin
|
||||
copy_exec /sbin/rmmod /sbin
|
||||
-mkdir -p "${DESTDIR}/etc/modprobe.d"
|
||||
-cp -a /etc/modprobe.d/* "${DESTDIR}/etc/modprobe.d/"
|
||||
-
|
||||
-# workaround: libgcc always needed on old-abi arm
|
||||
-if [ "$DPKG_ARCH" = arm ] || [ "$DPKG_ARCH" = armeb ]; then
|
||||
- cp -a /lib/libgcc_s.so.1 "${DESTDIR}/lib/"
|
||||
+if [ -d /etc/modprobe.d ]; then
|
||||
+ mkdir -p "${DESTDIR}/etc/modprobe.d"
|
||||
+ cp -a /etc/modprobe.d/* "${DESTDIR}/etc/modprobe.d/"
|
||||
fi
|
||||
|
||||
run_scripts /usr/share/initramfs-tools/hooks
|
||||
95
templates/initramfs-tools/template
Normal file
95
templates/initramfs-tools/template
Normal file
@@ -0,0 +1,95 @@
|
||||
# Template file for 'initramfs-tools'
|
||||
pkgname=initramfs-tools
|
||||
version=0.92o
|
||||
wrksrc=$pkgname
|
||||
patch_files="$pkgname-xbps.diff"
|
||||
distfiles="
|
||||
http://ftp.de.debian.org/debian/pool/main/i/$pkgname/${pkgname}_${version}.tar.gz"
|
||||
build_style=custom-install
|
||||
short_desc="Tools for generating an initramfs"
|
||||
maintainer="Juan RP <xtraeme@gmail.com>"
|
||||
checksum=c6d76f51c08e23463fffd2fce027d62ffcfa317f549c58e14495459a1773a55e
|
||||
long_desc="
|
||||
This package contains tools to create and boot an initramfs for packaged 2.6
|
||||
Linux kernel. The initramfs is a gzipped cpio archive. At boot time, the
|
||||
kernel unpacks that archive into RAM, mounts and uses it as initial root
|
||||
file system. The mounting of the real root file system occurs in early user
|
||||
space. klibc provides utilities to setup root. Having the root on EVMS, MD,
|
||||
LVM2, LUKS or NFS is also supported. Any boot loader with initrd support is
|
||||
able to load an initramfs archive."
|
||||
|
||||
keep_dirs="/var/lib/$pkgname"
|
||||
config_files="/etc/$pkgname/initramfs.conf /etc/$pkgname/update-initramfs.conf"
|
||||
build_depends="cpio-2.9 util-linux-ng-2.14 klibc-1.5.14
|
||||
module-init-tools-3.5 udev-1.30 busybox-initramfs-1.13"
|
||||
run_depends="glibc-2.8 gawk-3.1.6 findutils-4.4.0 sed-4.1.5 grep-2.5.3
|
||||
$build_depends"
|
||||
|
||||
do_install()
|
||||
{
|
||||
local destdir=$XBPS_DESTDIR/$pkgname-$version
|
||||
local etcdir=$destdir/etc/$pkgname
|
||||
|
||||
# Required dirs
|
||||
install -d $etcdir/hooks
|
||||
install -d $etcdir/conf.d
|
||||
install -d $etcdir/scripts/init-bottom
|
||||
install -d $etcdir/scripts/init-premount
|
||||
install -d $etcdir/scripts/init-top
|
||||
install -d $etcdir/scripts/local-bottom
|
||||
install -d $etcdir/scripts/local-premount
|
||||
install -d $etcdir/scripts/local-top
|
||||
install -d $etcdir/scripts/nfs-bottom
|
||||
install -d $etcdir/scripts/nfs-premount
|
||||
install -d $etcdir/scripts/nfs-top
|
||||
install -d $destdir/usr/share/$pkgname
|
||||
install -d $destdir/usr/share/$pkgname/conf.d
|
||||
install -d $destdir/usr/share/$pkgname/hooks
|
||||
install -d $destdir/usr/share/$pkgname/hooksconf.d
|
||||
install -d $destdir/usr/share/$pkgname/modules.d
|
||||
install -d $destdir/usr/share/$pkgname/scripts
|
||||
install -d $destdir/usr/share/$pkgname/scripts/init-premount
|
||||
install -d $destdir/usr/share/$pkgname/scripts/init-top
|
||||
install -d $destdir/usr/share/$pkgname/scripts/local-premount
|
||||
install -d $destdir/usr/share/$pkgname/scripts/local-top
|
||||
install -d $destdir/usr/share/doc/$pkgname
|
||||
install -d $destdir/usr/share/doc/$pkgname/examples
|
||||
install -d $destdir/usr/share/man/man5
|
||||
install -d $destdir/usr/share/man/man8
|
||||
install -d $destdir/usr/sbin
|
||||
install -d $destdir/var/lib/$pkgname
|
||||
|
||||
# /etc config files
|
||||
install -m 644 $wrksrc/conf/initramfs.conf $etcdir
|
||||
install -m 644 $wrksrc/conf/update-initramfs.conf $etcdir
|
||||
|
||||
# Data
|
||||
install -m 755 $wrksrc/init $destdir/usr/share/$pkgname
|
||||
for f in functions local nfs; do
|
||||
install -m 644 $wrksrc/scripts/$f \
|
||||
$destdir/usr/share/$pkgname/scripts
|
||||
done
|
||||
install -m 755 $wrksrc/scripts/init-premount/* \
|
||||
$destdir/usr/share/$pkgname/scripts/init-premount
|
||||
install -m 755 $wrksrc/scripts/init-top/* \
|
||||
$destdir/usr/share/$pkgname/scripts/init-top
|
||||
install -m 755 $wrksrc/scripts/local-premount/* \
|
||||
$destdir/usr/share/$pkgname/scripts/local-premount
|
||||
install -m 755 $wrksrc/scripts/local-top/* \
|
||||
$destdir/usr/share/$pkgname/scripts/local-top
|
||||
install -m 755 $wrksrc/hooks/* $destdir/usr/share/$pkgname/hooks
|
||||
install -m 644 $wrksrc/hook-functions $destdir/usr/share/$pkgname
|
||||
install -m 644 $wrksrc/conf/modules $etcdir
|
||||
|
||||
# Examples
|
||||
install -m 644 $wrksrc/docs/* $destdir/usr/share/doc/$pkgname/examples
|
||||
|
||||
# Manpages
|
||||
install -m 644 $wrksrc/*.5 $destdir/usr/share/man/man5
|
||||
install -m 644 $wrksrc/*.8 $destdir/usr/share/man/man8
|
||||
|
||||
# Scripts
|
||||
install -m 755 $wrksrc/mkinitramfs $destdir/usr/sbin
|
||||
install -m 755 $wrksrc/mkinitramfs-kpkg $destdir/usr/sbin
|
||||
install -m 755 $wrksrc/update-initramfs $destdir/usr/sbin
|
||||
}
|
||||
Reference in New Issue
Block a user