Compare commits
28 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ab53094f90 | |||
| cab43beffc | |||
| 8de80fde9d | |||
| 1503f55f5b | |||
| e97cda244e | |||
| aa68cd49fb | |||
| 71a2e1ad88 | |||
| 32c39ff7e1 | |||
| 56806ba880 | |||
| 7f62dbb3ee | |||
| 812e861152 | |||
| e601e50570 | |||
| a131b1288a | |||
| ff24710b95 | |||
| 145a7d6271 | |||
| 318469f993 | |||
| d8ae21c31b | |||
| e337afdeb7 | |||
| 591ef6b826 | |||
| 4c562f7be6 | |||
| 17feef94c6 | |||
| b6660835d3 | |||
| 5cbab2dc0c | |||
| 59709f139e | |||
| 2d176a4b11 | |||
| cecae180ea | |||
| f549d24977 | |||
| 904d644990 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -23,3 +23,5 @@
|
||||
/screenlog*
|
||||
/logs
|
||||
*.swp
|
||||
*.lck
|
||||
#src/ipxe/src/
|
||||
|
||||
5
.gitmodules
vendored
Normal file
5
.gitmodules
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
[submodule "src/ipxe"]
|
||||
path = src/ipxe
|
||||
url = git://git.ipxe.org/ipxe.git
|
||||
[submodule "ipxe"]
|
||||
branch = master
|
||||
203
README
203
README
@@ -1,18 +1,11 @@
|
||||
######################################################################################################################################
|
||||
##### BDisk #####
|
||||
##### BDisk #####
|
||||
##### #####
|
||||
##### Written by Brent Saner #####
|
||||
##### <bts@square-r00t.net> #####
|
||||
##### Built upon my (Brent's) 'BDisk' ISO-building framework (http://bdisk.square-r00t.net) #####
|
||||
######################################################################################################################################
|
||||
|
||||
## Why Arch? ##
|
||||
Because it's a largely easy-to-use, well-documented (https://wiki.archlinux.org/) distro. It's no-frills and incredibly
|
||||
flexible/customizable, and can be made rather slim. It's also very friendly to run as a chroot inside any other distro.
|
||||
|
||||
All commands below should be issued in the root working directory of this git repository. (For me, this is
|
||||
/opt/dev/work/BDisk but this may be entirely different for you, depending on where you cloned the repository to.)
|
||||
|
||||
!!!!!! WARNING !!!!!!!
|
||||
I do NOT recommend running this on a machine that is using wireless, as it will download a LOT of data.
|
||||
If you ignore this warning, be prepared to explain to anyone you share your wifi with why Facebook takes 20 seconds to load,
|
||||
@@ -26,6 +19,35 @@ disabled by default).
|
||||
Till then, sorry for the inconvenience.
|
||||
!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
|
||||
## Why Arch? ##
|
||||
Because it's a largely easy-to-use, well-documented (https://wiki.archlinux.org/) distro. It's no-frills and incredibly
|
||||
flexible/customizable, and can be made rather slim. It's also very friendly to run as a chroot inside any other distro.
|
||||
|
||||
All commands below should be issued in the root working directory of this git repository. (For me, this is
|
||||
/opt/dev/work/BDisk but this may be entirely different for you, depending on where you cloned the repository to.)
|
||||
|
||||
## Features ##
|
||||
-Builds a hybrid ISO
|
||||
A hybrid ISO allows one to simply dd if=/path/to/file.iso of=/dev/<USB STICK> instead of using e.g. UNetBootin while also
|
||||
working with traditional optical media.
|
||||
-Builds a dual-architecture ISO
|
||||
BDisk allows you to create both a 32-bit and 64-bit ISO, either separately or part of the same ISO, and customize each
|
||||
based on architecture.
|
||||
-Supports both BIOS and UEFI booting in one ISO
|
||||
It can be difficult finding a live distribution that offers full UEFI support, which is frustrating if you're trying to
|
||||
install e.g. UEFI-enabled Gentoo, for instance. Not only does this ISO framework build support for both in the same ISO,
|
||||
but it also includes some UEFI shells as well.
|
||||
-Arch install scripts
|
||||
This live distro, assuming default packages are kept, should be 100% compatible with the Arch install guide
|
||||
(https://wiki.archlinux.org/index.php/installation_guide).
|
||||
-Allows for non-interactive runs, is git-friendly, logs all output while keeping the runtime output relatively sane, and allows
|
||||
the inclusion of arbitrary files in the finished filesystem.
|
||||
-TFP/HTTP/PXE support
|
||||
It will automatically copy over some files to tftpboot/ and http/, greatly saving some time in PXE booting. It also
|
||||
supports, by default, booting PXE with HTTP fetching for the squashed filesystems. Say goodbye to NFS.
|
||||
-Automatic versioning based on git tags
|
||||
|
||||
## Prerequisites ##
|
||||
-At least ~20Gb disk space free (remember, you need room for not only four chroots (one developing and one staging for i686/x86_64),
|
||||
but also disk space for working, the finished ISO(s), etc.)
|
||||
@@ -47,98 +69,89 @@ squashfs-tools
|
||||
xorriso (in RPMForge repo for CentOS 7)
|
||||
xz
|
||||
|
||||
and *probably* 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.
|
||||
and *probably* 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.
|
||||
|
||||
|
||||
## Configuration ##
|
||||
See extra/build.conf.sample. Copy to <PROJECT ROOT>/build.conf if you wish to modify any of the values, otherwise the defaults
|
||||
will be used. I recommend enabling I_AM_A_RACECAR if you have the hardware for it, as it can speed things up greatly.
|
||||
The file should be well-commented.
|
||||
|
||||
Also note the following files/paths:
|
||||
|
||||
-bin:
|
||||
The building/cleaning scripts.
|
||||
--/build.sh:
|
||||
Supports several modes:
|
||||
bin/build.sh update Updates existing chroots (does an apacman -Syyu --devel, copies over fresh files from
|
||||
overlays, etc.)
|
||||
bin/build.sh chroot Chroots you into the runtime for any interactive tasks you may wish to run.
|
||||
bin/build.sh build (DEFAULT) Builds the chroots, ISO, etc.
|
||||
bin/build.sh all Same as bin/build.sh build
|
||||
bin/build.sh Same as bin/build.sh build
|
||||
--/clean.sh:
|
||||
Supports several modes:
|
||||
bin/clean.sh all Clears everything out to a near-pristine working state. For convenience, it DOES NOT clear
|
||||
out build.conf.
|
||||
bin/clean.sh chroot Clears out only the working spaces, old ISOs, and the chroot directories. Hnady if you want to "start
|
||||
fresh" but still want to keep logs from earlier runs.
|
||||
bin/clean.sh squash Clears out only the working spaces and old ISOs. Useful if you're on a slow connection and would
|
||||
rather update the chroots instead of downloading filesystem snapshots again.
|
||||
bin/clean.sh Only clears workspaces and old ISOs.
|
||||
--/mirror.lst.sh:
|
||||
Builds a fresh mirror list. Note that it is US based.
|
||||
|
||||
-extra:
|
||||
Supporting files for the base building system (mirrorlist, etc.).
|
||||
--/${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)
|
||||
--/bootstrap/apacman-*.tar.xz:
|
||||
An AUR-enabled package manager. Necessary for AUR support.
|
||||
--/build.conf.sample:
|
||||
Sample/default config file. If you wish to override any settings, copy to <PROJECT ROOT>/build.conf and make your changes there.
|
||||
First run of the script will do this for you automatically.
|
||||
--/mirrorlist:
|
||||
A set of default mirrorlists to be used for the chroots during building and runtime. Feel free to replace with your own
|
||||
mirrorlist (current list is speed-optimized for east coast US).
|
||||
--/packages.32:
|
||||
A list of packages to install in the base system (32-bit runtime only).
|
||||
--/packages.64:
|
||||
A list of packages to install in the base system (64-bit runtime only).
|
||||
--/packages.both:
|
||||
A list of packages to install in the base system (these should be installed and are supported on both 64- AND 32-bit)
|
||||
--/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
|
||||
(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)
|
||||
--/pre-build.d/32:
|
||||
Same as above, but only for 32-bit environments.
|
||||
--/pre-build.d/64:
|
||||
You get the picture.
|
||||
-http:
|
||||
Files to be hosted for PXE booting the environment go here. Set this as your root/DocumentRoot in nginx/Apache (or, ideally,
|
||||
copy over to a separate webserver). This directory is wiped out during any bin/clean.sh operation.
|
||||
-lib:
|
||||
The "guts" of BDisk.
|
||||
-logs:
|
||||
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:
|
||||
These files are applied AFTER the initial setup of the chroots. Same hierarchy rules as extra/pre-build.d.
|
||||
-README:
|
||||
This file.
|
||||
-tftpboot:
|
||||
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.
|
||||
|
||||
## (Re)Building ##
|
||||
$ sudo bin/build.sh
|
||||
Building must be done as root, and on an Arch x86_64 system (future versions will allow for non-Arch distros).
|
||||
|
||||
# bin/build.sh
|
||||
|
||||
Yeah. It's that easy. The finished product is in iso/.
|
||||
|
||||
Build output should look something like this:
|
||||
|
||||
|
||||
[root@dawid BDisk]# time nice -n "-19" bin/build.sh
|
||||
You have not configured a build.conf OR you are not running from the project's root directory (the git repository's working directory).
|
||||
If you are indeed in the correct directory, you may copy the sample at extra/build.conf.sample,
|
||||
edit it for appropriate values, and copy to <PROJECT ROOT>/build.conf
|
||||
For now, though, I am copying over the default.
|
||||
Checking directory structure and creating lockfile at /opt/dev/work/BDisk/lockfile.lck...
|
||||
/opt/dev/work/BDisk/root.i686 does not exist - creating.
|
||||
/opt/dev/work/BDisk/root.x86_64 does not exist - creating.
|
||||
/opt/dev/work/BDisk/build32 does not exist - creating.
|
||||
/opt/dev/work/BDisk/build64 does not exist - creating.
|
||||
/opt/dev/work/BDisk/iso does not exist - creating.
|
||||
/opt/dev/work/BDisk/temp/bdisk does not exist - creating.
|
||||
/opt/dev/work/BDisk/temp/FPOS does not exist - creating.
|
||||
/opt/dev/work/BDisk/src does not exist - creating.
|
||||
/opt/dev/work/BDisk/tftpboot does not exist - creating.
|
||||
/opt/dev/work/BDisk/http/FPOS does not exist - creating.
|
||||
/opt/dev/work/BDisk/logs does not exist - creating.
|
||||
No existing chroot environment found. Creating...
|
||||
Now importing settings/variables.
|
||||
Checking/fetching snapshots...
|
||||
Extracting snapshots. This will take a while...
|
||||
Configuring snapshots...
|
||||
Initializing chroots...
|
||||
Prepping /opt/dev/work/BDisk/root.i686. This will take a while...
|
||||
...Key initializing...Done.
|
||||
...Importing keys...Done.
|
||||
...Installing base packages...Done.
|
||||
...Upgrading any outdated packages...Done. Finishing/cleaning up...
|
||||
Prepping /opt/dev/work/BDisk/root.x86_64. This will take a while...
|
||||
...Key initializing...Done.
|
||||
...Importing keys...Done.
|
||||
...Installing base packages...Done.
|
||||
...Upgrading any outdated packages...Done. Finishing/cleaning up...
|
||||
Installing common packages...
|
||||
...Packages installing to /opt/dev/work/BDisk/root.i686...Compiling kernel sources...Regular packages......Creating bdisk user...Done.
|
||||
Done.
|
||||
...Packages installing to /opt/dev/work/BDisk/root.x86_64...Compiling kernel sources...Regular packages......Creating bdisk user...Done.
|
||||
Done.
|
||||
Installing packages for 32-bit...
|
||||
Done.
|
||||
Installing packages for 64-bit...
|
||||
Done.
|
||||
Syncing overlay...
|
||||
Done.
|
||||
Chroot setup complete.
|
||||
Checking for appropriate kernel version and mksquashfs version...
|
||||
Data is not sync'd to buildroot; syncing...
|
||||
Syncing important files to /opt/dev/work/BDisk/build64 for building the squashed filesystem (this may take some time)...
|
||||
Compressing the package DB...
|
||||
cp: ‘/opt/dev/work/BDisk/build64/usr/share/zoneinfo/EST5EDT’ and ‘/opt/dev/work/BDisk/build64/etc/localtime’ are the same file
|
||||
cp: ‘/opt/dev/work/BDisk/root.x86_64/usr/share/zoneinfo/EST5EDT’ and ‘/opt/dev/work/BDisk/root.x86_64/etc/localtime’ are the same file
|
||||
Cleaning up unnecessary cruft in /opt/dev/work/BDisk/build64...
|
||||
[64-bit] Now generating the squashed image (if we need to) and hashes. This may take some time.
|
||||
[64-bit] Squashing filesystem. This can take a while depending on the size of your chroot(s).
|
||||
[64-bit] Copying files for PXE, and ISO building, please be patient.
|
||||
Data is not sync'd to buildroot; syncing...
|
||||
Syncing important files to /opt/dev/work/BDisk/build32 for building the squashed filesystem (this may take some time)...
|
||||
Compressing the package DB...
|
||||
cp: ‘/opt/dev/work/BDisk/build32/usr/share/zoneinfo/EST5EDT’ and ‘/opt/dev/work/BDisk/build32/etc/localtime’ are the same file
|
||||
cp: ‘/opt/dev/work/BDisk/root.i686/usr/share/zoneinfo/EST5EDT’ and ‘/opt/dev/work/BDisk/root.i686/etc/localtime’ are the same file
|
||||
Cleaning up unnecessary cruft in /opt/dev/work/BDisk/build32...
|
||||
[32-bit] Now generating the squashed image (if we need to) and hashes. This may take some time.
|
||||
[32-bit] Squashing filesystem. This can take a while depending on the size of your chroot(s).
|
||||
[32-bit] Copying files for PXE, and ISO building, please be patient.
|
||||
Building the actual .iso image. This may take a while.
|
||||
Setting up EFI stuff...
|
||||
Checking/fetching UEFI shells...
|
||||
Generating the EFI embedded FAT filesystem...
|
||||
EFI configuration complete...
|
||||
ISO generated; size is 1.3G.
|
||||
You can find it at /opt/dev/work/BDisk/iso/bdisk-v1.04-a8666bd-any.iso
|
||||
Cleaning up some stuff leftover from the build...
|
||||
Finished successfully!
|
||||
|
||||
real 250m48.104s
|
||||
user 163m6.046s
|
||||
sys 8m26.573s
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
If you want more verbosity, check out the logs/ directory.
|
||||
|
||||
8
TODO
8
TODO
@@ -2,6 +2,12 @@
|
||||
|
||||
-include WinMTR, build Mac OS X MTR for dist/tools on CD
|
||||
-include pre-compiled DoxBox for opening LUKS parts on Windows (https://github.com/t-d-k/doxbox)
|
||||
-include benchmarking
|
||||
-- http://sourceforge.net/projects/unixbench/
|
||||
-- https://code.google.com/p/byte-unixbench/
|
||||
-- https://github.com/akopytov/sysbench
|
||||
-- (http://blog.due.io/2014/linode-digitalocean-and-vultr-comparison/ etc.)
|
||||
-write doc on required chroot packages (e.g. pv, archiso*, etc.) so those wanting to remaster know which packages to leave in
|
||||
|
||||
|
||||
## NETWORKING ##
|
||||
@@ -11,6 +17,7 @@
|
||||
-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?
|
||||
-WISH: support iPXE? would save on ISO file size (letting us create MUCH bigger squash systems), but the downside is we lose EFI support and it requires a working network configuration- which defeats the purpose of a diagnostic disc.
|
||||
-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)
|
||||
|
||||
|
||||
## Building ##
|
||||
@@ -24,6 +31,7 @@
|
||||
-does gummiboot? loader? wtfever it's called support splash backgrounds? can i implement that differently somehow?
|
||||
-Host-specific chroot customizations (i.e. -J in <chroot>/etc/makepkg.conf
|
||||
-strip out/remove unnecessary and orphan packages (e.g. gcc, make, automake, etc.)
|
||||
-incorporate iPXE image building for "mini-iso's/mini-img's"
|
||||
|
||||
__________________________________________________________
|
||||
FOOTNOTES:
|
||||
|
||||
Binary file not shown.
BIN
extra/bootstrap/apacman-1.5-1-any.pkg.tar.xz
Normal file
BIN
extra/bootstrap/apacman-1.5-1-any.pkg.tar.xz
Normal file
Binary file not shown.
@@ -30,7 +30,7 @@ BASEDIR="$(pwd)"
|
||||
ISODIR="${BASEDIR}/iso"
|
||||
|
||||
# Where source code is kept.
|
||||
SRCDIR="${BASEDIR}/src"
|
||||
SRCDIR="${BASEDIR}/extrasrc"
|
||||
|
||||
# Where we mount for chroots etc.
|
||||
MOUNTPT="/mnt/${UXNAME}"
|
||||
|
||||
3
extra/external/SMC_DumpKey/README
vendored
Normal file
3
extra/external/SMC_DumpKey/README
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
taken with graces to http://www.contrib.andrew.cmu.edu/~somlo/OSXKVM/
|
||||
|
||||
Needs to be compiled on linux with gcc, and only runs on genuine Apple hardware (as it polls the SMC chip for the given value)
|
||||
193
extra/external/SMC_DumpKey/SmcDumpKey.c
vendored
Normal file
193
extra/external/SMC_DumpKey/SmcDumpKey.c
vendored
Normal file
@@ -0,0 +1,193 @@
|
||||
/*
|
||||
* prints out 4-character name of the SMC key at given index position;
|
||||
*
|
||||
* by Gabriel L. Somlo <somlo@cmu.edu>, Summer 2014
|
||||
*
|
||||
* Compile with: gcc -O2 -o SmcDumpKey SmcDumpKey.c -Wall
|
||||
*
|
||||
* You probably want to "modprobe -r applesmc" before running this...
|
||||
*
|
||||
* Code bits and pieces shamelessly ripped from the linux kernel driver
|
||||
* (drivers/hwmon/applesmc.c by N. Boichat and H. Rydberg)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License v2 as published by the
|
||||
* Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <limits.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <sys/io.h>
|
||||
#include <linux/byteorder/little_endian.h>
|
||||
|
||||
|
||||
#define APPLESMC_START 0x300
|
||||
#define APPLESMC_RANGE 0x20
|
||||
|
||||
#define APPLESMC_DATA_PORT (APPLESMC_START + 0x00)
|
||||
#define APPLESMC_CMD_PORT (APPLESMC_START + 0x04)
|
||||
|
||||
#define APPLESMC_READ_CMD 0x10
|
||||
#define APPLESMC_GET_KEY_BY_INDEX_CMD 0x12
|
||||
#define APPLESMC_GET_KEY_TYPE_CMD 0x13
|
||||
|
||||
|
||||
/* wait up to 128 ms for a status change. */
|
||||
#define APPLESMC_MIN_WAIT 0x0010
|
||||
#define APPLESMC_RETRY_WAIT 0x0100
|
||||
#define APPLESMC_MAX_WAIT 0x20000
|
||||
|
||||
|
||||
#define APPLESMC_KEY_NAME_LEN 4
|
||||
#define APPLESMC_KEY_TYPE_LEN 4
|
||||
|
||||
typedef struct key_type {
|
||||
uint8_t data_len;
|
||||
uint8_t data_type[APPLESMC_KEY_TYPE_LEN];
|
||||
uint8_t flags;
|
||||
} __attribute__((packed)) key_type;
|
||||
|
||||
|
||||
/* wait_read - Wait for a byte to appear on SMC port. */
|
||||
static int
|
||||
wait_read(void)
|
||||
{
|
||||
uint8_t status;
|
||||
int us;
|
||||
|
||||
for (us = APPLESMC_MIN_WAIT; us < APPLESMC_MAX_WAIT; us <<= 1) {
|
||||
usleep(us);
|
||||
status = inb(APPLESMC_CMD_PORT);
|
||||
/* read: wait for smc to settle */
|
||||
if (status & 0x01)
|
||||
return 0;
|
||||
}
|
||||
|
||||
fprintf(stderr, "wait_read() fail: 0x%02x\n", status);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*send_byte - Write to SMC port, retrying when necessary. */
|
||||
static int
|
||||
send_byte(uint8_t cmd, unsigned short port)
|
||||
{
|
||||
uint8_t status;
|
||||
int us;
|
||||
|
||||
outb(cmd, port);
|
||||
for (us = APPLESMC_MIN_WAIT; us < APPLESMC_MAX_WAIT; us <<= 1) {
|
||||
usleep(us);
|
||||
status = inb(APPLESMC_CMD_PORT);
|
||||
/* write: wait for smc to settle */
|
||||
if (status & 0x02)
|
||||
continue;
|
||||
/* ready: cmd accepted, return */
|
||||
if (status & 0x04)
|
||||
return 0;
|
||||
/* timeout: give up */
|
||||
if (us << 1 == APPLESMC_MAX_WAIT)
|
||||
break;
|
||||
/* busy: long wait and resend */
|
||||
usleep(APPLESMC_RETRY_WAIT);
|
||||
outb(cmd, port);
|
||||
}
|
||||
|
||||
fprintf(stderr,
|
||||
"send_byte(0x%02x, 0x%04x) fail: 0x%02x\n", cmd, port, status);
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int
|
||||
send_argument(const uint8_t *key)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < APPLESMC_KEY_NAME_LEN; i++)
|
||||
if (send_byte(key[i], APPLESMC_DATA_PORT))
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
read_smc(uint8_t cmd, const uint8_t *key, uint8_t *buf, uint8_t len)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (send_byte(cmd, APPLESMC_CMD_PORT) || send_argument(key)) {
|
||||
fprintf(stderr, "%.4s: read arg fail\n", key);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (send_byte(len, APPLESMC_DATA_PORT)) {
|
||||
fprintf(stderr, "%.4s: read len fail\n", key);
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
if (wait_read()) {
|
||||
fprintf(stderr, "%.4s: read data[%d] fail\n", key, i);
|
||||
return -1;
|
||||
}
|
||||
buf[i] = inb(APPLESMC_DATA_PORT);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
key_type kt;
|
||||
uint8_t data_buf[UCHAR_MAX];
|
||||
uint8_t i;
|
||||
|
||||
if (argc != 2 || strlen(argv[1]) != APPLESMC_KEY_NAME_LEN) {
|
||||
fprintf(stderr, "\nUsage: %s <4-char-key-name>\n\n", argv[0]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (ioperm(APPLESMC_START, APPLESMC_RANGE, 1) != 0) {
|
||||
perror("ioperm failed");
|
||||
return -2;
|
||||
}
|
||||
|
||||
if (read_smc(APPLESMC_GET_KEY_TYPE_CMD,
|
||||
(uint8_t *)argv[1], (uint8_t *)&kt, sizeof(kt)) != 0) {
|
||||
fprintf(stderr, "\nread_smc get_key_type error\n\n");
|
||||
return -3;
|
||||
}
|
||||
printf(" type=\"");
|
||||
for (i = 0; i < APPLESMC_KEY_TYPE_LEN; i++)
|
||||
printf(isprint(kt.data_type[i]) ? "%c" : "\\x%02x",
|
||||
(uint8_t)kt.data_type[i]);
|
||||
printf("\" length=%d flags=%x\n", kt.data_len, kt.flags);
|
||||
|
||||
if (read_smc(APPLESMC_READ_CMD,
|
||||
(uint8_t *)argv[1], data_buf, kt.data_len) != 0) {
|
||||
fprintf(stderr, "\nread_smc get_key_data error\n\n");
|
||||
return -4;
|
||||
}
|
||||
printf(" data=\"");
|
||||
for (i = 0; i < kt.data_len; i++)
|
||||
printf(isprint(data_buf[i]) ? "%c" : "\\x%02x",
|
||||
(uint8_t)data_buf[i]);
|
||||
printf("\"\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
# Server list generated by rankmirrors on 2015-01-10
|
||||
# Server list generated by rankmirrors on 2015-02-26
|
||||
Server = http://mirrors.advancedhosters.com/archlinux/$repo/os/$arch
|
||||
Server = http://mirror.yellowfiber.net/archlinux/$repo/os/$arch
|
||||
Server = http://mirror.es.its.nyu.edu/archlinux/$repo/os/$arch
|
||||
Server = http://mirror.us.leaseweb.net/archlinux/$repo/os/$arch
|
||||
Server = http://mirrors.rutgers.edu/archlinux/$repo/os/$arch
|
||||
Server = http://mirror.umd.edu/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
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# We need to install all X drivers.
|
||||
abs
|
||||
acpi
|
||||
acpidump
|
||||
#acpidump
|
||||
afflib
|
||||
aircrack-ng
|
||||
apr
|
||||
@@ -16,6 +16,7 @@ autopsy
|
||||
autossh
|
||||
beep
|
||||
bin86
|
||||
bind-tools
|
||||
binutils
|
||||
bluez-utils
|
||||
bonnie++
|
||||
@@ -60,7 +61,7 @@ djohn
|
||||
dmidecode
|
||||
dnssec-anchors
|
||||
dnstracer
|
||||
dnsutils
|
||||
#dnsutils #replaced by bind-tools, https://www.archlinux.org/packages/extra/x86_64/bind-tools/
|
||||
dos2unix
|
||||
dosfstools
|
||||
dropbear
|
||||
@@ -115,6 +116,7 @@ hddtemp
|
||||
hdparm
|
||||
hexcurse
|
||||
hexedit
|
||||
hfsprogs
|
||||
hfsutils
|
||||
htop
|
||||
httping
|
||||
@@ -129,6 +131,7 @@ iotop
|
||||
iozone
|
||||
ipcalc
|
||||
iperf
|
||||
iperf3
|
||||
iproute2
|
||||
ipsec-tools
|
||||
iptraf-ng
|
||||
@@ -191,6 +194,7 @@ netctl
|
||||
netselect
|
||||
nettle
|
||||
networkmanager
|
||||
networkmanager-pptp
|
||||
nginx-devel
|
||||
ngrep
|
||||
nmap
|
||||
@@ -232,14 +236,14 @@ psmisc
|
||||
pv
|
||||
pwgen
|
||||
pxz
|
||||
pyrit
|
||||
pyrit-svn
|
||||
python2-gnuplot
|
||||
python2-pyx
|
||||
rarcrack
|
||||
rcracki_mt
|
||||
rdiff-backup
|
||||
read-edid
|
||||
reaver
|
||||
reaver-wps-fork-t6x-git
|
||||
rename
|
||||
rfkill
|
||||
rp-pppoe
|
||||
@@ -316,7 +320,7 @@ vpnc
|
||||
weplab
|
||||
whdd
|
||||
whois
|
||||
wifite
|
||||
wifite-mod-pixiewps-git
|
||||
wipe
|
||||
wireshark-cli
|
||||
wpscrack
|
||||
|
||||
57
extra/pre-build.d/etc/apacman.conf
Normal file
57
extra/pre-build.d/etc/apacman.conf
Normal file
@@ -0,0 +1,57 @@
|
||||
#
|
||||
# /etc/apacman.conf
|
||||
#
|
||||
# See the apacman.conf(5) manpage for options
|
||||
|
||||
#
|
||||
# GENERAL OPTIONS
|
||||
#
|
||||
|
||||
#auronly=1
|
||||
#buildonly=1
|
||||
#cachevcs=1
|
||||
#ignorearch=1
|
||||
#needed=1
|
||||
noconfirm=1
|
||||
noedit=1
|
||||
#noaur=1
|
||||
#noconfirm=1
|
||||
#noedit=1
|
||||
#nofail=1
|
||||
#preview=1
|
||||
#purgebuild=1
|
||||
#quiet=1
|
||||
#skipcache=1
|
||||
skipinteg=1
|
||||
#skiptest=1
|
||||
#warn=1
|
||||
tmpdir=/var/tmp/apacman
|
||||
TMPDIR=/var/tmp/apacman
|
||||
|
||||
#
|
||||
# CONFIGURATION
|
||||
#
|
||||
|
||||
#tmpdir="/tmp/apacmantmp-$UID"
|
||||
#makepkgconf="/etc/makepkg.conf"
|
||||
#usermakepkgconf="$HOME/.makepkg.conf"
|
||||
#pacmanconf="/etc/pacman.conf"
|
||||
#downdir="/var/cache/pacman/pkg"
|
||||
#savedir="/var/cache/apacman/pkg"
|
||||
#editor="nano -w"
|
||||
editor="vim"
|
||||
#RPCURL="https://aur.archlinux.org/rpc.php?type"
|
||||
#PKGURL="https://aur.archlinux.org"
|
||||
#ABSURL="rsync.archlinux.org"
|
||||
|
||||
#
|
||||
# COLORIZATION
|
||||
#
|
||||
|
||||
COLOR1='\e[1;39m'
|
||||
COLOR2='\e[1;32m'
|
||||
COLOR3='\e[1;35m'
|
||||
COLOR4='\e[1;36m'
|
||||
COLOR5='\e[1;34m'
|
||||
COLOR6='\e[1;33m'
|
||||
COLOR7='\e[1;31m'
|
||||
@@ -1,92 +0,0 @@
|
||||
#!/bin/sh
|
||||
# change some versions around
|
||||
sed -i -e 's/^\(pkgbase=linux[[:space:]]*\)/#\1/g' ${1}
|
||||
sed -i -e 's/^#\(pkgbase=linux-\)custom.*$/\1BDisk/g' ${1}
|
||||
sed -i -e '/^_kernelname/a KERNVER=$(echo ${pkgver} | sed -e "s/\\\([0-9]\\\.[0-9]*\\\).*$/\\\1/")' ${1}
|
||||
sed -i -e '/^_kernelname/a KERNVER_MIN=$(echo ${pkgver} | sed -e "s/\\\([0-9]\\\.[0-9]*\\\)\\\.\\\(.*\\\)$/\\\2/")' ${1}
|
||||
sed -i -e "s/^\(makedepends=.*\))$/\1 'rsync' 'git')/g" ${1}
|
||||
##cp linux.preset linux-BDisk.preset
|
||||
##sed -i -e 's#^[[:space:]]*install\ -D\ -m644\ "${srcdir}/linux.preset".*$#install -D -m644 "${srcdir}/linux-BDisk.preset" "${pkgdir}/etc/mkinitcpio.d/${pkgbase}.preset"#g' ${1}
|
||||
##sed -i -e "s/\ 'fallback'//g" \
|
||||
##-e '/^fallback/d' \
|
||||
##-e '/^$/d' \
|
||||
##-e '/^[[:space:]]*$/d' \
|
||||
##-e 's#^\(default_image="/boot/initramfs-linux\).*#\1-BDisk"/g' linux-BDisk.preset
|
||||
##-e 's/^\(ALL_kver="/boot/vmlinuz-linux\)\(.*\)/\1-BDisk\2/g' linux-BDisk.preset
|
||||
|
||||
# add source for aufs3
|
||||
## 12.07.2014 - remove the "git checkout <SPECIFIC COMMIT HASH>" once a bug is fixed. currently fails with:
|
||||
##\ git checkout c75f6dddc1c58950c76cc1581e4b4c7ac8365bff > \/dev\/null 2>&1\
|
||||
## LD fs/aufs/built-in.o
|
||||
## CC [M] fs/aufs/module.o
|
||||
##In file included from fs/aufs/module.c:24:0:
|
||||
##fs/aufs/inode.h:307:12: error: function declaration isn't a prototype
|
||||
##[-Werror=strict-prototypes]
|
||||
## AuStubInt0(au_cpup_xattr, h_dst, h_src, ignore_flags)
|
||||
## ^
|
||||
##fs/aufs/aufs.h:28:21: note: in definition of macro 'AuStub'
|
||||
## static inline type name(__VA_ARGS__) { body; }
|
||||
## ^
|
||||
##fs/aufs/inode.h:307:1: note: in expansion of macro 'AuStubInt0'
|
||||
## AuStubInt0(au_cpup_xattr, h_dst, h_src, ignore_flags)
|
||||
## ^
|
||||
##cc1: some warnings being treated as errors
|
||||
##scripts/Makefile.build:257: recipe for target 'fs/aufs/module.o' failed
|
||||
##make[2]: *** [fs/aufs/module.o] Error 1
|
||||
##scripts/Makefile.build:404: recipe for target 'fs/aufs' failed
|
||||
##make[1]: *** [fs/aufs] Error 2
|
||||
##Makefile:929: recipe for target 'fs' failed
|
||||
##make: *** [fs] Error 2
|
||||
sed -i -e '/^prepare()\ {/a\
|
||||
\ git clone git:\/\/aufs.git.sourceforge.net\/gitroot\/aufs\/aufs3-standalone.git aufs3 > \/dev\/null 2>&1\
|
||||
\ cd aufs3\
|
||||
\ AUFS_MIN=$(git branch -a | grep "${KERNVER}" | tail -n1 | cut -f3 -d"/" | sed -e "s/aufs${KERNVER}//g ; s/\\\.\\\([0-9]*\\\).*$/\\\1/g")\
|
||||
\ if [ -n "${AUFS_MIN}" ] && [ -n "${KERNVER_MIN}" ] && [[ "${AUFS_MIN}" -le "${KERNVER_MIN}" ]] ; then CO="$(git branch -a | grep "${KERNVER}" | tail -n1 | cut -f3 -d"/")" ; else CO=aufs${KERNVER} ; fi \
|
||||
\ git checkout ${CO} > \/dev\/null 2>&1\
|
||||
\ cd ..\/' ${1}
|
||||
#sed -i -e 's/^\(_kernelname=\).*$/\1"-BDisk"/' ${1}
|
||||
sed -i -e '/^[[:space:]]*patch.*pkgver}"$/i rsync -a ../aufs3/Documentation/. Documentation/. ; rsync -a ../aufs3/fs/. fs/. ; cp -a ../aufs3/include/uapi/linux/aufs_type.h include/uapi/linux/. \
|
||||
\ for i in $(ls -1 ../aufs3/*.patch) ; do patch -p1 -i ../aufs3/${i} ; done' ${1}
|
||||
# and we need to be sure to build aufs3-util
|
||||
#sed -i -e '/^[[:space:]]*install\ -D\ -m644\ vmlinux.*$/a\
|
||||
#\ git clone git:\/\/git.code.sf.net\/p\/aufs\/aufs-util > \/dev\/null 2>&1\
|
||||
#\ cd aufs-util\
|
||||
#\ UTILVER=$(git branch -a | grep -v master | sort -nr | grep -v rcN | head -n1 | cut -f3 -d"\/")\
|
||||
#\ git checkout ${UTILVER} > \/dev\/null 2>&1\
|
||||
#\ make' ${1}
|
||||
|
||||
# and configure the kernel. this gets messy.
|
||||
#-e "s/^#[[:space:]]\\\(CONFIG_AUFS_FS\\\).*$/\\\1=m/g" \\\
|
||||
sed -i -e '/^[[:space:]]*make\ prepare.*$/i yes "" | make olddefconfig >/dev/null' ${1}
|
||||
sed -i -e '/^[[:space:]]*make\ prepare.*$/a sed -i \\\
|
||||
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_FS\\\).*$/\\\1=y/g" \\\
|
||||
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_BRANCH_MAX_127\\\).*$/\\\1=y/g" \\\
|
||||
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_SBILIST\\\).*$/\\\1=y/g" \\\
|
||||
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_HNOTIFY\\\).*$/\\\1=y/g" \\\
|
||||
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_HFSNOTIFY\\\).*$/\\\1=y/g" \\\
|
||||
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_EXPORT\\\).*$/\\\1=y/g" \\\
|
||||
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_INO_T_64\\\).*$/\\\1=y/g" \\\
|
||||
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_FHSM\\\).*$/\\\1=y/g" \\\
|
||||
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_RDU\\\).*$/\\\1=y/g" \\\
|
||||
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_BDEV_LOOP\\\).*$/\\\1=y/g" \\\
|
||||
-e "s/^#[[:space:]]\\\(AUFS_BRANCH_MAX_511\\\).*$/\\\1=n/g" \\\
|
||||
-e "s/^#[[:space:]]\\\(AUFS_BRANCH_MAX_1023\\\).*$/\\\1=n/g" \\\
|
||||
-e "s/^#[[:space:]]\\\(AUFS_BRANCH_MAX_32767\\\).*$/\\\1=n/g" ${srcdir}/../config{,.x86_64}' ${1}
|
||||
# yes, we have to do this twice. with a hammer.
|
||||
sed -i -e '/^[[:space:]]*make\ prepare.*$/a sed -i \\\
|
||||
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_FS\\\).*$/\\\1=m/g" \\\
|
||||
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_BRANCH_MAX_127\\\).*$/\\\1=y/g" \\\
|
||||
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_SBILIST\\\).*$/\\\1=y/g" \\\
|
||||
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_HNOTIFY\\\).*$/\\\1=y/g" \\\
|
||||
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_HFSNOTIFY\\\).*$/\\\1=y/g" \\\
|
||||
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_EXPORT\\\).*$/\\\1=y/g" \\\
|
||||
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_INO_T_64\\\).*$/\\\1=y/g" \\\
|
||||
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_FHSM\\\).*$/\\\1=y/g" \\\
|
||||
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_RDU\\\).*$/\\\1=y/g" \\\
|
||||
-e "s/^#[[:space:]]\\\(CONFIG_AUFS_BDEV_LOOP\\\).*$/\\\1=y/g" \\\
|
||||
-e "s/^#[[:space:]]\\\(AUFS_BRANCH_MAX_511\\\).*$/\\\1=n/g" \\\
|
||||
-e "s/^#[[:space:]]\\\(AUFS_BRANCH_MAX_1023\\\).*$/\\\1=n/g" \\\
|
||||
-e "s/^#[[:space:]]\\\(AUFS_BRANCH_MAX_32767\\\).*$/\\\1=n/g" .config' ${1}
|
||||
sed -i -e 's/^\([[:space:]]*yes\ ""\ |\ \)make\ config/\1make olddefconfig/' ${1}
|
||||
# and we have to edit the linux.install as well.
|
||||
sed -i -e 's/^\(KERNEL_NAME=\).*$/\1-BDisk/g' linux.install*
|
||||
3
extra/pre-build.d/etc/customizepkg.d/wifite-mod-pixiewps-git
Executable file
3
extra/pre-build.d/etc/customizepkg.d/wifite-mod-pixiewps-git
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
sed -i -e 's/any/x86_64/g' ${1}
|
||||
@@ -3,7 +3,7 @@
|
||||
# run. Advanced users may wish to specify all system modules
|
||||
# in this array. For instance:
|
||||
# MODULES="piix ide_disk reiserfs"
|
||||
MODULES="aufs ata_generic ata_piix loop nls_cp437 ext4 raid456 vfat netconsole"
|
||||
MODULES="overlay ata_generic ata_piix loop nls_cp437 ext4 raid456 vfat netconsole"
|
||||
|
||||
# BINARIES
|
||||
# This setting includes any additional binaries a given user may
|
||||
|
||||
15
extra/pre-build.d/etc/mkinitcpio.d/linux.preset
Normal file
15
extra/pre-build.d/etc/mkinitcpio.d/linux.preset
Normal file
@@ -0,0 +1,15 @@
|
||||
# mkinitcpio preset file for the 'linux' package
|
||||
|
||||
ALL_config="/etc/mkinitcpio.conf"
|
||||
ALL_kver="/boot/vmlinuz-linux"
|
||||
|
||||
#PRESETS=('default' 'fallback')
|
||||
PRESETS=('default')
|
||||
|
||||
#default_config="/etc/mkinitcpio.conf"
|
||||
default_image="/boot/initramfs-linux.img"
|
||||
#default_options=""
|
||||
|
||||
#fallback_config="/etc/mkinitcpio.conf"
|
||||
#fallback_image="/boot/initramfs-linux-fallback.img"
|
||||
#fallback_options="-S autodetect"
|
||||
@@ -4,26 +4,5 @@ set -e
|
||||
|
||||
apacman --noconfirm --noedit -S --needed customizepkg-scripting
|
||||
|
||||
echo -n "Compiling kernel sources..."
|
||||
set +e
|
||||
## Uncomment below and remove manual ABS/makepkg when https://github.com/oshazard/apacman/issues/2 is fulfulled
|
||||
#apacman --noconfirm --noedit -S --needed linux
|
||||
|
||||
export ABSROOT=/tmp
|
||||
abs core/linux
|
||||
|
||||
cd /tmp/core/linux
|
||||
customizepkg --modify
|
||||
|
||||
chown -R nobody:nobody /tmp/core/linux
|
||||
sudo -u nobody makepkg --skipinteg
|
||||
set -e
|
||||
|
||||
yes '' | apacman --skipinteg --noconfirm --noedit -U /tmp/core/linux/linux-*.pkg.tar.xz
|
||||
|
||||
#for i in $(ls -1 linux-*.pkg.tar.xz | sort);
|
||||
#do
|
||||
#apacman --skipinteg --noconfirm --noedit --noconfirm -U ${i}
|
||||
#done
|
||||
|
||||
echo "Done."
|
||||
|
||||
@@ -11,19 +11,13 @@ _mnt_fs() {
|
||||
ro_dev=$(losetup --find --show --read-only "${img}")
|
||||
echo ${ro_dev} >> /run/archiso/used_block_devices
|
||||
ro_dev_size=$(blockdev --getsz ${ro_dev})
|
||||
if [[ "${cowfile_size}" == "100" ]]; then
|
||||
rw_dev_size=${ro_dev_size}
|
||||
else
|
||||
# size calculation done in this way to avoid integer overflow when ro_dev_size is > 10.2G
|
||||
rw_dev_size=$((ro_dev_size/100*cowfile_size))
|
||||
fi
|
||||
|
||||
if [[ "${cow_persistent}" == "P" ]]; then
|
||||
if [[ -f "/run/archiso/cowspace/${cow_directory}/${img_name}.cow" ]]; then
|
||||
msg ":: Found '/run/archiso/cowspace/${cow_directory}/${img_name}.cow', using as persistent."
|
||||
else
|
||||
msg ":: Creating '/run/archiso/cowspace/${cow_directory}/${img_name}.cow' as persistent."
|
||||
dd of="/run/archiso/cowspace/${cow_directory}/${img_name}.cow" count=0 seek=${rw_dev_size} &> /dev/null
|
||||
truncate -s "${cowfile_size}" "/run/archiso/cowspace/${cow_directory}/${img_name}.cow"
|
||||
fi
|
||||
else
|
||||
if [[ -f "/run/archiso/cowspace/${cow_directory}/${img_name}.cow" ]]; then
|
||||
@@ -31,13 +25,13 @@ _mnt_fs() {
|
||||
rm -f "/run/archiso/cowspace/${cow_directory}/${img_name}.cow"
|
||||
fi
|
||||
msg ":: Creating '/run/archiso/cowspace/${cow_directory}/${img_name}.cow' as non-persistent."
|
||||
dd of="/run/archiso/cowspace/${cow_directory}/${img_name}.cow" count=0 seek=${rw_dev_size} &> /dev/null
|
||||
truncate -s "${cowfile_size}" "/run/archiso/cowspace/${cow_directory}/${img_name}.cow"
|
||||
fi
|
||||
|
||||
rw_dev=$(losetup --find --show "/run/archiso/cowspace/${cow_directory}/${img_name}.cow")
|
||||
echo ${rw_dev} >> /run/archiso/used_block_devices
|
||||
|
||||
echo "0 ${ro_dev_size} snapshot ${ro_dev} ${rw_dev} ${cow_persistent} 8" | dmsetup create ${dm_snap_name}
|
||||
dmsetup create ${dm_snap_name} --table "0 ${ro_dev_size} snapshot ${ro_dev} ${rw_dev} ${cow_persistent} 8"
|
||||
|
||||
_mnt_dev "/dev/mapper/${dm_snap_name}" "${newroot}${mnt}" "-w"
|
||||
echo $(readlink -f /dev/mapper/${dm_snap_name}) >> /run/archiso/used_block_devices
|
||||
@@ -52,7 +46,8 @@ _mnt_sfs() {
|
||||
|
||||
if [[ "${copytoram}" == "y" ]]; then
|
||||
msg -n ":: Copying squashfs image to RAM..."
|
||||
if ! cp "${img}" "/run/archiso/copytoram/${img_fullname}" ; then
|
||||
#if ! cp "${img}" "/run/archiso/copytoram/${img_fullname}" ; then
|
||||
if ! pv -pterabT "${img}" > "/run/archiso/copytoram/${img_fullname}" ; then
|
||||
echo "ERROR: while copy '${img}' to '/run/archiso/copytoram/${img_fullname}'"
|
||||
launch_interactive_shell
|
||||
fi
|
||||
@@ -108,9 +103,7 @@ run_hook() {
|
||||
[[ -z "${dm_snap_prefix}" ]] && dm_snap_prefix="arch"
|
||||
[[ -z "${archisodevice}" ]] && archisodevice="/dev/disk/by-label/${archisolabel}"
|
||||
if [[ -z "${cowfile_size}" ]]; then
|
||||
cowfile_size="100"
|
||||
else
|
||||
cowfile_size=${cowfile_size/%}
|
||||
cowfile_size="256M"
|
||||
fi
|
||||
|
||||
if [[ -n "${cow_label}" ]]; then
|
||||
@@ -175,8 +168,8 @@ archiso_mount_handler() {
|
||||
mkdir -p "/run/archiso/cowspace/${cow_directory}"
|
||||
|
||||
_mnt_sfs "/run/archiso/bootmnt/${archisobasedir}/${arch}/airootfs.sfs" "/run/archiso/sfs/airootfs"
|
||||
# _mnt_fs "/run/archiso/sfs/airootfs/airootfs.img" "${newroot}" "/"
|
||||
mount --bind "run/archiso/sfs/airootfs" "/new_root"
|
||||
#_mnt_fs "/run/archiso/sfs/airootfs/airootfs.img" "${newroot}" "/"
|
||||
mount --bind "/run/archiso/sfs/airootfs" "/new_root"
|
||||
|
||||
if [[ "${copytoram}" == "y" ]]; then
|
||||
umount /run/archiso/bootmnt
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
# vim: set ft=sh:
|
||||
|
||||
run_cleanuphook () {
|
||||
msg ":: Mounting aufs on / with tmpfs=rw, ${root}=ro ..."
|
||||
modprobe aufs
|
||||
msg ":: Mounting OverlayFS on / with tmpfs=rw, ${root}=ro ..."
|
||||
modprobe overlay
|
||||
|
||||
echo "Now attempting aufs mount..."
|
||||
echo "Now attempting overlay mount..."
|
||||
|
||||
mkdir /new_root.hw
|
||||
mount --move /new_root /new_root.hw
|
||||
mkdir /dev/shm
|
||||
mount -t tmpfs none /dev/shm
|
||||
mount -t aufs none /new_root -o dirs=/dev/shm=rw:/new_root.hw=ro -o noatime
|
||||
#mkdir /new_root.hw
|
||||
mkdir -p /run/archiso/cowspace/upperdir /run/archiso/cowspace/workdir
|
||||
#mount --move /new_root /new_root.hw
|
||||
#mkdir /dev/shm
|
||||
#mount -t tmpfs none /dev/shm
|
||||
#mount -t overlay overlay -olowerdir=/new_root.hw,upperdir=/new_root,workdir=/dev/shm -o noatime
|
||||
umount -l /new_root > /dev/null 2>&1
|
||||
mount -t overlay -o lowerdir=/run/archiso/sfs/airootfs,upperdir=/run/archiso/cowspace/upperdir,workdir=/run/archiso/cowspace/workdir airootfs /new_root
|
||||
pkill -9 dropbear #kill SSH (in preparation for the live system starting ssh on port 22
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ build() {
|
||||
add_binary losetup
|
||||
add_binary mountpoint
|
||||
add_binary truncate
|
||||
add_binary pv
|
||||
|
||||
add_file /usr/lib/udev/rules.d/60-cdrom_id.rules
|
||||
add_file /usr/lib/udev/rules.d/10-dm.rules
|
||||
|
||||
@@ -4,7 +4,7 @@ build()
|
||||
{
|
||||
add_module 'squashfs'
|
||||
add_module 'loop'
|
||||
add_module 'aufs'
|
||||
add_module 'overlay'
|
||||
|
||||
add_binary "sed"
|
||||
add_binary "pkill"
|
||||
@@ -16,6 +16,6 @@ build()
|
||||
help()
|
||||
{
|
||||
cat <<HELPEOF
|
||||
Mount a squashed flat-file directory with AUFS3 on /
|
||||
Mount a squashed flat-file directory with OverlayFS on /
|
||||
HELPEOF
|
||||
}
|
||||
|
||||
@@ -38,7 +38,8 @@ function jenny_craig () {
|
||||
#rm -f ${BUILDDIR}/etc/localtime
|
||||
rm -f ${BUILDDIR}/root/.bashrc
|
||||
# DISABLE when no longer building custom kernel
|
||||
find ${BUILDDIR}/usr/lib/modules/ -maxdepth 1 -iname "*-ARCH" -exec rm -rf '{}' \;
|
||||
#find ${BUILDDIR}/usr/lib/modules/ -maxdepth 1 -iname "*-ARCH" -exec rm -rf '{}' \;
|
||||
for i in $(ls -1t ${BUILDDIR}/usr/lib/modules | tail -n "+2") ; do rm -rf ${BUILDDIR}/usr/lib/modules/${i} ; done
|
||||
find ${BUILDDIR}/ -type f -name "*.pacnew" -exec rm -rf '{}' \;
|
||||
sed -i -e '/^MAKEFLAGS=.*$/d' ${BUILDDIR}/etc/makepkg.conf
|
||||
rm -rf ${BUILDDIR}/usr/share/locale/*
|
||||
|
||||
@@ -43,6 +43,11 @@ function will_it_blend () {
|
||||
local BUILDDIR="${BUILDDIR}${ARCHSUFFIX}"
|
||||
|
||||
# now let's build the squashed image... and generate some checksums as well to verify download integrity.
|
||||
# are we building split-arch ISOs?
|
||||
if [[ "${MULTIARCH}" == "n" ]];
|
||||
then
|
||||
rm -rf ${ARCHBOOT}
|
||||
fi
|
||||
mkdir -p ${ARCHBOOT}/${AIROOT}
|
||||
|
||||
if [ ! -f "${ARCHBOOT}/${AIROOT}/airootfs.sfs" ] || [ "${CHROOTDIR}/root/.bash_history" -nt "${ARCHBOOT}/${AIROOT}/airootfs.sfs" ];
|
||||
|
||||
@@ -32,16 +32,16 @@ function stuffy {
|
||||
# now for setting up loader config/entries. maybe add memtest or something in the future? i dunno.
|
||||
cat > ${TEMPDIR}/loader/loader.conf << EOF
|
||||
timeout 3
|
||||
default ${UXNAME}_ram
|
||||
default ${UXNAME}
|
||||
EOF
|
||||
cat > ${TEMPDIR}/loader/entries/${UXNAME}_ram.conf << EOF
|
||||
title ${PNAME}
|
||||
title ${PNAME} (RAM)
|
||||
linux /boot/${UXNAME}.kern
|
||||
initrd /boot/${UXNAME}.img
|
||||
options copytoram archisobasedir=${DISTNAME} archisolabel=${DISTNAME}
|
||||
EOF
|
||||
cat > ${TEMPDIR}/loader/entries/${UXNAME}.conf << EOF
|
||||
title ${PNAME} (Run from media)
|
||||
title ${PNAME} (Media)
|
||||
linux /boot/${UXNAME}.kern
|
||||
initrd /boot/${UXNAME}.img
|
||||
options archisobasedir=${DISTNAME} archisolabel=${DISTNAME}
|
||||
@@ -59,30 +59,42 @@ EOF
|
||||
# create the embedded efiboot FAT stuff
|
||||
# how big should we make the disk?
|
||||
echo "Generating the EFI embedded FAT filesystem..."
|
||||
FTSIZE=$(du -sc ${TEMPDIR}/{boot,EFI,loader} | tail -n1 | awk '{print $1}')
|
||||
FATSIZE=$((${FTSIZE} + 64)) # let's give a little wiggle room
|
||||
${RACECAR_CHK}truncate -s "${FATSIZE}"K ${TEMPDIR}/EFI/${DISTNAME}/efiboot.img
|
||||
# are we building split-arch ISOs?
|
||||
if [[ "${MULTIARCH}" == "n" ]];
|
||||
then
|
||||
rm -f ${TEMPDIR}/EFI/${DISTNAME}/efiboot.img
|
||||
fi
|
||||
# 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=$((${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/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" ${TEMPDIR}/EFI/shellx64_v1.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} + 786432)) # let's give a little wiggle room; 768k should do it. -_-
|
||||
${RACECAR_CHK}truncate -s "${FATSIZE}" ${TEMPDIR}/EFI/${DISTNAME}/efiboot.img
|
||||
${RACECAR_CHK}mkfs.vfat -F 32 -n ${DISTNAME}_EFI ${TEMPDIR}/EFI/${DISTNAME}/efiboot.img >> "${LOGFILE}.${FUNCNAME}" 2>&1
|
||||
#${RACECAR_CHK}mkfs.vfat -F32 -s2 -n ${DISTNAME}_EFI ${TEMPDIR}/EFI/${DISTNAME}/efiboot.img >> "${LOGFILE}.${FUNCNAME}" 2>&1
|
||||
mkdir -p ${SRCDIR}/efiboot
|
||||
mount ${TEMPDIR}/EFI/${DISTNAME}/efiboot.img ${SRCDIR}/efiboot
|
||||
mkdir -p ${SRCDIR}/efiboot/EFI/${DISTNAME}
|
||||
cp ${TEMPDIR}/boot/${UXNAME}.64.kern ${SRCDIR}/efiboot/EFI/${DISTNAME}/${UXNAME}.efi
|
||||
cp ${TEMPDIR}/boot/${UXNAME}.64.img ${SRCDIR}/efiboot/EFI/${DISTNAME}/${UXNAME}.img
|
||||
mkdir -p ${SRCDIR}/efiboot/{EFI/boot,loader/entries}
|
||||
# GETTING DEJA VU HERE.
|
||||
# GETTING DEJA VU HERE.
|
||||
cat > ${SRCDIR}/efiboot/loader/loader.conf << EOF
|
||||
timeout 3
|
||||
default ${UXNAME}_ram
|
||||
default ${UXNAME}
|
||||
EOF
|
||||
cat > ${SRCDIR}/efiboot/loader/entries/${UXNAME}_ram.conf << EOF
|
||||
title ${PNAME}
|
||||
title ${PNAME} (RAM)
|
||||
linux /EFI/${DISTNAME}/${UXNAME}.efi
|
||||
initrd /EFI/${DISTNAME}/${UXNAME}.img
|
||||
options copytoram archisobasedir=${DISTNAME} archisolabel=${DISTNAME}
|
||||
EOF
|
||||
cat > ${SRCDIR}/efiboot/loader/entries/${UXNAME}.conf << EOF
|
||||
title ${PNAME} (Run from media)
|
||||
title ${PNAME} (Media)
|
||||
linux /EFI/${DISTNAME}/${UXNAME}.efi
|
||||
initrd /EFI/${DISTNAME}/${UXNAME}.img
|
||||
options archisobasedir=${DISTNAME} archisolabel=${DISTNAME}
|
||||
@@ -99,7 +111,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/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 ${TEMPDIR}/EFI/shellx64_v* ${SRCDIR}/efiboot/EFI/.
|
||||
cp ${TEMPDIR}/EFI/shellx64_v{1,2}.efi ${SRCDIR}/efiboot/EFI/.
|
||||
umount ${SRCDIR}/efiboot
|
||||
echo "EFI configuration complete..."
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ MENU BACKGROUND /${UXNAME}.png
|
||||
LABEL check
|
||||
MENU LABEL Your best supported kernel should be detected automatically.
|
||||
COM32 ifcpu64.c32
|
||||
APPEND ${UXNAME}_ram_64 -- ${UXNAME}_ram_32
|
||||
APPEND ${UXNAME}_64 -- ${UXNAME}_32
|
||||
MENU DEFAULT
|
||||
|
||||
|
||||
@@ -84,10 +84,10 @@ MENU SEPARATOR
|
||||
## 64 BIT
|
||||
MENU BEGIN 64BIT
|
||||
MENU LABEL ^1) 64-Bit ...
|
||||
ONTIMEOUT ${UXNAME}_ram_64
|
||||
ONTIMEOUT ${UXNAME}_64
|
||||
|
||||
LABEL ${UXNAME}_ram_64
|
||||
MENU LABEL ^1) ${PNAME} (run from RAM) (Default)
|
||||
MENU LABEL ^1) ${PNAME} (run from RAM)
|
||||
LINUX /boot/${UXNAME}.64.kern
|
||||
INITRD /boot/${UXNAME}.64.img
|
||||
APPEND copytoram archisobasedir=${DISTNAME} archisolabel=${DISTNAME}
|
||||
@@ -97,7 +97,7 @@ LABEL ${UXNAME}_ram_64
|
||||
MENU DEFAULT
|
||||
|
||||
LABEL ${UXNAME}_64
|
||||
MENU LABEL ^1) ${PNAME}
|
||||
MENU LABEL ^1) ${PNAME} (Default)
|
||||
LINUX /boot/${UXNAME}.64.kern
|
||||
INITRD /boot/${UXNAME}.64.img
|
||||
APPEND archisobasedir=${DISTNAME} archisolabel=${DISTNAME}
|
||||
@@ -110,11 +110,11 @@ MENU END
|
||||
|
||||
MENU BEGIN 32BIT
|
||||
MENU LABEL ^2) 32-Bit ...
|
||||
ONTIMEOUT ${UXNAME}_ram_32
|
||||
ONTIMEOUT ${UXNAME}_32
|
||||
|
||||
## 32 BIT
|
||||
LABEL ${UXNAME}_ram_32
|
||||
MENU LABEL ^1) ${PNAME} (run from RAM) (Default)
|
||||
MENU LABEL ^1) ${PNAME} (run from RAM)
|
||||
LINUX /boot/${UXNAME}.32.kern
|
||||
INITRD /boot/${UXNAME}.32.img
|
||||
APPEND copytoram archisobasedir=${DISTNAME} archisolabel=${DISTNAME}
|
||||
@@ -124,7 +124,7 @@ LABEL ${UXNAME}_ram_32
|
||||
MENU DEFAULT
|
||||
|
||||
LABEL ${UXNAME}_32
|
||||
MENU LABEL ^2) ${PNAME}
|
||||
MENU LABEL ^2) ${PNAME} (Default)
|
||||
LINUX /boot/${UXNAME}.32.kern
|
||||
INITRD /boot/${UXNAME}.32.img
|
||||
APPEND archisobasedir=${DISTNAME} archisolabel=${DISTNAME}
|
||||
@@ -188,10 +188,10 @@ MENU SEPARATOR
|
||||
|
||||
MENU BEGIN ${ARCH}BIT
|
||||
MENU LABEL ^1) ${ARCH}-Bit ...
|
||||
ONTIMEOUT ${UXNAME}_ram_${ARCH}
|
||||
ONTIMEOUT ${UXNAME}_${ARCH}
|
||||
|
||||
LABEL ${UXNAME}_ram_${ARCH}
|
||||
MENU LABEL ^1) ${PNAME} (run from RAM) (Default)
|
||||
MENU LABEL ^1) ${PNAME} (run from RAM)
|
||||
LINUX /boot/${UXNAME}.${ARCH}.kern
|
||||
INITRD /boot/${UXNAME}.${ARCH}.img
|
||||
APPEND copytoram archisobasedir=${DISTNAME} archisolabel=${DISTNAME}
|
||||
@@ -201,7 +201,7 @@ LABEL ${UXNAME}_ram_${ARCH}
|
||||
MENU DEFAULT
|
||||
|
||||
LABEL ${UXNAME}_${ARCH}
|
||||
MENU LABEL ^1) ${PNAME}
|
||||
MENU LABEL ^1) ${PNAME} (Default)
|
||||
LINUX /boot/${UXNAME}.${ARCH}.kern
|
||||
INITRD /boot/${UXNAME}.${ARCH}.img
|
||||
APPEND archisobasedir=${DISTNAME} archisolabel=${DISTNAME}
|
||||
|
||||
@@ -37,22 +37,13 @@ function mentos {
|
||||
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"-")
|
||||
|
||||
if [[ -n $(find ${BASEDIR}/extra/pre-build.d/ -type f -newer ${BASEDIR}/root.x86_64/boot/vmlinuz-linux-${PNAME}) ]] || [[ "${INSTKERN}" != "${NEWKERN}" ]];
|
||||
then
|
||||
${CHROOTCMD} ${i}/ bash -c "${RACECAR_CHK}apacman --noconfirm --noedit --skipinteg -Syyu --devel" >> "${LOGFILE}.${FUNCNAME}" 2>&1
|
||||
else
|
||||
${CHROOTCMD} ${i}/ bash -c "${RACECAR_CHK}apacman --noconfirm --noedit --skipinteg -Syyu --devel --ignore linux,linux-${PNAME}" >> "${LOGFILE}.${FUNCNAME}" 2>&1
|
||||
fi
|
||||
for x in $(find ${i}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%.pacorig} ; done
|
||||
${CHROOTCMD} ${i}/ bash -c "${RACECAR_CHK}apacman --noconfirm --noedit --skipinteg -S --needed --ignore linux,linux-${PNAME} ${PKGLIST}" >> "${LOGFILE}.${FUNCNAME}" 2>&1
|
||||
${CHROOTCMD} ${i}/ bash -c "${RACECAR_CHK}apacman --noconfirm --noedit --skipinteg -S --needed --purgebuild --ignore linux ${PKGLIST}" >> "${LOGFILE}.${FUNCNAME}" 2>&1
|
||||
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}/ bash -c "apacman --noconfirm --noedit --skipinteg -S --needed ${PKGLIST}"
|
||||
if [[ -n $(find ${BASEDIR}/extra/pre-build.d/ -type f -newer root.x86_64/boot/vmlinuz-linux-${PNAME}) ]];
|
||||
then
|
||||
set +e
|
||||
${CHROOTCMD} ${i}/ bash -c "${RACECAR_CHK}mkinitcpio -p linux-${PNAME}" >> "${LOGFILE}.${FUNCNAME}" 2>&1
|
||||
set -e
|
||||
fi
|
||||
cp -a ${i}/boot/vmlinuz-linux ${i}/boot/vmlinuz-linux-${PNAME}
|
||||
cp -a ${i}/boot/initramfs-linux.img ${i}/boot/initramfs-linux-${PNAME}.img
|
||||
echo "Done."
|
||||
done
|
||||
|
||||
@@ -62,7 +53,7 @@ function mentos {
|
||||
PKGLIST=$(sed -e '/^[[:space:]]*#/d ; /^[[:space:]]*$/d' ${BASEDIR}/extra/packages.32 | tr '\n' ' ')
|
||||
if [ -n "${PKGLIST}" ];
|
||||
then
|
||||
${CHROOTCMD} ${CHROOTDIR32}/ bash -c "yes '' | ${RACECAR_CHK}apacman --noconfirm --noedit --skipinteg -S --needed ${PKGLIST}" >> "${LOGFILE}.${FUNCNAME}" 2>&1
|
||||
${CHROOTCMD} ${CHROOTDIR32}/ bash -c "yes '' | ${RACECAR_CHK}apacman --noconfirm --noedit --skipinteg -S --needed --purgebuild ${PKGLIST}" >> "${LOGFILE}.${FUNCNAME}" 2>&1
|
||||
fi
|
||||
for x in $(find ${CHROOTDIR32}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%.pacorig} ; done
|
||||
|
||||
@@ -71,7 +62,7 @@ function mentos {
|
||||
PKGLIST=$(sed -e '/^[[:space:]]*#/d ; /^[[:space:]]*$/d' ${BASEDIR}/extra/packages.64 | tr '\n' ' ')
|
||||
if [ -n "${PKGLIST}" ];
|
||||
then
|
||||
${CHROOTCMD} ${CHROOTDIR64}/ bash -c "${RACECAR_CHK}apacman --noconfirm --noedit --skipinteg -S --needed ${PKGLIST}" >> "${LOGFILE}.${FUNCNAME}" 2>&1
|
||||
${CHROOTCMD} ${CHROOTDIR64}/ bash -c "yes '' | ${RACECAR_CHK}apacman --noconfirm --noedit --skipinteg -S --needed --purgebuild ${PKGLIST}" >> "${LOGFILE}.${FUNCNAME}" 2>&1
|
||||
fi
|
||||
for x in $(find ${CHROOTDIR64}/etc/ -type f -iname "*.pacorig");do mv -f ${x} ${x%.pacorig} ; done
|
||||
#${CHROOTCMD} ${CHROOTDIR64}/ bash -c "apacman --noconfirm --noedit --skipinteg -S --needed ${PKGLIST}"
|
||||
|
||||
@@ -74,7 +74,8 @@ function mkchroot {
|
||||
cd "${BASEDIR}"
|
||||
|
||||
## Set some vars.
|
||||
MIRROR='http://mirrors.kernel.org/archlinux'
|
||||
#MIRROR='http://mirrors.kernel.org/archlinux'
|
||||
MIRROR='http://mirror.us.leaseweb.net/archlinux'
|
||||
RLSDIR="${MIRROR}/iso/latest"
|
||||
|
||||
CURRLS64=$(curl -s ${RLSDIR}/sha1sums.txt | grep bootstrap | awk '{print $2}' | grep 'x86_64')
|
||||
@@ -93,10 +94,10 @@ function mkchroot {
|
||||
echo "Local: ${LOCSUM64}"
|
||||
echo "Remote: ${CKSUM64}"
|
||||
echo "Fetching fresh copy."
|
||||
curl -o latest.64.tar.gz "${RLSDIR}/${CURRLS64}" >> "${LOGFILE}.${FUNCNAME}" 2>&1
|
||||
curl -o latest.64.tar.gz "${RLSDIR}/${CURRLS64}"
|
||||
fi
|
||||
else
|
||||
curl -o latest.64.tar.gz "${RLSDIR}/${CURRLS64}" >> "${LOGFILE}.${FUNCNAME}" 2>&1
|
||||
curl -o latest.64.tar.gz "${RLSDIR}/${CURRLS64}"
|
||||
fi
|
||||
|
||||
if [ -f "latest.32.tar.gz" ];
|
||||
@@ -153,6 +154,12 @@ EOF
|
||||
|
||||
for i in ${CHROOTDIR32} ${CHROOTDIR64};
|
||||
do
|
||||
# Disable NetworkManager. Fuck that shit.
|
||||
ln -s /dev/null ${i}/etc/systemd/system/NetworkManager.service
|
||||
ln -s /dev/null ${i}/etc/systemd/system/NetworkManager-dispatcher.service
|
||||
# Remove the machine-id file so it's automatically generated.
|
||||
# NOTE: this kind of fucks things up presently.
|
||||
#rm -f ${i}/etc/machine-id
|
||||
# Prep pacman
|
||||
echo "Prepping ${i}. This will take a while..."
|
||||
echo -n "...Key initializing..."
|
||||
@@ -185,7 +192,8 @@ EOF
|
||||
mkdir -p ${i}/var/tmp/pkg
|
||||
cp ${BASEDIR}/extra/bootstrap/apacman* ${i}/var/tmp/pkg/apacman.tar.xz
|
||||
#${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" >> "${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
|
||||
${CHROOTCMD} ${i} bash -c "apacman -S --noconfirm --noedit --skipinteg -S apacman-deps expac" >> "${LOGFILE}.${FUNCNAME}" 2>&1
|
||||
#rm -rf ${i}/var/tmp/pkg
|
||||
#${CHROOTCMD} ${i}/ pacman -S --noconfirm --needed yaourt >> "${LOGFILE}.${FUNCNAME}" 2>&1
|
||||
@@ -211,13 +219,15 @@ EOF
|
||||
PKGLIST=$(sed -e '/^[[:space:]]*#/d ; /^[[:space:]]*$/d' ${BASEDIR}/extra/packages.both | tr '\n' ' ')
|
||||
for i in ${CHROOTDIR32} ${CHROOTDIR64};
|
||||
do
|
||||
echo "Running post-build tasks (building kernel, etc.) in ${i}..."
|
||||
echo "Running post-build tasks in ${i}..."
|
||||
${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
|
||||
#set +e
|
||||
#${CHROOTCMD} ${i}/ /usr/bin/bash -c "apacman --noconfirm --noedit --skipinteg -S --needed linux" >> "${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
|
||||
${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/initramfs-linux.img ${i}/boot/initramfs-linux-${PNAME}.img
|
||||
set -e
|
||||
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...
|
||||
#${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
|
||||
@@ -261,7 +271,9 @@ EOF
|
||||
for i in ${CHROOTDIR32} ${CHROOTDIR64};
|
||||
do
|
||||
set +e
|
||||
${CHROOTCMD} ${i}/ /usr/bin/bash -c "mkinitcpio -p linux-${PNAME}" >> "${LOGFILE}.${FUNCNAME}" 2>&1
|
||||
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
|
||||
cp -a ${i}/boot/initramfs-linux.img ${i}/boot/initramfs-linux-${PNAME}.img
|
||||
set -e
|
||||
done
|
||||
|
||||
|
||||
@@ -7,3 +7,44 @@ 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
|
||||
|
||||
function fuck_you_gimme_net() {
|
||||
IFACE=$(ifconfig -a -s | egrep -E '^((en|wl)p?|em)' | awk '{print $1}' | tr '\n' ' ' | sed -e 's/\ $//g')
|
||||
for i in ${IFACE};
|
||||
do
|
||||
|
||||
LINK_STATE=$(ethtool ${i} | egrep '^[[:space:]]*Link' | sed -re 's/^[[:space:]]*Link detected:(.*)/\1/g')
|
||||
DEV=$(echo ${i} | sed -re 's/^([A-Za-z]{1}).*/\1/g' | tr '[[:upper:]]' '[[:lower:]]' )
|
||||
if [ "${DEV}" == "e" ];
|
||||
then
|
||||
if [ "${LINK_STATE}" != "no" ];
|
||||
then
|
||||
DEV='ethernet-dhcp'
|
||||
else
|
||||
# skip disconnected ethernet
|
||||
continue
|
||||
fi
|
||||
else
|
||||
DEV='wireless-open'
|
||||
fi
|
||||
|
||||
ifconfig ${i} down
|
||||
cp -a /etc/netctl/examples/${DEV} /etc/netctl/${i}
|
||||
sed -i -re "s/^([[:space:]]*Interface[[:space:]]*=).*/\1${i}/g" /etc/netctl/${i}
|
||||
if [ "${DEV}" == "wireless-open" ];
|
||||
then
|
||||
ifconfig ${i} up && \
|
||||
ESSID=$(iwlist ${i} scanning | egrep -A5 -B5 '^[[:space:]]*Encryption key:off' | egrep '^[[:space:]]*ESSID:' | sed -re 's/^[[:space:]]*ESSID:(.*)/\1/g')
|
||||
sed -i -re "s/^([[:space:]]*ESSID[[:space:]]*=).*/\1${ESSID}/g" /etc/netctl/${i}
|
||||
ifconfig ${i} down
|
||||
fi
|
||||
netctl restart ${i} > /dev/null 2>&1
|
||||
done
|
||||
}
|
||||
|
||||
ping -c1 google.com | grep -q '1 received'
|
||||
if [[ "${?}" != "0" ]];
|
||||
then
|
||||
fuck_you_gimme_net
|
||||
systemctl restart openvpn@*
|
||||
fi
|
||||
|
||||
1
src/ipxe
Submodule
1
src/ipxe
Submodule
Submodule src/ipxe added at d73982f098
14
src/ipxe-efi
Normal file
14
src/ipxe-efi
Normal file
@@ -0,0 +1,14 @@
|
||||
http://ipxe.org/download#efi
|
||||
|
||||
"
|
||||
|
||||
iPXE supports the EFI and UEFI environments, as well as the standard PC BIOS. You can build an EFI driver ROM using the .efirom image format. For example:
|
||||
|
||||
make bin-i386-efi/808610de.efirom # 32-bit driver ROM
|
||||
make bin-x86_64-efi/808610de.efirom # 64-bit driver ROM
|
||||
|
||||
"
|
||||
|
||||
|
||||
|
||||
http://ipxe.org/efi/vision
|
||||
Reference in New Issue
Block a user