void-packages/templates/initramfs-tools/initramfs-tools-xbps.diff

266 lines
7.9 KiB
Diff

--- scripts/init-top/keymap.orig 2009-08-27 07:25:39.071099923 +0200
+++ scripts/init-top/keymap 2009-08-27 07:25:57.336100046 +0200
@@ -16,12 +16,12 @@ esac
OPTS="-q"
# Should terminal be in UTF8 mode?
-if [ -x /bin/kbd_mode ]; then
- /bin/kbd_mode -u
+if [ -x /sbin/kbd_mode ]; then
+ /sbin/kbd_mode -u
OPTS="${OPTS} -u"
fi
# Load custom keymap
-if [ -x /bin/loadkeys -a -r /etc/boottime.kmap.gz ]; then
+if [ -x /sbin/loadkeys -a -r /etc/boottime.kmap.gz ]; then
loadkeys ${OPTS} /etc/boottime.kmap.gz
fi
--- hook-functions.orig 2009-03-30 11:48:21.000000000 +0200
+++ hook-functions 2009-08-27 08:17:31.726915318 +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})"
@@ -363,11 +363,7 @@ auto_add_modules()
{
case "$1" in
base)
- for x in ehci-hcd ohci-hcd uhci-hcd usbhid hid_a4tech \
- hid_apple hid_belkin hid_bright hid_cherry hid_chicony \
- hid_cypress hid_dell hid_ezkey hid_gyration hid_logitech \
- hid_microsoft hid_monterey hid_petalynx hid_pl hid_samsung \
- hid_sony hid_sunplus hid_tmff hid_zpff usb-storage ext2 \
+ for x in ehci-hcd ohci-hcd uhci-hcd usbhid usb-storage ext2 \
ext3 ext4 ext4dev isofs jfs nfs reiserfs udf xfs af_packet \
atkbd i8042 virtio_pci; do
manual_add_modules "${x}"
@@ -388,10 +384,6 @@ auto_add_modules()
manual_add_modules "${x}"
done
;;
- fb)
- copy_modules_dir kernel/drivers/video
- copy_modules_dir kernel/drivers/char/agp
- ;;
ide)
copy_modules_dir kernel/drivers/ide
;;
@@ -433,7 +425,6 @@ auto_add_modules()
*)
auto_add_modules base
auto_add_modules net
- auto_add_modules fb
auto_add_modules ide
auto_add_modules scsi
auto_add_modules block
@@ -465,16 +456,28 @@ EOF
}
+compare_versions()
+{
+ local curv="$1" minv="$2"
+
+ xbps-cmpver $curv $minv
+ if [ $? -eq 0 ] || [ $? -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 +485,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 +499,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
--- update-initramfs.orig 2009-03-30 18:31:44.000000000 +0200
+++ update-initramfs 2009-08-27 08:40:12.227893271 +0200
@@ -8,22 +8,8 @@ USETRIGGERS=true
mode=""
version=""
-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
@@ -314,7 +300,8 @@ get_sorted_versions()
fi
worklist=""
for gsv_i in $version_list; do
- if dpkg --compare-versions "${gsv_x}" '>' "${gsv_i}"; then
+ xbps-cmpver "${gsv_x}" "${gsv_i}"
+ if [ $? -eq 0 ] || [ $? -eq 1 ]; then
worklist="${worklist} ${gsv_x} ${gsv_i}"
gsv_x=""
else
--- scripts/local.orig 2009-03-19 21:16:14.000000000 +0100
+++ scripts/local 2009-10-06 17:45:04.671054874 +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=$?
@@ -26,12 +26,12 @@ get_fstype ()
pre_mountroot()
{
+ wait_for_udev 10
+
[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/local-top"
run_scripts /scripts/local-top
[ "$quiet" != "y" ] && log_end_msg
- wait_for_udev 10
-
# Don't wait for a root device that doesn't have a corresponding
# device in /dev (ie, mtd0)
if [ "${ROOT#/dev}" = "${ROOT}" ]; then
--- init.orig 2009-03-20 10:10:13.000000000 +0100
+++ init 2009-10-08 16:50:24.108954736 +0200
@@ -2,14 +2,29 @@
echo "Loading, please wait..."
+# Create some required busybox symlinks.
+if [ -x /bin/busybox ]; then
+ busybox ln -s /bin/busybox /bin/cut
+ busybox ln -s /bin/busybox /bin/touch
+ busybox ln -s /bin/busybox /bin/tr
+ busybox ln -s /bin/busybox /bin/grep
+ busybox ln -s /bin/busybox /bin/awk
+ busybox ln -s /bin/busybox /bin/tail
+ busybox ln -s /bin/busybox /bin/basename
+ busybox ln -s /bin/busybox /bin/ls
+ busybox ln -s /bin/busybox /bin/cp
+ busybox ln -s /bin/busybox /bin/rm
+ busybox ln -s /bin/busybox /sbin/pkill
+fi
+
[ -d /dev ] || mkdir -m 0755 /dev
[ -d /root ] || mkdir -m 0700 /root
[ -d /sys ] || mkdir /sys
[ -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
--- mkinitramfs.orig 2009-04-02 12:25:45.000000000 +0200
+++ mkinitramfs 2009-10-08 16:50:03.681982224 +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/busybox-initramfs/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
@@ -251,16 +249,17 @@ else
ln -s ${BUSYBOXDIR}/busybox ${DESTDIR}/bin/sh
fi
-# Modutils
+# module-init-tools
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/"
+# libblkid
+copy_exec /sbin/blkid /sbin
+
+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