Update packages to use /run and compat symlinks inside of it.

/run is now used explicitly by udev>=167 so I followed the lead and
updated XBPS core packages to use it by default.
This commit is contained in:
Juan RP
2011-04-29 20:26:58 +02:00
parent 948728e2ec
commit 6b4cb03a83
8 changed files with 153 additions and 65 deletions

View File

@@ -8,6 +8,7 @@ for f in $(/bin/busybox --list); do
/bin/busybox ln -s /bin/busybox /bin/${f}
done
[ -d /run ] || mkdir -m 0755 /run
[ -d /dev ] || mkdir -m 0755 /dev
[ -d /root ] || mkdir -m 0700 /root
[ -d /sys ] || mkdir /sys
@@ -21,14 +22,19 @@ mount -t proc -o nodev,noexec,nosuid proc /proc
if [ -e /etc/udev/udev.conf ]; then
. /etc/udev/udev.conf
fi
if ! mount -t devtmpfs -o mode=0755 devtmpfs /dev; then
tmpfs_size="10M"
tmpfs_size="10M"
# Mount devtmpfs for /dev, fallback to tmpfs if not supported.
if ! mount -t devtmpfs -o size=$tmpfs_size,mode=0755 devtmpfs /dev; then
echo "W: devtmpfs not available, falling back to tmpfs for /dev"
mount -t tmpfs -o size=$tmpfs_size,mode=0755 udev /dev
[ -e /dev/console ] || mknod -m 0600 /dev/console c 5 1
[ -e /dev/null ] || mknod /dev/null c 1 3
fi
mkdir /dev/.initramfs
# Also mount a tmpfs for /run directory.
mount -t tmpfs -o mode=0755,nosuid,nodev tmpfs /run
mkdir /run/udev
mkdir /run/.initramfs
# Set modprobe env
export MODPROBE_OPTIONS="-qb"
@@ -158,7 +164,7 @@ for x in $(cat /proc/cmdline); do
debug)
debug=y
quiet=n
exec >/dev/.initramfs/initramfs.debug 2>&1
exec >/run/.initramfs/initramfs.debug 2>&1
set -x
;;
debug=*)
@@ -290,10 +296,13 @@ unset readonly
unset resume
unset resume_offset
# Umount sysfs and procfs, they will be mounted by init scripts.
# Umount misc filesystems, they will be mounted by the init scripts.
umount /sys
umount /proc
# Move /run to the final rootfs, so that .initramfs debug is available.
mount -n -o move /run ${rootmnt}/run
# Chain to real filesystem
exec switch_root ${rootmnt} ${init} "$@"
panic "Could not execute run-init."

View File

@@ -1,6 +1,6 @@
# Template file for 'initramfs-tools'
pkgname=initramfs-tools
_localver=0.99.10 # This is the XBPS version
_localver=0.99.11 # This is the XBPS version
_distver=0.98.8 # This should match debian version
version=${_localver}.${_distver}
build_style=custom-install