summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-06-11 13:32:15 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-06-11 13:32:15 +0000
commit1faa5640be35ffafba47aabbe9073dee4284ffbf (patch)
tree4d183d0b68e1605d1b0deafe0eba709c2434d43c
parentec29e1265d3d9d66c14fc564898220351a6c2efd (diff)
downloadalpine-baselayout-1faa5640be35ffafba47aabbe9073dee4284ffbf.tar.bz2
alpine-baselayout-1faa5640be35ffafba47aabbe9073dee4284ffbf.tar.xz
moved modloop and hwdrivers to openrc package
-rw-r--r--init.d/Makefile4
-rwxr-xr-xinit.d/hwdrivers26
-rw-r--r--init.d/modloop87
3 files changed, 1 insertions, 116 deletions
diff --git a/init.d/Makefile b/init.d/Makefile
index 6a95023..01b3534 100644
--- a/init.d/Makefile
+++ b/init.d/Makefile
@@ -1,6 +1,4 @@
-SCRIPTS = hwdrivers \
- modloop \
- rcL \
+SCRIPTS = rcL \
rcK \
rcS \
tuntap \
diff --git a/init.d/hwdrivers b/init.d/hwdrivers
deleted file mode 100755
index 2d3f6d3..0000000
--- a/init.d/hwdrivers
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/sbin/runscript
-
-depend() {
- need sysfs dev
- before checkfs fsck
- keyword novserver
-}
-
-# Load hardware drivers
-start() {
- # check for boot option "nocoldplug"
- if get_bootparam noautodetect; then
- ewarn "Autodetection of hardware disabled from boot cmdline"
- return 0
- fi
-
-
- ebegin "Loading hardware drivers"
- find /sys -name modalias | xargs sort -u \
- | xargs modprobe -a 2> /dev/null
- # we run it twice so we detect all devices
- find /sys -name modalias | xargs sort -u \
- | xargs modprobe -a 2> /dev/null
- eend 0
-}
-
diff --git a/init.d/modloop b/init.d/modloop
deleted file mode 100644
index a7cfb30..0000000
--- a/init.d/modloop
+++ /dev/null
@@ -1,87 +0,0 @@
-#!/sbin/runscript
-
-# script that will mount image with modules
-
-depend() {
- need dev
- before checkfs fsck hwdrivers
- keyword novserver
-}
-
-# read kernel options
-init_KOPT() {
- eval set -- `cat /proc/cmdline 2>/dev/null`
- while [ $# -gt 0 ]; do
- case "$1" in
- *=*) eval "KOPT_${1%%=*}='${1#*=}'" ;;
- *) eval "KOPT_$(echo $1 | sed 's: :_:g')=yes" ;;
- esac
- shift
- done
-}
-
-find_mnt() {
- local dev="$1"
- local fsfile="$2"
- awk "\$ == \"$dev\" {print \$2}\"" "$fsfile" 2>/dev/null
-}
-
-# initialies: alpine_dev, alpine_mnt, alpine_fs, alpine_mounted
-find_media() {
- init_KOPT
- alpine_mounted=
- alpine_dev=${KOPT_alpine_dev%%:*}
- alpine_fs=${KOPT_alpine_dev#*:}
- [ "$alpine_fs" = "$KOPT_alpine_dev" ] && unset alpine_fs
- # first we check if alpine_dev is mounted and use this
- alpine_mnt=$(find_mnt /dev/$alpine_dev /proc/mounts)
- if [ -z "$alpine_mnt" ]; then
- # then we check fstab
- alpine_mnt=$(find_mnt /dev/$alpine_dev /etc/fstab)
- else
- alpine_mounted=yes
- fi
- # finally we fallback to /media/<devicename>
- [ -z "$alpine_mnt" ] && alpine_mnt=/media/$alpine_dev
-}
-
-start() {
- local modloop mount_opts
- find_media
- if [ -z "$alpine_dev" ] ; then
- ebegin "Skipping mount module loopback (specify with alpine_dev)"
- eend 0
- return 0
- fi
-
- modloop=${KOPT_modloop:-$KOPT_BOOT_IMAGE.cmg}
- [ -n "$alpine_fs" ] && mount_opts = "-t $alpine_fs"
-
- ebegin "Mounting loopback device for kernel modules"
- if [ -z "$alpine_mounted" ]; then
- mount $mount_opts $alpine_dev $alpine_mnt 2>/dev/null
- fi
- mkdir -p /.modloop /lib
-
- mount -o loop,ro -t cramfs $modloop /.modloop &&\
- rm -rf /lib/modules &&\
- ln -sf /.modloop/modules /lib/
- eend $?
-
- # copy firmware if there are any
- if [ -d $alpine_mnt/firmware ]; then
- ebegin "Copying firmware from $alpine_mnt/firmware"
- cp -R -a $alpine_mnt/firmware /lib/
- eend $?
- fi
-}
-
-stop() {
- find_media
- [ -z "$alpine_dev" ] && return 0
- ebegin "Unmounting loopback device for kernel modules"
- umount -d /.modloop &&\
- umount $alpine_mnt 2>/dev/null
- eend $?
-}
-