2009-03-07 07:27:06 +01:00
|
|
|
--- update-initramfs.orig 2009-03-07 06:30:03.039700454 +0100
|
|
|
|
+++ update-initramfs 2009-03-07 06:32:05.679694852 +0100
|
|
|
|
@@ -1,4 +1,4 @@
|
|
|
|
-#!/bin/sh
|
|
|
|
+#!/bin/sh -e
|
|
|
|
|
|
|
|
STATEDIR=/var/lib/initramfs-tools
|
|
|
|
BOOTDIR=/boot
|
|
|
|
@@ -8,22 +8,8 @@ USETRIGGERS=true
|
|
|
|
mode=""
|
|
|
|
version=""
|
2009-02-25 18:54:56 +01:00
|
|
|
|
2009-03-07 07:27:06 +01:00
|
|
|
-set -e
|
|
|
|
-
|
|
|
|
[ -r ${CONF} ] && . ${CONF}
|
|
|
|
|
|
|
|
-if $USETRIGGERS \
|
|
|
|
- && [ x"$DPKG_MAINTSCRIPT_PACKAGE" != x ] \
|
|
|
|
- && [ $# = 1 ] \
|
|
|
|
- && [ x"$1" = x-u ] \
|
|
|
|
- && dpkg-trigger --check-supported 2>/dev/null
|
|
|
|
-then
|
|
|
|
- if dpkg-trigger --no-await update-initramfs; then
|
|
|
|
- echo "update-initramfs: deferring update (trigger activated)"
|
|
|
|
- exit 0
|
|
|
|
- fi
|
|
|
|
-fi
|
|
|
|
-
|
|
|
|
usage()
|
|
|
|
{
|
|
|
|
if [ -n "${1}" ]; then
|
|
|
|
@@ -313,7 +299,8 @@ get_sorted_versions()
|
|
|
|
fi
|
|
|
|
worklist=""
|
|
|
|
for gsv_i in $version_list; do
|
|
|
|
- if dpkg --compare-versions "${gsv_x}" '>' "${gsv_i}"; then
|
|
|
|
+ rv=$(xbps-cmpver "${gsv_x}" "${gsv_i}")
|
|
|
|
+ if [ "$rv" -eq 0 ]; then
|
|
|
|
worklist="${worklist} ${gsv_x} ${gsv_i}"
|
|
|
|
gsv_x=""
|
|
|
|
else
|
2009-05-02 02:31:23 +02:00
|
|
|
--- init.orig 2009-05-02 02:17:42.338577448 +0200
|
|
|
|
+++ init 2009-05-02 02:18:01.671572443 +0200
|
|
|
|
@@ -8,8 +8,8 @@ echo "Loading, please wait..."
|
|
|
|
[ -d /proc ] || mkdir /proc
|
|
|
|
[ -d /tmp ] || mkdir /tmp
|
|
|
|
mkdir -p /var/lock
|
|
|
|
-mount -t sysfs -o nodev,noexec,nosuid none /sys
|
|
|
|
-mount -t proc -o nodev,noexec,nosuid none /proc
|
|
|
|
+mount -t sysfs -o nodev,noexec,nosuid sysfs /sys
|
|
|
|
+mount -t proc -o nodev,noexec,nosuid proc /proc
|
|
|
|
|
|
|
|
# Note that this only becomes /dev on the real filesystem if udev's scripts
|
|
|
|
# are used; which they will be, but it's worth pointing out
|
|
|
|
--- hook-functions.orig 2009-03-30 11:48:21.000000000 +0200
|
2009-06-19 15:50:18 +02:00
|
|
|
+++ hook-functions 2009-06-19 15:35:52.907111168 +0200
|
|
|
|
@@ -231,7 +231,7 @@ dep_add_modules()
|
|
|
|
# findout root block device + fstype
|
|
|
|
eval "$(mount | awk '/\/dev\// {if ($3 == "/") {print "root=" $1 "\nFSTYPE=" $5; exit}}')"
|
|
|
|
if [ "${root}" = "/dev/root" ] ; then
|
|
|
|
- root="/dev/disk/by-uuid/"$(/lib/udev/vol_id --uuid ${root}) 2>/dev/null
|
|
|
|
+ root="/dev/disk/by-uuid/"$(/sbin/blkid -s UUID -o value ${root}) 2>/dev/null
|
|
|
|
fi
|
|
|
|
root="$(readlink -f ${root})"
|
|
|
|
|
2009-05-02 02:31:23 +02:00
|
|
|
@@ -465,16 +465,28 @@ EOF
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
+compare_versions()
|
|
|
|
+{
|
|
|
|
+ local curv="$1" minv="$2"
|
|
|
|
+
|
|
|
|
+ xbps-cmpver $curv $minv
|
|
|
|
+ if [ $? -eq 0 -o $? -eq 1 ]; then
|
|
|
|
+ return 0
|
|
|
|
+ else
|
|
|
|
+ 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"
|
|
|
|
;;
|
|
|
|
@@ -482,7 +494,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
|
|
|
|
@@ -496,7 +508,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
|
2009-06-19 15:50:18 +02:00
|
|
|
--- mkinitramfs.orig 2009-04-02 12:25:45.000000000 +0200
|
|
|
|
+++ mkinitramfs 2009-06-19 15:36:48.635447999 +0200
|
|
|
|
@@ -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 -n "$0" -- "$@"`
|
|
|
|
|
|
|
|
@@ -141,7 +140,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.
|
|
|
|
#
|
|
|
|
@@ -238,7 +237,6 @@ fi
|
|
|
|
|
|
|
|
# Busybox
|
|
|
|
if [ "${BUSYBOX}" = "n" ] || [ ! -e ${BUSYBOXDIR}/busybox ]; then
|
|
|
|
- mv ${DESTDIR}/bin/sh.shared ${DESTDIR}/bin/sh
|
|
|
|
# those root need busybox
|
|
|
|
eval "$(mount | awk '/ \/ / {print "r_dev=" $1; exit}')"
|
|
|
|
if [ "${r_dev#/dev/mapper/}" != "${r_dev}" ]; then
|
|
|
|
@@ -252,17 +250,19 @@ else
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Modutils
|
|
|
|
-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/"
|
2009-06-20 18:52:27 +02:00
|
|
|
+copy_exec /sbin/modprobe /sbin
|
|
|
|
+copy_exec /sbin/depmod /sbin
|
|
|
|
+#
|
|
|
|
+copy_exec /sbin/rmmod /sbin
|
|
|
|
+#
|
2009-06-19 15:50:18 +02:00
|
|
|
+if [ -d /etc/modprobe.d ]; then
|
|
|
|
+ mkdir -p "${DESTDIR}/etc/modprobe.d"
|
|
|
|
+ cp -a /etc/modprobe.d/* "${DESTDIR}/etc/modprobe.d/"
|
|
|
|
fi
|
|
|
|
|
|
|
|
+# libblkid
|
|
|
|
+copy_exec /sbin/blkid /sbin
|
|
|
|
+
|
|
|
|
run_scripts /usr/share/initramfs-tools/hooks
|
|
|
|
run_scripts "${CONFDIR}"/hooks
|
|
|
|
|
|
|
|
--- scripts/local.orig 2009-06-19 15:37:17.337740970 +0200
|
|
|
|
+++ scripts/local 2009-06-19 15:38:22.157057084 +0200
|
|
|
|
@@ -8,11 +8,11 @@ get_fstype ()
|
|
|
|
local FS FSTYPE FSSIZE RET
|
|
|
|
FS="${1}"
|
|
|
|
|
|
|
|
- # vol_id has a more complete list of file systems,
|
|
|
|
+ # blkid has a more complete list of file systems,
|
|
|
|
# but fstype is more robust
|
|
|
|
eval $(fstype "${FS}" 2> /dev/null)
|
|
|
|
- if [ "$FSTYPE" = "unknown" ] && [ -x /lib/udev/vol_id ]; then
|
|
|
|
- FSTYPE=$(/lib/udev/vol_id -t "${FS}" 2> /dev/null)
|
|
|
|
+ if [ "$FSTYPE" = "unknown" ] && [ -x /sbin/blkid ]; then
|
|
|
|
+ FSTYPE=$(/sbin/blkid -s TYPE -o value "${FS}" 2> /dev/null)
|
|
|
|
fi
|
|
|
|
RET=$?
|
|
|
|
|