-
Notifications
You must be signed in to change notification settings - Fork 49
Creating a standalone driver module
Kevin Peterson edited this page Mar 28, 2019
·
5 revisions
Documentation of the specific approach to creating a standalone driver module. The procedure for creating motorNewport is expected to be more
-
Clone motor
[~/epics/motor-split/Newport]$ git clone https://github.com/epics-modules/motor.git Cloning into 'motor'... remote: Enumerating objects: 34, done. remote: Counting objects: 100% (34/34), done. remote: Compressing objects: 100% (31/31), done. remote: Total 16693 (delta 13), reused 11 (delta 3), pack-reused 16659 Receiving objects: 100% (16693/16693), 5.96 MiB | 0 bytes/s, done. Resolving deltas: 100% (12631/12631), done. Checking out files: 100% (853/853), done.
-
Work with a clone of a clone to avoid pushing back to github and also allow a clean restart of the process
[~/epics/motor-split/Newport]$ git clone file://motor motorNewport1 Cloning into 'motorNewport1'... remote: Counting objects: 16301, done. remote: Compressing objects: 100% (3945/3945), done. remote: Total 16301 (delta 12330), reused 16301 (delta 12330) Receiving objects: 100% (16301/16301), 5.89 MiB | 0 bytes/s, done. Resolving deltas: 100% (12330/12330), done. Checking out files: 100% (853/853), done. [~/epics/motor-split/Newport]$ cd motorNewport1/ [~/epics/motor-split/Newport/motorNewport1]$
-
Figure out the egrep pattern for the files that should be retained
Run this command with different patterns in the quotes to see which files will be retained: $ git ls-files | egrep "<pattern>" These are the files that were retained for motorNewport: [~/epics/motor-split/Newport/motorNewport1]$ git ls-files | egrep "(XPS|xps|HXP|hxp|AG_|CONEX|SMC100|NewportSrc|Newport_|gitattributes|gitignore)" .gitattributes .gitignore iocBoot/iocWithAsyn/XPSAux.substitutions iocBoot/iocWithAsyn/connect_AG_CONEX iocBoot/iocWithAsyn/connect_AG_UC iocBoot/iocWithAsyn/motor.cmd.hxp iocBoot/iocWithAsyn/motor.substitutions.AG_CONEX iocBoot/iocWithAsyn/motor.substitutions.AG_UC iocBoot/iocWithAsyn/motor.substitutions.CONEX-PP iocBoot/iocWithAsyn/motor.substitutions.SMC100 iocBoot/iocWithAsyn/motor.substitutions.hxp iocBoot/iocWithAsyn/motor.substitutions.xps iocBoot/iocWithAsyn/motor.substitutions.xps3 iocBoot/iocWithAsyn/motor.substitutions.xps4 iocBoot/iocWithAsyn/motor.substitutions.xps5 iocBoot/iocWithAsyn/st.cmd.AG_CONEX iocBoot/iocWithAsyn/st.cmd.AG_UC iocBoot/iocWithAsyn/st.cmd.CONEX-PP iocBoot/iocWithAsyn/st.cmd.SMC100 iocBoot/iocWithAsyn/st.cmd.xps iocBoot/iocWithAsyn/st.cmd.xps3 iocBoot/iocWithAsyn/st.cmd.xps4 iocBoot/iocWithAsyn/st.cmd.xps5 iocBoot/iocWithAsyn/st.cmd.xps6 iocsh/Newport_ESP300.iocsh iocsh/Newport_MM4000.iocsh iocsh/Newport_PM500.iocsh motorApp/Db/HXP_coords.db motorApp/Db/HXP_extra.db motorApp/Db/XPSAuxAi.db motorApp/Db/XPSAuxAo.db motorApp/Db/XPSAuxBi.db motorApp/Db/XPSAuxBo.db motorApp/Db/XPSAuxLi.db motorApp/Db/XPSAuxLo.db motorApp/Db/XPSPositionCompare.db motorApp/Db/XPSPositionCompare_settings.req motorApp/Db/XPSTclScript.template motorApp/Db/XPS_extra.db motorApp/Db/profileMoveAxisXPS.template motorApp/Db/profileMoveControllerXPS.template motorApp/Db/profileMoveControllerXPS_settings.req motorApp/Db/xpsSlave.db motorApp/NewportSrc/AG_CONEX.cpp motorApp/NewportSrc/AG_CONEX.h motorApp/NewportSrc/AG_UC.cpp motorApp/NewportSrc/AG_UC.h motorApp/NewportSrc/Firmware.txt motorApp/NewportSrc/HXPDriver.cpp motorApp/NewportSrc/HXPDriver.h motorApp/NewportSrc/MM4005_trajectoryScan.st motorApp/NewportSrc/Makefile motorApp/NewportSrc/NewportRegister.cc motorApp/NewportSrc/NewportRegister.h motorApp/NewportSrc/README motorApp/NewportSrc/SMC100Driver.cpp motorApp/NewportSrc/SMC100Driver.h motorApp/NewportSrc/SMC100Register.cc motorApp/NewportSrc/SMC100Register.h motorApp/NewportSrc/Socket.cpp motorApp/NewportSrc/Socket.h motorApp/NewportSrc/XPSAsynInterpose.c motorApp/NewportSrc/XPSAsynInterpose.h motorApp/NewportSrc/XPSAxis.cpp motorApp/NewportSrc/XPSAxis.h motorApp/NewportSrc/XPSController.cpp motorApp/NewportSrc/XPSController.h motorApp/NewportSrc/XPSGathering.c motorApp/NewportSrc/XPSGathering2.c motorApp/NewportSrc/XPSGatheringMain.c motorApp/NewportSrc/XPSGatheringRegister.c motorApp/NewportSrc/XPS_C8_drivers.cpp motorApp/NewportSrc/XPS_C8_drivers.h motorApp/NewportSrc/XPS_C8_errors.h motorApp/NewportSrc/XPS_trajectoryScan.st motorApp/NewportSrc/asynOctetSocket.cpp motorApp/NewportSrc/asynOctetSocket.h motorApp/NewportSrc/devESP300.cc motorApp/NewportSrc/devMM3000.cc motorApp/NewportSrc/devMM4000.cc motorApp/NewportSrc/devNewport.dbd motorApp/NewportSrc/devNewportSeq.dbd motorApp/NewportSrc/devPM500.cc motorApp/NewportSrc/drvESP300.cc motorApp/NewportSrc/drvMM3000.cc motorApp/NewportSrc/drvMM4000.cc motorApp/NewportSrc/drvMM4000Asyn.c motorApp/NewportSrc/drvMM4000Asyn.h motorApp/NewportSrc/drvMMCom.h motorApp/NewportSrc/drvPM500.cc motorApp/NewportSrc/drvXPSAsyn.c motorApp/NewportSrc/drvXPSAsyn.h motorApp/NewportSrc/drvXPSAsynAux.c motorApp/NewportSrc/hxp_drivers.cpp motorApp/NewportSrc/hxp_drivers.h motorApp/NewportSrc/hxp_errors.h motorApp/NewportSrc/seqPVmacros.h motorApp/NewportSrc/strtok_r.c motorApp/NewportSrc/strtok_r.h motorApp/NewportSrc/tclCall.cc motorApp/NewportSrc/tclCall.h motorApp/NewportSrc/trajectoryScan.h motorApp/NewportSrc/xpsSlave.st motorApp/NewportSrc/xps_ftp.c motorApp/NewportSrc/xps_ftp.h motorApp/op/adl/HXP.adl motorApp/op/adl/HXP_coordSys.adl motorApp/op/adl/HXP_extra.adl motorApp/op/adl/HXP_motors.adl motorApp/op/adl/HXP_moveAll.adl motorApp/op/adl/XPSAux.adl motorApp/op/adl/XPSAuxBi_more.adl motorApp/op/adl/XPSAuxTest.adl motorApp/op/adl/XPSExtra.adl motorApp/op/adl/XPSPositionCompare.adl motorApp/op/adl/XPSPositionCompare8.adl motorApp/op/adl/XPSTop.adl motorApp/op/adl/profileMoveXPS.adl motorApp/op/opi/HXP.opi motorApp/op/opi/HXP_coordSys.opi motorApp/op/opi/HXP_extra.opi motorApp/op/opi/HXP_motors.opi motorApp/op/opi/HXP_moveAll.opi motorApp/op/opi/XPSAux.opi motorApp/op/opi/XPSAuxBi_more.opi motorApp/op/opi/XPSAuxTest.opi motorApp/op/opi/XPSExtra.opi motorApp/op/opi/XPSTest.opi motorApp/op/opi/XPSTop.opi motorApp/op/opi/profileMoveXPS.opi motorApp/op/ui/autoconvert/HXP.ui motorApp/op/ui/autoconvert/HXP_coordSys.ui motorApp/op/ui/autoconvert/HXP_extra.ui motorApp/op/ui/autoconvert/HXP_motors.ui motorApp/op/ui/autoconvert/HXP_moveAll.ui motorApp/op/ui/autoconvert/XPSAux.ui motorApp/op/ui/autoconvert/XPSAuxBi_more.ui motorApp/op/ui/autoconvert/XPSAuxTest.ui motorApp/op/ui/autoconvert/XPSExtra.ui motorApp/op/ui/autoconvert/XPSTest.ui motorApp/op/ui/autoconvert/XPSTop.ui motorApp/op/ui/autoconvert/profileMoveXPS.ui
-
Filter the git history to include only the specified files
[~/epics/motor-split/Newport/motorNewport1]$ git filter-branch --prune-empty --index-filter 'git ls-files -z | egrep -zv "(XPS|xps|HXP|hxp|AG_|CONEX|SMC100|NewportSrc|Newport_|gitattributes|gitignore)" | xargs -0 -r git rm --cached -q' HEAD Rewrite 1196bbe4df5968ae4ac05c142a9f4be93827d06e (2487/2778)error: duplicate parent 2cc7aa2d7457306425e6ee27c8a688db50571cc9 ignored Rewrite ab6092f8b5dc3f07a055d4039bac44dd2c88bda4 (2491/2778)error: duplicate parent 0db4a37e80a8488a3dba413a2a28f996aeb5f978 ignored Rewrite 724dd71a723a4fb36fd84a08b4665091002cffd9 (2503/2778)error: duplicate parent adc4a679ee91e901ed1b089b76e5e2a4c4b254ca ignored Rewrite ae84076e42347a365b360d1d5f1583a07805b02d (2505/2778)error: duplicate parent b32cd24c638e1d72f2ab8f77b78fec1ad6930eae ignored Rewrite 6cb7ff2a5e4d19aad382f81b2c5fe50eec1e7da8 (2533/2778)error: duplicate parent a1f39cfc70cded11ca79d5c0edaea3406038bb3b ignored Rewrite 14b1070b7d64fb95e7dcf4be06b9386a088cf258 (2543/2778)error: duplicate parent cd379f7aea23c33cbb78b9213d908f02c76ec0a9 ignored Rewrite 6b9ca72120ce26c074a04f833363bb4c7400bb8d (2545/2778)error: duplicate parent 31ae96e1dffb60413074b46715b87dfca90a6993 ignored Rewrite 345fecadb8c1a20448ee54be3b9f2865da5fa0e5 (2555/2778)error: duplicate parent faaff0981d26bb0c6daa7b6f0f8ef005da388a5b ignored Rewrite 8966aeabf292874de8c78754e95e14cde1f1c776 (2568/2778)error: duplicate parent 01ff42a40354b828265ab8e4f422a7efea131b09 ignored Rewrite 4ade0a7f3717696d20dcfc75895acf4489c1fa40 (2588/2778)error: duplicate parent f34d55b819d2b1431ab6ded087ef5f2ad441458d ignored Rewrite 6990911206d54e5bf0ec1e4ba7284154b45866cf (2679/2778)error: duplicate parent b5ecd77677303ff237925a00e1ae13da371dbfc5 ignored Rewrite 09fcb5986c7bcb0d88d75949cf3ec40d680f4c17 (2725/2778)error: duplicate parent bdeee1578989eda786ae7999124ade8dd424af00 ignored Rewrite 548a013a38ea4c2b44953463162aaeb240a3efed (2729/2778)error: duplicate parent 3dee3edd2f3f762323bbae76dc7c686297e2333c ignored Rewrite c09b49c245aa0b8ad3f0cbb38e434de045f22d9d (2736/2778)error: duplicate parent 2d235e5a38c16432c49e734bcdf1586ba084f1bc ignored Rewrite 741d4292cd78cf7c059426ecf0aea6269c4f9a50 (2740/2778)error: duplicate parent c2d21902b2273aeccabdd196ce5abb589f590e8b ignored Rewrite f6e9f2620981aecd4e4793d56bbdf858dcb28a21 (2743/2778)error: duplicate parent a455255b50000416fb92e1eb9e98ec7d84a76976 ignored Rewrite 5cebc48ba84b77ed3ca470a5e0d3f4e32de9ca0e (2778/2778) Ref 'refs/heads/master' was rewritten [~/epics/motor-split/Newport/motorNewport1]$
-
Create a new clone
[~/epics/motor-split/Newport/motorNewport1]$ cd ../ [~/epics/motor-split/Newport]$ git clone file://motorNewport1 motorNewport2 Cloning into 'motorNewport2'... remote: Counting objects: 18357, done. remote: Compressing objects: 100% (5697/5697), done. remote: Total 18357 (delta 12747), reused 15990 (delta 12317) Receiving objects: 100% (18357/18357), 6.06 MiB | 1.44 MiB/s, done. Resolving deltas: 100% (12747/12747), done. [~/epics/motor-split/Newport]$ cd motorNewport2/
-
Remove the empty merge commits (the 'duplicate parent' commits from the previous filter-branch command)
[~/epics/motor-split/Newport/motorNewport2]$ git filter-branch --prune-empty --parent-filter 'sed "s/-p //g" | xargs -r git show-branch --independent | sed "s/\</-p /g"' Rewrite 28aeff5d88fe103bb50c3d60b633ab7392fd2a19 (696/696) Ref 'refs/heads/master' was rewritten [~/epics/motor-split/Newport/motorNewport2]$ [~/epics/motor-split/Newport/motorNewport2]$ cd ../ [~/epics/motor-split/Newport]$
-
IAMHERE
$ $ $ $ $ $ $ $ $ $