]> git.webhop.me Git - bs-cst-neutrino-hd.git/commitdiff
adjust buildsystem for Neutrino-HD mass storage support/functions
authorMarkham <markham001@gmx.de>
Thu, 4 Feb 2016 13:57:59 +0000 (14:57 +0100)
committerMarkham <markham001@gmx.de>
Thu, 4 Feb 2016 13:57:59 +0000 (14:57 +0100)
make/neutrino.mk
skel-root-apollo/lib/mdev/fs/mount [new symlink]
skel-root-kronos/lib/mdev/fs/mount [new symlink]
skel-root-nevis/etc/mdev/mdev-mount.sh
skel-root-nevis/lib/mdev/fs/mount [new symlink]

index c93876b237f26be47a6c64fb99ed7359dccb0804..c3b4c3e509fb70f5e9ec7050708693cdbf2ac383 100755 (executable)
@@ -87,6 +87,7 @@ $(NEUTRINO_OBJDIR)/config-nevis.status: $(NEUTRINO_DEPS) $(D)/neutrino-hd-libs
                CC=$(TARGET)-gcc CFLAGS="$(NEVIS_CFLAGS)" CXXFLAGS="$(NEVIS_CFLAGS)" LDFLAGS="$(NEUTRINO_LDFLAGS)" \
                $(SOURCE_DIR)/neutrino-hd/configure --host=$(TARGET) --build=$(BUILD) --prefix= \
                        --enable-maintainer-mode --with-target=cdk --with-targetprefix= --with-boxmodel=nevis \
+                       --enable-mdev \
                        --enable-pip \
                        --enable-lua \
                        --enable-giflib \
diff --git a/skel-root-apollo/lib/mdev/fs/mount b/skel-root-apollo/lib/mdev/fs/mount
new file mode 120000 (symlink)
index 0000000..8e1b6b8
--- /dev/null
@@ -0,0 +1 @@
+/etc/mdev/mdev-mount.sh
\ No newline at end of file
diff --git a/skel-root-kronos/lib/mdev/fs/mount b/skel-root-kronos/lib/mdev/fs/mount
new file mode 120000 (symlink)
index 0000000..8e1b6b8
--- /dev/null
@@ -0,0 +1 @@
+/etc/mdev/mdev-mount.sh
\ No newline at end of file
index 4b77a6eddec465b8d8a8e18b7190b6d3f5b55bc2..2e1d27e0b74d32141c3a866453354779467bf65a 100755 (executable)
@@ -8,6 +8,10 @@ ROOTDEV=$(readlink /dev/root)
 
 # do not add or remove root device again...
 [ "$ROOTDEV" = "$MDEV" ] && exit 0
+if [ -e /tmp/.nomdevmount ]; then
+       log_info "no action on $MDEV -- /tmp/.nomdevmount exists"
+       exit 0
+fi
 
 create_symlinks() {
        DEVBASE=${MDEV:0:3} # first 3 characters
@@ -23,39 +27,40 @@ create_symlinks() {
        if [ -n "$LABEL" ]; then
                rm -f "$LABEL"
                ln -s $MDEV "$LABEL"
-       elif [ -n "$MODEL" ]; then
+       fi
+       if [ -n "$UUID" ]; then
+               LINK="${TYPE}${TYPE:+-}${UUID}"
+               rm -f "${LINK}"
+               ln -s $MDEV "${LINK}"
+       fi
+       if [ -n "$MODEL" ]; then
                LINK="${MODEL}${PARTNUM:+-}${PARTNUM}"
                rm -f "${LINK}"
                ln -s $MDEV "${LINK}"
-       elif [ -n "$UUID" ]; then
-               LINK="${TYPE}${TYPE:+-}${UUID}"
+       fi
+       BUS=""
+       PORT=""
+       P=$PHYSDEVPATH
+       case "$P" in
+       /devices/platform/cx2450x-ehci.?/usb?/?-?/?-?.?/?-?.?:?.?/host*) # hub
+               PORT=${P#*.*.}  # strip off /devices/platform/cx2450x-ehci.?/usb?/?-?/?-?
+               PORT=${PORT%%/*}        # strip off /?-?.?:?.?/host*, leaving the port
+               BUS="usb-${P:31:1}-hub-${PORT}"
+               ;;
+       /devices/platform/cx2450x-ehci.?/usb?/?-?/?-?:?.?/host*) # no hub
+               BUS="usb-${P:31:1}"
+               ;;
+       /devices/platform/cnxt_sata?-?.?/host*)
+               BUS="sata-${P:27:1}"
+               ;;
+       *)
+               # BUS="unknown" # ignored for now
+               ;;
+       esac
+       if [ -n "$BUS" ]; then
+               LINK="${BUS}${PARTNUM:+-}${PARTNUM}"
                rm -f "${LINK}"
                ln -s $MDEV "${LINK}"
-       else
-               BUS=""
-               PORT=""
-               P=$PHYSDEVPATH
-               case "$P" in
-               /devices/platform/cx2450x-ehci.?/usb?/?-?/?-?.?/?-?.?:?.?/host*) # hub
-                       PORT=${P#*.*.}  # strip off /devices/platform/cx2450x-ehci.?/usb?/?-?/?-?
-                       PORT=${PORT%%/*}        # strip off /?-?.?:?.?/host*, leaving the port
-                       BUS="usb-${P:31:1}-hub-${PORT}"
-                       ;;
-               /devices/platform/cx2450x-ehci.?/usb?/?-?/?-?:?.?/host*) # no hub
-                       BUS="usb-${P:31:1}"
-                       ;;
-               /devices/platform/cnxt_sata?-?.?/host*)
-                       BUS="sata-${P:27:1}"
-                       ;;
-               *)
-                       # BUS="unknown" # ignored for now
-                       ;;
-               esac
-               if [ -n "$BUS" ]; then
-                       LINK="${BUS}${PARTNUM:+-}${PARTNUM}"
-                       rm -f "${LINK}"
-                       ln -s $MDEV "${LINK}"
-               fi
        fi
 
        cd $OLDPWD
@@ -93,7 +98,7 @@ case "$ACTION" in
                # remove old mountpoint symlinks we might have for this device
                rm -f $MOUNTPOINT
                mkdir -p $MOUNTPOINT
-               for i in 1 2; do # retry, my freeagent drive sometimes needs more time
+               for i in 1 2 3 4 5; do # retry, my freeagent drive sometimes needs more time
                        # $LOG "mounting /dev/$MDEV to $MOUNTPOINT try $i"
                        OUT1=$(mount -t auto /dev/$MDEV $MOUNTPOINT 2>&1 >/dev/null)
                        RET1=$?
@@ -119,6 +124,9 @@ case "$ACTION" in
                        fi
                        rmdir $MOUNTPOINT
                fi
+               if [ -x /bin/mdev_helper ]; then
+                       /bin/mdev_helper
+               fi
                ;;
        remove)
                $LOG "unmounting /dev/$MDEV"
@@ -131,5 +139,9 @@ case "$ACTION" in
                else
                        $WARN "umount /dev/$MDEV failed with $RET"
                fi
+               if [ -x /bin/mdev_helper ]; then
+                       /bin/mdev_helper
+               fi
                ;;
 esac
+
diff --git a/skel-root-nevis/lib/mdev/fs/mount b/skel-root-nevis/lib/mdev/fs/mount
new file mode 120000 (symlink)
index 0000000..8e1b6b8
--- /dev/null
@@ -0,0 +1 @@
+/etc/mdev/mdev-mount.sh
\ No newline at end of file