diff --git a/.gitignore b/.gitignore
index 429fb12..d0c22f1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -30,6 +30,7 @@
/extrasrc
# You should really generate local copies of these, as they're pretty private.
+**/etc/dropbear
**/etc/openvpn
**/etc/systemd/system/multi-user.target.wants/openvpn@*
**/etc/ssh
diff --git a/bdisk/build.py b/bdisk/build.py
index 87af788..c2dd1b1 100755
--- a/bdisk/build.py
+++ b/bdisk/build.py
@@ -128,23 +128,20 @@ def genUEFI(build, bdisk):
shell1_fetch.close()
print("{0}: [BUILD] Building UEFI support...".format(datetime.datetime.now()))
## But wait! That's not all! We need more binaries.
- # http://blog.hansenpartnership.com/linux-foundation-secure-boot-system-released/
- shim_url = 'http://blog.hansenpartnership.com/wp-uploads/2013/'
+ # Looks like these are in the "efitools" package now.
for f in ('PreLoader.efi', 'HashTool.efi'):
if f == 'PreLoader.efi':
fname = 'bootx64.efi'
else:
fname = f
if not os.path.isfile(prepdir + '/EFI/boot/' + fname):
- url = shim_url + f
- url_fetch = urlopen(url)
- with open(prepdir + '/EFI/boot/' + fname, 'wb+') as dl:
- dl.write(url_fetch.read())
- url_fetch.close()
+ shutil.copy2('{0}/root.x86_64/usr/share/efitools/efi/{1}'.format(chrootdir, f),
+ '{0}/EFI/boot/{1}'.format(prepdir, fname))
# And we also need the systemd efi bootloader.
if os.path.isfile(prepdir + '/EFI/boot/loader.efi'):
os.remove(prepdir + '/EFI/boot/loader.efi')
- shutil.copy2(chrootdir + '/root.x86_64/usr/lib/systemd/boot/efi/systemd-bootx64.efi', prepdir + '/EFI/boot/loader.efi')
+ shutil.copy2(chrootdir + '/root.x86_64/usr/lib/systemd/boot/efi/systemd-bootx64.efi',
+ prepdir + '/EFI/boot/loader.efi')
# And the accompanying configs for the systemd efi bootloader, too.
tpl_loader = jinja2.FileSystemLoader(templates_dir)
env = jinja2.Environment(loader = tpl_loader)
@@ -194,7 +191,7 @@ def genUEFI(build, bdisk):
with open(efiboot_img, 'wb+') as f:
f.truncate(sizetotal)
DEVNULL = open(os.devnull, 'w')
- cmd = ['/sbin/mkfs.vfat', '-F', '32', '-n', bdisk['name'] + '_EFI', efiboot_img]
+ cmd = ['/sbin/mkfs.fat', '-F', '32', '-n', bdisk['name'] + '_EFI', efiboot_img]
subprocess.call(cmd, stdout = DEVNULL, stderr = subprocess.STDOUT)
cmd = ['/bin/mount', efiboot_img, build['mountpt']]
subprocess.call(cmd)
diff --git a/bdisk/ipxe.py b/bdisk/ipxe.py
index 5dad2d8..a09d874 100755
--- a/bdisk/ipxe.py
+++ b/bdisk/ipxe.py
@@ -118,7 +118,7 @@ def genISO(conf):
tpl_loader = jinja2.FileSystemLoader(templates_dir)
env = jinja2.Environment(loader = tpl_loader)
bootdir = '{0}/ipxe_mini'.format(dlpath)
- efiboot_img = '{0}/EFI/BOOT/mini.efi'.format(bootdir)
+ efiboot_img = '{0}/EFI/{1}/efiboot.img'.format(bootdir, bdisk['name'])
innerefi64 = '{0}/src/bin-x86_64-efi/ipxe.efi'.format(ipxe_src)
efi = False
# this shouldn't be necessary... if it is, we can revisit this in the future. see "Inner dir" below.
@@ -130,10 +130,23 @@ def genISO(conf):
print('{0}: [IPXE] UEFI support for Mini ISO...'.format(datetime.datetime.now()))
if os.path.isdir(bootdir):
shutil.rmtree(bootdir)
- os.makedirs('{0}/EFI/BOOT'.format(bootdir), exist_ok = True) # EFI
- # Inner dir (mini.efi file)
- sizetotal = 65536 # 64K wiggle room. increase this if we add IA64.
+ os.makedirs(os.path.dirname(efiboot_img), exist_ok = True) # FAT32 embedded EFI dir
+ os.makedirs('{0}/EFI/boot'.format(bootdir), exist_ok = True) # EFI bootloader binary dir
+ # Inner dir (miniboot.img file)
+ #sizetotal = 2097152 # 2MB wiggle room. increase this if we add IA64.
+ sizetotal = 34603008 # 33MB wiggle room. increase this if we add IA64.
sizetotal += os.path.getsize(innerefi64)
+ sizefiles = ['HashTool', 'PreLoader']
+ for f in sizefiles:
+ sizetotal += os.path.getsize('{0}/root.x86_64/usr/share/efitools/efi/{1}.efi'.format(
+ chrootdir,
+ f))
+ # These won't be *quite* accurate since it's before the template substitution,
+ # but it'll be close enough.
+ for (path, dirs, files) in os.walk(templates_dir):
+ for file in files:
+ fname = os.path.join(path, file)
+ sizetotal += os.path.getsize(fname)
print("{0}: [IPXE] Creating EFI ESP image {1} ({2})...".format(
datetime.datetime.now(),
efiboot_img,
@@ -143,22 +156,53 @@ def genISO(conf):
with open(efiboot_img, 'wb+') as f:
f.truncate(sizetotal)
DEVNULL = open(os.devnull, 'w')
- cmd = ['/sbin/mkfs.vfat', '-F', '32', '-n', 'iPXE_EFI', efiboot_img]
+ cmd = ['/sbin/mkfs.fat', '-F', '32', '-n', 'iPXE_EFI', efiboot_img]
subprocess.call(cmd, stdout = DEVNULL, stderr = subprocess.STDOUT)
- cmd = ['/bin/mount', efiboot_img, build['mountpt']]
+ cmd = ['/bin/mount', efiboot_img, mountpt]
subprocess.call(cmd)
- os.makedirs(mountpt + '/EFI/BOOT')
- shutil.copy2(innerefi64,'{0}/EFI/BOOT/BOOTX64.EFI'.format(mountpt))
+ os.makedirs(mountpt + '/EFI/boot', exist_ok = True) # "Inner" (EFI image)
+ os.makedirs('{0}/EFI/{1}'.format(mountpt, bdisk['name']), exist_ok = True) # "Inner" (EFI image)
+ os.makedirs('{0}/boot'.format(bootdir), exist_ok = True) # kernel(s)
+ os.makedirs('{0}/loader/entries'.format(bootdir), exist_ok = True) # EFI
+ for d in (mountpt, bootdir):
+ shutil.copy2(innerefi64,'{0}/EFI/boot/ipxe.efi'.format(d))
+ for f in ('PreLoader.efi', 'HashTool.efi'):
+ if f == 'PreLoader.efi':
+ fname = 'bootx64.efi'
+ else:
+ fname = f
+ if not os.path.isfile('{0}/EFI/boot/{1}'.format(mountpt, fname)):
+ shutil.copy2('{0}/root.x86_64/usr/share/efitools/efi/{1}'.format(chrootdir, f),
+ '{0}/EFI/boot/{1}'.format(mountpt, fname))
+ if not os.path.isfile('{0}/EFI/boot/{1}'.format(bootdir, f)):
+ shutil.copy2('{0}/root.x86_64/usr/share/efitools/efi/{1}'.format(chrootdir, f),
+ '{0}/EFI/boot/{1}'.format(bootdir, fname))
+ # And the systemd efi bootloader.
+ if not os.path.isfile('{0}/EFI/boot/loader.efi'.format(mountpt)):
+ shutil.copy2('{0}/root.x86_64/usr/lib/systemd/boot/efi/systemd-bootx64.efi'.format(chrootdir),
+ '{0}/EFI/boot/loader.efi'.format(mountpt))
+ if not os.path.isfile('{0}/EFI/boot/loader.efi'.format(bootdir)):
+ shutil.copy2('{0}/root.x86_64/usr/lib/systemd/boot/efi/systemd-bootx64.efi'.format(chrootdir),
+ '{0}/EFI/boot/loader.efi'.format(bootdir))
+ # And loader entries.
+ os.makedirs('{0}/loader/entries'.format(mountpt, exist_ok = True))
+ for t in ('loader', 'base'):
+ if t == 'base':
+ name = bdisk['uxname']
+ tplpath = '{0}/loader/entries'.format(mountpt)
+ else:
+ name = t
+ tplpath = '{0}/loader'.format(mountpt)
+ tpl = env.get_template('EFI/{0}.conf.j2'.format(t))
+ tpl_out = tpl.render(build = build, bdisk = bdisk)
+ with open('{0}/{1}.conf'.format(tplpath, name), "w+") as f:
+ f.write(tpl_out)
cmd = ['/bin/umount', mountpt]
subprocess.call(cmd)
# Outer dir
- os.makedirs('{0}/boot'.format(bootdir), exist_ok = True) # kernel(s)
- os.makedirs('{0}/loader/entries'.format(bootdir), exist_ok = True) # EFI
+ outerdir = True
os.makedirs('{0}/isolinux'.format(bootdir), exist_ok = True) # BIOS
- # we reuse the preloader.efi from full ISO build
- shutil.copy2('{0}/EFI/boot/bootx64.efi'.format(prepdir),
- '{0}/EFI/BOOT/BOOTX64.EFI'.format(bootdir))
- # and we create the loader entries
+ # and we create the loader entries (outer)
for t in ('loader','base'):
if t == 'base':
name = bdisk['uxname']
@@ -167,7 +211,7 @@ def genISO(conf):
name = t
tplpath = '{0}/loader'.format(bootdir)
tpl = env.get_template('EFI/{0}.conf.j2'.format(t))
- tpl_out = tpl.render(build = build, bdisk = bdisk)
+ tpl_out = tpl.render(build = build, bdisk = bdisk, outerdir = outerdir)
with open('{0}/{1}.conf'.format(tplpath, name), "w+") as f:
f.write(tpl_out)
if mini:
@@ -198,7 +242,7 @@ def genISO(conf):
'-boot-info-table',
'-isohybrid-mbr', '{0}/root.{1}/usr/lib/syslinux/bios/isohdpfx.bin'.format(chrootdir, arch[0]),
'-eltorito-alt-boot',
- '-e', 'EFI/BOOT/mini.efi',
+ '-e', 'EFI/{0}/{1}'.format(bdisk['name'], os.path.basename(efiboot_img)),
'-no-emul-boot',
'-isohybrid-gpt-basdat',
'-output', isopath,
@@ -227,7 +271,8 @@ def genISO(conf):
'-output', isopath,
bootdir]
DEVNULL = open(os.devnull, 'w')
- subprocess.call(cmd, stdout = DEVNULL, stderr = subprocess.STDOUT)
+ #subprocess.call(cmd, stdout = DEVNULL, stderr = subprocess.STDOUT)
+ subprocess.call(cmd)
# Get size of ISO
iso['name'] = ['Mini']
iso['Mini'] = {}
diff --git a/docs/BDisk_User_Manual.v1.fodt b/docs/BDisk_User_Manual.v1.fodt
deleted file mode 100644
index 4f25b24..0000000
--- a/docs/BDisk_User_Manual.v1.fodt
+++ /dev/null
@@ -1,832 +0,0 @@
-
-
-
- 2016-12-01T11:27:37.6655108212016-12-04T05:22:38.498441678PT12H18M12S33LibreOffice/5.2.3.3$Linux_X86_64 LibreOffice_project/20m0$Build-3
-
-
- 93054
- 0
- 40748
- 21751
- true
- false
-
-
- view2
- 11578
- 3494
- 0
- 93054
- 40746
- 114803
- 0
- 1
- false
- 100
- false
-
-
-
-
- false
- true
- true
- true
- 0
- true
- true
-
- false
- false
- false
- false
- false
- false
- false
- false
- false
- false
- false
- false
- true
- true
- false
- false
- true
- false
- true
- false
- false
-
- false
- false
- true
- false
- false
-
- false
- false
- false
- false
- true
- 1037822
- false
- false
- true
- false
- true
- true
- false
- true
- 0
- false
- true
- high-resolution
- false
- false
- false
- false
- true
- true
-
- true
- false
- false
- false
- true
- false
- false
- false
-
- true
- false
- 38510
- false
- 1
- true
- false
- false
- 0
- false
- false
-
-
- false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ,
-
-
-
- ,
-
-
-
-
-
-
- BDisk ManualPage 5 of 5
-
-
-
-
- Sunday, December 4, 2016
-
-
-
-
-
-
-
-
-
-
-
-
-
- BDISK
- Manual v1.0
- Brent Saner
- bts@square-r00t.net
-
-
-
-
-
- Table of Contents
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Table of Contents
-
- Chapter I: Introduction3
- Section I.1: What is BDisk?3
- Section I.2: Who wrote it?3
- Section I.3: What is this document?3
- I.3.i: Conventions used in this document3
- Section I.4: Further information/resources3
- I.4.i: For Users3
- I.4.ii: For Developers4
- Chapter II: Getting Started4
-
-
-
- Introduction
- What is BDisk?
- BDisk refers to both a live distribution I use in my own uses (for rescue situations, recovery, etc.) but foremost and most importantly, it refers to the tool I use for building that distribution. This is what this project and documentation refer to when the word “BDisk” is used.
- BDisk is GPLv3-licensed. This means that you can use it for business reasons, personal reasons, modify it, etc. There are a few restrictions I retain, however, on this (don’t worry; they’re all in line with the GPLv3). You can find the full license in docs/LICENSE.
- When I rewrote BDisk in Python 3.x (I should take the time to note that I am still quite new to python so expect there to be plenty of optimizations to be made and general WTF-ery from seasoned python developers), one of my main goals was to make it as easy to use as possible. This is surprisingly hard to do- it’s quite challenging to try to approach software you’ve written with the mindset of someone other than you. Please see the For Users section (I.4.i).
- Who wrote it?
- I (Brent Saner) am a GNU/Linux Systems/Network Administrator/Engineer- I wear a lot of hats. I have a lot of side projects to keep me busy when I’m not working at ${dayjob}, mostly to assist in other side projects and become more efficient and proficient at those tasks. “Shaving the yak,” indeed.
- I did a lot of research into how low-level boot operations take place, both in BIOS and UEFI1
- Unified Extensible Firmware Interface. UEFI is not BIOS, and BIOS is not UEFI. (and corresponding concepts such as Secureboot, etc.) which is no easy task to understand and very commonly misunderstood. (For instance, a common misconception is that UEFI necessarily implies Secureboot. This is quite far from the truth and UEFI by itself is quite a useful replacement for BIOS). Many of these misconceptions are simply due to lack of knowledge about the intricacies and complexities behind these technologies. Some of it is simply FUD2
- Fear, Uncertainty, Doubt- propaganda, in other words. generated to prey on the fears of those who don’t understand the underlying specifications or technology.
- It’s my hope that by releasing this utility and documenting it that you can use it and save some time for yourself as well (and hopefully get the chance to learn a bit more in the process!).
- What is this document?
- This document is intended to be an indexed and easier-to-use reference than the other plaintext files (in docs/).
- Conventions used in this document
- There are certain formats used in this document to specify what type of text they are representing.
-
-
- Commands will be in italics.
-
-
- e.g. cat /tmp/file.txt
-
-
-
-
- Paths (files, directories) will be in bold (unless part of a command, output, etc.).
-
-
- e.g. /tmp/file.txt
-
-
-
-
- Variables will be underlined
-
-
- e.g. print(foo)
-
-
-
-
- URLs (hyperlinks, really; you should be able to click on them) are bold and underlined.
-
-
- e.g. https://bdisk.square-r00t.net
-
-
-
-
- Paramaters/arguments will be either in <angled brackets>, [square brackets], or [<both>]
-
-
- <> are used for positional arguments/parameters, or “placeholders”
-
-
- [] are used for optional arguments/parameters
-
-
- Thus e.g. someprog –dostuff <stufftodo> [--domorestuff <morestufftodo>]
-
-
-
-
- Further information/resources
- For Users
- If you encounter any bugs (or have any suggestions on how to improve BDisk!), please file a bug report in my bug tracker.
- For Developers
- The source is available to browse online or can be checked out via git (via the git protocol or http protocol). It is also available via Arch Linux’s AUR. If you are interested in packaging BDisk for other distributions, please feel free to contact me.
- Getting Started
-
-
-
-
\ No newline at end of file
diff --git a/docs/TODO b/docs/TODO
index 7470123..143069e 100644
--- a/docs/TODO
+++ b/docs/TODO
@@ -7,6 +7,7 @@
-GPG sigs on built files
-fix the branding, etc. on ipxe. :(
-convert docs to asciidoc, turn up instead of RTD (https://github.com/rtfd/readthedocs.org/issues/17#issuecomment-3752702)
+-add ipxe to full iso maybe?
## General ##
diff --git a/docs/manual/BODY.adoc b/docs/manual/BODY.adoc
new file mode 100644
index 0000000..f147782
--- /dev/null
+++ b/docs/manual/BODY.adoc
@@ -0,0 +1,4 @@
+include::USER.adoc[]
+include::DEV.adoc[]
+
+include::FOOT.adoc[]
diff --git a/docs/manual/DEV.adoc b/docs/manual/DEV.adoc
new file mode 100644
index 0000000..5571dcf
--- /dev/null
+++ b/docs/manual/DEV.adoc
@@ -0,0 +1,10 @@
+= Developer Manual
+[partintro]
+.What good is software if nobody changes it?
+--
+Text.
+
+More text.
+--
+
+include::dev/FUNCTIONS.adoc[]
diff --git a/docs/manual/FOOT.adoc b/docs/manual/FOOT.adoc
new file mode 100644
index 0000000..4a39877
--- /dev/null
+++ b/docs/manual/FOOT.adoc
@@ -0,0 +1,4 @@
+[appendix]
+= User Manual
+[appendix]
+= Developer Manual
diff --git a/docs/manual/00-HEAD.adoc b/docs/manual/HEAD.adoc
similarity index 85%
rename from docs/manual/00-HEAD.adoc
rename to docs/manual/HEAD.adoc
index 1f94d6c..7e936c5 100644
--- a/docs/manual/00-HEAD.adoc
+++ b/docs/manual/HEAD.adoc
@@ -1,33 +1,38 @@
-BDisk User and Developer Manual
-===============================
-Brent Saner
+= BDisk User and Developer Manual
+Brent Saner
v1.0, 2016-12
:doctype: book
-
-<<<
+:data-uri:
+:imagesdir: images
+:toc: preamble
+:toc2: left
+:sectnums:
+:toclevels: 5
+// So there's currently a "bug" in that the TOC will display with continued numbering across parts.
+// i essentially want the opposite of https://github.com/asciidoctor/asciidoctor/issues/979 TODO
[dedication]
-Thanks
-======
+= Thanks
See CREDITS in the project source for a list of thanks.
+
[preface]
-Preface
-=======
+= Preface
+=== About the Author
I (Brent Saner) am a GNU/Linux Systems/Network Administrator/Engineer- I wear a lot of hats. I have a lot of side projects to keep me busy when I’m not working at _${dayjob}_, mostly to assist in other side projects and become more efficient and proficient at those tasks. “Shaving the yak,” footnote:[See http://catb.org/jargon/html/Y/yak-shaving.html] indeed.
A lot of research went into how low-level boot operations take place when writing BDisk, both in BIOS and UEFI footnote:[*Unified Extensible Firmware Interface.* UEFI is not BIOS, and BIOS is not UEFI.] (and corresponding concepts such as Secureboot, etc.) which is no easy task to understand and very commonly misunderstood. (For instance, a common misconception is that UEFI necessarily implies Secureboot. This is quite far from the truth and UEFI by itself is quite a useful replacement for BIOS). I invite you to do research into the specifications yourself; it's rather fascinating.
-What is BDisk?
-~~~~~~~~~~~~~~
+
+=== What is BDisk?
BDisk refers to both a live distribution I use in my own uses (for rescue situations, recovery, etc.) but foremost and most importantly, it also refers to the tool I use for building that distribution. The latter is what this project and documentation refer to when the word “BDisk” is used.
When I rewrote BDisk in Python 3.x (I should take the time to note that I am still quite new to Python so expect there to be plenty of optimizations to be made and general WTF-ery from seasoned Python developers), one of my main goals was to make it as easy to use as possible. This is surprisingly hard to do- it’s quite challenging to try to approach software you’ve written with the mindset of someone other than you.
It’s my hope that by releasing this utility (and documenting it), you can use it and save some time for yourself as well (and hopefully get the chance to learn a bit more in the process!).
-Copyright/Licensing
-~~~~~~~~~~~~~~~~~~~
+
+=== Copyright/Licensing
BDisk is GPLv3-licensed. This means that you can use it for business reasons, personal reasons, modify it, etc. Please be sure to familiarize yourself with the full set of terms. You can find the full license in `docs/LICENSE`.
image::https://www.gnu.org/graphics/gplv3-127x51.png[GPLv3,align="center"]
@@ -36,16 +41,4 @@ This document (and all other associated author-generated documentation) are rele
image::https://i.creativecommons.org/l/by-sa/4.0/88x31.png[CC-BY-SA_4.0,align="center"]
-<<<
-
-User Manual
-===========
-
-[partintro]
-.What good is software if nobody uses it?
---
-BDisk was ultimately designed to make your life easier.
---
-
-TEXT
-----
\ No newline at end of file
+include::BODY.adoc[]
diff --git a/docs/manual/USER.adoc b/docs/manual/USER.adoc
new file mode 100644
index 0000000..8851918
--- /dev/null
+++ b/docs/manual/USER.adoc
@@ -0,0 +1,23 @@
+= User Manual
+
+[partintro]
+.What good is software if nobody uses it?
+--
+BDisk was ultimately designed to make your life easier. "Why would I possibly need yet another LiveCD/LiveUSB?" Well, that's sort of the point- by customizing a live distribution of GNU/Linux to _your_ particular needs/desires/whimsy, you can do away with the multiple other images you keep around. It's designed to let you create a fully customized distribution.
+
+Using BDisk, you can:
+
+* Install GNU/Linux (https://wiki.archlinux.org/index.php/installation_guide[Arch], https://watchmysys.com/blog/2015/02/installing-centos-7-with-a-chroot/[CentOS], https://www.debian.org/releases/stable/amd64/apds03.html.en[Debian], https://wiki.gentoo.org/wiki/Handbook:AMD64#Installing_Gentoo[Gentoo], https://help.ubuntu.com/lts/installation-guide/powerpc/apds04.html[Ubuntu]...). BDisk may be Arch-based, but many if not most other distros offer ways to install from any GNU/Linux live distribution.
+* Perform disk maintenance (https://raid.wiki.kernel.org/index.php/RAID_setup[mdadm], fdisk/http://www.rodsbooks.com/gdisk/[gdisk], http://gparted.org/[gparted], https://www.thomas-krenn.com/en/wiki/StorCLI[storcli], etc.). Need to replace that disk in your RAID and you don't have hotswap? Not a problem!
+* Rescue, recover, wipe (http://www.sleuthkit.org/sleuthkit/[scalpel], http://www.andybev.com/index.php/Nwipe[nwipe], http://foremost.sourceforge.net/[foremost], etc.). Chances are this is why you booted a live distro in the first place, yes?
+* Boot over the Internet (or LAN). Burning a new image to CD/DVD/USB is a pain. BDisk has built-in support for http://ipxe.org/[iPXE] (and traditional PXE setups). Update the filesystem image once, deploy it everywhere.
+* And much, much more.
+** Seriously.
+
+This manual will give you the information you need to build your very own live GNU/Linux distribution.
+--
+
+include::user/GETTING_STARTED.adoc[]
+
+include::user/PROJECT_LAYOUT.adoc[]
+
diff --git a/docs/manual/dev/FUNCTIONS.adoc b/docs/manual/dev/FUNCTIONS.adoc
new file mode 100644
index 0000000..fae6cb6
--- /dev/null
+++ b/docs/manual/dev/FUNCTIONS.adoc
@@ -0,0 +1,5 @@
+== Layout of BDisk functions
+text
+
+== Moar Functions
+and more text.
diff --git a/docs/manual/images/fig1.1.png b/docs/manual/images/fig1.1.png
new file mode 100644
index 0000000..827612d
Binary files /dev/null and b/docs/manual/images/fig1.1.png differ
diff --git a/docs/manual/user/GETTING_STARTED.adoc b/docs/manual/user/GETTING_STARTED.adoc
new file mode 100644
index 0000000..5b90a5e
--- /dev/null
+++ b/docs/manual/user/GETTING_STARTED.adoc
@@ -0,0 +1,36 @@
+== Getting Started
+
+=== Downloading
+If it isn't in your distro's repositories (It *is* in Arch's AUR! Both https://aur.archlinux.org/packages/bdisk/[tagged release] and https://aur.archlinux.org/packages/bdisk-git/[git master].), you can still easily get rolling. Simply visit the project's https://git.square-r00t.net/BDisk/[source code web interface] and download a tarball under the *Download* column:
+
+image::fig1.1.png[cgit,align="center"]
+
+If you know the tag of the commit you want, you can use curl:
+
+`curl -sL -o bdisk.tar.xz https://git.square-r00t.net/BDisk/snapshot/BDisk-3.11.tar.xz`
+
+or wget:
+
+`wget -O bdisk.tar.xz https://git.square-r00t.net/BDisk/snapshot/BDisk-3.11.tar.xz`
+
+You can use `https://git.square-r00t.net/BDisk/snapshot/BDisk-master.tar.xz` for the URL if you want the latest working version. If you want a snapshot of a specific commit, you can use e.g. `https://git.square-r00t.net/BDisk/snapshot/BDisk-5ac510762ce00eef213957825de0e6d07186e7f8.tar.xz` and so on.
+
+Alternatively, you can use https://git-scm.com/[git]. Git most definitely _should_ be in your distro's repositories.
+
+TIP: If you're new to git and want to learn more, I highly recommend the book https://git-scm.com/book/en/v2[Pro Git]. It is available for free download (or online reading).
+
+You can use https:
+
+You can clone via https:
+
+`git clone https://git.square-r00t.net/BDisk`
+
+or native git protocol:
+
+`git clone git://git.square-r00t.net/bdisk.git BDisk`
+
+The git protocol is much faster, but at a cost of lessened security.
+
+=== Prerequisites
+Here's a complete list of prerequisites:
+
diff --git a/docs/manual/user/PROJECT_LAYOUT.adoc b/docs/manual/user/PROJECT_LAYOUT.adoc
new file mode 100644
index 0000000..5806240
--- /dev/null
+++ b/docs/manual/user/PROJECT_LAYOUT.adoc
@@ -0,0 +1,2 @@
+== Project Structure
+file tree, explain dirs and files
diff --git a/extra/pre-build.d/x86_64/root/iso.pkgs.arch b/extra/pre-build.d/x86_64/root/iso.pkgs.arch
index ce1d5d0..3e9ba8b 100644
--- a/extra/pre-build.d/x86_64/root/iso.pkgs.arch
+++ b/extra/pre-build.d/x86_64/root/iso.pkgs.arch
@@ -1,2 +1,3 @@
# Commented lines are supported (via a preceding # only).
# Packages from the AUR can be specified.
+efitools
diff --git a/extra/templates/iPXE/EFI/base.conf.j2 b/extra/templates/iPXE/EFI/base.conf.j2
index a67728b..db8a10d 100644
--- a/extra/templates/iPXE/EFI/base.conf.j2
+++ b/extra/templates/iPXE/EFI/base.conf.j2
@@ -1,3 +1,3 @@
-title {{ bdisk['pname'] }} iPXE (netboot)
-efi /EFI/BOOT/mini.efi
+title {{ bdisk['pname'] }} iPXE (Mini)
+efi /EFI/boot/ipxe.efi