void-packages/templates/initramfs-tools-xbps.diff
Juan RP 8e76afef28 initramfs-tools: fix path to busybox dir.
--HG--
extra : convert_revision : 9d9646c4431000f3ad88276c20d5e33130715b4a
2009-01-30 16:50:56 +01:00

111 lines
3.4 KiB
Diff

--- 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