From 7f423a77100f6862b3811b488da61824579d27b9 Mon Sep 17 00:00:00 2001 From: Peter Zumbruch Date: Mon, 25 Nov 2013 17:16:39 +0100 Subject: [PATCH] extending epics documentation for dreamplug, Linux and HadCon --- epics.tex | 363 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 207 insertions(+), 156 deletions(-) diff --git a/epics.tex b/epics.tex index 4d57930..fbe7c72 100644 --- a/epics.tex +++ b/epics.tex @@ -20,8 +20,7 @@ yet included. \end{center} \end{figure} -A running EPICS node looks like it is shown in figure -\ref{fig:epicsDetectorControlSystemRunningNode}. +A running EPICS node looks like it is shown in figure \ref{fig:epicsDetectorControlSystemRunningNode}. \begin{figure}[htp] \begin{center} @@ -46,7 +45,7 @@ small cpus easily by too many requests. \subsubsection{Startup} At reboot a scs crontab entry assures the automatic restart of the EPICS IOCs -using \emph{procserv} +using \emph{procserv}. \begin{itemize} \item Check \emph{scs}'s crontab: \small \begin{verbatim} crontab -l @@ -72,16 +71,18 @@ using \emph{procserv} \subsubsection{\emph{Main} IOC failure} \paragraph{Check and Restart} - \begin{itemize} - \item ssh to scs@hadesdaq02 (password is ??? (ask Peter / Burkhard)) \begin{verbatim} - ssh scs@hadesdaq02 \end{verbatim} + \begin{enumerate} + \item ssh to scs@hadesdaq02 (password is ??? (ask Peter / Burkhard)) + \begin{verbatim} ssh scs@hadesdaq02 \end{verbatim} \item test for processes, the call chain is:\\ - \emph{procServ} $\Rightarrow$ \emph{ startEpicsIoc\_includingHVSemaphoreCheck.sh } $\Rightarrow$ \emph{hades} + \emph{procServ} $\Rightarrow$ \emph{ startEpicsIoc\_includingHVSemaphoreCheck.sh } $\Rightarrow$ \emph{hades}\\ + \begin{verbatim} + ps U scs + \end{verbatim} \scriptsize \begin{verbatim} - ps U scs \end{verbatim} \tiny \begin{verbatim} [...] COMMAND - [...] [...]/procServ [options] ./startEpicsIoc\_includingHVSemaphoreCheck.sh ../../bin/linux-x86/hades st.cmd - [...] /bin/bash ./startEpicsIoc\_includingHVSemaphoreCheck.sh ../../bin/linux-x86/hades st.cmd + [...] [...]/procServ [options] ./startEpicsIoc\_includingHVSemaphoreCheck.sh ../../bin/linux-x86/hades st.cmd + [...] /bin/bash ./startEpicsIoc\_includingHVSemaphoreCheck.sh ../../bin/linux-x86/hades st.cmd [...] ../../bin/linux-x86/hades st.cmd \end{verbatim} \normalsize \item if only the ``\emph{procServ}'' process is running but not its subprocesses\\ @@ -94,9 +95,9 @@ using \emph{procserv} quit # to quit the telnet session. \end{verbatim} - \end{itemize} + \end{enumerate} \paragraph{To start from scratch:} - \begin{itemize} + \begin{enumerate} \item ssh to scs@hadesdaq02 (password is ??? (ask Peter / Burkhard)) \begin{verbatim} ssh scs@hadesdaq02 \end{verbatim} \item make sure none of these processes are running: @@ -113,13 +114,14 @@ using \emph{procserv} \begin{verbatim} telnet localhost 4813 # ==> you should see epics> prompt. - #dbl ==> gives you list of PVs. + #dbl "HAD:IOC:*" ==> gives you a short list of PVs starting with "HAD:IOC:" + #dbl ==> gives you a very long list (~ 60.000 lines) of PVs. # + ] to get back to the telnet prompt # then type quit # to quit the telnet session. \end{verbatim} - \end{itemize} + \end{enumerate} \subsubsection{External Documentation} \begin{itemize} @@ -137,44 +139,68 @@ using \emph{procserv} \subsubsection{Startup} At reboot a scs crontab entry assures the automatic restart of the EPICS IOCs -using \emph{procserv} +using \emph{procserv}. +\begin{itemize} + \item Check \emph{scs}'s crontab: \small \begin{verbatim} + crontab -l + + # DO NOT EDIT THIS FILE - edit the master and reinstall. + # (/tmp/crontab.b8ak69 installed on Tue Jan 31 17:11:30 2012) + # (Cronie version 4.2) + # m h dom mon dow command + @reboot cd ~scs/procServ && ./ioc-cave.sh + \end{verbatim} \normalsize + \begin{itemize} + \item If it is missing then edit scs's crontab + \begin{itemize} + \item Automatic \scriptsize \begin{verbatim} + cmd=$(echo '@reboot cd ~scs/procServ && ./ioc-cave.sh') && \ + echo -e "$(crontab -l 2>/dev/null | grep -F -v -e "$cmd")\n$cmd" | crontab - + \end{verbatim} \normalsize + \item by-hand \small \begin{verbatim} + crontab -e \end{verbatim} \normalsize + \end{itemize} + \end{itemize} +\end{itemize} \subsubsection{Failure of the DreamPlug} -\paragraph{IOC Failure} - In case the IOC isn't responding, but the system is still accessible: - \begin{itemize} - \item ssh to scs@dreamp\emph{XY} (password is ??? (ask Peter / Burkhard), \emph{XY} number of dreamplug) \begin{verbatim} - ssh scs@dreampXY \end{verbatim} - \item test for processes, the call chain is:\\ - \emph{procServ} $\Rightarrow$ \emph{ startEpicsIoc\_includingHVSemaphoreCheck.sh } $\Rightarrow$ \emph{hades} - \begin{verbatim} - ps U scs \end{verbatim} \tiny \begin{verbatim} - [...] COMMAND - [...] [...]/procServ [options] ../../bin/linux-arm/streamHadcon st.cmd - [...] ../../bin/linux-arm/streamHadcon st.cmd - \end{verbatim} \normalsize - \item if only the ``\emph{procServ}'' process is running but not its subprocesses\\ - ``\emph{streamHadcon}'' then locally telnet to procServ and restart the EPICS IOC - \begin{verbatim} - telnet localhost 4813 - # then + R will restart the trb IOC - # then + ] to bet back to the telnet prompt - # then type - quit - # to quit the telnet session. - \end{verbatim} - \end{itemize} +\paragraph{IOC Failure}~\\ + In case the IOC isn't responding, but the system is still accessible, Check and Restart (paragraph: \ref{par:epics_check_and_restart}) + \paragraph{Check and Restart} + \label{par:epics_check_and_restart} + \begin{enumerate} + \item ssh to scs@dreamp\emph{XY}\\ + (password is ??? (ask Peter / Burkhard), \emph{XY} number of dreamplug) + \begin{verbatim} ssh scs@dreampXY} \end{verbatim} + \item test for processes, the call chain is:\\ + \emph{procServ} $\Rightarrow$ \emph{ startEpicsIoc\_includingHVSemaphoreCheck.sh } $\Rightarrow$ \emph{hades} + \begin{verbatim} ps U scs + \end{verbatim} \scriptsize + \begin{verbatim} + [...] COMMAND + [...] [...]/procServ [options] ../../bin/linux-arm/streamHadcon st.cmd + [...] ../../bin/linux-arm/streamHadcon st.cmd + \end{verbatim} \normalsize + \item if only the ``\emph{procServ}'' process is running but not its subprocesses\\ + ``\emph{streamHadcon}'' then locally telnet to procServ and restart the EPICS IOC + \begin{verbatim} + telnet localhost 4813 + # then + R will restart the trb IOC + # then + ] to bet back to the telnet prompt + # then type + quit + # to quit the telnet session. + \end{verbatim} + \end{enumerate} -\paragraph{System Failure, Crash\newline} - \vspace{1 cm} - In the case of a failure of the DreamPlug system itself: -\begin{enumerate} - \item Please reboot several times. - \item If this is not successful: \textbf{Check and Reinstall Complete System} -\end{enumerate} +\paragraph{System Failure, Crash}~\\ + In the case of a failure of the DreamPlug system itself: + \begin{enumerate} + \item Please reboot several times. + \item If this is not successful: \textbf{Check and Reinstall Complete System} + \end{enumerate} -\subparagraph{Check, \emph{optional} } - \vspace{1 cm} +\subparagraph{Check, \emph{optional}}~\\ For the \textbf{optional} checking you need to have an external ``\emph{GuruPlug JTAG board}'' attached to the dreamplug and a mobile PC running a terminal program e.g. \emph{picocom}. For reinstalling the dreamPlugs this is not necessary, since the current \emph{uboot} configuration already contain a multi boot system. @@ -182,110 +208,137 @@ using \emph{procserv} \begin{itemize} \item check with an external ``\emph{GuruPlug JTAG board}'' attached to the dreamplug, only the smaller connector (``\emph{UART}''), and your PC/Laptop.\\ - Then you can start on a laptop: - \begin{verbatim} - #picocom (exit via: ctrl-a + ctrl-x) - picocom -b 115200 /dev/ttyUSB0 - \end{verbatim} - and reboot again: use the commands \emph{help}, \emph{reset}, \emph{printenv} for a first check and analysis - \begin{verbatim} + Then you can start on a laptop: + \begin{verbatim} + #picocom (exit via: ctrl-a + ctrl-x) + picocom -b 115200 /dev/ttyUSB0 + \end{verbatim} + and reboot again. Hit any key within to stop the autoboot procedure. Then for a first check and analysis use the commands: + \begin{itemize} + \item \emph{help} + \item \emph{reset} + \item \emph{printenv} + \end{itemize} + \begin{verbatim} Hit any key to stop autoboot: 1 Marvell>> Marvell>> help Marvell>> reset Marvell>> printenv - \end{verbatim} + \end{verbatim} \end{itemize} -\subparagraph{Reinstall Complete System}{\footnote{\href{http://wiki.gsi.de/Epics/DreamplugRollbackSystemAndUImage}{http://wiki.gsi.de/Epics/DreamplugRollbackSystemAndUImage: Dreamplug Rollback System And UImage}}} - -\begin{itemize} - \item Requirements: +\subparagraph{Reinstall Complete System}~\\ + $\rightarrow$ \href{http://wiki.gsi.de/Epics/DreamplugRollbackSystemAndUImage} + {wiki.gsi.de/Epics: Dreamplug Rollback System And UImage} \begin{itemize} - \item \textbf{\emph{uboot} configuration}: + \item \textbf{Requirements}: + \begin{itemize} + \item \textbf{\emph{uboot} configuration}: At least a dual boot system which tries at last the internal disk, - e.g. \href{http://wiki.gsi.de/Epics/DreamplugTweakUBootFasterMultiBoot}{Dreamplug Tweak UBoot Faster Multi Boot}, which is already installed on all HADES dreamplugs - \item \textbf{Sources}: - \begin{itemize} - \item offline: the prepared USB stick / SD card, (ask Peter) - \item online: - \begin{itemize} - \item ``\emph{das u-boot}'' uimage file, $\approx 3 MB$:\\ - \small\href{http://jspc29.x-matter.uni-frankfurt.de/bitfiles/dreamplug-uimage-04112013.tar.xz}{http://jspc29.x-matter.uni-frankfurt.de/bitfiles/dreamplug-uimage-04112013.tar.xz} \normalsize - \item system tar ball, $\approx 1 GB$: \\ - \small\href{http://jspc29.x-matter.uni-frankfurt.de/bitfiles/dreamplug-system-04112013.tar.xz}{http://jspc29.x-matter.uni-frankfurt.de/bitfiles/dreamplu-system-04112013.tar.xz}\normalsize - \end{itemize} - \end{itemize} + e.g. \href{http://wiki.gsi.de/Epics/DreamplugTweakUBootFasterMultiBoot}{wiki.gsi.de/Epics: Dreamplug Tweak UBoot Faster Multi Boot}, + which is already installed on all HADES dreamplugs.\\ + If not: + \begin{enumerate} + \item Connect with an external ``\emph{GuruPlug JTAG board}'' attached to the + dreamplug, only the smaller connector (``\emph{UART}''), and your PC/Laptop.\\ + Then you can start on a laptop: + \begin{verbatim} + #picocom (exit via: ctrl-a + ctrl-x) + picocom -b 115200 /dev/ttyUSB0 + \end{verbatim} + and reboot again. Hit any key within to stop the autoboot procedure. + \begin{verbatim} + Hit any key to stop autoboot: 1 + Marvell>> + \end{verbatim} + \item Copy and paste the following section to the {\tt Marvell>> } prompt: + \tiny + \begin{verbatim} + setenv x_bootargs 'console=ttyS0,115200 panic=10 rootwait rootdelay=10' + setenv image_address 0x6400000 + + setenv bootcmd 'run init; run bootcmd_sdd ;run bootcmd_sdc; run bootcmd_sdb; run bootcmd_sda;' + setenv init 'run clear_kernel_in_mem; run x_bootcmd_usb;' + setenv bootcmd_sda 'setenv root_device /dev/sda2; setenv usb_device_id 0; run boot_common;' + setenv bootcmd_sdb 'setenv root_device /dev/sdb2; setenv usb_device_id 1; run boot_common;' + setenv bootcmd_sdc 'setenv root_device /dev/sdc2; setenv usb_device_id 2; run boot_common;' + setenv bootcmd_sdd 'setenv root_device /dev/sdd2; setenv usb_device_id 3; run boot_common;' + + setenv boot_common 'run bootcmd_echo_boot_attempt; run setargs; run x_bootcmd_kernel; bootm ${image_address};' + + setenv clear_kernel_in_mem 'echo Purging kernel in memory; mw ${image_address} 0x0 0x300000;' + setenv bootcmd_echo_boot_attempt 'echo attempting to boot from: ${root_device};' + setenv setargs 'setenv bootargs ${x_bootargs} root=${root_device}; echo bootargs="${bootargs}";' + setenv x_bootcmd_kernel 'fatload usb ${usb_device_id} ${image_address} uimage;' + + saveenv + \end{verbatim} + \normalsize + \end{enumerate} + \item \textbf{Sources}: + \begin{itemize} + \item offline: the prepared USB stick / SD card, (ask Peter) + \item online: + \begin{itemize} + \item ``\emph{das u-boot}'' uimage file, $\approx 3 MB$:\\ + \small\href{http://jspc29.x-matter.uni-frankfurt.de/bitfiles/dreamplug-uimage-04112013.tar.xz}{http://jspc29.x-matter.uni-frankfurt.de/bitfiles/dreamplug-uimage-04112013.tar.xz} \normalsize + \item system tar ball, $\approx 1 GB$: \\ + \small\href{http://jspc29.x-matter.uni-frankfurt.de/bitfiles/dreamplug-system-04112013.tar.xz}{http://jspc29.x-matter.uni-frankfurt.de/bitfiles/dreamplu-system-04112013.tar.xz}\normalsize + \end{itemize} + \end{itemize} + \end{itemize} + \item \textbf{Prepare your external usb stick/SD card}: \\ + If you don't have a prepared system available you have to prepare a new USB stick/SD card. + \scriptsize \begin{verbatim} + target= && + + cd $(mktemp -u) && + wget -N http://jspc29.x-matter.uni-frankfurt.de/bitfiles/dreamplug-uimage-04112013.tar.xz && + wget -N http://jspc29.x-matter.uni-frankfurt.de/bitfiles/dreamplug-system-04112013.tar.xz && + + scr=$(tar atf dreamplug-system-04112013.tar.xz | grep -w dreamplugCreateBootDeviceFunctionSet.sh) && + tar axf dreamplug-system-04112013.tar.xz $scr && + mv $scr $(basename $scr) && unset scr && + + . ./dreamplugCreateBootDeviceFunctionSet.sh && + createBootDevicePartition && + createBootDeviceMounts && + + tar Jxvf dreamplug-uimage-04112013.tar.xz -C /mnt/${target}1 && + tar Jxvf dreamplug-system-04112013.tar.xz -C /mnt/${target}2 && + + createBootDeviceUmounts + + #optional + cd && rm -rf $OLDPWD + \end{verbatim} \normalsize + \item \textbf{Restoring from external USB stick/SD card}: + \begin{enumerate} + \item Plug your prepared USB device / SD card into the Dreamplug + \item Restart your system + \item Login to the dreamplug with root privileges:\\ + user/pw: \emph{restore}/\emph{nosoup4u} \\ + on login user \emph{restore} becomes automatically: root + \item apply this scriplet \scriptsize + + \begin{verbatim} + #if dreamplugRestoreLocalSystemFromExternal.sh is not on the system or you want to get the newest + dpScript=dreamplugRestoreLocalSystemFromExternal.sh + wget -N http://wiki.gsi.de/pub/Epics/DreamplugRollbackSystemAndUImage/${dpScript} + + #optional source + source= + + chmod u+x ./${dpScript} && + ./${dpScript} + \end{verbatim} \normalsize + \item reboot your device, with no boot device connected, + \begin{itemize} + \item at reboot the user \emph{restore} is automatically disabled by a crontab entry + \end{itemize} + \end{enumerate} \end{itemize} - \item Prepare your external usb stick / SD card: \\ If you don't have a prepared system available you have to prepare a new stick / SD card. - \scriptsize \begin{verbatim} - target= && - cd $(mktemp -u) && - wget -N http://jspc29.x-matter.uni-frankfurt.de/bitfiles/dreamplug-uimage-04112013.tar.xz && - wget -N http://jspc29.x-matter.uni-frankfurt.de/bitfiles/dreamplug-system-04112013.tar.xz && - scr=$(tar atf dreamplug-system-04112013.tar.xz | grep -w dreamplugCreateBootDeviceFunctionSet.sh) && - tar axf dreamplug-system-04112013.tar.xz $scr && - mv $scr $(basename $scr) && unset scr && - . ./dreamplugCreateBootDeviceFunctionSet.sh && - createBootDevicePartition && - createBootDeviceMounts && - tar Jxvf dreamplug-uimage-04112013.tar.xz -C /mnt/${target}1 && - tar Jxvf dreamplug-system-04112013.tar.xz -C /mnt/${target}2 && - createBootDeviceUmounts - - #optional - cd && rm -rf $OLDPWD - \end{verbatim} \normalsize - \item Restoring from external USB stick / SD card - \begin{enumerate} - \item Plug your prepared USB device / SD card into the Dreamplug - \item Restart your system - \item Login to the dreamplug with root privileges:\\ - user/pw: restore/nosoup4u \\ - becomes automatically: root \\ - \item \scriptsize \begin{verbatim} - #if dreamplugRestoreLocalSystemFromExternal.sh is not on the system or you want to get the newest - dpScript=dreamplugRestoreLocalSystemFromExternal.sh - wget -N http://wiki.gsi.de/pub/Epics/DreamplugRollbackSystemAndUImage/${dpScript} - - #optional source - source= - - chmod u+x ./${dpScript} && - ./${dpScript} - \end{verbatim} \normalsize - \item reboot your device, with no boot device connected - \end{enumerate} -\end{itemize} - - - -\begin{verbatim} - -picocom -b 115200 /dev/ttyUSB0 -(picocom: exit via: ctrl-a + ctrl-x - -# to boot from the internal SD-card -setenv x_bootcmd_kernel fatload usb 0 0x6400000 uImage -setenv x_bootargs_root root=/dev/sda2 rootdelay=10 -saveenv -reset - -# to set the device to boot from an external USB-stick -setenv x_bootcmd_kernel fatload usb 2 0x6400000 uImage_2.6.33.7 -setenv x_bootargs_root root=/dev/sdc2 rootdelay=10 -saveenv -reset - - -#USB stick root password: nosoup4u - -# if everything fails: -# overwrite the internal SD-card with an image (the one on the stick) -gzip -cdv /backup_ee_dev007_sda.raw.gz | dd of=/dev/sda bs=1M - - -\end{verbatim} \paragraph{External Documentation} \begin{itemize} @@ -304,15 +357,13 @@ Located on lxhadesdaq, but currently not used anymore. \subsubsection{If CTS monitor in Epics does not work} \begin{itemize} \item Check and Restart - \begin{itemize} + \begin{enumerate} \item ssh to scs@lxhadesdaq (password is ??? (ask Peter / Burkhard)) \begin{verbatim} ssh scs@lxhadesdaq \end{verbatim} - \item test for processes \footnotesize - \begin{verbatim} - ps U scs - + \item test for processes + \begin{verbatim} ps U scs \end{verbatim} \scriptsize \begin{verbatim} PID TTY STAT TIME COMMAND 30793 ? S 0:00 procServ 4813 ../../bin/linux-x86/trb st.cmd 30800 pts/88 Ssl+ 0:02 ../../bin/linux-x86/trb st.cmd @@ -321,16 +372,16 @@ Located on lxhadesdaq, but currently not used anymore. \item if only the ``\emph{procServ}'' process is running but not its subprocess\\ ``\emph{trb}'' then locally telnet to procServ and restart the EPICS IOC \begin{verbatim} - telnet localhost 4813 - # then + R will restart the trb IOC - # then + ] to bet back to the telnet prompt - # then type - quit - # to quit the telnet session. + telnet localhost 4813 + # then + R will restart the trb IOC + # then + ] to bet back to the telnet prompt + # then type + quit + # to quit the telnet session. \end{verbatim} - \end{itemize} + \end{enumerate} \item To start from scratch: - \begin{itemize} + \begin{enumerate} \item ssh to scs@lxhadesdaq (password is ??? (ask Peter / Burkhard)) \begin{verbatim} ssh scs@lxhadesdaq @@ -352,6 +403,6 @@ Located on lxhadesdaq, but currently not used anymore. quit # to quit the telnet session. \end{verbatim} - \end{itemize} + \end{enumerate} \end{itemize} -- 2.43.0