mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-27 11:13:24 +02:00
Remove mkinitcpio, klibc and udev (for klibc).
This commit is contained in:
@@ -1,32 +0,0 @@
|
||||
#! /bin/sh
|
||||
# Implement blacklisting for udev-loaded modules
|
||||
# Includes module checking
|
||||
# - Aaron Griffin & Tobias Powalowski for Archlinux
|
||||
[ $# -ne 1 ] && exit 1
|
||||
|
||||
if [ -f /proc/cmdline ]; then
|
||||
for cmd in $(cat /proc/cmdline); do
|
||||
case $cmd in
|
||||
*=*) eval $cmd ;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
|
||||
# get the real names from modaliases
|
||||
i="$(/bin/modprobe -i --show-depends $1 | minised "s#^insmod /lib.*/\(.*\)\.ko.*#\1#g" | minised 's|-|_|g')"
|
||||
# add disablemodules= from commandline to blacklist
|
||||
k="$(echo ${disablemodules} | minised 's|-|_|g' | minised 's|,| |g')"
|
||||
|
||||
if [ "${k}" != "" ] ; then
|
||||
for o in ${k}; do
|
||||
echo "${o}.ko" >> /disablemodules
|
||||
done
|
||||
for n in ${i}; do
|
||||
if /bin/ugrep "^$n.ko" /disablemodules 2>&1 >/dev/null; then
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
fi
|
||||
/bin/modprobe $1
|
||||
|
||||
# vim: set et ts=4:
|
||||
@@ -1,115 +0,0 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# start_udev
|
||||
# script to initialize /dev by using udev.
|
||||
#
|
||||
# Modified for Archlinux by Tobias Powalowski <tpowa@archlinux.org>
|
||||
#
|
||||
# Inspired by:
|
||||
#
|
||||
# Copyright (C) 2004 Greg Kroah-Hartman <greg@kroah.com>
|
||||
#
|
||||
# Released under the GPL v2 only.
|
||||
#
|
||||
# This needs to be run at the earliest possible point in the boot
|
||||
# process.
|
||||
#
|
||||
# Based on the udev init.d script
|
||||
#
|
||||
# Thanks go out to the Gentoo developers for proving
|
||||
# that this is possible to do.
|
||||
#
|
||||
# Yes, it's very verbose, feel free to turn off all of the echo calls,
|
||||
# they were there to make me feel better that everything was working
|
||||
# properly during development...
|
||||
|
||||
prog=udev
|
||||
sysfs_dir=/sys
|
||||
bin=/sbin/udev
|
||||
udevd=/sbin/udevd
|
||||
udev_root="/dev"
|
||||
|
||||
trigger_device_events ()
|
||||
{
|
||||
/sbin/udevtrigger
|
||||
}
|
||||
|
||||
wait_for_queue ()
|
||||
{
|
||||
# disabled because it hangs network boot
|
||||
#loop=20
|
||||
#while ! [ "$loop" -gt 0 -a -d /dev/.udev/queue ]; do
|
||||
# sleep 0.1;
|
||||
# loop=$(($loop - 1))
|
||||
#done
|
||||
/sbin/udevsettle
|
||||
}
|
||||
|
||||
make_extra_nodes ()
|
||||
{
|
||||
# there are a few things that sysfs does not export for us.
|
||||
# these things go here (and remember to remove them in
|
||||
# remove_extra_nodes()
|
||||
#
|
||||
# Thanks to Gentoo for the initial list of these.
|
||||
ln -sf /proc/self/fd $udev_root/fd
|
||||
ln -sf /proc/self/fd/0 $udev_root/stdin
|
||||
ln -sf /proc/self/fd/1 $udev_root/stdout
|
||||
ln -sf /proc/self/fd/2 $udev_root/stderr
|
||||
ln -sf /proc/kcore $udev_root/core
|
||||
}
|
||||
|
||||
udev_init ()
|
||||
{
|
||||
# don't use udev if sysfs is not mounted.
|
||||
if [ ! -d $sysfs_dir/block ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#echo "mounting... ramfs at $udev_root"
|
||||
mount -t ramfs none $udev_root
|
||||
|
||||
# propogate /udev from /sys
|
||||
#echo "Creating initial udev device nodes:"
|
||||
|
||||
#echo "making extra nodes"
|
||||
make_extra_nodes
|
||||
|
||||
# check if udevd is already running
|
||||
#echo "start udev daemon"
|
||||
/sbin/udevd --daemon
|
||||
|
||||
case "$(uname -r)" in
|
||||
2.6.[0-9]|2.6.[0-9][!0-9]*) ;;
|
||||
*) if [ -f "/sys/class/tty/console/uevent" ]; then
|
||||
#echo "Kernel >= 2.6.15 and supports uevents"
|
||||
# trigger the sorted events
|
||||
echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug
|
||||
# catch events that are real fast
|
||||
mkdir -p /dev/.udev/queue
|
||||
else
|
||||
# for older kernels without uevents will be removed when udevstart dies in udev
|
||||
echo "Kernel does not support uevents, you need a kernel >= 2.6.15!"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
udev_uevents ()
|
||||
{
|
||||
# configure all devices
|
||||
trigger_device_events
|
||||
# until we know how to do better, just wait for _all_ events to finish
|
||||
wait_for_queue
|
||||
}
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
udev_init
|
||||
udev_uevents
|
||||
fi
|
||||
|
||||
[ "$1" = "init" ] && udev_init
|
||||
[ "$1" = "uevents" ] && udev_uevents
|
||||
|
||||
exit 0
|
||||
@@ -1,71 +0,0 @@
|
||||
# Udev rules for Archlinux by Tobias Powalowski <tpowa@archlinux.org>
|
||||
#
|
||||
# This ruleset should provide a DevFS-compatible device tree.
|
||||
#
|
||||
# There are a number of modifiers that are allowed to be used in some
|
||||
# of the different fields. They provide the following subsitutions:
|
||||
#
|
||||
# %n the "kernel number" of the device.
|
||||
# For example, 'sda3' has a "kernel number" of '3'
|
||||
# %k the kernel name for the device.
|
||||
# %M the kernel major number for the device
|
||||
# %m the kernel minor number for the device
|
||||
# %b the bus id for the device
|
||||
# %c the string returned by the PROGRAM
|
||||
# %s{filename} the content of a sysfs attribute.
|
||||
# %% the '%' char itself.
|
||||
#
|
||||
# There are a number of modifiers that are allowed to be used in some of the
|
||||
# fields. See the udev man page for a full description of them.
|
||||
# global stuff
|
||||
#
|
||||
|
||||
#####################################
|
||||
# Early rules - begin
|
||||
#####################################
|
||||
# wait for sysfs
|
||||
ACTION=="add", DEVPATH=="/devices/*", ENV{PHYSDEVBUS}=="?*", WAIT_FOR_SYSFS="bus"
|
||||
ACTION=="add", SUBSYSTEM=="scsi", WAIT_FOR_SYSFS="ioerr_cnt"
|
||||
|
||||
#####################################
|
||||
# Early rules -end
|
||||
#####################################
|
||||
|
||||
#####################################
|
||||
###### Hotplug rules - begin
|
||||
#####################################
|
||||
# check if the device has already been claimed by a driver
|
||||
ENV{PHYSDEVDRIVER}=="?*", GOTO="hotplug_driver_loaded"
|
||||
|
||||
# Modaliases to load
|
||||
ACTION=="add", ENV{MODALIAS}=="?*", RUN+="/lib/udev/load-modules.sh $env{MODALIAS}"
|
||||
# SCSI addon modules
|
||||
ACTION=="add", SUBSYSTEM=="scsi", SYSFS{type}=="[07]", RUN+="/lib/udev/load-modules.sh sd_mod"
|
||||
ACTION=="add", SUBSYSTEM=="scsi", SYSFS{type}=="14", RUN+="/lib/udev/load-modules.sh sd_mod"
|
||||
ACTION=="add", SUBSYSTEM=="scsi", SYSFS{type}=="[45]", RUN+="/lib/udev/load-modules.sh sr_mod"
|
||||
ACTION=="add", SUBSYSTEM=="scsi", SYSFS{type}=="1", SYSFS{vendor}=="Onstream", SYSFS{model}!="ADR*", RUN+="/lib/udev/load-modules.sh osst"
|
||||
ACTION=="add", SUBSYSTEM=="scsi", SYSFS{type}=="1", SYSFS{vendor}=="Onstream", SYSFS{model}=="ADR*", RUN+="/lib/udev/load-modules.sh st"
|
||||
ACTION=="add", SUBSYSTEM=="scsi", SYSFS{type}=="1", SYSFS{vendor}!="Onstream", RUN+="/lib/udev/load-modules.sh st"
|
||||
ACTION=="add", SUBSYSTEM=="scsi", SYSFS{type}=="[23689]", RUN+="/lib/udev/load-modules.sh sg"
|
||||
|
||||
LABEL="hotplug_driver_loaded"
|
||||
|
||||
# FIRMWARE
|
||||
ACTION=="add", SUBSYSTEM=="firmware", ENV{FIRMWARE}=="?*", RUN+="/lib/udev/firmware.sh"
|
||||
#####################################
|
||||
##### Hotplug rules - end
|
||||
#####################################
|
||||
|
||||
#####################################
|
||||
###### CD/DVD symlinks - begin
|
||||
#####################################
|
||||
ACTION=="add", BUS=="ide", KERNEL=="hd[a-z]", IMPORT="/lib/udev/cdrom_id --export $tempnode"
|
||||
ACTION=="add", BUS=="scsi", KERNEL=="sr[0-9]*", IMPORT="/lib/udev/cdrom_id --export $tempnode"
|
||||
ACTION=="add", BUS=="scsi", KERNEL=="scd[a-z]", IMPORT="/lib/udev/cdrom_id --export $tempnode"
|
||||
ENV{ID_CDROM}=="?*", SYMLINK+="cd/cdrom-%b"
|
||||
ENV{ID_CDROM_CD_RW}=="?*", SYMLINK+="cd/cdrw-%b"
|
||||
ENV{ID_CDROM_DVD}=="?*", SYMLINK+="cd/dvd-%b"
|
||||
ENV{ID_CDROM_DVD_R}=="?*", SYMLINK+="cd/dvd-%b"
|
||||
#####################################
|
||||
###### CD/DVD symlinks - end
|
||||
#####################################
|
||||
@@ -1,7 +0,0 @@
|
||||
# vim: set ft=sh:
|
||||
run_hook ()
|
||||
{
|
||||
msg -n ":: Loading udev..."
|
||||
/etc/start_udev
|
||||
msg "done."
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
# vim:set ft=sh:
|
||||
|
||||
install ()
|
||||
{
|
||||
MODULES=""
|
||||
BINARIES=""
|
||||
FILES=" /etc/udev/udev.conf"
|
||||
SCRIPT="udev"
|
||||
add_file /lib/initcpio/udev/udevd /sbin/udevd
|
||||
add_file /lib/initcpio/udev/udevtrigger /sbin/udevtrigger
|
||||
add_file /lib/initcpio/udev/udevsettle /sbin/udevsettle
|
||||
add_file /lib/initcpio/udev/udev.rules /etc/udev/rules.d/udev.rules
|
||||
add_file /lib/initcpio/udev/start_udev /etc/start_udev
|
||||
add_file /lib/initcpio/udev/firmware.sh /lib/udev/firmware.sh
|
||||
add_file /lib/initcpio/udev/cdrom_id /lib/udev/cdrom_id
|
||||
add_file /lib/initcpio/udev/load-modules.sh /lib/udev/load-modules.sh
|
||||
}
|
||||
|
||||
help ()
|
||||
{
|
||||
cat <<HELPEOF
|
||||
This hook will use udev to create your root device node
|
||||
and detect the needed modules for your root device.
|
||||
It is recommended to use this hook instead of modload.
|
||||
HELPEOF
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
# vim: set ft=sh:
|
||||
|
||||
install ()
|
||||
{
|
||||
MODULES=" $(checked_modules "block/virtio_blk") "
|
||||
|
||||
MODULES=$(echo ${MODULES}) #trim whitespace
|
||||
if [ "x${MODULES}" != "x" ]; then
|
||||
MODULES="${MODULES} virtio_pci"
|
||||
fi
|
||||
|
||||
BINARIES=""
|
||||
FILES=""
|
||||
SCRIPT=""
|
||||
}
|
||||
|
||||
help ()
|
||||
{
|
||||
cat<<HELPEOF
|
||||
This hook loads the necessary modules for an virtio root device.
|
||||
Detection will take place at runtime. To minimize the modules
|
||||
in the image, add the autodetect hook too.
|
||||
HELPEOF
|
||||
}
|
||||
Reference in New Issue
Block a user