Compare commits

...

44 Commits
v1.20 ... v2.51

Author SHA1 Message Date
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
71e9d7be5d adding some backup packages, disabling untested distros 2015-07-24 04:50:51 -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
b36ef29900 some minor modifications.. 2015-07-23 03:49:14 -04:00
f4c8f45ee3 oops. forgot the noconfirm for haveged. 2015-07-22 22:21:57 -04:00
342d9894f5 FINALLY. testing cross-distro after many tweaks. also switched to github mirrors for the UEFI shells because sourceforge sucks. 2015-07-21 15:06:28 -04:00
4403901d8f i'm a dumb. 2015-07-17 07:36:19 -04:00
fc0a1ec94a now during testing... 2015-07-17 06:41:16 -04:00
eca04c2140 adding baseline pkgs 2015-07-16 12:48:35 -04:00
6c4634a11d mageia/(open)?SUSE pkgs list done, untested. also, i am an idiot. 2015-07-16 05:18:34 -04:00
7fb7871daf gentoo pkgs list done, untested 2015-07-16 04:07:31 -04:00
43cd3ab4b9 Fedora pkgs list done, added elementaryOS. both untested. 2015-07-16 03:13:36 -04:00
ef664d39b9 Debian, Devuan, Ubuntu, etc. pkgs list done- untested 2015-07-16 00:25:41 -04:00
411a544d4b arch/arch-based, rhel/rhel-based pkglists done. untested. 2015-07-15 22:04:45 -04:00
7fb6e77c32 more work done... still 100% untested, and i need to finish the package lists, but i have a testing platform built for all the distros. 2015-07-15 03:56:53 -04:00
0153d38a33 halfway there. now i just need to build the package lists. 2015-07-14 01:30:03 -04:00
52cb0ea321 working on dat cross-distro support.... 2015-07-12 03:04:09 -04:00
67aba34ed1 adding custom EMBED URI 2015-07-12 00:46:45 -04:00
b4d619f2f9 updating gitignore 2015-07-12 00:45:54 -04:00
3d5e724bd5 updating TODO, changing default EMBED for iPXE to use https 2015-07-09 22:02:03 -04:00
77 changed files with 1156 additions and 282 deletions

5
.gitignore vendored
View File

@@ -24,10 +24,13 @@
/logs /logs
*.swp *.swp
*.lck *.lck
#src/ipxe/src/ /extrasrc
# You should really generate local copies of these, as they're pretty private. # You should really generate local copies of these, as they're pretty private.
extra/pre-build.d/etc/openvpn/client.conf 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

@@ -7,6 +7,8 @@
#DEBUG #DEBUG
#set -x #set -x
echo "Starting at $(date)..."
## Import settings ## Import settings
if [ -f "build.conf" ]; if [ -f "build.conf" ];
then then
@@ -72,6 +74,8 @@ do
fi fi
done done
source ${BASEDIR}/lib/00-depcheck.func.sh
if [ ! -f "./BUILDNO" ]; if [ ! -f "./BUILDNO" ];
then then
echo '0' > ./BUILDNO echo '0' > ./BUILDNO
@@ -81,12 +85,12 @@ 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
BUILDTIME="$(date)" BUILDTIME="$(date)"
BUILD_MACHINE="$(hostname -f)" BUILD_MACHINE="$(hostname -f) (${HOST_DIST})"
#BUILD_USERNAME="${SUDO_USER}" #BUILD_USERNAME="${SUDO_USER}"
#BUILD_USERNAME="$(who am i | awk '{print $1}')" #BUILD_USERNAME="$(who am i | awk '{print $1}')"
set +e ; logname > /dev/null 2>&1 set +e ; logname > /dev/null 2>&1
@@ -99,8 +103,8 @@ fi
set -e set -e
USERNAME_REAL="$(grep ${BUILD_USERNAME} /etc/passwd | cut -f5 -d':')" USERNAME_REAL="$(grep ${BUILD_USERNAME} /etc/passwd | cut -f5 -d':')"
cat > 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}
@@ -109,17 +113,18 @@ EOF
## FUNCTIONS ## ## FUNCTIONS ##
source lib/02-im_batman.func.sh #source ${BASEDIR}/lib/00-depcheck.func.sh ## this should be called like, VERYYYY first thing, right after sanity/safety checks and such.
source lib/03-holla_atcha_boi.func.sh source ${BASEDIR}/lib/01-mk.chroot.func.sh ## this is called automatically and only if no chroot exists
source lib/04-release_me.func.sh source ${BASEDIR}/lib/02-holla_atcha_boi.func.sh
source lib/05-facehugger.func.sh source ${BASEDIR}/lib/03-release_me.func.sh
source lib/06-chroot_wrapper.func.sh source ${BASEDIR}/lib/04-facehugger.func.sh
source lib/07-jenny_craig.func.sh source ${BASEDIR}/lib/05-chroot_wrapper.func.sh
source lib/08-centos_is_stupid.func.sh source ${BASEDIR}/lib/06-jenny_craig.func.sh
source lib/09-will_it_blend.func.sh source ${BASEDIR}/lib/07-centos_is_stupid.func.sh
source lib/10-stuffy.func.sh source ${BASEDIR}/lib/08-will_it_blend.func.sh
source lib/11-yo_dj.func.sh source ${BASEDIR}/lib/09-stuffy.func.sh
source lib/12-mentos.func.sh source ${BASEDIR}/lib/10-yo_dj.func.sh
source ${BASEDIR}/lib/11-mentos.func.sh
## The Business-End(TM) ## ## The Business-End(TM) ##
@@ -132,16 +137,6 @@ release_me 64 > /dev/null 2>&1
release_me 32 > /dev/null 2>&1 release_me 32 > /dev/null 2>&1
# do we need to perform any updates? # do we need to perform any updates?
if [[ -f "${CHROOTDIR}root.x86_64/root/chroot" || -f "${CHROOTDIR}root.i686/root/chroot" ]];
then
chroot_wrapper 64
chroot_wrapper 32
centos_is_stupid
will_it_blend 64
will_it_blend 32
yo_dj
fi
if [[ ${1} == "update" ]]; if [[ ${1} == "update" ]];
then then
mentos mentos
@@ -161,7 +156,7 @@ then
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
if [[ "${MULTIARCH}" == "y" ]]; if [[ "${MULTIARCH}" == "y" ]];
then then
@@ -194,4 +189,4 @@ fi
# yay! we're done! # yay! we're done!
rm -f ${LOCKFILE} rm -f ${LOCKFILE}
echo "Finished successfully!" echo "Finished successfully at $(date)!"

View File

@@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
echo "Started at $(date)..."
## Import settings ## Import settings
if [ -f "build.conf" ]; if [ -f "build.conf" ];
then then
@@ -82,3 +84,5 @@ do
done done
rm -f ${LOCKFILE} rm -f ${LOCKFILE}
echo "Finished successfully at $(date)!"

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.

1
docs/LICENSE Symbolic link
View File

@@ -0,0 +1 @@
COPYING

View File

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 ##
@@ -15,28 +16,35 @@
-autodetection/configuration of network. DHCP is currently running by default, but does it need to support IPv6? if so, how would the user configure their network? -autodetection/configuration of network. DHCP is currently running by default, but does it need to support IPv6? if so, how would the user configure their network?
-SECURE SSH: https://stribika.github.io/2015/01/04/secure-secure-shell.html -SECURE SSH: https://stribika.github.io/2015/01/04/secure-secure-shell.html
-DISABLE NETWORKMANAGER AND "fi.w1.wpa_supplicant1"??? keeps spawning wpa_supplicant (and thusly killing networking proper) -DISABLE NETWORKMANAGER AND "fi.w1.wpa_supplicant1"??? keeps spawning wpa_supplicant (and thusly killing networking proper)
-for netboot, custom user agent (should be defined by build.conf)
--iPXE's curl
--initrd's curl
## 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
--https://aur.archlinux.org/packages/ip/ipxe-git/PKGBUILD (NOTE the patches- banner and efi iso specifically) --enable use of custom CA/self-signed certs for HTTPS etc. DONE, partially. need to incorporate codesign certs/keys. routines, conf variables
--add conf option to specify EMBED uri -enable mirror= kernel commandline.
-X-platform --if mirror_(NAME) is present, use that as repo name.
--what distros are supported? --if it starts with /, treat as mirrorlist (Include); otherwise use Server =
--automatically install what we need for buildtime --if it has mirror_SIG-X, set signature options e.g. _SIG-N would be "SigLevel = Never"
--hardcode list of runtime 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
--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

