initramfs-tools: remove dpkg specific stuff.
Added keep_dirs and conf_files stuff. The patch added should be enough to fix those errors that I caught while testing it. --HG-- extra : convert_revision : 6ef6087618149fb8463d7cbe25e2c4f99fc9696c
This commit is contained in:
parent
944309d934
commit
833f3a7c6f
|
@ -0,0 +1,85 @@
|
|||
--- mkinitramfs.orig 2008-12-15 01:06:46.000000000 +0100
|
||||
+++ mkinitramfs 2008-12-15 01:08:08.000000000 +0100
|
||||
@@ -70,7 +70,7 @@ if [ -n "$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
|
||||
+ if ! compare_versions "$target_upstream_version" "2.6.12"; then
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
@@ -164,7 +164,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,8 +272,10 @@ 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/"
|
||||
+if [ -d /etc/modprobe.d ]; then
|
||||
+ mkdir -p "${DESTDIR}/etc/modprobe.d"
|
||||
+ cp -a /etc/modprobe.d/* "${DESTDIR}/etc/modprobe.d/"
|
||||
+fi
|
||||
|
||||
# workaround: libgcc always needed on old-abi arm
|
||||
if [ "$DPKG_ARCH" = arm ] || [ "$DPKG_ARCH" = armeb ]; then
|
||||
--- 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
|
|
@ -2,6 +2,7 @@
|
|||
pkgname=initramfs-tools
|
||||
version=0.92l
|
||||
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
|
||||
|
@ -17,7 +18,10 @@ long_desc="
|
|||
LVM2, LUKS or NFS is also supported. Any boot loader with initrd support is
|
||||
able to load an initramfs archive."
|
||||
|
||||
build_depends="cpio-2.9 util-linux-ng-2.14 klibc-1.5.14 module-init-tools-3.5 udev-1.30"
|
||||
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"
|
||||
run_depends="glibc-2.8 $build_depends"
|
||||
|
||||
do_install()
|
||||
|
|
Loading…
Reference in New Issue