Compare commits

...

36 Commits
v2.01 ... v2.70

Author SHA1 Message Date
c418fca548 added instructions for submitting patch 2016-07-09 14:15:39 -04:00
2d6384e15d updating mirrorlist 2016-07-09 01:09:27 -04:00
a08ae5dd06 updating patches, tweaks, etc. 2016-07-04 06:23:52 -04:00
91b8edcc26 updating, adding some package fixes 2016-04-30 06:49:05 -04:00
3cbf32be30 updating docs 2016-04-27 20:49:56 -04:00
4e2a2fecb1 adding key for my packages 2016-04-07 00:35:52 -04:00
001fdf99d3 fixing this stupid fucking patch. gorram whitespace tabs gorram it 2016-03-02 01:29:05 -05:00
e95c4f3cff updating patch... 2016-03-01 22:15:03 -05:00
f43ceb501f updating package list with some temporary workarounds (my customizepkg-scripting might be causing some to fail?), updated some embedded confs, cleaned up some functions, updated ipxe patches 2016-02-25 10:08:43 -05:00
d826082f2b ipxe update, packages update 2016-01-10 14:34:49 -05:00
5ea464fac9 fixing build 2015-10-02 02:17:33 -04:00
8726f63c7c updating TODO, etc. 2015-09-26 15:03:11 -04:00
673a54ef2e hrmm.. gpg throwing errors and killing chroot 2015-09-23 15:27:49 -04:00
f4397354a9 adding some gitignores in prep for SSL support in iPXE 2015-09-18 01:31:58 -04:00
ac6d269a64 POINT RELEASE: all distros listed done testing 2015-09-03 00:09:48 -04:00
59bec45449 workaround for importing some SUSE vars... 2015-08-31 04:54:29 -04:00
164032088a some updates from testing.. 2015-08-29 18:09:45 -04:00
2870866232 point update 2015-08-27 20:57:45 -04:00
b2c9fc731a successful build 2015-08-25 17:33:29 -04:00
0e121285bf oops. 2015-08-24 01:51:17 -04:00
bd11e3e9ec checking in before test build and tag 2015-08-24 01:50:30 -04:00
cbde8105c1 new patches... 2015-08-21 14:45:51 -04:00
6f33687230 checking in 2015-08-17 02:07:46 -04:00
24409fe287 fixing some runtime and http stuff 2015-08-05 14:19:34 -04:00
7bf72d3987 fixing blank passwords per build.conf and updating ipxe src checkout 2015-08-04 03:19:22 -04:00
559e989e1b Merge branch 'master' of square-r00t.net:bdisk 2015-08-03 11:19:21 -04:00
7ffa278b19 merging 2015-08-03 11:19:16 -04:00
65200c2a00 fixing files 2015-08-03 11:18:33 -04:00
79a87e4789 fixing some naming stuffz... 2015-08-03 04:05:03 -04:00
e2a5ef10eb fedora passes. also discovered bug- AUR4's missing some packages. TODO: port over/adopt pkgs that are missing. 2015-07-30 12:55:54 -04:00
21dccef17c devuan and elementary not supported- non-systemd chrooting broken atm 2015-07-30 03:35:29 -04:00
c6f5a880c5 Merge branch 'master' of square-r00t.net:bdisk 2015-07-30 01:26:36 -04:00
fa5a962552 centos tested 2015-07-30 01:24:54 -04:00
0036055330 updating ipxe sources. fingers crossed patches still work, haven't tested yet. 2015-07-24 04:53:55 -04:00
8b351731bd squashfs3-tools shouldn't be necessary... which is good, because it isn't working in AUR4 anyways. 2015-07-23 18:10:07 -04:00
c6dd840e43 updating apacman 2015-07-23 15:40:23 -04:00
64 changed files with 601 additions and 317 deletions

3
.gitignore vendored
View File

