summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Lee2015-07-01 19:01:35 -0400
committerMark Lee2015-07-01 19:01:35 -0400
commit435e0bc6704b86f03470c494ba99d24e3bc40afb (patch)
tree94e815c8f1b7b06bfb9a9552826a525a3cb81a53
downloadaur-435e0bc6704b86f03470c494ba99d24e3bc40afb.tar.gz
Initial import
-rw-r--r--.SRCINFO16
-rw-r--r--PKGBUILD54
-rw-r--r--liveroot.install13
3 files changed, 83 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..601b90451408
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,16 @@
+pkgbase = liveroot
+ pkgdesc = Initcpio hooks for non persistent boot
+ pkgver = 21
+ pkgrel = 1
+ url = https://github.com/bluerider/liveroot.git
+ install = liveroot.install
+ arch = any
+ license = GPL3
+ makedepends = git
+ depends = util-linux
+ depends = rsync
+ source = git+https://github.com/bluerider/liveroot.git
+ sha256sums = SKIP
+
+pkgname = liveroot
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..2a88bb88f930
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,54 @@
+#Maintainer : mark@markelee.com
+#Contributor: mark@markelee.com
+
+pkgname='liveroot'
+url='https://github.com/bluerider/liveroot.git'
+pkgdesc='Initcpio hooks for non persistent boot'
+pkgver=21
+pkgrel=1
+arch=('any')
+depends=('util-linux' 'rsync')
+makedepends=('git')
+license=('GPL3')
+source=("git+$url")
+sha256sums=('SKIP')
+install="${pkgname}.install"
+
+prepare() {
+ echo "Do you want to use the static compiler?"
+ echo "b|B : btrfs specific"
+ echo "y|Y : use compiler"
+ echo "n|N : use standard oroot hook"
+ read ans
+ case $ans in
+ b|B)
+ bash "${srcdir}/${pkgname}/compiler" btrfs &&
+ mv ${srcdir}{,/${pkgname}/initcpio/hooks}/oroot &&
+ mv "${srcdir}/oroot_install" "${srcdir}/${pkgname}/initcpio/install/oroot" &&
+ msg "Compiled oroot for btrfs" ||
+ msg "Failed to compile oroot"
+ ;;
+ y|Y)
+ bash "${srcdir}/${pkgname}/compiler" &&
+ mv ${srcdir}{,/${pkgname}/initcpio/hooks}/oroot &&
+ mv "${srcdir}/oroot_install" "${srcdir}/${pkgname}/initcpio/install/oroot" &&
+ msg "Compiled oroot" ||
+ msg "Failed to compile oroot"
+ ;;
+ n|N)
+ msg "Using default oroot hook"
+ ;;
+ esac;
+}
+
+package() {
+ install -m755 -d "${pkgdir}/usr/lib/initcpio/hooks"
+ install -m755 -d "${pkgdir}/usr/lib/initcpio/install"
+ install -m644 "${srcdir}/${pkgname}/initcpio/hooks/oroot" "${pkgdir}/usr/lib/initcpio/hooks"
+ install -m644 "${srcdir}/${pkgname}/initcpio/install/oroot" "${pkgdir}/usr/lib/initcpio/install"
+ install -m755 -d "${pkgdir}/etc/modprobe.d"
+ echo "options zram num_devices=$[$(nproc)+2]" > "/${pkgdir}/etc/modprobe.d/zram.conf"
+ install -m755 -d "${pkgdir}/usr/share/liveroot"
+ install -m644 "${srcdir}/${pkgname}/examples/mkinitcpio.conf.example" "${pkgdir}/usr/share/liveroot"
+ install -m644 "${srcdir}/${pkgname}/examples/syslinux.cfg.example" "${pkgdir}/usr/share/liveroot"
+}
diff --git a/liveroot.install b/liveroot.install
new file mode 100644
index 000000000000..a58999809ef6
--- /dev/null
+++ b/liveroot.install
@@ -0,0 +1,13 @@
+post_install() {
+ cat <<EOF
+See templates at /usr/share/liveroot/ for examples of how to activate liveroot.
+Add zram btrfs ext2 overlay to modules array in /etc/mkinitcpio.conf
+Add oroot to hooks array in /etc/mkinitcpio.conf
+Add either oroot=raw,oroot=live or oroot=compresssed to kernel cmdline
+oroot=compressed, oroot=raw, and oroot=live now feature a script called overlay_flush. Use this to flush the upper overlay onto the lower backing disk.
+EOF
+}
+
+post_upgrade() {
+ mkinitcpio -p linux
+} \ No newline at end of file