Primer
late Middle English: from medieval Latin primarius (liber) ‘primary (book)’ and primarium (manuale) ‘primary (manual)’.
wiktionary
From Middle English primer, primere, from Medieval Latin primarius and primarium(“ prayer book”) possibly via Anglo-Norman primer(“ prayer book”), from prima(“ prime the liturgical hour and office”) + -arius and -arium(“forming related objects”). Its use for schoolbooks derived from the late medieval and early modern use of such prayer books to teach reading.
prime + -er.
From Anglo-Norman primer(“ first”), from Latin prīmārius(“ first”)
etymonline
primer (n.1)
late 14c., "prayer-book, layperson's devotional manual," also "school book" (senses not distinguished in Middle English, as reading was taught from prayer books), from Medieval Latin primarium, from Latin primus "first" (see prime (adj.)), on the notion of "a first book." The word also might be all or in part from prime (n.) in the time sense on the same notion as a book of hours. Meaning "small introductory book on any topic" is from 1807.
primer (n.2)
"explosive cap," 1819, agent noun from prime (v.).
primer (n.3)
"first layer of dye or paint," 1680s, agent noun from prime (v.).