@@ -31,3 +31,6 @@ extra/pre-build.d/etc/openvpn/client.conf
overlay/etc/ssh/* overlay/etc/ssh/*
overlay/home/bdisk overlay/home/bdisk
overlay/etc/systemd/system/multi-user.target.wants/openvpn@client.service overlay/etc/systemd/system/multi-user.target.wants/openvpn@client.service
src/ipxe_local/ssl/keys
src/ipxe_local/ssl/crts
src/ipxe_local/ssl/txt

View File

@@ -85,7 +85,7 @@ CHROOTDIR_GLOB="${CHROOTDIR}"
BUILDDIR_GLOB="${BUILDDIR}" BUILDDIR_GLOB="${BUILDDIR}"
# Set the version. # Set the version.
VERSION="$(git describe --abbrev=0 --tags)-$(git rev-parse --short --verify HEAD)" BUILDVERSION="$(git describe --abbrev=0 --tags)-$(git rev-parse --short --verify HEAD)"
BUILD="$(cat BUILDNO)" BUILD="$(cat BUILDNO)"
BUILD="$(expr ${BUILD} + 1)" BUILD="$(expr ${BUILD} + 1)"
echo ${BUILD} > ./BUILDNO echo ${BUILD} > ./BUILDNO
@@ -104,7 +104,7 @@ set -e
USERNAME_REAL="$(grep ${BUILD_USERNAME} /etc/passwd | cut -f5 -d':')" USERNAME_REAL="$(grep ${BUILD_USERNAME} /etc/passwd | cut -f5 -d':')"
cat > ${BASEDIR}/VERSION_INFO.txt << EOF cat > ${BASEDIR}/VERSION_INFO.txt << EOF
Version: ${VERSION} Version: ${BUILDVERSION}
Build: ${BUILD} Build: ${BUILD}
Time: ${BUILDTIME} Time: ${BUILDTIME}
Machine: ${BUILD_MACHINE} Machine: ${BUILD_MACHINE}
@@ -155,6 +155,22 @@ then
exit 0 exit 0
fi fi
# implement for future, needs tweaking- JUST rebuild the ISO.
#if [[ ${1} == "respin" ]];
#then
# if [[ "${MULTIARCH}" == "y" ]];
# then
# centos_is_stupid
# yo_dj any
# else
# centos_is_stupid
# yo_dj 64
# centos_is_stupid
# yo_dj 32
# fi
#fi
#
# or are we just building? # or are we just building?
if [[ ${1} == "build" || -z ${1} || ${1} == "all" ]]; if [[ ${1} == "build" || -z ${1} || ${1} == "all" ]];
then then

33
docs/FAQ Normal file
View File

@@ -0,0 +1,33 @@
BDisk Frequently Asked(/Unasked) Questions
0.) Why does it take so long to build?
1.) Why is the generated ISO file so big?
2.) How do I find the version/release/etc. number of an ISO?
=========================================================
0.) WHY DOES IT TAKE SO LONG TO BUILD?
A: This typically occurs when you're building from within a LiveCD/LiveUSB situation, in a VM/container/etc., or on a headless server.
If this is the case, you may run into what appears to be "stalling", especially while keys are generating for the chroots.
Thankfully, there is an easy fix. You can install the "haveged"(http://www.issihosts.com/haveged/) software and run it. This will
show an immediate and non-negligible improvement for the above contexts. If you have extra power to throw at it (or are using a dedicated build box)
as well, I recommend enabling I_AM_A_RACECAR in your build.conf. BDisk will then be more aggressive with its resource consumption.
1.) WHY IS THE GENERATED ISO FILE SO BIG?
A: You may have enabled a LOT of packages in extra/packages.(32|64|both). Or you're using the default set of packages, which tries to include a LOT
of different (and in some cases, redundant) packages for widespread utilization and usage. In addition, keep in mind that BDisk builds a single ISO
that can be used on both i686 architectures AND full x86_64 architectures ("AMD64" as you may sometimes see it referenced). Because it doesn't cheat
and just use a 64-bit kernel with a 32-bit userland, it needs two different squash images on each ISO- one for 32-bit userland and one for 64-bit
userland.
2.) HOW DO I FIND THE VERSION/RELEASE/ETC. NUMBER OF AN ISO?
A: This can be found in a multitude of places. The full-size ISO file (iso/<distname>-<git tag>-<git rev number>-(32|64|any).iso) should have the
version right in the file name. If you want more detailed information (or perhaps you renamed the file), you can mount the ISO as loopback in GNU/Linux,
*BSD, or Mac OS X and check /path/to/mounted/iso/VERSION_INTO.txt. Lastly, within the runtime itself (especially handy if booting via iPXE), you can
check /root/VERSION_INFO.txt within the running live environment.

View File

@@ -16,6 +16,9 @@ It should be fine over ethernet, since hardware switches are much faster and eff
Future versions, once this project has a dumping ground, will fetch highly compressed snapshotted chroot filesystems instead Future versions, once this project has a dumping ground, will fetch highly compressed snapshotted chroot filesystems instead
of dynamically building the entire install chroots (both x86_64 and i686) instead (with the option of building fresh locally, of dynamically building the entire install chroots (both x86_64 and i686) instead (with the option of building fresh locally,
disabled by default). disabled by default).
Maybe.
Till then, sorry for the inconvenience. Till then, sorry for the inconvenience.
!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!
@@ -56,11 +59,6 @@ All commands below should be issued in the root working directory of this git re
but also disk space for working, the finished ISO(s), etc.) but also disk space for working, the finished ISO(s), etc.)
-The following packages installed on the build host: -The following packages installed on the build host:
(NOTE: future versions will have dependencies checked automatically and installed if necessary,
depending on distro your host build machine is. the OS detection and package installation component of that isn't
done yet though. 2014.10.31)
(NOTE2: Make sure all the packages you specify are valid package names. A mistyped package name will cause the chroot creation to
break and everything else will break as a result.)
curl curl
dosfstools dosfstools
@@ -72,9 +70,24 @@ squashfs-tools
xorriso (in RPMForge repo for CentOS 7) xorriso (in RPMForge repo for CentOS 7)
xz xz
and *probably* a few others. The scripts run with set -e for the most part, so if something's missed, you'll know. and maybe a few others. The scripts run with set -e for the most part, so if something's missed, you'll know.
Oh, you will know. Oh, you will know.
If these packages are missing, they will be automatically installed. Currently, the following distros as host build systems
are supported (assumes most recent release):
Antergos
Arch
CentOS
Debian
Fedora
Gentoo
Mageia
Manjaro
openSUSE
RHEL
SUSE
Ubuntu
## Configuration ## ## Configuration ##
See extra/build.conf.sample. Copy to <PROJECT ROOT>/build.conf if you wish to modify any of the values, otherwise the defaults See extra/build.conf.sample. Copy to <PROJECT ROOT>/build.conf if you wish to modify any of the values, otherwise the defaults
@@ -105,6 +118,18 @@ Also note the following files/paths:
--/mirror.lst.sh: --/mirror.lst.sh:
Builds a fresh mirror list. Note that it is US based. Builds a fresh mirror list. Note that it is US based.
-docs:
Documentation for BDisk.
--/COPYING:
See LICENSE.
--/README:
This file.
--/LICENSE:
The license file.
--/FAQ:
Several quick questions you might have.
--/TODO:
Some features, bug fixes, etc. I have planned.
-examples: -examples:
Included recommendation for how to lay things out, etc. Included recommendation for how to lay things out, etc.
--/HTTP: --/HTTP:
@@ -112,7 +137,7 @@ Also note the following files/paths:
-extra: -extra:
Supporting files for the base building system (mirrorlist, etc.). Supporting files for the base building system (mirrorlist, etc.).
--/${UXNAME}.png: --/${UXNAME}.png:
A 640x480 8-bit RGBA colour PNG which will be used as the background for the bootsplash (if booting via BIOS and not UEFI) L A 640x480 8-bit RGBA colour PNG which will be used as the background for the bootsplash (if booting via BIOS and not UEFI)
--/bootstrap/apacman-*.tar.xz: --/bootstrap/apacman-*.tar.xz:
An AUR-enabled package manager. Necessary for AUR support. An AUR-enabled package manager. Necessary for AUR support.
--/build.conf.sample: --/build.conf.sample:
@@ -130,6 +155,8 @@ Also note the following files/paths:
--/pre-build.d: --/pre-build.d:
Contains files injected into the system. Both 64-bit and 32-bit environments. Note: be sure to place them in hierarchical order Contains files injected into the system. Both 64-bit and 32-bit environments. Note: be sure to place them in hierarchical order
(e.g. if you wish to have a file at /usr/foo/bar, you will need to place it in <PROJECT ROOT>/extra/pre-build.d/usr/foo/bar) (e.g. if you wish to have a file at /usr/foo/bar, you will need to place it in <PROJECT ROOT>/extra/pre-build.d/usr/foo/bar)
(NOTE: Make sure all the packages you specify are valid package names. A mistyped or nonexistent package name will cause the chroot
creation to break and everything else will break as a result.)
--/pre-build.d/32: --/pre-build.d/32:
Same as above, but only for 32-bit environments. Same as above, but only for 32-bit environments.
--/pre-build.d/64: --/pre-build.d/64:
@@ -143,8 +170,6 @@ Also note the following files/paths:
Here you can find full output of the runs. They are prefixed with run's PID number, and named after the function they occur in. Here you can find full output of the runs. They are prefixed with run's PID number, and named after the function they occur in.
-overlay: -overlay:
These files are applied AFTER the initial setup of the chroots. Same hierarchy rules as extra/pre-build.d. These files are applied AFTER the initial setup of the chroots. Same hierarchy rules as extra/pre-build.d.
-README:
This file.
-src: -src:
Supporting source code/source code from other projects. Supporting source code/source code from other projects.
--ipxe/: --ipxe/:
@@ -153,14 +178,12 @@ Also note the following files/paths:
Various patches and supporting configs to tweak the iPXE build. Various patches and supporting configs to tweak the iPXE build.
-tftpboot: -tftpboot:
Files to be served via TFTP for PXE booting. This directory is wiped out during any bin/clean.sh operation. Files to be served via TFTP for PXE booting. This directory is wiped out during any bin/clean.sh operation.
-TODO:
This is just what I'm using to track stuff I want to add.
You may notice other files come and go; they're mostly there for extra goodies/used to determine other things. You may notice other files come and go; they're mostly there for extra goodies/used to determine other things.
## (Re)Building ## ## (Re)Building ##
Building must be done as root, and on an Arch x86_64 system (future versions will allow for non-Arch distros). Building must be done as root, and on a supported distro (see Prerequisites for a list).
# bin/build.sh # bin/build.sh
@@ -168,3 +191,10 @@ Yeah. It's that easy. The finished product is in iso/.
If you want more verbosity, check out the logs/ directory. If you want more verbosity, check out the logs/ directory.
## Submitting Patches ##
If you have a fix or feature you'd like added, please follow the same pull request process for the kernel
(https://www.kernel.org/doc/Documentation/SubmittingPatches) and email to bts@square-r00t.net
Alternatively, file a bug at https://bugs.square-r00t.net/index.php?project=2 with a patch attached.

View File

@@ -6,6 +6,7 @@
-- https://github.com/akopytov/sysbench -- https://github.com/akopytov/sysbench
-- (http://blog.due.io/2014/linode-digitalocean-and-vultr-comparison/ etc.) -- (http://blog.due.io/2014/linode-digitalocean-and-vultr-comparison/ etc.)
-package in AUR -package in AUR
-base rewrite in python. pyalpm may come in handy here.
## NETWORKING ## ## NETWORKING ##
@@ -22,25 +23,28 @@
## Building ## ## Building ##
-GUMMIBOOT IS GONE FROM THE REPOS. I could repackage it, but better to just see what the hell archiso's doing.
-WISH: Better logging[0] -WISH: Better logging[0]
-WISH: signing for secureboot releases (PreLoader and gummiboot handle this okay, but require manual intervention
-use manual chrooting functions ONLY if distro not detected as arch. if /usr/bin/systemd-nspawn exists, use that instead -use manual chrooting functions ONLY if distro not detected as arch. if /usr/bin/systemd-nspawn exists, use that instead
--does arch-chroot work across all distros? see https://wiki.archlinux.org/index.php/Install_bundled_32-bit_system_in_Arch64 and https://wiki.archlinux.org/index.php/Chroot --does arch-chroot work across all distros? see https://wiki.archlinux.org/index.php/Install_bundled_32-bit_system_in_Arch64 and https://wiki.archlinux.org/index.php/Chroot
--i think this might be unnecessary. testing across other major distros is necessary, but i think i can just use the chroot'd arch-chroot --i think this might be unnecessary. testing across other major distros is necessary, but i think i can just use the chroot'd arch-chroot
-tweak build.conf (and build.conf.sample) to source the pwd and set as BASEDIR ***if*** the project resources are present in pwd, otherwise throw warning -tweak build.conf (and build.conf.sample) to source the pwd and set as BASEDIR ***if*** the project resources are present in pwd, otherwise throw warning
--this is half-done;PWD is currently used by default. --this is half-done;PWD is currently used by default.
-does gummiboot? loader? wtfever it's called support splash backgrounds? can i implement that differently somehow? -does gummiboot? loader? wtfever it's called support splash backgrounds? can i implement that differently somehow?
--yes, see e.g. https://www.reddit.com/r/archlinux/comments/3bwgf0/where_put_the_splasharchbmp_to_splash_screen_boot/
-strip out/remove unnecessary and orphan packages (e.g. gcc, make, automake, etc.) -strip out/remove unnecessary and orphan packages (e.g. gcc, make, automake, etc.)
-incorporate iPXE tweaks: -incorporate iPXE tweaks:
--http://ipxe.org/crypto --http://ipxe.org/crypto
--http://ipxe.org/cmd/imgtrust --http://ipxe.org/cmd/imgtrust
--http://ipxe.org/cmd/imgverify --http://ipxe.org/cmd/imgverify
--enable use of custom CA/self-signed certs for HTTPS etc. --enable use of custom CA/self-signed certs for HTTPS etc. DONE, partially. need to incorporate codesign certs/keys. routines, conf variables
-X-platform -enable mirror= kernel commandline.
--what distros are supported? --if mirror_(NAME) is present, use that as repo name.
--automatically install what we need for buildtime --if it starts with /, treat as mirrorlist (Include); otherwise use Server =
---need to finish pkg lists and then test, but meta files should be done as well as lib script --if it has mirror_SIG-X, set signature options e.g. _SIG-N would be "SigLevel = Never"
--hardcode list of runtime (e.g. live media) dependencies (e.g. openssh, vim, etc.) -iPXE background support. sed -rf "${BASEDIR}/src/ipxe_local/script.sed" ${SRCDIR}/ipxe/src/config/general.h ; sed -rf "${BASEDIR}/src/ipxe_local/script2.sed" ${SRCDIR}/ipxe/src/config/console.h
--...and create separate list for after-the-fact e.g. goodies --note that iPXE VESAFB console is not (yet) supported in EFI, so this is on hold.
## Split into Separate Tools CD ## ## Split into Separate Tools CD ##

Binary file not shown.

View File

@@ -71,6 +71,35 @@ BUILDMINI="no"
# This currently does not work for HTTPS with self-signed certificates. # This currently does not work for HTTPS with self-signed certificates.
IPXE_URI="https://bdisk.square-r00t.net" IPXE_URI="https://bdisk.square-r00t.net"
# Path to the (root) CA certificate file (in PEM/X509 format) iPXE should use.
# If one is not specified, one will be generated.
# Only used if BUILDMINI is set to yes.
# Please properly escape any spaces or other funky characters.
# Note that you can use your own CA to sign existing certs. See http://ipxe.org/crypto for
# more info. This is handy if you run a third-party/"Trusted" root-CA-signed certificate
# for the HTTPS target.
# Requires IPXE_SSL_CAKEY if specified.
IPXE_SSL_CA=""
# Path to the (root) CA key file (in PEM/X509 format) iPXE should use.
# If one is not specified, one will be generated.
# Only used if BUILDMINI is set to yes.
# Please properly escape any spaces or other funky characters.
# Requires IPXE_SSL_CA if specified.
IPXE_SSL_CAKEY=""
# Path to the CLIENT certificate (in PEM/X509). If one is not specified, one will be generated.
# Only used if BUILDMINI is set to yes.
# Please properly escape any spaces or other funky characters.
# Requires IPXE_SSL_KEY if specified.
IPXE_SSL_CRT=""
# Path to the CLIENT key (in PEM/X509). If one is not specified, one will be generated.
# Only used if BUILDMINI is set to yes.
# Please properly escape any spaces or other funky characters.
# Requires IPXE_SSL_CRT if specified.
IPXE_SSL_KEY=""
# Set to "yes" to enable pushing new changes to a git repo/committing to a local repo # Set to "yes" to enable pushing new changes to a git repo/committing to a local repo
GIT="no" GIT="no"

View File

@@ -1,7 +1,7 @@
# Server list generated by rankmirrors on 2015-02-26 # Server list generated by rankmirrors on 2016-07-09
Server = http://mirror.us.leaseweb.net/archlinux/$repo/os/$arch
Server = http://mirrors.advancedhosters.com/archlinux/$repo/os/$arch Server = http://mirrors.advancedhosters.com/archlinux/$repo/os/$arch
Server = http://mirror.umd.edu/archlinux/$repo/os/$arch Server = http://ftp.osuosl.org/pub/archlinux/$repo/os/$arch
Server = http://mirror.vtti.vt.edu/archlinux/$repo/os/$arch
Server = http://mirror.jmu.edu/pub/archlinux/$repo/os/$arch
Server = http://mirror.es.its.nyu.edu/archlinux/$repo/os/$arch
Server = http://mirrors.rutgers.edu/archlinux/$repo/os/$arch Server = http://mirrors.rutgers.edu/archlinux/$repo/os/$arch
Server = http://mirror.jmu.edu/pub/archlinux/$repo/os/$arch
Server = http://arch.mirrors.ionfish.org/$repo/os/$arch

View File

@@ -3,7 +3,7 @@
abs abs
acpi acpi
#acpidump #acpidump
afflib #afflib
aircrack-ng aircrack-ng
apr apr
apr-util apr-util
@@ -43,7 +43,7 @@ cpio
cpuburn cpuburn
cpupower cpupower
crackpkcs12 crackpkcs12
#cryptcat cryptcat
cryptsetup cryptsetup
csync2 csync2
customizepkg-scripting customizepkg-scripting
@@ -54,7 +54,7 @@ dd_rescue
dd_rhelp dd_rhelp
debianutils debianutils
debootstrap debootstrap
dialog #dialog #giving a weird dependency issue
diffutils diffutils
djohn djohn
dmidecode dmidecode
@@ -107,6 +107,7 @@ gptfdisk
gst-libav gst-libav
gst-plugins-ugly gst-plugins-ugly
hashcat hashcat
hashdeep
hddtemp hddtemp
hdparm hdparm
hexcurse hexcurse
@@ -140,30 +141,46 @@ keyutils
kismet-allplugins kismet-allplugins
lftp lftp
links links
#logkeys #logkeys-git # requires a /dev/input, which apparently isn't included in the chroots
logkeys-keymaps
lm_sensors lm_sensors
lrzsz lrzsz
lshw lshw
lsiutil #lsiutil # 404'ing on source url at the moment
lsof lsof
lsscsi lsscsi
lxde #lxde # apacman currently doesn't like package groups, so...
gpicview
lxappearance
lxappearance-obconf
lxde-common
lxde-icon-theme
lxdm
lxinput
lxlauncher
lxmusic
lxpanel
lxrandr
lxsession
lxtask
lxterminal
openbox
pcmanfm
# end lxde
lynx lynx
#lzip #lzip
macchanger macchanger
magicrescue magicrescue
mbr #mbr # doesn't seem to build anymore
mbuffer mbuffer
mcelog mcelog
md5deep
mdadm mdadm
mdcrack mdcrack
megaraid-cli # superseded by storcli
#megaraid-cli
memtester memtester
mfoc mfoc
minicom minicom
mondo #mondo
mtd-utils mtd-utils
mtr mtr
mtree mtree
@@ -184,7 +201,8 @@ nmap
nmon nmon
ntfs-3g ntfs-3g
ntfsfixboot ntfsfixboot
nwipe #nwipe #broken since they moved to github(?)
nwipe-git
obnam obnam
open-iscsi open-iscsi
openipmi openipmi
@@ -212,14 +230,13 @@ pkgfile
pkgtools pkgtools
ppp ppp
pptpclient pptpclient
prebootloader
procinfo-ng procinfo-ng
procps-ng procps-ng
progsreiserfs progsreiserfs
psmisc psmisc
pwgen pwgen
pixz pixz
pyrit-svn pyrit
python2-gnuplot python2-gnuplot
python2-pyx python2-pyx
rarcrack rarcrack
@@ -252,7 +269,8 @@ smartmontools
smbclient smbclient
s-nail s-nail
socat socat
#star ## do people even USE tape packups anymore? #star ## do people even USE tape backups anymore?
storcli
strace strace
stress stress
sucrack sucrack
@@ -268,7 +286,7 @@ thttpd
tmon tmon
tmux tmux
tre tre
truecrack-svn truecrack-git
truecrypt truecrypt
tor tor
udftools udftools
@@ -293,7 +311,7 @@ vncrack
vnstat vnstat
vpnc vpnc
weplab weplab
whdd #whdd #currently depends on dialog, which is broke as shit
whois whois
wifite-mod-pixiewps-git wifite-mod-pixiewps-git
wipe wipe
@@ -308,6 +326,7 @@ xmlto
xorg xorg
xorg-drivers xorg-drivers
xorg-xinit xorg-xinit
xterm
zerofree zerofree
zip zip
zsh zsh

View File

@@ -37,7 +37,8 @@ VerbosePkgLists
# By default, pacman accepts packages signed by keys that its local keyring # By default, pacman accepts packages signed by keys that its local keyring
# trusts (see pacman-key and its man page), as well as unsigned packages. # trusts (see pacman-key and its man page), as well as unsigned packages.
SigLevel = Required DatabaseOptional #SigLevel = Required DatabaseOptional #RE-ENABLE ME WHEN A NEW SNAPSHOT IS RELEASED WITH FIXED GPG
SigLevel = Never
LocalFileSigLevel = Optional LocalFileSigLevel = Optional
#RemoteFileSigLevel = Required #RemoteFileSigLevel = Required

View File

@@ -37,7 +37,8 @@ VerbosePkgLists
# By default, pacman accepts packages signed by keys that its local keyring # By default, pacman accepts packages signed by keys that its local keyring
# trusts (see pacman-key and its man page), as well as unsigned packages. # trusts (see pacman-key and its man page), as well as unsigned packages.
SigLevel = Required DatabaseOptional #SigLevel = Required DatabaseOptional #RE-ENABLE ME WHEN A NEW SNAPSHOT IS RELEASED WITH FIXED GPG
SigLevel = Never
LocalFileSigLevel = Optional LocalFileSigLevel = Optional
#RemoteFileSigLevel = Required #RemoteFileSigLevel = Required

View File

@@ -11,27 +11,26 @@
#buildonly=1 #buildonly=1
#cachevcs=1 #cachevcs=1
#ignorearch=1 #ignorearch=1
#needed=1 #keepkeys=1
needed=1
#noaur=1
noconfirm=1 noconfirm=1
noedit=1 noedit=1
#noaur=1 nofail=1
#noconfirm=1
#noedit=1
#nofail=1
#preview=1 #preview=1
#purgebuild=1 progress=1
purgebuild=1
#quiet=1 #quiet=1
#skipcache=1 skipcache=1
skipinteg=1 #skipinteg=1
#skiptest=1 #skiptest=1
#warn=1 #warn=1
#tmpdir=/var/tmp/apacman
#TMPDIR=/var/tmp/apacman
# #
# CONFIGURATION # CONFIGURATION
# #
#builddir="/tmp/pkgbuild-$UID"
#tmpdir="/tmp/apacmantmp-$UID" #tmpdir="/tmp/apacmantmp-$UID"
#makepkgconf="/etc/makepkg.conf" #makepkgconf="/etc/makepkg.conf"
#usermakepkgconf="$HOME/.makepkg.conf" #usermakepkgconf="$HOME/.makepkg.conf"
@@ -39,19 +38,21 @@ skipinteg=1
#downdir="/var/cache/pacman/pkg" #downdir="/var/cache/pacman/pkg"
#savedir="/var/cache/apacman/pkg" #savedir="/var/cache/apacman/pkg"
#editor="nano -w" #editor="nano -w"
editor="vim" #pager="less -R"
#RPCURL="https://aur.archlinux.org/rpc.php?type" #RPCURL="https://aur.archlinux.org/rpc.php?type"
#PKGURL="https://aur.archlinux.org" #PKGURL="https://aur.archlinux.org"
#WEBURL="https://www.archlinux.org"
#ABSURL="rsync.archlinux.org" #ABSURL="rsync.archlinux.org"
# #
# COLORIZATION # COLORIZATION
# #
COLOR1='\e[1;39m' #COLOR1='\e[1;39m'
COLOR2='\e[1;32m' #COLOR2='\e[1;32m'
COLOR3='\e[1;35m' #COLOR3='\e[1;35m'
COLOR4='\e[1;36m' #COLOR4='\e[1;36m'
COLOR5='\e[1;34m' #COLOR5='\e[1;34m'
COLOR6='\e[1;33m' #COLOR6='\e[1;33m'
COLOR7='\e[1;31m' #COLOR7='\e[1;31m'

View File

@@ -0,0 +1,4 @@
#!/bin/bash
# original URL at sourceforge chokes out
sed -re 's@^(source=\(").*$@\1ftp://ftp.gnome.org/mirror/temp/sf2015/a/au/autopsy/autopsy/2.24/autopsy-2.24.tar.gz")@g' ${1}

View File

@@ -0,0 +1,3 @@
#!/bin/bash
sed -i -e 's/build(/package(/g' ${1}

View File

@@ -0,0 +1,3 @@
#!/bin/bash
sed -i -re 's/^(url=)\((.*)\)$/\1\2/g' ${1}

View File

@@ -0,0 +1,3 @@
#!/bin/bash
sed -i -re 's/^(url=)\((.*)\)$/\1\2/g' ${1}

View File

@@ -0,0 +1,3 @@
#!/bin/bash
sed -i -re 's/^(url=)\((.*)\)$/\1\2/g' ${1}

View File

@@ -0,0 +1,3 @@
#!/bin/bash
sed -re 's@^(source=\(").*$@\1https://github.com/kwilczynski/lsi/blob/master/lsiutil/LSIUtil_1.62.zip?raw=true")@g' ${1}

View File

@@ -0,0 +1,4 @@
#!/bin/bash
# original URL at sourceforge chokes out
sed -re 's@^(source=\(").*$@\1http://fossies.org/linux/privat/${pkgname}-${pkgver}.tar.gz")@g' ${1}

View File

@@ -0,0 +1,7 @@
#!/bin/bash
if [[ ! -f "/usr/lib/libdialog.so" ]];
then
echo "Please run the following: sudo ln -s /usr/lib/libdialog.so.1.2 /usr/lib/libdialog.so"
echo "This package will fail to build otherwise."
fi

View File

@@ -1,3 +1,3 @@
#!/bin/bash #!/bin/bash
sed -i -e 's/any/x86_64/g' ${1} sed -i -re "s/'any'/'i686' 'x86_64'/g" ${1}

View File

@@ -64,4 +64,4 @@ COMPRESSION="xz"
# COMPRESSION_OPTIONS # COMPRESSION_OPTIONS
# Additional options for the compressor # Additional options for the compressor
#COMPRESSION_OPTIONS="" COMPRESSION_OPTIONS="-9"

View File

@@ -1,7 +1,6 @@
# Server list generated by rankmirrors on 2014-11-10 Server = http://mirrors.advancedhosters.com/archlinux/$repo/os/$arch
Server = http://mirror.rit.edu/archlinux/$repo/os/$arch Server = http://mirrors.gigenet.com/archlinux/$repo/os/$arch
Server = http://mirror.cc.columbia.edu/pub/linux/archlinux/$repo/os/$arch Server = http://il.mirrors.linaxe.net/archlinux/$repo/os/$arch
Server = http://mirrors.acm.wpi.edu/archlinux/$repo/os/$arch Server = http://mirror.grig.io/archlinux/$repo/os/$arch
Server = http://mirror.jmu.edu/pub/archlinux/$repo/os/$arch Server = http://arch.mirrors.ionfish.org/$repo/os/$arch
Server = http://mirror.cs.pitt.edu/archlinux/$repo/os/$arch Server = http://cosmos.cites.illinois.edu/pub/archlinux/$repo/os/$arch
Server = http://mirror.vtti.vt.edu/archlinux/$repo/os/$arch

View File

@@ -3,6 +3,6 @@
set -e set -e
apacman --noconfirm --noedit -S --needed customizepkg-scripting apacman --noconfirm --noedit -S --needed customizepkg-scripting
ln -s /usr/lib/libdialog.so.1.2 /usr/lib/libdialog.so
echo "Done." echo "Done."

View File

@@ -168,6 +168,7 @@ EOF
echo "Done." echo "Done."
echo -n "...Importing keys..." echo -n "...Importing keys..."
${CHROOTCMD} ${i}/ pacman-key --populate archlinux >> "${LOGFILE}.${FUNCNAME}" 2>&1 ${CHROOTCMD} ${i}/ pacman-key --populate archlinux >> "${LOGFILE}.${FUNCNAME}" 2>&1
${CHROOTCMD} ${i}/ pacman-key -r 93481F6B >> "${LOGFILE}.${FUNCNAME}" 2>&1 # add developer's keys
echo "Done." echo "Done."
# Prep base building system # Prep base building system
echo -n "...Installing base packages..." echo -n "...Installing base packages..."
@@ -179,7 +180,8 @@ EOF
for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%%.pacorig} ; done for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%%.pacorig} ; done
echo "Done." echo "Done."
echo -n "...Upgrading any outdated packages..." echo -n "...Upgrading any outdated packages..."
${CHROOTCMD} ${i}/ pacman -Syyu --noconfirm >> "${LOGFILE}.${FUNCNAME}" 2>&1 ${CHROOTCMD} ${i}/ pacman -Syyu --force --noconfirm >> "${LOGFILE}.${FUNCNAME}" 2>&1
${CHROOTCMD} ${i}/ pacman-key --refresh-keys >> "${LOGFILE}.${FUNCNAME}" 2>&1
for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%%.pacorig} ; done for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%%.pacorig} ; done
echo "Done. Finishing/cleaning up..." echo "Done. Finishing/cleaning up..."
${CHROOTCMD} ${i}/ pacman -S --noconfirm --needed base-devel >> "${LOGFILE}.${FUNCNAME}" 2>&1 ${CHROOTCMD} ${i}/ pacman -S --noconfirm --needed base-devel >> "${LOGFILE}.${FUNCNAME}" 2>&1
@@ -195,7 +197,7 @@ EOF
#${CHROOTCMD} ${i} "pacman --noconfirm -U /var/tmp/pkg/apacman.tar.xz" >> "${LOGFILE}.${FUNCNAME}" 2>&1 #${CHROOTCMD} ${i} "pacman --noconfirm -U /var/tmp/pkg/apacman.tar.xz" >> "${LOGFILE}.${FUNCNAME}" 2>&1
${CHROOTCMD} ${i} bash -c "pacman --noconfirm -U /var/tmp/pkg/apacman.tar.xz && mkdir /var/tmp/apacman && chmod 0750 /var/tmp/apacman && chown root:aurbuild /var/tmp/apacman " >> "${LOGFILE}.${FUNCNAME}" 2>&1 ${CHROOTCMD} ${i} bash -c "pacman --noconfirm -U /var/tmp/pkg/apacman.tar.xz && mkdir /var/tmp/apacman && chmod 0750 /var/tmp/apacman && chown root:aurbuild /var/tmp/apacman " >> "${LOGFILE}.${FUNCNAME}" 2>&1
for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%%.pacorig} ; done for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%%.pacorig} ; done
${CHROOTCMD} ${i} bash -c "apacman -S --noconfirm --noedit --skipinteg -S apacman-deps expac" >> "${LOGFILE}.${FUNCNAME}" 2>&1 ${CHROOTCMD} ${i} bash -c "apacman -S --noconfirm --noedit --skipinteg -S apacman apacman-deps expac" >> "${LOGFILE}.${FUNCNAME}" 2>&1
#rm -rf ${i}/var/tmp/pkg #rm -rf ${i}/var/tmp/pkg
#${CHROOTCMD} ${i}/ pacman -S --noconfirm --needed yaourt >> "${LOGFILE}.${FUNCNAME}" 2>&1 #${CHROOTCMD} ${i}/ pacman -S --noconfirm --needed yaourt >> "${LOGFILE}.${FUNCNAME}" 2>&1
for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%%.pacorig} ; done for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%%.pacorig} ; done
@@ -245,38 +247,39 @@ EOF
for x in $(find ${CHROOTDIR64}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%.pacorig} ; done for x in $(find ${CHROOTDIR64}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%.pacorig} ; done
set -e set -e
# preprocessing # extra packages
sed -i -e '/base-devel/d ; /multilib-devel/d' ${BASEDIR}/extra/packages.* sed -i -e '/base-devel/d ; /multilib-devel/d' ${BASEDIR}/extra/packages.{both,64}
# both # both
echo "Installing extra common packages..." echo "Installing extra common packages..."
PKGLIST=$(sed -e '/^[[:space:]]*#/d ; /^[[:space:]]*$/d' ${BASEDIR}/extra/packages.both | tr '\n' ' ') PKGLIST=$(sed -e '/^[[:space:]]*#/d ; /^[[:space:]]*$/d' ${BASEDIR}/extra/packages.both | tr '\n' ' ')
for i in ${CHROOTDIR32} ${CHROOTDIR64}; for i in ${CHROOTDIR32} ${CHROOTDIR64};
do do
echo "Running post-build tasks in ${i}..." echo "Running post-build tasks in ${i}..."
chmod 700 ${i}/root/post-build.sh
${CHROOTCMD} ${i}/ "/root/post-build.sh" >> "${LOGFILE}.${FUNCNAME}" 2>&1 ${CHROOTCMD} ${i}/ "/root/post-build.sh" >> "${LOGFILE}.${FUNCNAME}" 2>&1
for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%%.pacorig} ; done for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%%.pacorig} ; done
set +e set +e
${CHROOTCMD} ${i}/ /usr/bin/bash -c "apacman --noconfirm --noedit --skipinteg -S --needed linux" >> "${LOGFILE}.${FUNCNAME}" 2>&1 ${CHROOTCMD} ${i}/ /usr/bin/bash -c "apacman --noconfirm --noedit --skipinteg -S --needed linux" >> "${LOGFILE}.${FUNCNAME}" 2>&1
cp -a ${i}/boot/vmlinuz-linux ${i}/boot/vmlinuz-linux-${PNAME} cp -a ${i}/boot/vmlinuz-linux ${i}/boot/vmlinuz-linux-${DISTNAME}
cp -a ${i}/boot/initramfs-linux.img ${i}/boot/initramfs-linux-${PNAME}.img #cp -a ${i}/boot/initramfs-linux.img ${i}/boot/initramfs-linux-${DISTNAME}.img
set -e set -e
for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%%.pacorig} ; done for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%%.pacorig} ; done
# Uncomment if you wish to use the mkpasswd binary from within the chroot... # Uncomment if you wish to use the mkpasswd binary from within the chroot...
#${CHROOTCMD} ${i}/ bash -c "apacman --noconfirm --noedit --skipinteg -S --needed debian-whois-mkpasswd" >> "${LOGFILE}.${FUNCNAME}" 2>&1 #${CHROOTCMD} ${i}/ bash -c "apacman --noconfirm --noedit --skipinteg -S --needed debian-whois-mkpasswd" >> "${LOGFILE}.${FUNCNAME}" 2>&1
#for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%%.pacorig} ; done #for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%%.pacorig} ; done
echo -n "Regular packages..." echo -n "Regular packages..."
set +e
${CHROOTCMD} ${i}/ bash -c "yes '' | apacman --noconfirm --noedit --skipinteg -S --needed ${PKGLIST}" >> "${LOGFILE}.${FUNCNAME}" 2>&1 ${CHROOTCMD} ${i}/ bash -c "yes '' | apacman --noconfirm --noedit --skipinteg -S --needed ${PKGLIST}" >> "${LOGFILE}.${FUNCNAME}" 2>&1
set +e
for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%%.pacorig} ; done for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%%.pacorig} ; done
# User creation
set -e set -e
# User creation
echo -n "...Creating ${REGUSR} user..." echo -n "...Creating ${REGUSR} user..."
${CHROOTCMD} ${i}/ useradd -m -s /bin/bash -c "Default user" ${REGUSR} >> "${LOGFILE}.${FUNCNAME}" 2>&1 ${CHROOTCMD} ${i}/ useradd -m -s /bin/bash -c "Default user" ${REGUSR} >> "${LOGFILE}.${FUNCNAME}" 2>&1
${CHROOTCMD} ${i}/ usermod -aG users,games,video,audio ${REGUSR} >> "${LOGFILE}.${FUNCNAME}" 2>&1 ${CHROOTCMD} ${i}/ usermod -aG users,games,video,audio ${REGUSR} >> "${LOGFILE}.${FUNCNAME}" 2>&1
${CHROOTCMD} ${i}/ passwd -d ${REGUSR} >> "${LOGFILE}.${FUNCNAME}" 2>&1 ${CHROOTCMD} ${i}/ passwd -d ${REGUSR} >> "${LOGFILE}.${FUNCNAME}" 2>&1
mkdir -p ${i}/etc/sudoers.d ; chmod 750 ${i}/etc/sudoers.d mkdir -p ${i}/etc/sudoers.d ; chmod 750 ${i}/etc/sudoers.d
echo "${REGUSR} ALL=(ALL) ALL" >> ${i}/etc/sudoers.d/${REGUSR} printf "Defaults:${REGUSR} \041lecture\n${REGUSR} ALL=(ALL) ALL\n" >> ${i}/etc/sudoers.d/${REGUSR}
if [ -n "${REGUSR_PASS}" ]; if [[ -n "${REGUSR_PASS}" && "${REGUSR_PASS}" != '{[BLANK]}' ]];
then then
#${CHROOTCMD} ${i}/ "/usr/bin/echo ${REGUSR}:${REGUSR_PASS} | chpasswd -e" >> "${LOGFILE}.${FUNCNAME}" 2>&1 #${CHROOTCMD} ${i}/ "/usr/bin/echo ${REGUSR}:${REGUSR_PASS} | chpasswd -e" >> "${LOGFILE}.${FUNCNAME}" 2>&1
sed -i -e "s|^${REGUSR}::|${REGUSR}:${REGUSR_PASS}:|g" ${i}/etc/shadow sed -i -e "s|^${REGUSR}::|${REGUSR}:${REGUSR_PASS}:|g" ${i}/etc/shadow
@@ -286,7 +289,7 @@ EOF
else else
${CHROOTCMD} ${i}/ usermod -L ${REGUSR} >> "${LOGFILE}.${FUNCNAME}" 2>&1 ${CHROOTCMD} ${i}/ usermod -L ${REGUSR} >> "${LOGFILE}.${FUNCNAME}" 2>&1
fi fi
if [ -n "${ROOT_PASS}" ]; if [[ -n "${ROOT_PASS}" && "${ROOT_PASS}" != '{[BLANK]}' ]];
then then
#${CHROOTCMD} ${i}/ "/usr/bin/echo root:${ROOT_PASS} | chpasswd -e" >> "${LOGFILE}.${FUNCNAME}" 2>&1 #${CHROOTCMD} ${i}/ "/usr/bin/echo root:${ROOT_PASS} | chpasswd -e" >> "${LOGFILE}.${FUNCNAME}" 2>&1
sed -i -e "s|^root::|root:${ROOT_PASS}:|g" ${i}/etc/shadow sed -i -e "s|^root::|root:${ROOT_PASS}:|g" ${i}/etc/shadow
@@ -306,7 +309,7 @@ EOF
set +e set +e
for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%.pacorig} ; done for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%.pacorig} ; done
${CHROOTCMD} ${i}/ /usr/bin/bash -c "mkinitcpio -p linux" >> "${LOGFILE}.${FUNCNAME}" 2>&1 ${CHROOTCMD} ${i}/ /usr/bin/bash -c "mkinitcpio -p linux" >> "${LOGFILE}.${FUNCNAME}" 2>&1
cp -a ${i}/boot/initramfs-linux.img ${i}/boot/initramfs-linux-${PNAME}.img cp -a ${i}/boot/initramfs-linux.img ${i}/boot/initramfs-linux-${DISTNAME}.img
set -e set -e
done done

View File

@@ -4,8 +4,7 @@ function centos_is_stupid {
if [[ "${HOST_DIST}" == "CentOS" || "${HOST_DIST}" == "RHEL" ]]; if [[ "${HOST_DIST}" == "CentOS" || "${HOST_DIST}" == "RHEL" ]];
then then
rpm -qa | egrep -q "^xorriso-[0-9]" if [[ "$(rpm -qa | egrep -q '^xorriso-[0-9]')" != "0" ]];
if [[ "${?}" != "0" ]];
then then
# Download/install the proper xorriso # Download/install the proper xorriso
EL_VER="$(rpm -qa coreutils | sed -re 's/^coreutils-[0-9.-]*el([0-9])*.*$/\1/g')" EL_VER="$(rpm -qa coreutils | sed -re 's/^coreutils-[0-9.-]*el([0-9])*.*$/\1/g')"
@@ -17,7 +16,9 @@ function centos_is_stupid {
XORRISO_RPM=$(curl -s http://pkgs.repoforge.org/xorriso/ | egrep "\"xorriso-[0-9.-]*el${EL_VER}.rf.x86_64.rpm\"" | sed -re "s/^.*\"(xorriso[0-9.-]*el${EL_VER}.rf.x86_64.rpm).*$/\1/g") XORRISO_RPM=$(curl -s http://pkgs.repoforge.org/xorriso/ | egrep "\"xorriso-[0-9.-]*el${EL_VER}.rf.x86_64.rpm\"" | sed -re "s/^.*\"(xorriso[0-9.-]*el${EL_VER}.rf.x86_64.rpm).*$/\1/g")
echo "Since you're using either CentOS or RHEL, we need to install xorriso directly from an RPM. Please wait while we do this..." echo "Since you're using either CentOS or RHEL, we need to install xorriso directly from an RPM. Please wait while we do this..."
curl -sLo /tmp/${XORRISO_RPM} http://pkgs.repoforge.org/xorriso/${XORRISO_RPM} curl -sLo /tmp/${XORRISO_RPM} http://pkgs.repoforge.org/xorriso/${XORRISO_RPM}
set +e
yum -y install /tmp/${XORRISO_RPM} >> "${LOGFILE}.${FUNCNAME}" 2>&1 yum -y install /tmp/${XORRISO_RPM} >> "${LOGFILE}.${FUNCNAME}" 2>&1
set -e
echo "Done." echo "Done."
echo echo
fi fi
@@ -28,8 +29,7 @@ function centos_is_stupid {
# UGH. And you know what? Fuck SUSE too. # UGH. And you know what? Fuck SUSE too.
if [[ "${HOST_DIST}" == "openSUSE" || "${HOST_DIST}" == "SUSE" ]]; if [[ "${HOST_DIST}" == "openSUSE" || "${HOST_DIST}" == "SUSE" ]];
then then
rpm -qa | egrep -q "^xorriso-[0-9]" if [[ "$(rpm -qa | egrep -q '^xorriso-[0-9]')" != "0" ]];
if [[ "${?}" != "0" ]];
then then
# Download/install the proper xorriso # Download/install the proper xorriso
source /etc/os-release source /etc/os-release
@@ -37,7 +37,10 @@ function centos_is_stupid {
XORRISO_RPM=$(curl -s "http://software.opensuse.org/download.html?project=home%3AKnolleblau&package=xorriso" | egrep "/openSUSE_${SUSE_VER}/x86_64/xorriso-[0-9.-]" | tail -n1 | sed -re 's|^.*x86_64/(xorriso-[0-9.-]*.x86_64.rpm).*$|\1|g') XORRISO_RPM=$(curl -s "http://software.opensuse.org/download.html?project=home%3AKnolleblau&package=xorriso" | egrep "/openSUSE_${SUSE_VER}/x86_64/xorriso-[0-9.-]" | tail -n1 | sed -re 's|^.*x86_64/(xorriso-[0-9.-]*.x86_64.rpm).*$|\1|g')
echo "Since you're using openSUSE or SLED/SLES, we need to install xorriso directly from an RPM. Please wait while we do this..." echo "Since you're using openSUSE or SLED/SLES, we need to install xorriso directly from an RPM. Please wait while we do this..."
curl -sLo /tmp/${XORRISO_RPM} "http://download.opensuse.org/repositories/home:/Knolleblau/openSUSE_${SUSE_VER}/x86_64/${XORRISO_RPM}" curl -sLo /tmp/${XORRISO_RPM} "http://download.opensuse.org/repositories/home:/Knolleblau/openSUSE_${SUSE_VER}/x86_64/${XORRISO_RPM}"
cp /etc/zypp/zypp.conf /etc/zypp/zypp.conf_BAK."${$}"
echo 'pkg_gpgcheck = no' >> /etc/zypp/zypp.conf
zypper install --no-confirm -l /tmp/${XORRISO_RPM} >> "${LOGFILE}.${FUNCNAME}" 2>&1 zypper install --no-confirm -l /tmp/${XORRISO_RPM} >> "${LOGFILE}.${FUNCNAME}" 2>&1
mv -f /etc/zypp/zypp.conf_BAK."${$}" /etc/zypp/zypp.conf
echo "Done." echo "Done."
echo echo
@@ -64,6 +67,7 @@ function centos_is_stupid {
echo "Please ensure you are connected to the Internet/have repositories configured correctly." echo "Please ensure you are connected to the Internet/have repositories configured correctly."
exit 1 exit 1
fi fi
set -e
fi fi
zypper search binutils-devel | egrep -q '^[[:space:]]*|[[:space:]]*binutils-devel[[:space:]]*' zypper search binutils-devel | egrep -q '^[[:space:]]*|[[:space:]]*binutils-devel[[:space:]]*'

View File

@@ -75,14 +75,19 @@ function will_it_blend () {
# and now we copy stuff into the live directories # and now we copy stuff into the live directories
echo "[${ARCHSUFFIX}-bit] Copying files for PXE, and ISO building, please be patient." echo "[${ARCHSUFFIX}-bit] Copying files for PXE, and ISO building, please be patient."
#rm -rf ${TEMPDIR}/* #rm -rf ${TEMPDIR}/*
if [ ! -f ${BASEDIR}/extra/${UXNAME}.png ];
then
cat ${BASEDIR}/extra/bdisk.png > ${BASEDIR}/extra/${UXNAME}.png
fi
cp -af ${BASEDIR}/extra/${UXNAME}.png ${TEMPDIR}/. cp -af ${BASEDIR}/extra/${UXNAME}.png ${TEMPDIR}/.
cp -af ${BASEDIR}/extra/${UXNAME}.png ${TFTPDIR}/. cp -af ${BASEDIR}/extra/${UXNAME}.png ${TFTPDIR}/.
mkdir -p ${TEMPDIR}/boot mkdir -p ${TEMPDIR}/boot
cp -af ${CHROOTDIR}/boot/initramfs-linux-${PNAME}.img ${TEMPDIR}/boot/${UXNAME}.${ARCHSUFFIX}.img cp -af ${CHROOTDIR}/boot/initramfs-linux-${DISTNAME}.img ${TEMPDIR}/boot/${UXNAME}.${ARCHSUFFIX}.img
cp -af ${CHROOTDIR}/boot/vmlinuz-linux-${PNAME} ${TEMPDIR}/boot/${UXNAME}.${ARCHSUFFIX}.kern cp -af ${CHROOTDIR}/boot/vmlinuz-linux-${DISTNAME} ${TEMPDIR}/boot/${UXNAME}.${ARCHSUFFIX}.kern
cp -af ${CHROOTDIR}/boot/initramfs-linux-${PNAME}.img ${TFTPDIR}/${UXNAME}.${ARCHSUFFIX}.img cp -af ${CHROOTDIR}/boot/initramfs-linux-${DISTNAME}.img ${TFTPDIR}/${UXNAME}.${ARCHSUFFIX}.img
cp -af ${CHROOTDIR}/boot/vmlinuz-linux-${PNAME} ${TFTPDIR}/${UXNAME}.${ARCHSUFFIX}.kern cp -af ${CHROOTDIR}/boot/vmlinuz-linux-${DISTNAME} ${TFTPDIR}/${UXNAME}.${ARCHSUFFIX}.kern
cp -af ${ARCHBOOT}/* ${HTTPDIR}/${DISTNAME}/. cp -af ${ARCHBOOT}/* ${HTTPDIR}/${DISTNAME}/.
cp -af ${TFTPDIR}/* ${HTTPDIR}/.
chown -R ${HTTPUSR}:${HTTPGRP} ${HTTPDIR} chown -R ${HTTPUSR}:${HTTPGRP} ${HTTPDIR}
chown ${TFTPUSR}:${TFTPGRP} ${TFTPDIR}/${UXNAME}.* chown ${TFTPUSR}:${TFTPGRP} ${TFTPDIR}/${UXNAME}.*
} }

View File

@@ -14,10 +14,14 @@ function stuffy {
echo "Setting up EFI stuff..." echo "Setting up EFI stuff..."
mkdir -p ${TEMPDIR}/{EFI/{${DISTNAME},boot},loader/entries} mkdir -p ${TEMPDIR}/{EFI/{${DISTNAME},boot},loader/entries}
# this stuff comes from the prebootloader pkg and gummiboot pkg. lets us boot on UEFI machines with secureboot still enabled. # this stuff comes from the prebootloader pkg and systemd-boot. lets us boot on UEFI machines with secureboot still enabled.
cp ${BASEDIR}/root.x86_64/usr/lib/prebootloader/PreLoader.efi ${TEMPDIR}/EFI/boot/bootx64.efi # the signed prebootloader binaries, however, have been replaced by non-signed ones. so we need to fetch them.
cp ${BASEDIR}/root.x86_64/usr/lib/prebootloader/HashTool.efi ${TEMPDIR}/EFI/boot/. # fetched from http://blog.hansenpartnership.com/linux-foundation-secure-boot-system-released/
cp ${BASEDIR}/root.x86_64/usr/lib/gummiboot/gummibootx64.efi ${TEMPDIR}/EFI/boot/loader.efi # TODO: can i use syslinux.efi instead? curl -so ${TEMPDIR}/EFI/boot/bootx64.efi "http://blog.hansenpartnership.com/wp-uploads/2013/PreLoader.efi" # MD5: 4f7a4f566781869d252a09dc84923a82 TODO: implement checksumming check
curl -so ${TEMPDIR}/EFI/boot/HashTool.efi http://blog.hansenpartnership.com/wp-uploads/2013/HashTool.efi
#cp ${BASEDIR}/root.x86_64/usr/lib/prebootloader/PreLoader.efi ${TEMPDIR}/EFI/boot/bootx64.efi
#cp ${BASEDIR}/root.x86_64/usr/lib/prebootloader/HashTool.efi ${TEMPDIR}/EFI/boot/.
cp ${BASEDIR}/root.x86_64/usr/lib/systemd/boot/efi/systemd-bootx64.efi ${TEMPDIR}/EFI/boot/loader.efi # TODO: can i use syslinux.efi instead?
echo "Checking/fetching UEFI shells..." echo "Checking/fetching UEFI shells..."
if [ ! -f "${TEMPDIR}/EFI/shellx64_v2.efi" ]; if [ ! -f "${TEMPDIR}/EFI/shellx64_v2.efi" ];
@@ -69,9 +73,10 @@ EOF
# now we need to calculate the space for various files we're going to include... # now we need to calculate the space for various files we're going to include...
FATSIZE=$(stat --format="%s" ${TEMPDIR}/boot/${UXNAME}.64.kern) # EFI/BDISK/bdisk.efi FATSIZE=$(stat --format="%s" ${TEMPDIR}/boot/${UXNAME}.64.kern) # EFI/BDISK/bdisk.efi
FATSIZE=$((${FATSIZE} + $(stat --format="%s" ${TEMPDIR}/boot/${UXNAME}.64.img))) # EFI/BDISK/bdisk.img FATSIZE=$((${FATSIZE} + $(stat --format="%s" ${TEMPDIR}/boot/${UXNAME}.64.img))) # EFI/BDISK/bdisk.img
FATSIZE=$((${FATSIZE} + $(stat --format="%s" ${BASEDIR}/root.x86_64/usr/lib/prebootloader/PreLoader.efi))) # EFI/boot/bootx64.efi #FATSIZE=$((${FATSIZE} + $(stat --format="%s" ${BASEDIR}/root.x86_64/usr/lib/prebootloader/PreLoader.efi))) # EFI/boot/bootx64.efi
FATSIZE=$((${FATSIZE} + $(stat --format="%s" ${BASEDIR}/root.x86_64/usr/lib/prebootloader/HashTool.efi))) # EFI/boot/HashTool.efi FATSIZE=$((${FATSIZE} + $(stat --format="%s" ${TEMPDIR}/EFI/boot/bootx64.efi))) # EFI/boot/bootx64.efi
FATSIZE=$((${FATSIZE} + $(stat --format="%s" ${BASEDIR}/root.x86_64/usr/lib/gummiboot/gummibootx64.efi))) # EFI/boot/loader.efi FATSIZE=$((${FATSIZE} + $(stat --format="%s" ${TEMPDIR}/EFI/boot/HashTool.efi))) # EFI/boot/HashTool.efi
FATSIZE=$((${FATSIZE} + $(stat --format="%s" ${BASEDIR}/root.x86_64/usr/lib/systemd/boot/efi/systemd-bootx64.efi))) # EFI/boot/loader.efi
FATSIZE=$((${FATSIZE} + $(stat --format="%s" ${TEMPDIR}/EFI/shellx64_v1.efi))) FATSIZE=$((${FATSIZE} + $(stat --format="%s" ${TEMPDIR}/EFI/shellx64_v1.efi)))
FATSIZE=$((${FATSIZE} + $(stat --format="%s" ${TEMPDIR}/EFI/shellx64_v2.efi))) FATSIZE=$((${FATSIZE} + $(stat --format="%s" ${TEMPDIR}/EFI/shellx64_v2.efi)))
FATSIZE=$((${FATSIZE} + $(du -sb ${TEMPDIR}/loader | tail -n1 | awk '{print $1}'))) # loader/* (okay so i cheated a little here.) FATSIZE=$((${FATSIZE} + $(du -sb ${TEMPDIR}/loader | tail -n1 | awk '{print $1}'))) # loader/* (okay so i cheated a little here.)
@@ -110,9 +115,9 @@ title UEFI Shell (v1)
efi /EFI/shellx64_v1.efi efi /EFI/shellx64_v1.efi
EOF EOF
cp ${BASEDIR}/root.x86_64/usr/lib/prebootloader/PreLoader.efi ${SRCDIR}/efiboot/EFI/boot/bootx64.efi cp ${TEMPDIR}/EFI/boot/bootx64.efi ${SRCDIR}/efiboot/EFI/boot/bootx64.efi
cp ${BASEDIR}/root.x86_64/usr/lib/prebootloader/HashTool.efi ${SRCDIR}/efiboot/EFI/boot/. cp ${TEMPDIR}/EFI/boot/HashTool.efi ${SRCDIR}/efiboot/EFI/boot/.
cp ${BASEDIR}/root.x86_64/usr/lib/gummiboot/gummibootx64.efi ${SRCDIR}/efiboot/EFI/boot/loader.efi # TODO: can i use syslinux.efi instead? cp ${BASEDIR}/root.x86_64/usr/lib/systemd/boot/efi/systemd-bootx64.efi ${SRCDIR}/efiboot/EFI/boot/loader.efi # TODO: can i use syslinux.efi instead?
cp ${TEMPDIR}/EFI/shellx64_v{1,2}.efi ${SRCDIR}/efiboot/EFI/. cp ${TEMPDIR}/EFI/shellx64_v{1,2}.efi ${SRCDIR}/efiboot/EFI/.
umount ${SRCDIR}/efiboot umount ${SRCDIR}/efiboot
echo "EFI configuration complete..." echo "EFI configuration complete..."

View File

@@ -5,15 +5,15 @@ function yo_dj () {
ARCH="${1}" ARCH="${1}"
echo "Building the actual .iso image. This may take a while." echo "Building the actual .iso image. This may take a while."
#im_batman ## WHYTF IS THIS HERE?! #im_batman ## WHYTF IS THIS HERE?!
ISOFILENAME="${UXNAME}-${VERSION}.iso" ISOFILENAME="${UXNAME}-${BUILDVERSION}.iso"
#MINIFILENAME="${UXNAME}-${VERSION}-mini.iso" #MINIFILENAME="${UXNAME}-${BUILDVERSION}-mini.iso"
MINIFILENAME="${UXNAME}-mini.iso" MINIFILENAME="${UXNAME}-mini.iso"
USBFILENAME="${UXNAME}-mini.usb.img" USBFILENAME="${UXNAME}-mini.usb.img"
if [[ "${MULTIARCH}" == "y" ]]; if [[ "${MULTIARCH}" == "y" ]];
then then
ISOFILENAME="${UXNAME}-${VERSION}-any.iso" ISOFILENAME="${UXNAME}-${BUILDVERSION}-any.iso"
else else
ISOFILENAME="${UXNAME}-${VERSION}-${ARCH}.iso" ISOFILENAME="${UXNAME}-${BUILDVERSION}-${ARCH}.iso"
fi fi
if [[ "${I_AM_A_RACECAR}" == "y" ]]; if [[ "${I_AM_A_RACECAR}" == "y" ]];
@@ -284,32 +284,109 @@ EOF
if [[ "${BUILDMINI}" == "y" ]]; if [[ "${BUILDMINI}" == "y" ]];
then then
echo "Now generating the iPXE images; please wait..." echo "Now generating the iPXE images; please wait..."
## Get the latest version of ipxe from git.
git submodule init >> "${LOGFILE}.${FUNCNAME}" 2>&1 git submodule init >> "${LOGFILE}.${FUNCNAME}" 2>&1
git submodule update >> "${LOGFILE}.${FUNCNAME}" 2>&1 git submodule update >> "${LOGFILE}.${FUNCNAME}" 2>&1
cd ${BASEDIR}/src/ipxe/src cd ${BASEDIR}/src/ipxe/src
git checkout master .
git clean -xdf > /dev/null 2>&1 git clean -xdf > /dev/null 2>&1
git reset --hard HEAD >> "${LOGFILE}.${FUNCNAME}" 2>&1 git reset --hard HEAD >> "${LOGFILE}.${FUNCNAME}" 2>&1
git checkout master >> "${LOGFILE}.${FUNCNAME}" 2>&1 git checkout master >> "${LOGFILE}.${FUNCNAME}" 2>&1
git pull >> "${LOGFILE}.${FUNCNAME}" 2>&1 git pull >> "${LOGFILE}.${FUNCNAME}" 2>&1
git checkout master >> "${LOGFILE}.${FUNCNAME}" 2>&1 git checkout master >> "${LOGFILE}.${FUNCNAME}" 2>&1
# It will not build if we don't do this. Apparently we *need* libiberty.
# ...or do we?
#git revert -n 40a9a0f0
## Apply our patches.
# This replaces the 0003 and 0004 patches.
# curl -s https://patch-diff.githubusercontent.com/raw/ipxe/ipxe/pull/49.patch > ${BASEDIR}/src/ipxe_local/patches/ipxe-0003-no-PIE.patch 2>/dev/null # this isn't really necessary, I think? If you're dying right around this step, uncomment.
curl -s https://patch-diff.githubusercontent.com/raw/ipxe/ipxe/pull/50.patch > ${BASEDIR}/src/ipxe_local/patches/ipxe-0004-eiso.patch 2>/dev/null
for i in $(find ${BASEDIR}/src/ipxe_local/patches/ -type f -iname "*.patch" -printf '%P\n' | sort); for i in $(find ${BASEDIR}/src/ipxe_local/patches/ -type f -iname "*.patch" -printf '%P\n' | sort);
do do
patch -Np2 < ${BASEDIR}/src/ipxe_local/patches/${i} >> "${LOGFILE}.${FUNCNAME}" 2>&1 patch --verbose -Np2 < ${BASEDIR}/src/ipxe_local/patches/${i} >> "${LOGFILE}.${FUNCNAME}" 2>&1
done done
## SSL
SSLDIR="${BASEDIR}/src/ipxe_local/ssl"
mkdir -p ${SSLDIR}/{keys,crts,txt}
chmod 000 ${SSLDIR}/keys
chown root:root ${SSLDIR}/keys
if [[ -z "${IPXE_SSL_CA}" && -z "${IPXE_SSL_KEY}" ]];
then
# Generate SSL CA
#rm -rf ${SSLDIR}/*
cd "${SSLDIR}"
IPXE_SSL_CA="${SSLDIR}/crts/ca.crt"
IPXE_SSL_CAKEY="${SSLDIR}/keys/ca.key"
IPXE_DOMAIN=$(echo ${IPXE_URI} | sed -re 's/^(f|ht)tps?:\/\/// ; s/\/.*//')
if [[ ! -f "${SSLDIR}/txt/ca.srl" ]];
then
echo 01 > ${SSLDIR}/txt/ca.srl
fi
touch ${SSLDIR}/txt/ca.idx
openssl req -days 3650 -subj "/CN=${IPXE_DOMAIN}/O=${PNAME}/C=NA" -x509 -newkey rsa:4096 -nodes -out ${IPXE_SSL_CA} -keyout ${IPXE_SSL_CAKEY} -sha512 >> "${LOGFILE}.${FUNCNAME}" 2>&1
openssl req -days 3650 -subj "/CN=${IPXE_DOMAIN}/O=${PNAME}/C=NA" -newkey rsa:4096 -keyout ${SSLDIR}/keys/server.key -nodes -out ${SSLDIR}/crts/server.csr -sha512 >> "${LOGFILE}.${FUNCNAME}" 2>&1
openssl ca -days 3650 -batch -config ${SSLDIR}/openssl.cnf -keyfile ${IPXE_SSL_CAKEY} -in ${SSLDIR}/crts/server.csr -out ${SSLDIR}/crts/server.crt >> "${LOGFILE}.${FUNCNAME}" 2>&1
#cat crts/server.crt crts/ca.crt > crts/server_chained.crt
elif [[ -z "${IPXE_SSL_CA}" && -e "${IPXE_SSL_CAKEY}" ]];
then
echo "ERROR: You specified IPXE_SSL_CAKEY but not IPXE_SSL_CA. If one is specified, the other must be also."
exit 1
elif [[ -z "${IPXE_SSL_CAKEY}" && -e "${IPXE_SSL_CA}" ]];
then
echo "ERROR: You specified IPXE_SSL_CA but not IPXE_SSL_CAKEY. If one is specified, the other must be also."
exit 1
elif [[ ! -e "${IPXE_SSL_CA}" || ! -e "${IPXE_SSL_CAKEY}" ]];
then
echo "ERROR: You have specified both IPXE_SSL_CA and IPXE_SSL_CAKEY but one (or both) are not valid paths/files."
exit 1
fi
if [[ -z "${IPXE_SSL_KEY}" && -z "${IPXE_SSL_CRT}" ]];
then
IPXE_SSL_KEY="${SSLDIR}/keys/client.key"
IPXE_SSL_CRT="${SSLDIR}/crts/client.crt"
IPXE_DOMAIN=$(echo ${IPXE_URI} | sed -re 's/^(f|ht)tps?:\/\/// ; s/\/.*//')
# Generate SSL client key.
openssl req -days 3650 -subj "/CN=${IPXE_DOMAIN}/O=${PNAME}/C=NA" -newkey rsa:4096 -keyout ${IPXE_SSL_KEY} -nodes -out ${SSLDIR}/crts/client.csr -sha512 >> "${LOGFILE}.${FUNCNAME}" 2>&1
# Sign the crt.
openssl ca -days 3650 -batch -config ${SSLDIR}/openssl.cnf -keyfile ${IPXE_SSL_CAKEY} -in ${SSLDIR}/crts/client.csr -out ${IPXE_SSL_CRT} >> "${LOGFILE}.${FUNCNAME}" 2>&1
elif [[ -z "${IPXE_SSL_CRT}" && -e "${IPXE_SSL_KEY}" ]];
then
echo "ERROR: You specified IPXE_SSL_KEY but not IPXE_SSL_CRT. If one is specified, the other must be also."
exit 1
elif [[ -z "${IPXE_SSL_KEY}" && -e "${IPXE_SSL_CRT}" ]];
then
echo "ERROR: You specified IPXE_SSL_CRT but not IPXE_SSL_KEY. If one is specified, the other must be also."
exit 1
elif [[ ! -e "${IPXE_SSL_CRT}" || ! -e "${IPXE_SSL_KEY}" ]];
then
echo "ERROR: You have specified both IPXE_SSL_CRT and IPXE_SSL_KEY but one (or both) are not valid paths/files."
exit 1
fi
cd ${BASEDIR}/src/ipxe/src
# Generate the iPXE EMBED script... # Generate the iPXE EMBED script...
sed -re "s,^(chain\ ).*$,\1${IPXE_URI},g" \ sed -re "s,^(chain\ ).*$,\1${IPXE_URI},g" \
-e 's/%%COMMA%%/,/g' ${BASEDIR}/src/ipxe_local/EMBED > ${SRCDIR}/EMBED -e 's/%%COMMA%%/,/g' ${BASEDIR}/src/ipxe_local/EMBED > ${SRCDIR}/EMBED
# And now we build!
#make everything EMBED="${SRCDIR}/EMBED" >> "${LOGFILE}.${FUNCNAME}" 2>&1 #make everything EMBED="${SRCDIR}/EMBED" >> "${LOGFILE}.${FUNCNAME}" 2>&1
make bin-i386-efi/ipxe.efi bin-x86_64-efi/ipxe.efi EMBED="${SRCDIR}/EMBED" >> "${LOGFILE}.${FUNCNAME}" 2>&1 make bin-i386-efi/ipxe.efi bin-x86_64-efi/ipxe.efi \
make bin/ipxe.eiso bin/ipxe.usb EMBED="${SRCDIR}/EMBED" >> "${LOGFILE}.${FUNCNAME}" 2>&1 EMBED="${SRCDIR}/EMBED" \
TRUST="${IPXE_SSL_CA}" \
CERT="${IPXE_SSL_CA},${IPXE_SSL_CRT}" \
PRIVKEY="${IPXE_SSL_KEY}" >> "${LOGFILE}.${FUNCNAME}" 2>&1
make bin/ipxe.eiso bin/ipxe.usb \
EMBED="${SRCDIR}/EMBED" \
TRUST="${IPXE_SSL_CA}" \
CERT="${IPXE_SSL_CA},${IPXE_SSL_CRT}" \
PRIVKEY="${IPXE_SSL_KEY}" >> "${LOGFILE}.${FUNCNAME}" 2>&1
# Change this to USB-only... # Change this to USB-only...
#make all EMBED="${BASEDIR}/src/ipxe_local/EMBED" >> "${LOGFILE}.${FUNCNAME}" 2>&1 #make all EMBED="${BASEDIR}/src/ipxe_local/EMBED" >> "${LOGFILE}.${FUNCNAME}" 2>&1
mv -f ${BASEDIR}/src/ipxe/src/bin/ipxe.usb ${ISODIR}/${USBFILENAME} mv -f ${BASEDIR}/src/ipxe/src/bin/ipxe.usb ${ISODIR}/${USBFILENAME}
mv -f ${BASEDIR}/src/ipxe/src/bin/ipxe.eiso ${ISODIR}/${MINIFILENAME} mv -f ${BASEDIR}/src/ipxe/src/bin/ipxe.eiso ${ISODIR}/${MINIFILENAME}
make clean >> "${LOGFILE}.${FUNCNAME}" 2>&1 make clean >> "${LOGFILE}.${FUNCNAME}" 2>&1
git reset --hard >> "${LOGFILE}.${FUNCNAME}" 2>&1 cd ${BASEDIR}/src/ipxe
git checkout master . > /dev/null 2>&1
git clean -xdf > /dev/null 2>&1 git clean -xdf > /dev/null 2>&1
git checkout master > /dev/null 2>&1 git reset --hard >> "${LOGFILE}.${FUNCNAME}" 2>&1
#git reset --hard HEAD > /dev/null 2>&1 #git reset --hard HEAD > /dev/null 2>&1
echo echo
fi fi

