commit f6026e7ed2e4fec98f2c891cc6a0b622ea3e402e
parent da5d6965b5a22245447a9716c45f7b51819df050
Author: torter <koubbamohamedrayan@gmail.com>
Date: Sun, 22 Nov 2026 20:46:42 +0000
base r21: udev-init-scripts-openrc in the base, mag runs once after an upgrade an older mag did, for the -openrc services it left out
Diffstat:
4 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/pkg/chamesle-base/post-install b/pkg/chamesle-base/post-install
@@ -14,4 +14,5 @@ levels() {
}
levels
add default dhcpcd
+touch /var/lib/mag/.install-if
exit 0
diff --git a/pkg/mag/trigger b/pkg/mag/trigger
@@ -0,0 +1,8 @@
+#!/bin/sh
+# a mag before 0.5 knows no install_if, so an upgrade it ran left out the -openrc services: the new mag brings them, once
+f=/var/lib/mag/.install-if
+[ -e $f ] && exit 0
+touch $f
+unset MAG_ROOT
+mag upgrade
+exit 0
diff --git a/tools/mkapk b/tools/mkapk
@@ -1,22 +1,22 @@
#!/bin/sh
# mkapk: packs DIR into a package mag installs, signed with KEY, and leaves its index entry in OUT/.idx for mkrepo.
-# mkapk -k KEY -n NAME -v VERSION -a ARCH -d DESC [-D DEPS] [-s SCRIPTS] [-o OUT] DIR
+# mkapk -k KEY -n NAME -v VERSION -a ARCH -d DESC [-D DEPS] [-s SCRIPTS] [-t TRIGGERS] [-o OUT] DIR
# SCRIPTS is a directory with any of post-install, pre-upgrade and the rest
set -e
# GNU tar, for --record-size and --sort
tar=$(command -v gtar || echo tar)
-deps= scripts= out=.
-while getopts k:n:v:a:d:D:s:o: o; do
+deps= scripts= triggers= out=.
+while getopts k:n:v:a:d:D:s:t:o: o; do
case $o in
k) key=$OPTARG;; n) name=$OPTARG;; v) ver=$OPTARG;; a) arch=$OPTARG;; d) desc=$OPTARG;;
- D) deps=$OPTARG;; s) scripts=$OPTARG;; o) out=$OPTARG;;
+ D) deps=$OPTARG;; s) scripts=$OPTARG;; t) triggers=$OPTARG;; o) out=$OPTARG;;
*) exit 2;;
esac
done
shift $((OPTIND - 1))
dir=$1
if [ -z "$key" ] || [ -z "$name" ] || [ -z "$ver" ] || [ -z "$arch" ] || [ ! -d "$dir" ]; then
- echo "usage: mkapk -k KEY -n NAME -v VERSION -a ARCH -d DESC [-D DEPS] [-s SCRIPTS] [-o OUT] DIR" >&2
+ echo "usage: mkapk -k KEY -n NAME -v VERSION -a ARCH -d DESC [-D DEPS] [-s SCRIPTS] [-t TRIGGERS] [-o OUT] DIR" >&2
exit 2
fi
mkdir -p "$out/.idx"
@@ -38,6 +38,7 @@ $tar --format=gnu --owner=0 --group=0 --numeric-owner --sort=name -C "$dir" -cf
echo "arch = $arch"
echo "license = BSD-2-Clause"
for d in $deps; do echo "depend = $d"; done
+ [ -z "$triggers" ] || echo "triggers = $triggers"
echo "datahash = $(sha256sum "$tmp/data.tar.gz" | cut -d' ' -f1)"
} > "$tmp/c/.PKGINFO"
more=
diff --git a/tools/mkpkgs b/tools/mkpkgs
@@ -14,12 +14,12 @@ mkapk() { "$here/tools/mkapk" -k "$KEY" -a "$arch" -o "$out" "$@"; }
mkdir -p "$tmp/mag/usr/bin"
install -m755 "$MAG" "$tmp/mag/usr/bin/mag"
-mkapk -n mag -v "$("$MAG" --version | cut -d' ' -f2)" -d "the package manager" "$tmp/mag"
+mkapk -n mag -v "$("$MAG" --version | cut -d' ' -f2)" -d "the package manager" -s "$here/pkg/mag" -t /etc/init.d "$tmp/mag"
mkdir -p "$tmp/init"
mkapk -n chamesle-init -v 1 -d "moves a base from before r20 over to OpenRC" -s "$here/pkg/chamesle-init" "$tmp/init"
-deps="alpine-baselayout busybox busybox-binsh busybox-suid doas mksh agetty bash mount umount findmnt util-linux-misc chamesle-init openrc busybox-openrc eudev eudev-openrc dhcpcd-openrc kmod dhcpcd e2fsprogs dosfstools curl mag"
+deps="alpine-baselayout busybox busybox-binsh busybox-suid doas mksh agetty bash mount umount findmnt util-linux-misc chamesle-init openrc busybox-openrc eudev eudev-openrc udev-init-scripts udev-init-scripts-openrc dhcpcd-openrc kmod dhcpcd e2fsprogs dosfstools curl mag"
if [ -n "$RIFLE" ]; then
mkdir -p "$tmp/rifle/usr/bin"
install -m755 "$RIFLE" "$tmp/rifle/usr/bin/rifle"