|
| 1 | +#!/usr/bin/env bash |
| 2 | +# Copyright (c) 2023 The Toltec Contributors |
| 3 | +# SPDX-License-Identifier: MIT |
| 4 | + |
| 5 | +pkgnames=(debian-chroot debootstrap) |
| 6 | +section="utils" |
| 7 | +# Each package has it's own timestamp override below |
| 8 | +timestamp=2023-12-22T19:37Z |
| 9 | +maintainer= "Eeems <[email protected]>" |
| 10 | +installdepends=(display) |
| 11 | +flags=(nostrip) |
| 12 | + |
| 13 | +source=( |
| 14 | + https://github.com/Eeems-org/remarkable-debian-chroot/archive/ea12a1bf851f412e8df4b59fe072bce26bb72571.zip |
| 15 | + https://salsa.debian.org/installer-team/debootstrap/-/archive/1.0.133/debootstrap-1.0.133.tar.gz |
| 16 | + debian-chroot.conf |
| 17 | +) |
| 18 | +sha256sums=( |
| 19 | + 3fcd571ba1aa1a5c55a32767c34e6939e0c0e8ad9213425c6d66d25300fe24b8 |
| 20 | + 734af3492eea99de940853e2c00e1a9ebd65c463362155f613aa24b9cc3336a0 |
| 21 | + SKIP |
| 22 | +) |
| 23 | + |
| 24 | +debian-chroot() { |
| 25 | + pkgdesc="A minimal Debian chroot for the reMarkable tablet" |
| 26 | + url=https://github.com/Eeems-Org/remarkable-debian-chroot |
| 27 | + pkgver=0.0.0-1 |
| 28 | + timestamp=2023-12-22T19:37Z |
| 29 | + license=MIT |
| 30 | + installdepends=(debootstrap lsof) |
| 31 | + package() { |
| 32 | + install -D -m 755 \ |
| 33 | + "$srcdir"/bin/debian-chroot \ |
| 34 | + "$pkgdir"/opt/bin/debian-chroot |
| 35 | + install -D -m 655 \ |
| 36 | + "$srcdir"/debian-chroot.conf \ |
| 37 | + "$pkgdir"/home/root/.config/debian-chroot.conf |
| 38 | + mkdir -p "$pkgdir"/opt/etc/ |
| 39 | + ln -s /home/root/.config/debian-chroot.conf \ |
| 40 | + "$pkgdir"/opt/etc/debian-chroot.conf |
| 41 | + source "$srcdir"/debian-chroot.conf |
| 42 | + mkdir -p "$pkgdir"/opt/lib/ |
| 43 | + ln -s "$chroot_path" "$pkgdir"/opt/lib/debian-chroot |
| 44 | + } |
| 45 | + configure() { |
| 46 | + # Force debian chroot to install iteself |
| 47 | + debian-chroot true |
| 48 | + } |
| 49 | + preremove() { |
| 50 | + source /home/root/.config/debian-chroot.conf |
| 51 | + if lsof "$chroot_path" 2> /dev/null | grep "$chroot_path"; then |
| 52 | + echo "Error: debian-chroot has running processes" |
| 53 | + exit 1 |
| 54 | + fi |
| 55 | + if grep -q "$chroot_path " /proc/mounts; then |
| 56 | + /bin/umount -R "$chroot_path" |
| 57 | + fi |
| 58 | + cp /home/root/.config/debian-chroot.conf /tmp/_debian-chroot.conf |
| 59 | + } |
| 60 | + postremove() { |
| 61 | + source /tmp/_debian-chroot.conf |
| 62 | + rm -rf "$chroot_path" |
| 63 | + rm /tmp/_debian-chroot.conf |
| 64 | + } |
| 65 | +} |
| 66 | + |
| 67 | +debootstrap() { |
| 68 | + pkgdesc="debootstrap is a tool which will install a Debian base system into a subdirectory of another, already installed system." |
| 69 | + installdepends=(perl ar) |
| 70 | + url=https://wiki.debian.org/Debootstrap |
| 71 | + pkgver=1.0.133-1 |
| 72 | + timestamp=2023-10-21T11:38Z |
| 73 | + license=MIT |
| 74 | + package() { |
| 75 | + cd "$srcdir" |
| 76 | + sed -i 's|/usr/sbin|/sbin|' Makefile |
| 77 | + make DESTDIR="$pkgdir"/opt install |
| 78 | + sed -i 's|DEBOOTSTRAP_DIR=/usr/share/debootstrap|DEBOOTSTRAP_DIR=/opt/usr/share/debootstrap|' "$pkgdir"/opt/sbin/debootstrap |
| 79 | + } |
| 80 | +} |
0 commit comments