@@ -61,7 +61,46 @@ MULTIARCH="yes"
# set this to "yes". Otherwise, just build the full ISO. # set this to "yes". Otherwise, just build the full ISO.
BUILDMINI="no" BUILDMINI="no"
# set to "yes" to enable pushing new changes to a git repo/committing to a local repo # What URI should iPXE's EMBED script use?
# Only used if BUILDMINI is set to yes.
# DO NOT USE A ',' (comma); instead, replace it with:
# %%COMMA%%
# If you require HTTP BASIC Authentication or HTTP Digest Authentication (untested), you can
# format it via the following:
# https://user:password@domain.tld/page.php
# This currently does not work for HTTPS with self-signed certificates.
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
GIT="no" GIT="no"
# If this is set, use rsync to copy the http and iso files. This is the rsync destination host. # If this is set, use rsync to copy the http and iso files. This is the rsync destination host.
@@ -119,17 +158,19 @@ I_AM_A_RACECAR="no"
# ________________________________________________________________________________________________ # ________________________________________________________________________________________________
## RECOMMENDED DEFALTS ## ## RECOMMENDED DEFALTS ##
# The following shoult not be changed unless you are ABSOLUTELY, 100% SURE and COMPLETELY POSITIVE # The following should not be changed unless you are ABSOLUTELY, 100% SURE and COMPLETELY POSITIVE
# about what you are doing!!! # about what you are doing!!!
# Legacy support. # This can be used to override automatic distro-detection.
BASEDIR="${BASEDIR}" # If you DO set this, be sure that you have a matching profile in
# ${BASEDIR}/lib/prereqs/<Distro>/meta !!
HOST_DIST=""
# This used to be defined statically (e.g. CHBASEDIR="${BASEDIR}/chroot"), # This used to be defined statically, but is now dynamically appended. Please don't alter this
# but is now dynamically appended. Please don't alter this unless you renamed the chroot directory paths. # unless you renamed the chroot directory paths.
CHROOTDIR="${BASEDIR}/" CHROOTDIR="${BASEDIR}/"
CHROOTDIR32="${CHBASEDIR}root.i686" CHROOTDIR32="${CHROOTDIR}root.i686"
CHROOTDIR64="${CHBASEDIR}root.x86_64" CHROOTDIR64="${CHROOTDIR}root.x86_64"
# This is a directory we use for staging. It definitely should not be checked into git. # This is a directory we use for staging. It definitely should not be checked into git.
# It used to be defined statically (e.g. BUILDDIR="${BASEDIR}/build"), # It used to be defined statically (e.g. BUILDDIR="${BASEDIR}/build"),

View File

@@ -3,27 +3,29 @@
abs abs
acpi acpi
#acpidump #acpidump
afflib #afflib
aircrack-ng aircrack-ng
apr apr
apr-util apr-util
arch-install-scripts
archiso
arj arj
asciidoc asciidoc
atop atop
autopsy autopsy
autossh autossh
backuppc
#bacula ## TODO: grab all the bacula packages in here
beep beep
bin86 bin86
bind-tools bind-tools
binutils binutils
bluez-utils bluez-utils
bonnie++ bonnie++
boxbackup-client
boxbackup-server
bozocrack-git bozocrack-git
bridge-utils bridge-utils
burp-backup-git
btrfs-progs btrfs-progs
bzip2
cabextract cabextract
cdrtools cdrtools
cdw cdw
@@ -33,17 +35,17 @@ chntpw
cifs-utils cifs-utils
ckermit ckermit
clamav clamav
clonezilla
cmospwd cmospwd
colordiff colordiff
coreutils
cowpatty cowpatty
cpio cpio
cpuburn cpuburn
cpupower cpupower
crackpkcs12 crackpkcs12
cronie
#cryptcat #cryptcat
cryptsetup cryptsetup
csync2
customizepkg-scripting customizepkg-scripting
dar dar
dcfldd dcfldd
@@ -52,9 +54,6 @@ dd_rescue
dd_rhelp dd_rhelp
debianutils debianutils
debootstrap debootstrap
dhclient
dhcp
dhcpcd
dialog dialog
diffutils diffutils
djohn djohn
@@ -63,7 +62,6 @@ dnssec-anchors
dnstracer dnstracer
#dnsutils #replaced by bind-tools, https://www.archlinux.org/packages/extra/x86_64/bind-tools/ #dnsutils #replaced by bind-tools, https://www.archlinux.org/packages/extra/x86_64/bind-tools/
dos2unix dos2unix
dosfstools
dropbear dropbear
dstat dstat
dump dump
@@ -73,8 +71,6 @@ dvd+rw-tools
e2fsprogs e2fsprogs
ecryptfs-utils ecryptfs-utils
ed ed
efibootmgr
efivar
elfutils elfutils
#elilo-efi #elilo-efi
elinks elinks
@@ -110,7 +106,6 @@ gpm
gptfdisk gptfdisk
gst-libav gst-libav
gst-plugins-ugly gst-plugins-ugly
gummiboot
hashcat hashcat
hddtemp hddtemp
hdparm hdparm
@@ -132,10 +127,8 @@ iozone
ipcalc ipcalc
iperf iperf
iperf3 iperf3
iproute2
ipsec-tools ipsec-tools
iptraf-ng iptraf-ng
iputils
irssi irssi
iso-codes iso-codes
isomaster isomaster
@@ -145,10 +138,8 @@ jfsutils
john john
keyutils keyutils
kismet-allplugins kismet-allplugins
libisoburn
lftp lftp
links links
localepurge
#logkeys #logkeys
logkeys-keymaps logkeys-keymaps
lm_sensors lm_sensors
@@ -159,10 +150,7 @@ lsof
lsscsi lsscsi
lxde lxde
lynx lynx
lz4
#lzip #lzip
lzo
lzop
macchanger macchanger
magicrescue magicrescue
mbr mbr
@@ -171,14 +159,13 @@ mcelog
md5deep md5deep
mdadm mdadm
mdcrack mdcrack
megaraid-cli # superseded by storcli
#megaraid-cli
memtester memtester
mfoc mfoc
minicom minicom
mkinitcpio-nfs-utils mondo
ms-sys
mtd-utils mtd-utils
mtools
mtr mtr
mtree mtree
#mtx #mtx
@@ -189,11 +176,8 @@ ncftp
ncompress ncompress
ncrack ncrack
net-snmp net-snmp
net-tools
netctl
netselect netselect
nettle nettle
networkmanager
networkmanager-pptp networkmanager-pptp
nginx-devel nginx-devel
ngrep ngrep
@@ -201,16 +185,18 @@ nmap
nmon nmon
ntfs-3g ntfs-3g
ntfsfixboot ntfsfixboot
nwipe #nwipe #broken since they moved to github(?)
nwipe-git
obnam
open-iscsi open-iscsi
openipmi openipmi
openssh
openvpn
ophcrack ophcrack
os-prober os-prober
p7zip p7zip
pack pack
par2cmdline par2cmdline
partclone
partclone-utils
parted parted
partimage partimage
pax-utils pax-utils
@@ -233,9 +219,8 @@ procinfo-ng
procps-ng procps-ng
progsreiserfs progsreiserfs
psmisc psmisc
pv
pwgen pwgen
pxz pixz
pyrit-svn pyrit-svn
python2-gnuplot python2-gnuplot
python2-pyx python2-pyx
@@ -251,7 +236,6 @@ rpcbind
rpmextract rpmextract
rp-pppoe rp-pppoe
rsnapshot rsnapshot
rsync
rygel rygel
safecopy safecopy
samba samba
@@ -261,27 +245,21 @@ scrounge-ntfs
scrub scrub
scsiadd scsiadd
sdparm sdparm
sed
setserial setserial
sg3_utils sg3_utils
sharutils sharutils
shorewall
sipcalc sipcalc
sipcrack sipcrack
smartmontools smartmontools
smbclient smbclient
s-nail s-nail
socat socat
squashfs3-tools #star ## do people even USE tape packups anymore?
squashfs-tools storcli
#star
strace strace
stress stress
sucrack sucrack
sudo
symlinks symlinks
sysfsutils
syslinux
sysstat sysstat
tcpdump tcpdump
tcpslice tcpslice
@@ -292,7 +270,6 @@ thin-provisioning-tools
thttpd thttpd
tmon tmon
tmux tmux
traceroute
tre tre
truecrack-svn truecrack-svn
truecrypt truecrypt
@@ -300,6 +277,7 @@ tor
udftools udftools
#udpcast #udpcast
unace unace
unison
unrar unrar
unshield unshield
unzip unzip
@@ -332,6 +310,8 @@ xfsprogs
xmlto xmlto
xorg xorg
xorg-drivers xorg-drivers
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