View File

@@ -22,7 +22,7 @@ function mentos {
RACECAR_CHK="" RACECAR_CHK=""
fi fi
if [[ -n $(find ${BASEDIR}/extra/pre-build.d/ -type f -newer ${BASEDIR}/root.x86_64/boot/vmlinuz-linux-${PNAME}) ]]; if [[ -n $(find ${BASEDIR}/extra/pre-build.d/ -type f -newer ${BASEDIR}/root.x86_64/boot/vmlinuz-linux-${DISTNAME}) ]];
then then
touch ${LOCKFILE} touch ${LOCKFILE}
sleep 2 sleep 2
@@ -36,7 +36,7 @@ function mentos {
for i in ${CHROOTDIR32} ${CHROOTDIR64}; for i in ${CHROOTDIR32} ${CHROOTDIR64};
do do
echo -n "...Packages installing/upgrading to ${i}..." echo -n "...Packages installing/upgrading to ${i}..."
local INSTKERN=$(file ${i}/boot/vmlinuz-linux-${PNAME} | awk '{print $9}' | cut -f1 -d"-") local INSTKERN=$(file ${i}/boot/vmlinuz-linux-${DISTNAME} | awk '{print $9}' | cut -f1 -d"-")
local MIRROR=$(egrep '^Server' ${i}/etc/pacman.d/mirrorlist | head -n1 | sed -e 's/^Server\ =\ //g ; s#$repo.*#core/os/x86_64/#g') local MIRROR=$(egrep '^Server' ${i}/etc/pacman.d/mirrorlist | head -n1 | sed -e 's/^Server\ =\ //g ; s#$repo.*#core/os/x86_64/#g')
local NEWKERN=$(curl -s "${MIRROR}" | grep linux | awk '{print $3}' | cut -f2 -d\" | egrep '^linux-[0-9].*pkg.tar.xz$' | cut -f2 -d"-") local NEWKERN=$(curl -s "${MIRROR}" | grep linux | awk '{print $3}' | cut -f2 -d\" | egrep '^linux-[0-9].*pkg.tar.xz$' | cut -f2 -d"-")
@@ -45,8 +45,8 @@ function mentos {
for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%.pacorig} ; done for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%.pacorig} ; done
${CHROOTCMD} ${i}/ /usr/bin/bash -c "mkinitcpio -p linux" >> "${LOGFILE}.${FUNCNAME}" 2>&1 ${CHROOTCMD} ${i}/ /usr/bin/bash -c "mkinitcpio -p linux" >> "${LOGFILE}.${FUNCNAME}" 2>&1
#${CHROOTCMD} ${i}/ bash -c "apacman --noconfirm --noedit --skipinteg -S --needed ${PKGLIST}" #${CHROOTCMD} ${i}/ bash -c "apacman --noconfirm --noedit --skipinteg -S --needed ${PKGLIST}"
cp -a ${i}/boot/vmlinuz-linux ${i}/boot/vmlinuz-linux-${PNAME} cp -a ${i}/boot/vmlinuz-linux ${i}/boot/vmlinuz-linux-${DISTNAME}
cp -a ${i}/boot/initramfs-linux.img ${i}/boot/initramfs-linux-${PNAME}.img cp -a ${i}/boot/initramfs-linux.img ${i}/boot/initramfs-linux-${DISTNAME}.img
echo "Done." echo "Done."
done done

View File

@@ -1,6 +1,6 @@
NAME='CentOS' NAME='CentOS'
# Currently fails on installing software *inside* the chroot. Will troubleshoot and restore when figured out. # Currently fails on installing software *inside* the chroot. Will troubleshoot and restore when figured out.
SUPPORTED='untested' SUPPORTED='yes'
CHECK_METHOD='egrep "^CentOS" /etc/redhat-release' CHECK_METHOD='egrep "^CentOS" /etc/redhat-release'
PKG_MGR='yum -y install ${pkgname}' PKG_MGR='yum -y install ${pkgname}'
PRE_RUN='none' PRE_RUN='none'

View File

@@ -1,5 +1,5 @@
NAME='Debian' NAME='Debian'
SUPPORTED='untested' SUPPORTED='yes'
CHECK_METHOD='egrep "^NAME=\"Debian\ GNU/Linux\"$" /etc/os-release' CHECK_METHOD='egrep "^NAME=\"Debian\ GNU/Linux\"$" /etc/os-release'
PKG_MGR='apt-get -y install ${pkgname}' PKG_MGR='apt-get -y install ${pkgname}'
PRE_RUN='apt-get update' PRE_RUN='apt-get update'

View File

@@ -10,7 +10,7 @@ libiberty-dev
libisoburn1 libisoburn1
lynx lynx
liblzma5 liblzma5
liblsma-dev liblzma-dev
make make
mtools mtools
patch patch

View File

@@ -1,5 +1,5 @@
NAME='Devuan' NAME='Devuan'
SUPPORTED='yes' SUPPORTED='no'
CHECK_METHOD='egrep "^NAME=\"Devuan\ GNU/Linux\"$" /etc/os-release' CHECK_METHOD='egrep "^NAME=\"Devuan\ GNU/Linux\"$" /etc/os-release'
PKG_MGR='apt-get -y install ${pkgname}' PKG_MGR='apt-get -y install ${pkgname}'
PRE_RUN='apt-get update' PRE_RUN='apt-get update'

View File

@@ -1,5 +1,5 @@
NAME='Fedora' NAME='Fedora'
SUPPORTED='untested' SUPPORTED='yes'
CHECK_METHOD='egrep '^Fedora' /etc/redhat-release' CHECK_METHOD='egrep '^Fedora' /etc/redhat-release'
PKG_MGR='dnf -y install ${pkgname}' PKG_MGR='dnf -y install ${pkgname}'
PRE_RUN='none' PRE_RUN='none'

View File

@@ -1,6 +1,7 @@
binutils binutils
binutils-devel binutils-devel
curl curl
dosfstools
gcc gcc
git git
libisofs libisofs

View File

@@ -1,5 +1,5 @@
NAME='Gentoo' NAME='Gentoo'
SUPPORTED='untested' SUPPORTED='yes'
CHECK_METHOD='egrep "^Gentoo\ Base\ System" /etc/gentoo-release' CHECK_METHOD='egrep "^Gentoo\ Base\ System" /etc/gentoo-release'
PKG_MGR='emerge -q1Dn ${pkgname}' PKG_MGR='emerge -q1Dn ${pkgname}'
PRE_RUN='emerge -q --sync' PRE_RUN='emerge -q --sync'

View File

@@ -1,5 +1,6 @@
sys-devel/binutils sys-devel/binutils
net-misc/curl net-misc/curl
sys-fs/dosfstools
sys-devel/gcc sys-devel/gcc
dev-vcs/git dev-vcs/git
dev-libs/libisoburn dev-libs/libisoburn

View File

@@ -1,5 +1,5 @@
NAME='Mageia' NAME='Mageia'
SUPPORTED='untested' SUPPORTED='yes'
CHECK_METHOD='egrep "^Mageia\ release\ " /etc/mageia-release' CHECK_METHOD='egrep "^Mageia\ release\ " /etc/mageia-release'
PKG_MGR='urpmi --force --auto ${pkgname}' PKG_MGR='urpmi --force --auto ${pkgname}'
PRE_RUN='urpmi.update -a' PRE_RUN='urpmi.update -a'

View File

@@ -1,8 +1,8 @@
NAME='Manjaro' NAME='Manjaro'
SUPPORTED='untested' SUPPORTED='yes'
CHECK_METHOD='egrep "^NAME=\"Manjaro Linux\"$" /etc/os-release' CHECK_METHOD='egrep "^NAME=\"Manjaro Linux\"$" /etc/os-release'
PKG_MGR='pacman -S --needed --noconfirm ${pkgname}' PKG_MGR='pacman -S --needed --noconfirm ${pkgname}'
PRE_RUN='pacman -Syyyu' PRE_RUN='pacman -Syyy --noconfirm'
PKG_CHK='pacman -Q ${pkgname}' PKG_CHK='pacman -Q ${pkgname}'
URL='https://manjaro.org/' URL='https://manjaro.org/'
@@ -20,6 +20,7 @@ function distro_specific_tweaks {
if [[ "${?}" == "0" ]]; if [[ "${?}" == "0" ]];
then then
pacman -Rdd --noconfirm ${pkg_override} >> "${LOGFILE}.${FUNCNAME}" 2>&1 pacman -Rdd --noconfirm ${pkg_override} >> "${LOGFILE}.${FUNCNAME}" 2>&1
pacman -S --noconfirm ${pkg_override}-multilib >> "${LOGFILE}.${FUNCNAME}" 2>&1
fi fi
done done
set -e set -e

View File

@@ -1,6 +1,7 @@
NAME='Mint' NAME='Mint'
SUPPORTED='untested' SUPPORTED='no'
CHECK_METHOD='egrep "^DESCRIPTION=\"Linux\ Mint\"" /etc/linuxmint/info' # Needs non-systemd chroot method
CHECK_METHOD='egrep "^DESCRIPTION=\"Linux\ Mint" /etc/linuxmint/info'
PKG_MGR='apt-get -y install ${pkgname}' PKG_MGR='apt-get -y install ${pkgname}'
PRE_RUN='apt-get -y update' PRE_RUN='apt-get -y update'
PKG_CHK='dpkg-query -l ${pkgname}' PKG_CHK='dpkg-query -l ${pkgname}'

View File

@@ -1,5 +1,5 @@
NAME='RHEL' NAME='RHEL'
SUPPORTED='untested' SUPPORTED='yes'
# Red Hat Enterprise Linux Server release 6.5 (Santiago) # Red Hat Enterprise Linux Server release 6.5 (Santiago)
CHECK_METHOD='egrep "^Red\ Hat\ Enterprise\ Linux" /etc/redhat-release' CHECK_METHOD='egrep "^Red\ Hat\ Enterprise\ Linux" /etc/redhat-release'
PKG_MGR='yum -y install' PKG_MGR='yum -y install'

View File

@@ -1,6 +1,7 @@
binutils binutils
binutils-devel binutils-devel
curl curl
dosfstools
gcc gcc
git git
libisofs libisofs

View File

@@ -1,5 +1,5 @@
NAME='SUSE' NAME='SUSE'
SUPPORTED='untested' SUPPORTED='yes'
# Both SLED and SLES. We can probably safely combine them. # Both SLED and SLES. We can probably safely combine them.
CHECK_METHOD='egrep "^NAME=\"SLE(D|S)\"$" /etc/os-release' CHECK_METHOD='egrep "^NAME=\"SLE(D|S)\"$" /etc/os-release'
PKG_MGR='zypper install --no-confirm -l ${pkgname}' PKG_MGR='zypper install --no-confirm -l ${pkgname}'

View File

@@ -1,5 +1,5 @@
NAME='Ubuntu' NAME='Ubuntu'
SUPPORTED='untested' SUPPORTED='yes'
CHECK_METHOD='egrep "^DISTRIB_ID=Ubuntu$" /etc/lsb-release' CHECK_METHOD='egrep "^DISTRIB_ID=Ubuntu$" /etc/lsb-release'
PKG_MGR='apt-get -y install ${pkgname}' PKG_MGR='apt-get -y install ${pkgname}'
PRE_RUN='apt-get -y update' PRE_RUN='apt-get -y update'

View File

@@ -10,7 +10,7 @@ libiberty-dev
libisoburn1 libisoburn1
lynx lynx
liblzma5 liblzma5
liblsma-dev liblzma-dev
make make
mtools mtools
patch patch
@@ -19,7 +19,6 @@ rsync
sed sed
squashfs-tools squashfs-tools
syslinux syslinux
syslinux-efi
xorriso xorriso
xz-utils xz-utils
zlib1g zlib1g

View File

@@ -1,5 +1,5 @@
NAME='elementaryOS' NAME='elementaryOS'
SUPPORTED='untested' SUPPORTED='no'
CHECK_METHOD='egrep "^DISTRIB_ID=\"elementary OS\"$" /etc/lsb-release' CHECK_METHOD='egrep "^DISTRIB_ID=\"elementary OS\"$" /etc/lsb-release'
PKG_MGR='apt-get -y install ${pkgname}' PKG_MGR='apt-get -y install ${pkgname}'
PRE_RUN='apt-get -y update' PRE_RUN='apt-get -y update'

View File

@@ -8,11 +8,11 @@ dhcp
dhcpcd dhcpcd
dosfstools dosfstools
efibootmgr efibootmgr
efitools
efivar efivar
ethtool ethtool
file file
findutils findutils
gummiboot
iproute2 iproute2
iputils iputils
libisoburn libisoburn
@@ -32,7 +32,6 @@ pv
rsync rsync
sed sed
shorewall shorewall
squashfs3-tools
squashfs-tools squashfs-tools
sudo sudo
sysfsutils sysfsutils

View File

@@ -1,5 +1,5 @@
NAME='openSUSE' NAME='openSUSE'
SUPPORTED='untested' SUPPORTED='yes'
# Default doesn't have the quotes around the value, but I have a feeling that's a bug that will get "fixed" soon. # Default doesn't have the quotes around the value, but I have a feeling that's a bug that will get "fixed" soon.
CHECK_METHOD='egrep "^NAME=\"?openSUSE\"?$" /etc/os-release' CHECK_METHOD='egrep "^NAME=\"?openSUSE\"?$" /etc/os-release'
PKG_MGR='zypper install --no-confirm -l ${pkgname}' PKG_MGR='zypper install --no-confirm -l ${pkgname}'

View File

@@ -1,5 +1,8 @@
binutils binutils
binutils-devel
binutils-devel-32bit
curl curl
dosfstools
gcc gcc
gcc-32bit gcc-32bit
git git
@@ -15,3 +18,5 @@ sed
squashfs squashfs
syslinux syslinux
xz xz
xz-devel
xz-devel-32bit

View File

@@ -50,9 +50,10 @@ echo "==================================="
date date
if [ -n "${DEFROUTEIF}" ]; if [ -n "${DEFROUTEIF}" ];
then then
IPADDR=$(ip a s dev ${DEFROUTEIF} | egrep '^[[:space:]]*inet\ ' | awk '{print $2}' | cut -f1 -d"/")
HWADDR=$(ip l show dev ${DEFROUTEIF} | egrep '^[[:space:]]*link' | awk '{print $2}')
echo echo
echo -n "${DEFROUTEIF} is: " echo -n "${DEFROUTEIF} (${HWADDR}) is: ${IPADDR}"
ifconfig "${DEFROUTEIF}" | egrep 'inet|ether' | grep -v "inet6" | awk '{print $2}'
fi fi
echo echo
echo -n "tun0 is:" echo -n "tun0 is:"

View File

@@ -1,11 +1,6 @@
#/bin/sh - #/bin/sh -
#chmod 4755 /opt/google/chrome-beta/chrome-sandbox #chmod 4755 /opt/google/chrome-beta/chrome-sandbox
mkdir -p /var/db/sudo/lectured
touch /var/db/sudo/lectured/bdisk
chmod 700 /var/db/sudo/lectured
chgrp bdisk /var/db/sudo/lectured/bdisk
chmod 600 /var/db/sudo/lectured/bdisk
chmod 4755 /usr/bin/sudo chmod 4755 /usr/bin/sudo
function fuck_you_gimme_net() { function fuck_you_gimme_net() {

View File

@@ -0,0 +1,10 @@
## Enable IPv6 support
s/^#undef([[:space:]]*NET_PROTO_IPV6)/#define\1/g
## Enable HTTPS
s/^#undef([[:space:]]*DOWNLOAD_PROTO_HTTPS)/#define\1/g
s@^//(#define[[:space:]]*IMAGE_TRUST_CMD@\1@g
## Enable FTP
s/^#undef([[:space:]]*DOWNLOAD_PROTO_FTP)/#define\1/g
## Currently broken for EFI building
#s@^//(#define[[:space:]]*CONSOLE_CMD)@\1@g
#s@^//(#define[[:space:]]*IMAGE_PNG@\1@g

View File

@@ -0,0 +1,2 @@
## Currently broken on EFI systems
#s@^//(#define[[:space:]]*CONSOLE_VESAFB)@\1@g

View File

@@ -1,4 +1,8 @@
#!ipxe #!ipxe
dhcp dhcp
## TODO: signed kernel and initrd
#imgtrust --permanent
#imgverify vmlinuz path/to/vmlinuz.sig
#imgverify initrd path/to/initrd.sig
chain https://bdisk.square-r00t.net chain https://bdisk.square-r00t.net

View File

@@ -1,6 +1,8 @@
--- a/src/usr/autoboot.c 2015-06-29 04:18:17.055394598 -0400 diff --git a/src/usr/autoboot.c b/src/usr/autoboot.c
+++ b/src/usr/autoboot.c 2015-06-29 22:04:28.692916217 -0400 index e93b015..758e187 100644
@@ -71,6 +71,7 @@ --- a/src/usr/autoboot.c
+++ b/src/usr/autoboot.c
@@ -71,6 +71,7 @@ static int ( * is_autoboot_device ) ( struct net_device *netdev );
#define NORMAL "\033[0m" #define NORMAL "\033[0m"
#define BOLD "\033[1m" #define BOLD "\033[1m"
#define CYAN "\033[36m" #define CYAN "\033[36m"
@@ -8,16 +10,27 @@
/** The "scriptlet" setting */ /** The "scriptlet" setting */
const struct setting scriptlet_setting __setting ( SETTING_MISC, scriptlet ) = { const struct setting scriptlet_setting __setting ( SETTING_MISC, scriptlet ) = {
@@ -560,9 +561,9 @@ @@ -521,7 +522,6 @@ static int shell_banner ( void ) {
* @ret rc Return status code
*/
int ipxe ( struct net_device *netdev ) {
- struct feature *feature;
struct image *image;
char *scriptlet;
int rc;
@@ -538,11 +538,11 @@ int ipxe ( struct net_device *netdev ) {
* do so. * do so.
* *
*/ */
- printf ( NORMAL "\n\n" PRODUCT_NAME "\n" BOLD PRODUCT_SHORT_NAME " %s" - printf ( NORMAL "\n\n" PRODUCT_NAME "\n" BOLD PRODUCT_SHORT_NAME " %s"
- NORMAL " -- " PRODUCT_TAG_LINE " -- "
- CYAN PRODUCT_URI NORMAL "\nFeatures:", product_version );
+ printf ( NORMAL "\n\n" PRODUCT_NAME "\n" BOLD PRODUCT_SHORT_NAME + printf ( NORMAL "\n\n" PRODUCT_NAME "\n" BOLD PRODUCT_SHORT_NAME
NORMAL " -- " PRODUCT_TAG_LINE " -- "
- CYAN PRODUCT_URI NORMAL "\nFeatures:", product_version );
- for_each_table_entry ( feature, FEATURES )
- printf ( " %s", feature->name );
+ CYAN PRODUCT_URI NORMAL "\n" + CYAN PRODUCT_URI NORMAL "\n"
+ BOLD BLUE "http://bdisk.square-r00t.net/" NORMAL "\n" ); + BOLD "BDisk" BLUE "LiveDistro" NORMAL " -- Welp, Yer Boned!(TM) -- "
for_each_table_entry ( feature, FEATURES ) + BOLD BLUE "https://bdisk.square-r00t.net/" NORMAL "\n" );
printf ( " %s", feature->name );
printf ( "\n" ); printf ( "\n" );
/* Boot system */

View File

@@ -1,128 +0,0 @@
From ddf6f6ac945654b00121ab899fb0bbb63293e51e Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Tue, 7 Apr 2015 16:04:31 +0200
Subject: [PATCH 1/2] [build] allow to build ISO image with EFI support
(ipxe.eiso)
Signed-off-by: Christian Hesse <mail@eworm.de>
---
src/arch/i386/Makefile.pcbios | 6 ++++++
src/util/geniso | 39 ++++++++++++++++++++++++++++++---------
2 files changed, 36 insertions(+), 9 deletions(-)
diff --git a/src/arch/i386/Makefile.pcbios b/src/arch/i386/Makefile.pcbios
index ff82373..c7a58eb 100644
--- a/src/arch/i386/Makefile.pcbios
+++ b/src/arch/i386/Makefile.pcbios
@@ -59,6 +59,12 @@ NON_AUTO_MEDIA += iso
$(QM)$(ECHO) " [GENISO] $@"
$(Q)ISOLINUX_BIN=$(ISOLINUX_BIN) VERSION="$(VERSION)" bash util/geniso -o $@ $<
+# rule to make a non-emulation ISO boot image with EFI support
+NON_AUTO_MEDIA += eiso
+%eiso: %lkrn bin-i386-efi/ipxe.efi bin-x86_64-efi/ipxe.efi util/geniso
+ $(QM)$(ECHO) " [GENISO] $@"
+ $(Q)ISOLINUX_BIN=$(ISOLINUX_BIN) VERSION="$(VERSION)" bash util/geniso -e -o $@ $<
+
# rule to make a floppy emulation ISO boot image
NON_AUTO_MEDIA += liso
%liso: %lkrn util/geniso
diff --git a/src/util/geniso b/src/util/geniso
index 521c929..998370d 100755
--- a/src/util/geniso
+++ b/src/util/geniso
@@ -6,16 +6,21 @@ function help() {
echo "usage: ${0} [OPTIONS] foo.lkrn [bar.lkrn,...]"
echo
echo "where OPTIONS are:"
+ echo " -e build image with EFI support"
echo " -h show this help"
echo " -l build legacy image with floppy emulation"
echo " -o FILE save iso image to file"
}
+EFI=0
LEGACY=0
FIRST=""
-while getopts "hlo:" opt; do
+while getopts "ehlo:" opt; do
case ${opt} in
+ e)
+ EFI=1
+ ;;
h)
help
exit 0
@@ -37,23 +42,24 @@ if [ -z "${OUT}" ]; then
exit 1
fi
-# There should either be mkisofs or the compatible genisoimage program
-for command in genisoimage mkisofs; do
+# We require xorriso (from libisoburn) for EFI support
+# genisoimage and mkisofs are missing some features
+for command in xorriso; do
if ${command} --version >/dev/null 2>/dev/null; then
- mkisofs=(${command})
+ xorriso=(${command})
break
fi
done
-if [ -z "${mkisofs}" ]; then
- echo "${0}: mkisofs or genisoimage not found, please install or set PATH" >&2
+if [ -z "${xorriso}" ]; then
+ echo "${0}: xorriso not found, please install or set PATH" >&2
exit 1
fi
dir=$(mktemp -d bin/iso.dir.XXXXXX)
cfg=${dir}/isolinux.cfg
-mkisofs+=(-quiet -l -volid "iPXE" -preparer "iPXE build system"
+xorriso+=(-as mkisofs -quiet -l -volid "iPXE" -preparer "iPXE build system"
-appid "iPXE ${VERSION} - Open Source Network Boot Firmware"
-publisher "http://ipxe.org/" -c boot.cat)
@@ -116,12 +122,27 @@ case "${LEGACY}" in
fi
# generate the iso image
- "${mkisofs[@]}" -b boot.img -output ${OUT} ${dir}
+ "${xorriso[@]}" -b boot.img -output ${OUT} ${dir}
;;
0)
# copy isolinux bootloader
cp ${ISOLINUX_BIN} ${dir}
+ xorriso+=(-b isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table)
+
+ if [ "${EFI}" -eq 1 ]; then
+ # generate EFI image
+ img=${dir}/efiboot.img
+
+ mformat -f 2880 -C -i ${img} ::
+ mmd -i ${img} "::/EFI"
+ mmd -i ${img} "::/EFI/BOOT"
+ mcopy -m -i ${img} bin-x86_64-efi/ipxe.efi "::EFI/BOOT/BOOTX64.EFI"
+ mcopy -m -i ${img} bin-i386-efi/ipxe.efi "::EFI/BOOT/BOOTIA32.EFI"
+
+ xorriso+=(-eltorito-alt-boot -e efiboot.img -isohybrid-gpt-basdat -no-emul-boot)
+ fi
+
# syslinux 6.x needs a file called ldlinux.c32
LDLINUX_C32=$(dirname ${ISOLINUX_BIN})/ldlinux.c32
if [ -s ${LDLINUX_C32} ]; then
@@ -129,7 +150,7 @@ case "${LEGACY}" in
fi
# generate the iso image
- "${mkisofs[@]}" -b isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -output ${OUT} ${dir}
+ "${xorriso[@]}" -output ${OUT} ${dir}
# isohybrid will be used if available
if isohybrid --version >/dev/null 2>/dev/null; then
--
2.3.5

View File

@@ -0,0 +1,120 @@
From 189652b03032305a2db860e76fb58e81e3420c4d Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Wed, 24 Feb 2016 09:16:51 +0100
Subject: [PATCH] allow to build ISO image with EFI support (ipxe.eiso)
---
src/arch/x86/Makefile.pcbios | 6 +++++
src/util/geniso | 52 ++++++++++++++++++++++++++++++++++----------
2 files changed, 46 insertions(+), 12 deletions(-)
diff --git a/src/arch/x86/Makefile.pcbios b/src/arch/x86/Makefile.pcbios
index f8c2253..1e01636 100644
--- a/src/arch/x86/Makefile.pcbios
+++ b/src/arch/x86/Makefile.pcbios
@@ -86,6 +86,12 @@ NON_AUTO_MEDIA += iso
$(Q)ISOLINUX_BIN=$(ISOLINUX_BIN) LDLINUX_C32=$(LDLINUX_C32) \
VERSION="$(VERSION)" bash util/geniso -o $@ $<
+# rule to make a non-emulation ISO boot image with EFI support
+NON_AUTO_MEDIA += eiso
+%eiso: %lkrn bin-i386-efi/ipxe.efi bin-x86_64-efi/ipxe.efi util/geniso
+ $(QM)$(ECHO) " [GENISO] $@"
+ $(Q)ISOLINUX_BIN=$(ISOLINUX_BIN) VERSION="$(VERSION)" bash util/geniso -e -o $@ $<
+
# rule to make a floppy emulation ISO boot image
NON_AUTO_MEDIA += liso
%liso: %lkrn util/geniso
diff --git a/src/util/geniso b/src/util/geniso
index ff090d4..7694036 100755
--- a/src/util/geniso
+++ b/src/util/geniso
@@ -6,16 +6,21 @@ function help() {
echo "usage: ${0} [OPTIONS] foo.lkrn [bar.lkrn,...]"
echo
echo "where OPTIONS are:"
+ echo " -e build image with EFI support"
echo " -h show this help"
echo " -l build legacy image with floppy emulation"
echo " -o FILE save iso image to file"
}
+EFI=0
LEGACY=0
FIRST=""
-while getopts "hlo:" opt; do
+while getopts "ehlo:" opt; do
case ${opt} in
+ e)
+ EFI=1
+ ;;
h)
help
exit 0
@@ -37,17 +42,25 @@ if [ -z "${OUT}" ]; then
exit 1
fi
-# There should either be mkisofs or the compatible genisoimage program
-for command in genisoimage mkisofs; do
- if ${command} --version >/dev/null 2>/dev/null; then
- mkisofs=(${command})
- break
- fi
-done
-
-if [ -z "${mkisofs}" ]; then
- echo "${0}: mkisofs or genisoimage not found, please install or set PATH" >&2
+# We need xorriso (from libisoburn) for EFI support, so try that first.
+if xorriso --version >/dev/null 2>/dev/null; then
+ mkisofs=(xorriso -as mkisofs)
+elif [ ${EFI} -eq 1 ]; then
+ echo "${0}: xorriso not found, but required for EFI support. Please install." >&2
exit 1
+else
+ # fall back to mkisofs or the compatible genisoimage program
+ for command in genisoimage mkisofs; do
+ if ${command} --version >/dev/null 2>/dev/null; then
+ mkisofs=(${command})
+ break
+ fi
+ done
+
+ if [ -z "${mkisofs}" ]; then
+ echo "${0}: mkisofs or genisoimage not found, please install or set PATH" >&2
+ exit 1
+ fi
fi
dir=$(mktemp -d bin/iso.dir.XXXXXX)
@@ -122,13 +135,28 @@ case "${LEGACY}" in
# copy isolinux bootloader
cp ${ISOLINUX_BIN} ${dir}
+ mkisofs+=(-b isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table)
+
+ if [ "${EFI}" -eq 1 ]; then
+ # generate EFI image
+ img=${dir}/efiboot.img
+
+ mformat -f 2880 -C -i ${img} ::
+ mmd -i ${img} "::/EFI"
+ mmd -i ${img} "::/EFI/BOOT"
+ mcopy -m -i ${img} bin-x86_64-efi/ipxe.efi "::EFI/BOOT/BOOTX64.EFI"
+ mcopy -m -i ${img} bin-i386-efi/ipxe.efi "::EFI/BOOT/BOOTIA32.EFI"
+
+ mkisofs+=(-eltorito-alt-boot -e efiboot.img -isohybrid-gpt-basdat -no-emul-boot)
+ fi
+
# syslinux 6.x needs a file called ldlinux.c32
if [ -n "${LDLINUX_C32}" -a -s "${LDLINUX_C32}" ]; then
cp ${LDLINUX_C32} ${dir}
fi
# generate the iso image
- "${mkisofs[@]}" -b isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -output ${OUT} ${dir}
+ "${mkisofs[@]}" -output ${OUT} ${dir}
# isohybrid will be used if available
if isohybrid --version >/dev/null 2>/dev/null; then

View File

@@ -1,34 +0,0 @@
From a4f7e3ba395af4cd0a706df635309d4ef837ecf8 Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Wed, 8 Apr 2015 09:51:41 +0200
Subject: [PATCH 2/2] Fix no-PIE workaround for i386 builds
This workaround did not work for my version of gcc (4.9.2 20150304) as
no option -nopie exists.
We take another way: Let's check whether or not the macro __PIE__ is defined
and add -fno-PIE if it is.
Signed-off-by: Christian Hesse <mail@eworm.de>
---
src/arch/i386/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/arch/i386/Makefile b/src/arch/i386/Makefile
index 99f8753..897081b 100644
--- a/src/arch/i386/Makefile
+++ b/src/arch/i386/Makefile
@@ -75,8 +75,8 @@ CFLAGS += -Ui386
# output on stderr instead of checking the exit status.
#
ifeq ($(CCTYPE),gcc)
-PIE_TEST = [ -z "`$(CC) -fno-PIE -nopie -x c -c /dev/null -o /dev/null 2>&1`" ]
-PIE_FLAGS := $(shell $(PIE_TEST) && $(ECHO) '-fno-PIE -nopie')
+PIE_TEST = $(CC) -dM -E - < /dev/null | grep -q '__PIE__'
+PIE_FLAGS := $(shell $(PIE_TEST) && $(ECHO) '-fno-PIE')
WORKAROUND_CFLAGS += $(PIE_FLAGS)
endif
--
2.3.5

View File

@@ -0,0 +1,33 @@
[ ca ]
default_ca = ca_default
[ ca_default ]
certificate = crts/ca.crt
private_key = keys/ca.key
serial = txt/ca.srl
database = txt/ca.idx
#new_certs_dir = signed
new_certs_dir = crts
#default_md = default
default_md = sha512
policy = policy_anything
preserve = yes
default_days = 90
unique_subject = no
[ policy_anything ]
countryName = optional
stateOrProvinceName = optional
localityName = optional
organizationName = optional
organizationalUnitName = optional
commonName = optional
emailAddress = optional
[ cross ]
basicConstraints = critical,CA:true
keyUsage = critical,cRLSign,keyCertSign
[ codesigning ]
keyUsage = digitalSignature
extendedKeyUsage = codeSigning