aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile9
-rw-r--r--hook/uname4
-rw-r--r--install/uname10
-rw-r--r--systemd/uname2
4 files changed, 16 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 72f7dd1..2d146eb 100644
--- a/Makefile
+++ b/Makefile
@@ -1,16 +1,19 @@
# Makefile for mkinitcpio-uname
-VERSION=0.2.0
+VERSION=0.2.2
all:
@echo "Just run make install..."
.PHONY: install
install:
+ # install script and unit file
+ install -D -m0755 systemd/uname $(DESTDIR)/usr/lib/systemd/scripts/uname
+ install -D -m0644 systemd/uname.service $(DESTDIR)/usr/lib/systemd/system/uname.service
+
+ # install install-script and hook for plain old script based initramfs
install -D -m0644 install/uname $(DESTDIR)/usr/lib/initcpio/install/uname
install -D -m0755 hook/uname $(DESTDIR)/usr/lib/initcpio/hooks/uname
- install -D -m0644 systemd/uname.service $(DESTDIR)/usr/lib/systemd/system/uname.service
- install -D -m0755 systemd/uname $(DESTDIR)/usr/lib/systemd/scripts/uname
release:
git archive --format=tar.xz --prefix=mkinitcpio-uname-$(VERSION)/ $(VERSION) > mkinitcpio-uname-$(VERSION).tar.xz
diff --git a/hook/uname b/hook/uname
index 58fda04..34858e4 100644
--- a/hook/uname
+++ b/hook/uname
@@ -2,9 +2,9 @@
run_latehook() {
if [ -s /new_root/version ]; then
- echo " Booting $(cat /new_root/version) with $(uname -srm)."
+ echo " Booting $(cat /new_root/version) with $(uname -srm)."
else
- echo " Booting $(uname -srm)."
+ echo " Booting $(uname -srm)."
fi
echo
}
diff --git a/install/uname b/install/uname
index 153a646..f1eb5b3 100644
--- a/install/uname
+++ b/install/uname
@@ -1,10 +1,14 @@
#!/bin/sh
build() {
- if add_systemd_unit uname.service 2>/dev/null; then
+ if command -v add_systemd_unit >/dev/null; then
+ add_systemd_unit "uname.service"
+
# busybox provides uname, but the base hook is not prerequisite
- # for a systemd-enable initramfs - so add uname
- add_binary uname
+ # for a systemd-enable initramfs - so add uname if required
+ if [ ! -e "${BUILDROOT}/usr/bin/uname" ]; then
+ add_binary uname
+ fi
add_symlink "/usr/lib/systemd/system/sysinit.target.wants/uname.service" "../uname.service"
else
diff --git a/systemd/uname b/systemd/uname
index 7143927..293bdfb 100644
--- a/systemd/uname
+++ b/systemd/uname
@@ -1,4 +1,4 @@
#!/bin/sh
-echo " Booting $(uname -srm)."
+echo " Booting $(uname -srm)."
echo