@@ -25,8 +25,8 @@ noedit=1
skipinteg=1 skipinteg=1
#skiptest=1 #skiptest=1
#warn=1 #warn=1
tmpdir=/var/tmp/apacman #tmpdir=/var/tmp/apacman
TMPDIR=/var/tmp/apacman #TMPDIR=/var/tmp/apacman
# #
# CONFIGURATION # CONFIGURATION

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 -re 's@^(source=\(").*$@\1https://github.com/kwilczynski/lsi/blob/master/lsiutil/LSIUtil_1.62.zip?raw=true")@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

@@ -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

@@ -4,6 +4,9 @@ build() {
add_runscript add_runscript
add_binary curl add_binary curl
add_full_dir /etc/ssl
add_full_dir /etc/ca-certificates
} }
help() { help() {

View File

@@ -1,3 +1,93 @@
#!/bin/bash #!/bin/bash
# placeholder... function so_check_me_out {
FUNCNAME="depcheck"
if [[ -n ${HOST_DIST} ]];
then
if [[ ! -f ${BASEDIR}/lib/prereqs/${HOST_DIST}/meta || ! -f ${BASEDIR}/lib/prereqs/${HOST_DIST}/pkgs ]];
then
echo "ERROR: You have specified ${HOST_DIST} as your host system's distro, but it is missing a meta and/or pkgs profile."
exit 1
fi
fi
set +e
if [[ -z "${HOST_DIST}" ]];
then
for dist_profile in $(find "${BASEDIR}"/lib/prereqs -type f -name 'meta');
do
source ${dist_profile}
if [[ "${SUPPORTED}" != "yes" ]];
then
continue
fi
eval "${CHECK_METHOD}" > /dev/null 2>&1
if [[ "${?}" == "0" ]];
then
export HOST_DIST="${NAME}"
echo "Detected distro as ${HOST_DIST}."
break 2
fi
done
fi
set -e
# Sanity is important.
if [[ -z "${HOST_DIST}" ]];
then
echo "ERROR: Your distro was not found/detected, or is flagged as unsupported."
exit 1
fi
# So we've validated the distro. Here, check for packages and install if necessary. maybe use an array, but it'd be better to soft-fail if one of the packages is missing.
DISTRO_DIR="${BASEDIR}/lib/prereqs/${HOST_DIST}"
META="${DISTRO_DIR}/meta"
PKGLIST="${DISTRO_DIR}/pkgs"
# And once more, just to be safe.
source ${META}
## TWEAKS GET RUN HERE.
distro_specific_tweaks
if [[ "${PRE_RUN}" != 'none' ]];
then
echo "Now updating your local package cache..."
set +e
eval "${PRE_RUN}" >> "${LOGFILE}.${FUNCNAME}" 2>&1
if [[ "${?}" != "0" ]];
then
echo "ERROR: Syncing your local package cache via ${PRE_RUN} command failed."
echo "Please ensure you are connected to the Internet/have repositories configured correctly."
exit 1
fi
set -e
fi
set +e
while read pkgname;
do
eval "${PKG_CHK}" >> "${LOGFILE}.${FUNCNAME}" 2>&1
if [[ "${?}" != "0" ]];
then
echo "Installing ${pkgname}..."
eval "${PKG_MGR}" >> "${LOGFILE}.${FUNCNAME}" 2>&1
if [[ "${?}" != "0" ]];
then
echo "ERROR: ${pkgname} was not found to be installed and we can't install it."
echo "This usually means you aren't connected to the Internet or your package repositories"
echo "are not configured correctly. Review the list of packages in ${PKGLIST} and ensure"
echo "they are all available to be installed."
exit 1
fi
fi
done < ${PKGLIST}
set -e
rm -f "${LOCKFILE}"
}
so_check_me_out

View File

@@ -109,10 +109,10 @@ function mkchroot {
echo "Local: ${LOCSUM32}" echo "Local: ${LOCSUM32}"
echo "Remote: ${CKSUM32}" echo "Remote: ${CKSUM32}"
echo "Fetching fresh copy." echo "Fetching fresh copy."
curl -o latest.32.tar.gz "${RLSDIR}/${CURRLS32}" >> "${LOGFILE}.${FUNCNAME}" 2>&1 curl -o latest.32.tar.gz "${RLSDIR}/${CURRLS32}"
fi fi
else else
curl -o latest.32.tar.gz "${RLSDIR}/${CURRLS32}" >> "${LOGFILE}.${FUNCNAME}" 2>&1 curl -o latest.32.tar.gz "${RLSDIR}/${CURRLS32}"
fi fi
if [ ! -f "${CHROOTDIR32}/etc/pacman.d/gnupg/trustdb.gpg" ] || [ ! -f "${CHROOTDIR64}/etc/pacman.d/gnupg/trustdb.gpg" ]; if [ ! -f "${CHROOTDIR32}/etc/pacman.d/gnupg/trustdb.gpg" ] || [ ! -f "${CHROOTDIR64}/etc/pacman.d/gnupg/trustdb.gpg" ];
@@ -147,6 +147,7 @@ HOME_URL="https://www.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/" SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://bugs.archlinux.org/" BUG_REPORT_URL="https://bugs.archlinux.org/"
EOF EOF
cp ${BASEDIR}/VERSION_INFO.txt ${BASEDIR}/root.${i}/.
done done
# And make it usable. # And make it usable.
@@ -179,6 +180,7 @@ EOF
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 --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
@@ -212,38 +214,71 @@ EOF
sed -i -e "/^[[:space:]]*#*MAKEFLAGS=.*$/aMAKEFLAGS=\"-j${CPUCNT}\"" ${CHROOTDIR32}/etc/makepkg.conf sed -i -e "/^[[:space:]]*#*MAKEFLAGS=.*$/aMAKEFLAGS=\"-j${CPUCNT}\"" ${CHROOTDIR32}/etc/makepkg.conf
fi fi
# preprocessing # Baseline packages
sed -i -e '/base-devel/d ; /multilib-devel/d' ${BASEDIR}/extra/packages.* echo "Installing baseline packages..."
PKGLIST=$(sed -e '/^[[:space:]]*#/d ; /^[[:space:]]*$/d' ${BASEDIR}/lib/prereqs/iso.pkgs.lst | tr '\n' ' ')
for i in ${CHROOTDIR32} ${CHROOTDIR64};
do
set +e
for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%%.pacorig} ; done
set -e
${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
set -e
done
# 32-bit
PKGLIST=$(sed -e '/^[[:space:]]*#/d ; /^[[:space:]]*$/d' ${BASEDIR}/lib/prereqs/iso.pkgs.lst.32 | tr '\n' ' ')
if [ -n "${PKGLIST}" ];
then
${CHROOTCMD} ${CHROOTDIR32}/ /usr/bin/bash -c "apacman --noconfirm --noedit --skipinteg -S --needed ${PKGLIST}" >> "${LOGFILE}.${FUNCNAME}" 2>&1
fi
set +e
for x in $(find ${CHROOTDIR32}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%.pacorig} ; done
set -e
# 64-bit
PKGLIST=$(sed -e '/^[[:space:]]*#/d ; /^[[:space:]]*$/d' ${BASEDIR}/lib/prereqs/iso.pkgs.lst.64 | tr '\n' ' ')
if [ -n "${PKGLIST}" ];
then
${CHROOTCMD} ${CHROOTDIR64}/ /usr/bin/bash -c "apacman --noconfirm --noedit --skipinteg -S --needed ${PKGLIST}" >> "${LOGFILE}.${FUNCNAME}" 2>&1
fi
set +e
for x in $(find ${CHROOTDIR64}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%.pacorig} ; done
set -e
# extra packages
sed -i -e '/base-devel/d ; /multilib-devel/d' ${BASEDIR}/extra/packages.{both,64}
# both # both
echo "Installing 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
@@ -253,7 +288,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
@@ -273,12 +308,12 @@ 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
# 32-bit # 32-bit
echo "Installing packages for 32-bit..." echo "Installing extra packages for 32-bit..."
PKGLIST=$(sed -e '/^[[:space:]]*#/d ; /^[[:space:]]*$/d' ${BASEDIR}/extra/packages.32 | tr '\n' ' ') PKGLIST=$(sed -e '/^[[:space:]]*#/d ; /^[[:space:]]*$/d' ${BASEDIR}/extra/packages.32 | tr '\n' ' ')
if [ -n "${PKGLIST}" ]; if [ -n "${PKGLIST}" ];
then then
@@ -290,7 +325,7 @@ EOF
echo "Done." echo "Done."
# 64-bit # 64-bit
echo "Installing packages for 64-bit..." echo "Installing estra packages for 64-bit..."
PKGLIST=$(sed -e '/^[[:space:]]*#/d ; /^[[:space:]]*$/d' ${BASEDIR}/extra/packages.64 | tr '\n' ' ') PKGLIST=$(sed -e '/^[[:space:]]*#/d ; /^[[:space:]]*$/d' ${BASEDIR}/extra/packages.64 | tr '\n' ' ')
if [ -n "${PKGLIST}" ]; if [ -n "${PKGLIST}" ];
then then
@@ -326,10 +361,13 @@ EOF
echo "Done." echo "Done."
rm -f ${LOCKFILE} #rm -f ${LOCKFILE}
echo "Chroot setup complete." echo "Chroot setup complete."
} }
if [[ ! -f "${BASEDIR}/root.x86_64/VERSION_INFO.txt" && ! -f "${BASEDIR}/root.x86_64/VERSION_INFO.txt" ]];
then
mkchroot mkchroot
fi

