From: Markham Date: Thu, 4 Feb 2016 13:57:59 +0000 (+0100) Subject: adjust buildsystem for Neutrino-HD mass storage support/functions X-Git-Url: https://git.webhop.me/?a=commitdiff_plain;h=4ef8398b8eb2c16cb90b63469f1c1686427d956e;p=bs-cst-neutrino-hd.git adjust buildsystem for Neutrino-HD mass storage support/functions --- diff --git a/make/neutrino.mk b/make/neutrino.mk index c93876b..c3b4c3e 100755 --- a/make/neutrino.mk +++ b/make/neutrino.mk @@ -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 index 0000000..8e1b6b8 --- /dev/null +++ b/skel-root-apollo/lib/mdev/fs/mount @@ -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 index 0000000..8e1b6b8 --- /dev/null +++ b/skel-root-kronos/lib/mdev/fs/mount @@ -0,0 +1 @@ +/etc/mdev/mdev-mount.sh \ No newline at end of file diff --git a/skel-root-nevis/etc/mdev/mdev-mount.sh b/skel-root-nevis/etc/mdev/mdev-mount.sh index 4b77a6e..2e1d27e 100755 --- a/skel-root-nevis/etc/mdev/mdev-mount.sh +++ b/skel-root-nevis/etc/mdev/mdev-mount.sh @@ -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 index 0000000..8e1b6b8 --- /dev/null +++ b/skel-root-nevis/lib/mdev/fs/mount @@ -0,0 +1 @@ +/etc/mdev/mdev-mount.sh \ No newline at end of file