minix/drivers/ramdisk/rc

95 lines
2.4 KiB
Text
Raw Normal View History

#!/bin/sh
set -e
exec >/dev/log
exec 2>/dev/log
exec </dev/null
FSCK=/bin/fsck_mfs
ACPI=/usr/sbin/acpi
if [ X`/bin/sysenv arch` = Xi386 ]
then if [ -e $ACPI -a -n "`sysenv acpi`" ]
then
/bin/service -c up $ACPI
fi
/bin/service -c up /usr/sbin/pci
Input infrastructure, INPUT server, PCKBD driver This commit separates the low-level keyboard driver from TTY, putting it in a separate driver (PCKBD). The commit also separates management of raw input devices from TTY, and puts it in a separate server (INPUT). All keyboard and mouse input from hardware is sent by drivers to the INPUT server, which either sends it to a process that has opened a raw input device, or otherwise forwards it to TTY for standard processing. Design by Dirk Vogt. Prototype by Uli Kastlunger. Additional changes made to the prototype: - the event communication is now based on USB HID codes; all input drivers have to use USB codes to describe events; - all TTY keymaps have been converted to USB format, with the effect that a single keymap covers all keys; there is no (static) escaped keymap anymore; - further keymap tweaks now allow remapping of literally all keys; - input device renumbering and protocol rewrite; - INPUT server rewrite, with added support for cancel and select; - PCKBD reimplementation, including PC/AT-to-USB translation; - support for manipulating keyboard LEDs has been added; - keyboard and mouse multiplexer devices have been added to INPUT, primarily so that an X server need only open two devices; - a new "libinputdriver" library abstracts away protocol details from input drivers, and should be used by all future input drivers; - both INPUT and PCKBD can be restarted; - TTY is now scheduled by KERNEL, so that it won't be punished for running a lot; without this, simply running "yes" on the console kills the system; - the KIOCBELL IOCTL has been moved to /dev/console; - support for the SCANCODES termios setting has been removed; - obsolete keymap compression has been removed; - the obsolete Olivetti M24 keymap has been removed. Change-Id: I3a672fb8c4fd566734e4b46d3994b4b7fc96d578
2013-09-28 14:46:21 +02:00
/bin/service -c up /sbin/input -dev /dev/kbdmux
/bin/service -c up /sbin/pckbd
# Start procfs so we can access /proc/pci
mount -t procfs none /proc >/dev/null
# Do we want to use the virtio block device?
# If not specified, default to yes if the device is found.
if /bin/sysenv virtio_blk >/dev/null
then virtio_blk="`/bin/sysenv virtio_blk`"
elif grep '^[^ ]* [^ ]* 1AF4:1001 ' /proc/pci >/dev/null
then echo "virtio_blk not set, defaulting to using found virtio device."
virtio_blk=yes
fi
/bin/service -cn up /sbin/floppy -dev /dev/fd0
if [ X`/bin/sysenv ahci` = Xyes ]
then
# this is here temporarily, for testing purposes
/bin/service -c up /sbin/ahci -dev /dev/c0d0 -label ahci_0 -args instance=0
elif [ X"$virtio_blk" = Xyes ]
then
/bin/service -c up /sbin/virtio_blk -dev /dev/c0d0 -label virtio_blk_0 -args instance=0
else
/bin/service -c up /sbin/at_wini -dev /dev/c0d0 -label at_wini_0
/bin/service -cr up /sbin/at_wini -dev /dev/c1d0 -label at_wini_1 -args instance=1 2>/dev/null || :
fi
/bin/umount /proc >/dev/null
fi
if [ X`/bin/sysenv arch` = Xearm ]
then echo Starting the mmc driver
/bin/service -c up /sbin/mmc -dev /dev/c0d0
fi
/bin/service up /sbin/procfs || echo "WARNING: couldn't start procfs"
if /bin/sysenv rootdevname >/dev/null
2012-11-01 19:40:56 +01:00
then rootdevname=/dev/`/bin/sysenv rootdevname`
else echo "rootdevname not set"
exit 1
fi
if [ "`sysenv bin_img`" = 1 ]
then
bin_img="-i "
fi
if sysenv cdproberoot >/dev/null
then
echo
echo 'Looking for boot CD. This may take a minute.'
echo 'Please ignore any error messages.'
echo
cddev=`cdprobe` || { echo 'No CD found'; exit 1; }
export cddev
echo "Loading ramdisk from ${cddev}p1"
loadramdisk "$cddev"p1
elif [ "$rootdevname" = "/dev/ram" ]
then
2012-11-01 19:40:56 +01:00
ramimagename=/dev/`/bin/sysenv ramimagename`
echo "Loading ramdisk from $ramimagename"
loadramdisk "$ramimagename" || echo "WARNING: loadramdisk failed"
fi
2012-11-01 19:40:56 +01:00
echo "Root device name is $rootdevname"
if [ -e $FSCK ]
then $FSCK -p $rootdevname
fi
# Change root from temporary boot ramdisk to the configure
# root device
/bin/mount -n $bin_img"$rootdevname" /
/bin/mount -e -n -t procfs none /proc || echo "WARNING: couldn't mount procfs"
2006-03-07 15:58:18 +01:00
exec /bin/sh /etc/rc "$@"