summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Hiles2016-04-15 16:08:31 -0400
committerMatthew Hiles2016-04-15 16:08:31 -0400
commit7519ba65e03f1066f76cb1cb9be9e039c915b371 (patch)
tree116777b9ccb7d2476bd523ea5d3c4fe426da1d2f
downloadaur-7519ba65e03f1066f76cb1cb9be9e039c915b371.tar.gz
initial commit
-rw-r--r--.SRCINFO14
-rw-r--r--PKGBUILD35
-rw-r--r--tarballroot-hook14
-rw-r--r--tarballroot-install23
4 files changed, 86 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..302bfa8c0e58
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,14 @@
+pkgbase = mkinitcpio-tarball-utils
+ pkgdesc = Provides hooks for booting to a tmpfs
+ pkgver = 0.1
+ pkgrel = 1
+ arch = any
+ license = GPL
+ depends = mkinitcpio-nfs-utils
+ source = tarballroot-hook
+ source = tarballroot-install
+ md5sums = 582ed650034623c4c666905ae4ca900c
+ md5sums = 4d5a0b0566a929b0af277b53b4990a53
+
+pkgname = mkinitcpio-tarball-utils
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..0b8b321c1b71
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,35 @@
+# Maintainer: Matthew Hiles <matthew.hiles@gmail.com>
+pkgname=mkinitcpio-tarball-utils
+pkgver=0.1
+pkgrel=1
+epoch=
+pkgdesc="Provides hooks for booting to a tmpfs"
+arch=(any)
+url=""
+license=('GPL')
+groups=()
+depends=(mkinitcpio-nfs-utils)
+makedepends=()
+checkdepends=()
+optdepends=()
+provides=()
+conflicts=()
+replaces=()
+backup=()
+options=()
+install=
+changelog=
+source=(tarballroot-hook tarballroot-install)
+noextract=()
+validpgpkeys=()
+
+
+package() {
+ mkdir -p "$pkgdir/usr/lib/initcpio/hooks"
+ mkdir -p "$pkgdir/usr/lib/initcpio/install"
+ cp tarballroot-hook "$pkgdir/usr/lib/initcpio/hooks/tarball"
+ cp tarballroot-install "$pkgdir/usr/lib/initcpio/install/tarball"
+}
+
+md5sums=('582ed650034623c4c666905ae4ca900c'
+ '4d5a0b0566a929b0af277b53b4990a53')
diff --git a/tarballroot-hook b/tarballroot-hook
new file mode 100644
index 000000000000..6ef5243fb3d9
--- /dev/null
+++ b/tarballroot-hook
@@ -0,0 +1,14 @@
+# vim: set ft=sh:
+run_hook() {
+ if [ "${root}" = "tarball" ]; then
+ # set mount handler
+ mount_handler="tarball_mount_handler"
+ fi
+}
+
+tarball_mount_handler() {
+ mount -t tmpfs root "$1"
+ wget -O- ${tarball} | tar -Jx -C "$1"
+}
+
+# vim: set ft=sh ts=4 sw=4 et:
diff --git a/tarballroot-install b/tarballroot-install
new file mode 100644
index 000000000000..694a157d1f8b
--- /dev/null
+++ b/tarballroot-install
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+build() {
+
+ add_binary "/usr/bin/tar" "/bin/tar"
+ add_binary "/usr/bin/xz" "/bin/xz"
+
+ add_runscript
+}
+
+help() {
+ cat <<HELPEOF
+This hook adds the ability to use a tmpfs as root, downloading a tarball
+image (with xz compression) and extracting it on the fly.
+
+Don't forget to include the net hook.
+
+On the boot command line root=tarball and tarball=<url>
+
+HELPEOF
+}
+
+# vim: set ft=sh ts=4 sw=4 et: