]> Zhao Yanbai Git Server - minix.git/commitdiff
virtio_blk: always start if found 59/559/2
authorBen Gras <ben@minix3.org>
Wed, 15 May 2013 15:45:33 +0000 (15:45 +0000)
committerBen Gras <ben@minix3.org>
Fri, 17 May 2013 11:32:45 +0000 (11:32 +0000)
Change-Id: Iec70c67e1b675297b5ffb800a9fb263feffa9271

drivers/ramdisk/Makefile
drivers/ramdisk/proto
drivers/ramdisk/proto.common.etc
drivers/ramdisk/rc [changed mode: 0755->0644]

index d34b27eb3d351708e84487efa8a25ce3a7ae2d3e..280c770435809ce2dac0e7094efa98ea5a5b3e23 100644 (file)
@@ -29,7 +29,7 @@ ETC=          system.conf master.passwd
 EXTRA=         rc
 PROTO_FILES=   proto.common.etc proto.common.dynamic proto.dev
 PROG_DRIVERS=
-PROG_COMMANDS= mount fsck.mfs sh service loadramdisk sysenv
+PROG_COMMANDS= mount umount grep fsck.mfs sh service loadramdisk sysenv
 PROG_SERVERS=  mfs procfs
 PROG_BIN=
 PROG_SBIN=
index 99659d46ffca7313e5b245ace7cacdb41e21fdee..f8f650452f56d26df73a3cb80e3d655e9f19085a 100644 (file)
@@ -10,6 +10,8 @@ d--755 0 0
                fsck.mfs ---755 0 0 fsck.mfs
 #endif
                mount ---755 0 0 mount
+               umount ---755 0 0 umount
+               grep ---755 0 0 grep
                sh ---755 0 0 sh
                service ---755 0 0 service
        $
@@ -42,6 +44,8 @@ d--755 0 0
 #endif
                $
        $
+       proc d--755 0 0
+       $
        dev d--755 0 0
 #include "proto.dev"
        $
index 03b287005a6922505322ea27e9e0f1f1fa318a60..bd6de5250a7cd1259bf120900e8a82be64a7b3dd 100644 (file)
@@ -1,4 +1,5 @@
        etc d--755 0 0
+               mtab    s--555 2 1      /proc/mounts
                system.conf ---644 0 0 system.conf
                passwd ---644 0 0 passwd
                pwd.db ---644 0 0 pwd.db
old mode 100755 (executable)
new mode 100644 (file)
index b49c1dd..cf20b99
@@ -14,18 +14,32 @@ then        if [ -e $ACPI -a -n "`sysenv acpi`" ]
                /bin/service -c up $ACPI
        fi
        /bin/service -c up /usr/sbin/pci
+
+       # 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`/bin/sysenv virtio_blk` = Xyes ]
+       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
        fi
+       /bin/umount /proc >/dev/null
 fi
 
 if [ X`/bin/sysenv arch` = Xearm ]