mirror of
https://github.com/chipsec/chipsec
synced 2026-06-08 13:31:00 +00:00
d52ea51fd7
Modified:
docs/create_manual.cmd - Add html command and options to build either html or pdf, or both
docs/sphinx/_templates/scover.tmpl - Update date automatically
docs/sphinx/_templates/sstylesheet.style - remove references to templates that will no longer be used, add format styles
docs/sphinx/conf.py - Add several changes for documentation creation. HTML: main doc, copyright year, version and release numbers, html theme options. PDF: increased toc depth
docs/sphinx/index.rst - Update from Home wiki page
docs/sphinx/removeStrRst.py - change how titles are shown and more information shown for modules and add a function to update version in scover
Deleted:
docs/sphinx/_templates/cover.pdf - no longer used
docs/sphinx/_templates/layout.html - no longer used
docs/sphinx/_templates/page.pdf - no longer used
docs/sphinx/_templates/theme.conf - added in conf.py
docs/sphinx/_images/chipsec.jpg - replaced by architecture.png
Replaced by imported wiki files:
docs/sphinx/compandstruct.rst
docs/sphinx/dalinstall.rst
docs/sphinx/description.rst
docs/sphinx/installation.rst
docs/sphinx/linuxinstall.rst
docs/sphinx/mod.rst
docs/sphinx/options.py
docs/sphinx/options.rst
docs/sphinx/osxinstall.rst
docs/sphinx/uefinstall.rst
docs/sphinx/usage.rst
docs/sphinx/winstall.rst
Added
docs/create_manual.sh - Add script version for linux
the following is a list of files imported from the wiki:
docs/sphinx/Architecture-Overview.rst
docs/sphinx/Configuration-Files.rst
docs/sphinx/Developing.rst
docs/sphinx/Install in DAL Win.rst
docs/sphinx/Install in Linux.rst
docs/sphinx/Install in MacOS.rst
docs/sphinx/Install in Windows.rst
docs/sphinx/Interpreting-Results.rst
docs/sphinx/OS-Helpers-and-Drivers.rst
docs/sphinx/Platform-Detection.rst
docs/sphinx/Running-Chipsec.rst
docs/sphinx/USB with UEFI Shell.rst
docs/sphinx/Using-CHIPSEC-with-Kali-Linux.rst
docs/sphinx/Vulnerabilities-and-CHIPSEC-Modules.rst
docs/sphinx/_images/architecture.png
Signed-off-by: Sae86 <sae.batllori@intel.com>
88 lines
3.1 KiB
Python
88 lines
3.1 KiB
Python
#CHIPSEC: Platform Security Assessment Framework
|
|
#Copyright (c) 2010-2021, Intel Corporation
|
|
#
|
|
#This program is free software; you can redistribute it and/or
|
|
#modify it under the terms of the GNU General Public License
|
|
#as published by the Free Software Foundation; Version 2.
|
|
#
|
|
#This program is distributed in the hope that it will be useful,
|
|
#but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
#GNU General Public License for more details.
|
|
#
|
|
#You should have received a copy of the GNU General Public License
|
|
#along with this program; if not, write to the Free Software
|
|
#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
#
|
|
#Contact information:
|
|
#chipsec@intel.com
|
|
#
|
|
|
|
|
|
import os
|
|
|
|
doc_path = os.getcwd()
|
|
src_path = os.path.abspath(os.path.join(doc_path, '..', '..'))
|
|
|
|
# Remove subheaders from all rst modules
|
|
def modulesRst():
|
|
for _, _, rstFiles in os.walk(os.path.join(doc_path, 'modules')):
|
|
for file in rstFiles:
|
|
f = open(os.path.join('modules', file), 'r')
|
|
title = f.readline().split('.')
|
|
contents = f.read()
|
|
f.close()
|
|
|
|
contents = contents.replace('Submodules\n----------\n\n', '')
|
|
contents = contents.replace('Subpackages\n-----------\n\n', '')
|
|
contents = contents.replace('Module contents\n---------------\n\n', '')
|
|
|
|
f = open(os.path.join('modules', file), 'w')
|
|
f.write(title[-1] + contents)
|
|
f.close()
|
|
|
|
# Create rst for xml files
|
|
def xmlRst():
|
|
for _, _, cfgFiles in os.walk(os.path.join(src_path, 'chipsec', 'cfg', '8086')):
|
|
moduleStr = ''
|
|
for cfg in cfgFiles:
|
|
if ".py" not in cfg:
|
|
moduleStr += '\tchipsec.cfg.8086.{0}.rst\n'.format(cfg)
|
|
f = open(os.path.join(src_path, 'chipsec', 'cfg', '8086', cfg), 'r')
|
|
xmlContent = f.read()
|
|
f.close()
|
|
commentBegins = xmlContent.find('<!--')
|
|
commentEnds = xmlContent.find('-->')
|
|
xmlComment = xmlContent[commentBegins +4:commentEnds] + '\n'
|
|
f = open(os.path.join(doc_path, 'modules', 'chipsec.cfg.8086.' + cfg + '.rst'), 'w')
|
|
path = "chipsec\\\\cfg\\\\8086\\\\" + cfg
|
|
f.write( cfg[:-4] + "\n" + "=" *len(cfg) + "\n\n" + "Path: " + path + "\n\n" + xmlComment )
|
|
f.close()
|
|
f = open(os.path.join(doc_path, 'modules', 'chipsec.cfg.8086.rst'), 'w')
|
|
f.write(".. toctree::\n\n" + moduleStr)
|
|
f.close()
|
|
|
|
def getVersion():
|
|
ver_path = os.path.join(src_path, 'chipsec', 'VERSION')
|
|
scover_path = os.path.join(doc_path, '_templates','scover.tmpl')
|
|
|
|
f = open(os.path.join(ver_path), 'r')
|
|
version = f.read()
|
|
f.close()
|
|
|
|
f = open(os.path.join(scover_path), 'r')
|
|
contents = f.read()
|
|
f.close()
|
|
|
|
splitContents = contents.split('\n')
|
|
contents = contents.replace(splitContents[8], 'version ' + version)
|
|
f = open(os.path.join(scover_path), 'w')
|
|
f.write(contents)
|
|
f.close()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
modulesRst()
|
|
xmlRst()
|
|
getVersion()
|