View File

@@ -1,5 +1,7 @@
function holla_atcha_boi { function holla_atcha_boi {
FUNCNAME="holla_atcha_boi"
if [[ "${I_AM_A_RACECAR}" == "y" ]]; if [[ "${I_AM_A_RACECAR}" == "y" ]];
then then
RACECAR_CHK='nice -n -19 ' RACECAR_CHK='nice -n -19 '
@@ -7,6 +9,7 @@ function holla_atcha_boi {
RACECAR_CHK="" RACECAR_CHK=""
fi fi
so_check_me_out
# Do we have an existing chroot set up yet? If not, create. # Do we have an existing chroot set up yet? If not, create.
if [[ ! -d "root.x86_64/root" || ! -d "root.i686/root" ]]; if [[ ! -d "root.x86_64/root" || ! -d "root.i686/root" ]];

View File

@@ -1,30 +0,0 @@
function im_batman {
set +e # false errors are bad mmk
# Detect the distro and set some vars
if [ -f "/usr/bin/yum" ]; # CentOS/Redhat, etc.
then
OS_STRING='RHEL-like'
DISTRO='RHEL'
INST_CMD='yum -y install '
elif [ -f "/usr/bin/pacman" ]; # Arch, Manjaro, etc.
then
OS_STRING='Arch-like'
DISTRO='Arch'
INST_CMD='pacman -S '
elif [ -f "/usr/bin/emerge" ]; # Gentoo
then
OS_STRING='Gentoo-like'
DISTRO='Gentoo'
INST_CMD='emerge '
elif [ -f "/usr/bin/apt-get" ]; # Debian, Ubuntu (and derivatives), etc.
then
OS_STRING='Debian-like'
DISTRO="Debian"
INST_CMD='apt-get install '
else
echo 'Sorry, I cannot detect which distro you are running. Please report this along with what distro you are running. Dying now.'
exit 1
fi
set -e # and turn this back on lolz
}

View File

@@ -1,4 +1,7 @@
function release_me () { function release_me () {
FUNCNAME="release_me"
## check for mountpoints from a manual chroot and umount them if they're still mounted. ## check for mountpoints from a manual chroot and umount them if they're still mounted.
## NOTE: you can use findmnt(8) to view a tree of mountpoints, including bindmounts etc. ## NOTE: you can use findmnt(8) to view a tree of mountpoints, including bindmounts etc.
# Is there an active chroot? # Is there an active chroot?

View File

@@ -1,4 +1,7 @@
function facehugger () { function facehugger () {
FUNCNAME="facehugger"
local ARCHSUFFIX="${1}" local ARCHSUFFIX="${1}"
if [[ "${1}" == "64" ]]; if [[ "${1}" == "64" ]];
then then

View File

@@ -1,4 +1,7 @@
function chroot_wrapper () { function chroot_wrapper () {
FUNCNAME="chroot_wrapper"
local ARCHSUFFIX="${1}" local ARCHSUFFIX="${1}"
if [[ "${1}" == "64" ]]; if [[ "${1}" == "64" ]];
then then

View File

@@ -1,4 +1,7 @@
function jenny_craig () { function jenny_craig () {
FUNCNAME="jenny_craig"
BUILDDIR="${BUILDDIR_GLOB}" BUILDDIR="${BUILDDIR_GLOB}"
if [[ "${1}" == "64" ]]; if [[ "${1}" == "64" ]];
then then

View File

@@ -0,0 +1,102 @@
function centos_is_stupid {
FUNCNAME="centos_is_stupid"
if [[ "${HOST_DIST}" == "CentOS" || "${HOST_DIST}" == "RHEL" ]];
then
if [[ "$(rpm -qa | egrep -q '^xorriso-[0-9]')" != "0" ]];
then
# Download/install the proper xorriso
EL_VER="$(rpm -qa coreutils | sed -re 's/^coreutils-[0-9.-]*el([0-9])*.*$/\1/g')"
if (("${EL_VER}" < "7"));
then
echo "Wow. Your CentOS/RHEL is too old. Sorry; this is only supported on CentOS/RHEL 7 and up."
exit 1
fi
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..."
curl -sLo /tmp/${XORRISO_RPM} http://pkgs.repoforge.org/xorriso/${XORRISO_RPM}
set +e
yum -y install /tmp/${XORRISO_RPM} >> "${LOGFILE}.${FUNCNAME}" 2>&1
set -e
echo "Done."
echo
fi
# We used to fetch and compile mksquashfs from source here, but no longer- because a new enough version is *finally* in CentOS repos as of CentOS 7.
# This also lets us cut out the crufty version check and replace it with the one above.
fi
# UGH. And you know what? Fuck SUSE too.
if [[ "${HOST_DIST}" == "openSUSE" || "${HOST_DIST}" == "SUSE" ]];
then
if [[ "$(rpm -qa | egrep -q '^xorriso-[0-9]')" != "0" ]];
then
# Download/install the proper xorriso
source /etc/os-release
SUSE_VER="${VERSION_ID}"
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..."
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
mv -f /etc/zypp/zypp.conf_BAK."${$}" /etc/zypp/zypp.conf
echo "Done."
echo
fi
fi
# And a double fuck-you to SLED/SLES.
if [[ "${HOST_DIST}" == "SUSE" ]];
then
source /etc/os-release
source ${BASEDIR}/lib/prereqs/SUSE/meta
SUSE_VER="${VERSION_ID}"
SUSE_REL="${ID}"
SDK_PKGS=(binutils-devel git xz-devel xz-devel-32bit zlib-devel zlib-devel-32bit)
if [[ "${PRE_RUN}" != 'none' ]];
then
echo "Now updating your local package cache..."
set +e
eval "${PRE_RUN}" >> "${LOGFILE}.${FUNCNAME}" 2>&1
if [[ "${?}" != "0" ]];
then
echo "ERROR: Syncing your local package cache via ${PRE_RUN} command failed."
echo "Please ensure you are connected to the Internet/have repositories configured correctly."
exit 1
fi
set -e
fi
zypper search binutils-devel | egrep -q '^[[:space:]]*|[[:space:]]*binutils-devel[[:space:]]*'
if [[ "${?}" != "0" ]];
then
echo
echo "In order to install some of the necessary packages on the host, you will need to add the SLE SDK repository."
echo "It can be downloaded by visiting http://download.suse.com/ and search for 'SUSE Linux Enterprise Software Development Kit'"
echo "(or add it to your subscriptions)."
echo "See https://www.suse.com/documentation/${SUSE_REL}-${SUSE_VER}/book_sle_deployment/data/sec_add-ons_sdk.html for more information."
exit 1
else
for pkgname in "${SDK_PKGS[@]}";
do
eval "${PKG_CHK}" >> "${LOGFILE}.${FUNCNAME}" 2>&1
if [[ "${?}" != "0" ]];
then
echo "Installing ${pkgname}..."
eval "${PKG_MGR}" >> "${LOGFILE}.${FUNCNAME}" 2>&1
if [[ "${?}" != "0" ]];
then
echo "ERROR: ${pkgname} was not found to be installed and we can't install it."
echo "This usually means you aren't connected to the Internet or your package repositories"
echo "are not configured correctly. Review the list of packages in ${PKGLIST} and ensure"
echo "they are all available to be installed."
fi
fi
done
fi
fi
}

View File

@@ -1,70 +0,0 @@
function centos_is_stupid {
echo "Checking for appropriate kernel version and mksquashfs version..."
SQFS_VER=$(mksquashfs -version 2>&1 | head -n1 | awk '{print $3}' | sed -re 's/(^[0-9]*\.[0-9]*).*$/\1/g')
KERN_VER=$(uname -r | cut -f1 -d"-")
SQUASH_OPTS="-noappend -comp xz"
set +e
ver_check() {
[ "$1" == "$2" ] && return 10
ver1front=`echo $1 | cut -d "." -f -1`
ver1back=`echo $1 | cut -d "." -f 2-`
ver2front=`echo $2 | cut -d "." -f -1`
ver2back=`echo $2 | cut -d "." -f 2-`
if [ "$ver1front" != "$1" ] || [ "$ver2front" != "$2" ]; then
[ "$ver1front" -gt "$ver2front" ] && return 11
[ "$ver1front" -lt "$ver2front" ] && return 9
[ "$ver1front" == "$1" ] || [ -z "$ver1back" ] && ver1back=0
[ "$ver2front" == "$2" ] || [ -z "$ver2back" ] && ver2back=0
ver_check "$ver1back" "$ver2back"
return $?
else
[ "$1" -gt "$2" ] && return 11 || return 9
fi
}
ver_check ${KERN_VER} "2.6.38"
KERNTEST=${?}
ver_check ${SQFS_VER} "4.2"
SQFSTEST=${?}
if [ ${KERNTEST} -lt "10" ];
then
echo "You need a newer kernel to even think about doing this. (>= 2.6.38)"
echo "If you're on CentOS, there are 3.x branches available via the elrepo repository."
echo "I recommend the 'kernel-lt' package from there."
echo "Bailing out."
exit 1
#elif [ ${SQFS_VER} -ge "4.2" ] && [ ${KERN_VER} -ge "2.6.38" ];
elif [ ${SQFSTEST} -ge "10" ] && [ ${KERNTEST} -ge "10" ];
then
#echo "Awesome; your mksquashfs (if found) is not less than v4.2."
SQUASH_CMD=$(which mksquashfs)
if [ ${?} != "0" ];
then
echo "...Except you need to install whatever package you need to for mksquashfs."
exit 1
else
SQUASH_CMD=$(which mksquashfs)
fi
elif [ ${SQFSTEST} -lt "10" ] && [ ${KERNTEST} -ge "10" ];
then
if [ ! -f ${SRCDIR}/squashfs4.2/squashfs-tools/mksquashfs ];
then
echo "Boy howdy. We need to compile a custom version of the squashfs-tools because you aren't running a version that supports XZ. Give me a second."
set -e
mkdir -p ${SRCDIR} ${BASEDIR}/bin
cd ${SRCDIR}
#wget --quiet -O squashfs4.2.tar.gz "http://downloads.sourceforge.net/project/squashfs/squashfs/squashfs4.2/squashfs4.2.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fsquashfs%2Ffiles%2F&ts=1387047818&use_mirror=hivelocity"
curl -o squashfs4.2.tar.gz "http://downloads.sourceforge.net/project/squashfs/squashfs/squashfs4.2/squashfs4.2.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fsquashfs%2Ffiles%2F&ts=1387047818&use_mirror=hivelocity" >> "${LOGFILE}.${FUNCNAME}" 2>&1
tar -zxf squashfs4.2.tar.gz
cd squashfs4.2/squashfs-tools
make clean
sed -i -e 's/^#\(XZ_SUPPORT\)/\1/g' Makefile
make
SQUASH_CMD="${SRCDIR}/squashfs4.2/squashfs-tools/mksquashfs"
else
echo "Using custom-compiled mksquashfs from an earlier run."
SQUASH_CMD="${SRCDIR}/squashfs4.2/squashfs-tools/mksquashfs"
fi
fi
set -e
}

View File

@@ -1,4 +1,10 @@
function will_it_blend () { function will_it_blend () {
FUNCNAME="will_it_blend"
SQUASH_CMD="mksquashfs"
SQUASH_OPTS="-noappend -comp xz"
local ARCHSUFFIX="${1}" local ARCHSUFFIX="${1}"
if [[ "${1}" == "64" ]]; if [[ "${1}" == "64" ]];
then then
@@ -69,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

@@ -1,5 +1,7 @@
function stuffy { function stuffy {
FUNCNAME="stuffy"
cp -f ${BASEDIR}/VERSION_INFO.txt ${TEMPDIR}/. cp -f ${BASEDIR}/VERSION_INFO.txt ${TEMPDIR}/.
if [[ "${I_AM_A_RACECAR}" == "y" ]]; if [[ "${I_AM_A_RACECAR}" == "y" ]];
@@ -12,21 +14,21 @@ 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 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/prebootloader/HashTool.efi ${TEMPDIR}/EFI/boot/.
cp ${BASEDIR}/root.x86_64/usr/lib/gummiboot/gummibootx64.efi ${TEMPDIR}/EFI/boot/loader.efi # TODO: can i use syslinux.efi instead? 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" ];
then then
# EFI Shell 2.0 for UEFI 2.3+ ( http://sourceforge.net/apps/mediawiki/tianocore/index.php?title=UEFI_Shell ) # EFI Shell 2.0 for UEFI 2.3+ ( http://sourceforge.net/apps/mediawiki/tianocore/index.php?title=UEFI_Shell )
curl -o ${TEMPDIR}/EFI/shellx64_v2.efi https://svn.code.sf.net/p/edk2/code/trunk/edk2/ShellBinPkg/UefiShell/X64/Shell.efi >> "${LOGFILE}.${FUNCNAME}" 2>&1 curl -o ${TEMPDIR}/EFI/shellx64_v2.efi "https://github.com/tianocore/edk2/blob/master/ShellBinPkg/UefiShell/X64/Shell.efi?raw=true" >> "${LOGFILE}.${FUNCNAME}" 2>&1
fi fi
if [ ! -f "${TEMPDIR}/EFI/shellx64_v1.efi" ]; if [ ! -f "${TEMPDIR}/EFI/shellx64_v1.efi" ];
then then
# EFI Shell 1.0 for non UEFI 2.3+ ( http://sourceforge.net/apps/mediawiki/tianocore/index.php?title=Efi-shell ) # EFI Shell 1.0 for non UEFI 2.3+ ( http://sourceforge.net/apps/mediawiki/tianocore/index.php?title=Efi-shell )
curl -o ${TEMPDIR}/EFI/shellx64_v1.efi https://svn.code.sf.net/p/edk2/code/trunk/edk2/EdkShellBinPkg/FullShell/X64/Shell_Full.efi >> "${LOGFILE}.${FUNCNAME}" 2>&1 curl -o ${TEMPDIR}/EFI/shellx64_v1.efi "https://github.com/tianocore/edk2/blob/master/EdkShellBinPkg/FullShell/X64/Shell_Full.efi?raw=true" >> "${LOGFILE}.${FUNCNAME}" 2>&1
fi fi
# now for setting up loader config/entries. maybe add memtest or something in the future? i dunno. # now for setting up loader config/entries. maybe add memtest or something in the future? i dunno.
@@ -69,7 +71,7 @@ EOF
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" ${BASEDIR}/root.x86_64/usr/lib/prebootloader/HashTool.efi))) # EFI/boot/HashTool.efi
FATSIZE=$((${FATSIZE} + $(stat --format="%s" ${BASEDIR}/root.x86_64/usr/lib/gummiboot/gummibootx64.efi))) # EFI/boot/loader.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,7 +112,7 @@ EOF
cp ${BASEDIR}/root.x86_64/usr/lib/prebootloader/PreLoader.efi ${SRCDIR}/efiboot/EFI/boot/bootx64.efi cp ${BASEDIR}/root.x86_64/usr/lib/prebootloader/PreLoader.efi ${SRCDIR}/efiboot/EFI/boot/bootx64.efi
cp ${BASEDIR}/root.x86_64/usr/lib/prebootloader/HashTool.efi ${SRCDIR}/efiboot/EFI/boot/. cp ${BASEDIR}/root.x86_64/usr/lib/prebootloader/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

@@ -1,16 +1,19 @@
function yo_dj () { function yo_dj () {
FUNCNAME="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 #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" ]];
@@ -281,6 +284,7 @@ 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
@@ -289,21 +293,95 @@ EOF
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.
git revert -n 40a9a0f0
## Apply our patches.
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 -Np2 < ${BASEDIR}/src/ipxe_local/patches/${i} >> "${LOGFILE}.${FUNCNAME}" 2>&1
done done
#make everything EMBED="${BASEDIR}/src/ipxe_local/EMBED" >> "${LOGFILE}.${FUNCNAME}" 2>&1 ## SSL
make bin-i386-efi/ipxe.efi bin-x86_64-efi/ipxe.efi EMBED="${BASEDIR}/src/ipxe_local/EMBED" >> "${LOGFILE}.${FUNCNAME}" 2>&1 SSLDIR="${BASEDIR}/src/ipxe_local/ssl"
make bin/ipxe.eiso bin/ipxe.usb EMBED="${BASEDIR}/src/ipxe_local/EMBED" >> "${LOGFILE}.${FUNCNAME}" 2>&1 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...
sed -re "s,^(chain\ ).*$,\1${IPXE_URI},g" \
-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 bin-i386-efi/ipxe.efi bin-x86_64-efi/ipxe.efi \
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
cd ${BASEDIR}/src/ipxe
git reset --hard >> "${LOGFILE}.${FUNCNAME}" 2>&1 git reset --hard >> "${LOGFILE}.${FUNCNAME}" 2>&1
git clean -xdf > /dev/null 2>&1 git clean -xdf > /dev/null 2>&1
git checkout master > /dev/null 2>&1 git checkout master . > /dev/null 2>&1
#git reset --hard HEAD > /dev/null 2>&1 #git reset --hard HEAD > /dev/null 2>&1
echo echo
fi fi

View File

@@ -1,4 +1,7 @@
function mentos { function mentos {
FUNCNAME="mentos"
# Freshen up the chroots to git's HEAD. Package lists, overlay, etc. # Freshen up the chroots to git's HEAD. Package lists, overlay, etc.
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 # both
@@ -19,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
@@ -33,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"-")
@@ -42,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

27
lib/prereqs/Antergos/meta Normal file
View File

@@ -0,0 +1,27 @@
NAME='Antergos'
SUPPORTED='yes'
CHECK_METHOD='egrep "^NAME=\"Antergos Linux\"$" /etc/os-release'
PKG_MGR='pacman -S --needed --noconfirm ${pkgname}'
PRE_RUN='pacman -Syyy'
PKG_CHK='pacman -Q ${pkgname}'
URL='http://antergos.com/'
function distro_specific_tweaks {
# For some reason, I can't get "yes y | " to parse correctly with eval. And Arch isn't smart enough
# to figure out that if I enable the multilib repos, *I want multilib gcc*. Fuck it. We'll just remove it first.
pacman -S --needed --noconfirm haveged >> "${LOGFILE}.${FUNCNAME}" 2>&1
haveged
set +e
for pkg_override in gcc gcc-libs;
do
pacman -Q ${pkg_override} >> "${LOGFILE}.${FUNCNAME}" 2>&1
if [[ "${?}" == "0" ]];
then
pacman -Rdd --noconfirm ${pkg_override} >> "${LOGFILE}.${FUNCNAME}" 2>&1
fi
done
set -e
}

1
lib/prereqs/Antergos/pkgs Symbolic link
View File

@@ -0,0 +1 @@
../Arch/pkgs

27
lib/prereqs/Arch/meta Normal file
View File

@@ -0,0 +1,27 @@
NAME='Arch'
SUPPORTED='yes'
CHECK_METHOD='egrep "^NAME=\"Arch Linux\"$" /etc/os-release'
PKG_MGR='pacman -S --needed --noconfirm ${pkgname}'
PRE_RUN='pacman -Syyy'
PKG_CHK='pacman -Q ${pkgname}'
URL='https://www.archlinux.org/'
function distro_specific_tweaks {
# For some reason, I can't get "yes y | " to parse correctly with eval. And Arch isn't smart enough
# to figure out that if I enable the multilib repos, *I want multilib gcc*. Fuck it. We'll just remove it first.
pacman -S --needed --noconfirm haveged >> "${LOGFILE}.${FUNCNAME}" 2>&1
haveged
set +e
for pkg_override in gcc gcc-libs;
do
pacman -Q ${pkg_override} >> "${LOGFILE}.${FUNCNAME}" 2>&1
if [[ "${?}" == "0" ]];
then
pacman -Rdd --noconfirm ${pkg_override} >> "${LOGFILE}.${FUNCNAME}" 2>&1
fi
done
set -e
}

19
lib/prereqs/Arch/pkgs Normal file
View File

@@ -0,0 +1,19 @@
binutils
curl
dosfstools
findutils
gcc-libs-multilib
gcc-multilib
git
libisoburn
lynx
make
mtools
patch
perl
rsync
sed
squashfs-tools
syslinux
xz
zlib

17
lib/prereqs/CentOS/meta Normal file
View File

@@ -0,0 +1,17 @@
NAME='CentOS'
# Currently fails on installing software *inside* the chroot. Will troubleshoot and restore when figured out.
SUPPORTED='yes'
CHECK_METHOD='egrep "^CentOS" /etc/redhat-release'
PKG_MGR='yum -y install ${pkgname}'
PRE_RUN='none'
PKG_CHK='rpm -q ${pkgname} | egrep "^${pkgname}-[0-9]"'
URL='http://centos.org/'
function distro_specific_tweaks {
# NOTE: we handle installing of squashfs-tools (maybe) and xorriso in centos_is_stupid function.
# because they *suck*. Seriously. I need to install tk just to install xorriso. I mean, what?
# You need EPEL enabled, by the way.
echo "No tweaks found."
}

1
lib/prereqs/CentOS/pkgs Symbolic link
View File

@@ -0,0 +1 @@
../RHEL/pkgs

13
lib/prereqs/Debian/meta Normal file
View File

@@ -0,0 +1,13 @@
NAME='Debian'
SUPPORTED='yes'
CHECK_METHOD='egrep "^NAME=\"Debian\ GNU/Linux\"$" /etc/os-release'
PKG_MGR='apt-get -y install ${pkgname}'
PRE_RUN='apt-get update'
PKG_CHK='dpkg-query -l ${pkgname} | egrep "^ii[[:space:]]*${pkgname}"'
URL='http://www.debian.org/'
function distro_specific_tweaks {
echo "No tweaks found."
}

26
lib/prereqs/Debian/pkgs Normal file
View File

@@ -0,0 +1,26 @@
binutils
binutils-dev
curl
dosfstools
gcc
gcc-multilib
git
isolinux
libiberty-dev
libisoburn1
lynx
liblzma5
liblzma-dev
make
mtools
patch
perl
rsync
sed
squashfs-tools
syslinux
syslinux-efi
xorriso
xz-utils
zlib1g
zlib1g-dev

14
lib/prereqs/Devuan/meta Normal file
View File

@@ -0,0 +1,14 @@
NAME='Devuan'
SUPPORTED='no'
CHECK_METHOD='egrep "^NAME=\"Devuan\ GNU/Linux\"$" /etc/os-release'
PKG_MGR='apt-get -y install ${pkgname}'
PRE_RUN='apt-get update'
PKG_CHK='dpkg-query -l ${pkgname} | egrep "^ii[[:space:]]*${pkgname}"'
URL='http://www.debian.org/'
function distro_specific_tweaks {
echo "No tweaks found."
}

1
lib/prereqs/Devuan/pkgs Symbolic link
View File

@@ -0,0 +1 @@
../Debian/pkgs

14
lib/prereqs/Fedora/meta Normal file
View File

@@ -0,0 +1,14 @@
NAME='Fedora'
SUPPORTED='yes'
CHECK_METHOD='egrep '^Fedora' /etc/redhat-release'
PKG_MGR='dnf -y install ${pkgname}'
PRE_RUN='none'
PKG_CHK='rpm -q ${pkgname} | egrep "^${pkgname}-[0-9]"'
URL='https://getfedora.org/'
function distro_specific_tweaks {
echo "No tweaks found."
}

23
lib/prereqs/Fedora/pkgs Normal file
View File

@@ -0,0 +1,23 @@
binutils
binutils-devel
curl
dosfstools
gcc
git
libisofs
lynx
make
mtools
patch
perl
rsync
sed
squashfs-tools
syslinux
syslinux-devel
tar
xorriso
xz
xz-devel
zlib
zlib-devel

20
lib/prereqs/Gentoo/meta Normal file
View File

@@ -0,0 +1,20 @@
NAME='Gentoo'
SUPPORTED='yes'
CHECK_METHOD='egrep "^Gentoo\ Base\ System" /etc/gentoo-release'
PKG_MGR='emerge -q1Dn ${pkgname}'
PRE_RUN='emerge -q --sync'
PKG_CHK='emerge -qp @installed 2>/dev/null | egrep -E "/${pkgname}-[0-9.]+"'
URL='https://www.gentoo.org/'
function distro_specific_tweaks {
# WHY IS THIS EVEN MASKED?!
set +e
grep -q 'app-arch/lzma' /etc/portage/package.accept_keywords
if [[ "${?}" != "0" ]];
then
echo 'app-arch/lzma' >> /etc/portage/package.accept_keywords
fi
set -e
}

18
lib/prereqs/Gentoo/pkgs Normal file
View File

@@ -0,0 +1,18 @@
sys-devel/binutils
net-misc/curl
sys-fs/dosfstools
sys-devel/gcc
dev-vcs/git
dev-libs/libisoburn
www-client/lynx
app-arch/lzma
sys-devel/make
sys-fs/mtools
sys-devel/patch
dev-lang/perl
net-misc/rsync
sys-apps/sed
sys-fs/squashfs-tools
sys-boot/syslinux
app-arch/xz-utils
sys-libs/zlib

19
lib/prereqs/HUMAN Normal file
View File

@@ -0,0 +1,19 @@
This directory is used to enable cross-distro support and set baseline ISO packages needed for it to boot. A list of packages is needed for the *host* to build the ISO as well, which you'll find detailed below. Adding distro support is easy; there simply needs to be the following added:
<basedir>/lib/prereqs/<Distro>/{meta,pkgs}
"pkgs" should contain a list of the specific package names needed to install for that specific distro (as this isn't always standardized).
"meta" is a file consisting of the following variables (enclosed in single or double quotes, please:
NAME=<Distro - this should match the name of the directory this file is in!>
SUPPORTED=<yes or no- yes by default>
CHECK_METHOD=<a command that will be run that should return '0' (success) on *only* this specific distro
(or fully compatible derivatives, i.e. CentOS/RHEL)>
PKG_MGR=<a command used to prefix installation of packages e.g. for RHEL, "yum -y install">
PRE_RUN=<a command to be run before PKG_MGR (e.g. on Ubuntu, "apt-get update"). commonly used to update package caches/metadata.
if your distro does not require this, set PRE_RUN=none >
PKG_CHK=<a command that will be run that should return '0' (success) *only* if any given package in the pkgs file is installed. e.g. for RHEL, "rpm -q">
URL=<the URL for the distro. optional, as it isn't really used as any active part of the scripts- at least not presently.>
Oh- and your distro *must be able to install the package*. That means if you need to enable/add additional repositories, be sure to do so ahead of time.

14
lib/prereqs/Mageia/meta Normal file
View File

@@ -0,0 +1,14 @@
NAME='Mageia'
SUPPORTED='yes'
CHECK_METHOD='egrep "^Mageia\ release\ " /etc/mageia-release'
PKG_MGR='urpmi --force --auto ${pkgname}'
PRE_RUN='urpmi.update -a'
PKG_CHK='rpm -q ${pkgname} | egrep "^${pkgname}-[0-9]"'
URL='https://www.mageia.org/'
function distro_specific_tweaks {
echo "No tweaks found."
}

27
lib/prereqs/Mageia/pkgs Normal file
View File

@@ -0,0 +1,27 @@
binutils
binutils-devel
curl
gcc
git
lib64isofs6
lib64apr1_0
lib64apr-util1_0
lib64lzma5
lib64lzma-devel
lib64lzmalib1
lib64lzmalib-devel
libstdc++-devel
lynx
make
mtools
patch
perl
rsync
sed
squashfs-tools
syslinux
syslinux-devel
xorriso
xz
zlib
zlib-devel

28
lib/prereqs/Manjaro/meta Normal file
View File

@@ -0,0 +1,28 @@
NAME='Manjaro'
SUPPORTED='yes'
CHECK_METHOD='egrep "^NAME=\"Manjaro Linux\"$" /etc/os-release'
PKG_MGR='pacman -S --needed --noconfirm ${pkgname}'
PRE_RUN='pacman -Syyy --noconfirm'
PKG_CHK='pacman -Q ${pkgname}'
URL='https://manjaro.org/'
function distro_specific_tweaks {
# For some reason, I can't get "yes y | " to parse correctly with eval. And Arch isn't smart enough
# to figure out that if I enable the multilib repos, *I want multilib gcc*. Fuck it. We'll just remove it first.
pacman -S --needed --noconfirm haveged >> "${LOGFILE}.${FUNCNAME}" 2>&1
haveged
set +e
for pkg_override in gcc gcc-libs;
do
pacman -Q ${pkg_override} >> "${LOGFILE}.${FUNCNAME}" 2>&1
if [[ "${?}" == "0" ]];
then
pacman -Rdd --noconfirm ${pkg_override} >> "${LOGFILE}.${FUNCNAME}" 2>&1
pacman -S --noconfirm ${pkg_override}-multilib >> "${LOGFILE}.${FUNCNAME}" 2>&1
fi
done
set -e
}

1
lib/prereqs/Manjaro/pkgs Symbolic link
View File

@@ -0,0 +1 @@
../Arch/pkgs

14
lib/prereqs/Mint/meta Normal file
View File

@@ -0,0 +1,14 @@
NAME='Mint'
SUPPORTED='no'
# Needs non-systemd chroot method
CHECK_METHOD='egrep "^DESCRIPTION=\"Linux\ Mint" /etc/linuxmint/info'
PKG_MGR='apt-get -y install ${pkgname}'
PRE_RUN='apt-get -y update'
PKG_CHK='dpkg-query -l ${pkgname}'
URL='http://www.linuxmint.com/'
function distro_specific_tweaks {
echo "No tweaks found."
}

1
lib/prereqs/Mint/pkgs Symbolic link
View File

@@ -0,0 +1 @@
../Ubuntu/pkgs

15
lib/prereqs/RHEL/meta Normal file
View File

@@ -0,0 +1,15 @@
NAME='RHEL'
SUPPORTED='yes'
# Red Hat Enterprise Linux Server release 6.5 (Santiago)
CHECK_METHOD='egrep "^Red\ Hat\ Enterprise\ Linux" /etc/redhat-release'
PKG_MGR='yum -y install'
PRE_RUN='none'
PKG_CHK='rpm -q ${pkgname} | egrep "^${pkgname}-[0-9]"'
URL='http://www.redhat.com/en/technologies/linux-platforms/enterprise-linux'
function distro_specific_tweaks {
echo "No tweaks found."
}

21
lib/prereqs/RHEL/pkgs Normal file
View File

@@ -0,0 +1,21 @@
binutils
binutils-devel
curl
dosfstools
gcc
git
libisofs
lynx
make
mtools
patch
perl
rsync
sed
squashfs-tools
syslinux
syslinux-devel
xz
xz-devel
zlib
zlib-devel

16
lib/prereqs/SUSE/meta Normal file
View File

@@ -0,0 +1,16 @@
NAME='SUSE'
SUPPORTED='yes'
# Both SLED and SLES. We can probably safely combine them.
CHECK_METHOD='egrep "^NAME=\"SLE(D|S)\"$" /etc/os-release'
PKG_MGR='zypper install --no-confirm -l ${pkgname}'
PRE_RUN='zypper refresh'
PKG_CHK='rpm -q ${pkgname} | egrep "^${pkgname}-[0-9]"'
URL='https://www.suse.com/'
function distro_specific_tweaks {
# See the centos_is_stupid function. we do some tweaks there since -devel pkgs require the SDK on SLES/SLED.
echo "No tweaks found."
}

1
lib/prereqs/SUSE/pkgs Symbolic link
View File

@@ -0,0 +1 @@
../openSUSE/pkgs

14
lib/prereqs/Ubuntu/meta Normal file
View File

@@ -0,0 +1,14 @@
NAME='Ubuntu'
SUPPORTED='yes'
CHECK_METHOD='egrep "^DISTRIB_ID=Ubuntu$" /etc/lsb-release'
PKG_MGR='apt-get -y install ${pkgname}'
PRE_RUN='apt-get -y update'
PKG_CHK='dpkg-query -l ${pkgname} | egrep "^ii[[:space:]]*${pkgname}"'
URL='http://www.ubuntu.com/'
function distro_specific_tweaks {
echo "No tweaks found."
}

25
lib/prereqs/Ubuntu/pkgs Normal file
View File

@@ -0,0 +1,25 @@
binutils
binutils-dev
curl
dosfstools
gcc
gcc-multilib
git
isolinux
libiberty-dev
libisoburn1
lynx
liblzma5
liblzma-dev
make
mtools
patch
perl
rsync
sed
squashfs-tools
syslinux
xorriso
xz-utils
zlib1g
zlib1g-dev

View File

@@ -0,0 +1,14 @@
NAME='elementaryOS'
SUPPORTED='no'
CHECK_METHOD='egrep "^DISTRIB_ID=\"elementary OS\"$" /etc/lsb-release'
PKG_MGR='apt-get -y install ${pkgname}'
PRE_RUN='apt-get -y update'
PKG_CHK='dpkg-query -l ${pkgname} | egrep "^ii[[:space:]]*${pkgname}"'
URL='https://elementary.io/'
function distro_specific_tweaks {
echo "No tweaks found."
}

View File

@@ -0,0 +1 @@
../Ubuntu/pkgs

39
lib/prereqs/iso.pkgs.lst Normal file
View File

@@ -0,0 +1,39 @@
arch-install-scripts
archiso
bzip2
coreutils
cronie
dhclient
dhcp
dhcpcd
dosfstools
efibootmgr
efivar
ethtool
file
findutils
iproute2
iputils
libisoburn
localepurge
lz4
lzo
lzop
mkinitcpio-nfs-utils
ms-sys
mtools
net-tools
netctl
networkmanager
openssh
openvpn
prebootloader
pv
rsync
sed
shorewall
squashfs-tools
sudo
sysfsutils
syslinux
traceroute

View File

@@ -0,0 +1 @@
# This can be used for 32-bit only packages

View File

@@ -0,0 +1 @@
# This can be used for 64-bit only packages

15
lib/prereqs/openSUSE/meta Normal file
View File

@@ -0,0 +1,15 @@
NAME='openSUSE'
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.
CHECK_METHOD='egrep "^NAME=\"?openSUSE\"?$" /etc/os-release'
PKG_MGR='zypper install --no-confirm -l ${pkgname}'
PRE_RUN='zypper refresh'
PKG_CHK='rpm -q ${pkgname} | egrep "^${pkgname}-[0-9]"'
URL='https://www.opensuse.org/'
function distro_specific_tweaks {
echo "No tweaks found."
}

22
lib/prereqs/openSUSE/pkgs Normal file
View File

@@ -0,0 +1,22 @@
binutils
binutils-devel
binutils-devel-32bit
curl
dosfstools
gcc
gcc-32bit
git
libisoburn1
libisofs6
lynx
make
mtools
patch
perl
rsync
sed
squashfs
syslinux
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
chain http://bdisk.square-r00t.net ## 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

View File

@@ -1,14 +1,13 @@
From ddf6f6ac945654b00121ab899fb0bbb63293e51e Mon Sep 17 00:00:00 2001 From d2092664b3cf866b2ab338fe056149d3266d0acc Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de> From: Christian Hesse <mail@eworm.de>
Date: Tue, 7 Apr 2015 16:04:31 +0200 Date: Sun, 19 Apr 2015 13:16:09 +0200
Subject: [PATCH 1/2] [build] allow to build ISO image with EFI support Subject: [PATCH 1/1] allow to build ISO image with EFI support (ipxe.eiso)
(ipxe.eiso)
Signed-off-by: Christian Hesse <mail@eworm.de> Signed-off-by: Christian Hesse <mail@eworm.de>
--- ---
src/arch/i386/Makefile.pcbios | 6 ++++++ src/arch/i386/Makefile.pcbios | 6 +++++
src/util/geniso | 39 ++++++++++++++++++++++++++++++--------- src/util/geniso | 52 +++++++++++++++++++++++++++++++++----------
2 files changed, 36 insertions(+), 9 deletions(-) 2 files changed, 46 insertions(+), 12 deletions(-)
diff --git a/src/arch/i386/Makefile.pcbios b/src/arch/i386/Makefile.pcbios diff --git a/src/arch/i386/Makefile.pcbios b/src/arch/i386/Makefile.pcbios
index ff82373..c7a58eb 100644 index ff82373..c7a58eb 100644
@@ -28,7 +27,7 @@ index ff82373..c7a58eb 100644
NON_AUTO_MEDIA += liso NON_AUTO_MEDIA += liso
%liso: %lkrn util/geniso %liso: %lkrn util/geniso
diff --git a/src/util/geniso b/src/util/geniso diff --git a/src/util/geniso b/src/util/geniso
index 521c929..998370d 100755 index 521c929..9e8588c 100755
--- a/src/util/geniso --- a/src/util/geniso
+++ b/src/util/geniso +++ b/src/util/geniso
@@ -6,16 +6,21 @@ function help() { @@ -6,16 +6,21 @@ function help() {
@@ -54,49 +53,47 @@ index 521c929..998370d 100755
h) h)
help help
exit 0 exit 0
@@ -37,23 +42,24 @@ if [ -z "${OUT}" ]; then @@ -37,17 +42,25 @@ if [ -z "${OUT}" ]; then
exit 1 exit 1
fi fi
-# There should either be mkisofs or the compatible genisoimage program -# There should either be mkisofs or the compatible genisoimage program
-for command in genisoimage mkisofs; do -for command in genisoimage mkisofs; do
+# We require xorriso (from libisoburn) for EFI support - if ${command} --version >/dev/null 2>/dev/null; then
+# genisoimage and mkisofs are missing some features
+for command in xorriso; do
if ${command} --version >/dev/null 2>/dev/null; then
- mkisofs=(${command}) - mkisofs=(${command})
+ xorriso=(${command}) - break
break - fi
fi -done
done -
-if [ -z "${mkisofs}" ]; then -if [ -z "${mkisofs}" ]; then
- echo "${0}: mkisofs or genisoimage not found, please install or set PATH" >&2 - echo "${0}: mkisofs or genisoimage not found, please install or set PATH" >&2
+if [ -z "${xorriso}" ]; then +# We need xorriso (from libisoburn) for EFI support, so try that first.
+ echo "${0}: xorriso not found, please install or set PATH" >&2 +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 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 fi
dir=$(mktemp -d bin/iso.dir.XXXXXX) dir=$(mktemp -d bin/iso.dir.XXXXXX)
cfg=${dir}/isolinux.cfg @@ -122,6 +135,21 @@ case "${LEGACY}" in
-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 # copy isolinux bootloader
cp ${ISOLINUX_BIN} ${dir} cp ${ISOLINUX_BIN} ${dir}
+ xorriso+=(-b isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table) + mkisofs+=(-b isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table)
+ +
+ if [ "${EFI}" -eq 1 ]; then + if [ "${EFI}" -eq 1 ]; then
+ # generate EFI image + # generate EFI image
@@ -108,18 +105,18 @@ index 521c929..998370d 100755
+ mcopy -m -i ${img} bin-x86_64-efi/ipxe.efi "::EFI/BOOT/BOOTX64.EFI" + 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" + 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) + mkisofs+=(-eltorito-alt-boot -e efiboot.img -isohybrid-gpt-basdat -no-emul-boot)
+ fi + fi
+ +
# syslinux 6.x needs a file called ldlinux.c32 # syslinux 6.x needs a file called ldlinux.c32
LDLINUX_C32=$(dirname ${ISOLINUX_BIN})/ldlinux.c32 LDLINUX_C32=$(dirname ${ISOLINUX_BIN})/ldlinux.c32
if [ -s ${LDLINUX_C32} ]; then if [ -s ${LDLINUX_C32} ]; then
@@ -129,7 +150,7 @@ case "${LEGACY}" in @@ -129,7 +157,7 @@ case "${LEGACY}" in
fi fi
# generate the iso image # generate the iso image
- "${mkisofs[@]}" -b isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -output ${OUT} ${dir} - "${mkisofs[@]}" -b isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -output ${OUT} ${dir}
+ "${xorriso[@]}" -output ${OUT} ${dir} + "${mkisofs[@]}" -output ${OUT} ${dir}
# isohybrid will be used if available # isohybrid will be used if available
if isohybrid --version >/dev/null 2>/dev/null; then if isohybrid --version >/dev/null 2>/dev/null; then

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