From f6ef263cc91d6b209f4655236c7ba160cb66066b Mon Sep 17 00:00:00 2001 From: brl Date: Thu, 18 Jan 2018 18:15:21 -0500 Subject: [PATCH] package for setting up some files in initramfs --- .../citadel-initramfs/citadel-initramfs.bb | 31 ++++++++++++++++++ .../citadel-initramfs/files/11-dm.rules | 5 +++ .../citadel-initramfs/files/crypttab | 1 + .../files/initrd-debug-shell.service | 32 +++++++++++++++++++ .../citadel-initramfs/files/initrd-release | 5 +++ 5 files changed, 74 insertions(+) create mode 100644 meta-citadel-distro/recipes-core/citadel-initramfs/citadel-initramfs.bb create mode 100644 meta-citadel-distro/recipes-core/citadel-initramfs/files/11-dm.rules create mode 100644 meta-citadel-distro/recipes-core/citadel-initramfs/files/crypttab create mode 100644 meta-citadel-distro/recipes-core/citadel-initramfs/files/initrd-debug-shell.service create mode 100644 meta-citadel-distro/recipes-core/citadel-initramfs/files/initrd-release diff --git a/meta-citadel-distro/recipes-core/citadel-initramfs/citadel-initramfs.bb b/meta-citadel-distro/recipes-core/citadel-initramfs/citadel-initramfs.bb new file mode 100644 index 0000000..79caf38 --- /dev/null +++ b/meta-citadel-distro/recipes-core/citadel-initramfs/citadel-initramfs.bb @@ -0,0 +1,31 @@ +DESCRIPTION = "" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" +SECTION = "" +DEPENDS = "" + +SRC_URI = "file://initrd-release file://crypttab file://11-dm.rules" + +S = "${WORKDIR}" + +do_install() { + install -d ${D}${sysconfdir} + install -m 644 ${WORKDIR}/initrd-release ${D}${sysconfdir} + install -m 644 ${WORKDIR}/crypttab ${D}${sysconfdir} + install -d ${D}${sysconfdir}/udev/rules.d + install -m 644 ${WORKDIR}/11-dm.rules ${D}${sysconfdir}/udev/rules.d + install -d ${D}/dev + mknod -m 622 ${D}/dev/console c 5 1 +} + +FILES_${PN} += "/dev/console" + +pkg_postinst_${PN}() { + ln -sf initrd-release $D${sysconfdir}/os-release + #ln -s ${systemd_unitdir}/systemd $D/init + ln -sf ${systemd_system_unitdir}/initrd.target $D${systemd_system_unitdir}/default.target + rm -f $D${sysconfdir}/fstab + > $D${sysconfdir}/fstab +} + +inherit allarch diff --git a/meta-citadel-distro/recipes-core/citadel-initramfs/files/11-dm.rules b/meta-citadel-distro/recipes-core/citadel-initramfs/files/11-dm.rules new file mode 100644 index 0000000..89941c4 --- /dev/null +++ b/meta-citadel-distro/recipes-core/citadel-initramfs/files/11-dm.rules @@ -0,0 +1,5 @@ +SUBSYSTEM!="block", GOTO="dm_end" +KERNEL!="dm-[0-9]*", GOTO="dm_end" +ACTION!="add|change", GOTO="dm_end" +OPTIONS+="db_persist" +LABEL="dm_end" diff --git a/meta-citadel-distro/recipes-core/citadel-initramfs/files/crypttab b/meta-citadel-distro/recipes-core/citadel-initramfs/files/crypttab new file mode 100644 index 0000000..a3ca7a5 --- /dev/null +++ b/meta-citadel-distro/recipes-core/citadel-initramfs/files/crypttab @@ -0,0 +1 @@ +luks UUID=683a17fc-4457-42cc-a946-cde67195a101 diff --git a/meta-citadel-distro/recipes-core/citadel-initramfs/files/initrd-debug-shell.service b/meta-citadel-distro/recipes-core/citadel-initramfs/files/initrd-debug-shell.service new file mode 100644 index 0000000..1fc875e --- /dev/null +++ b/meta-citadel-distro/recipes-core/citadel-initramfs/files/initrd-debug-shell.service @@ -0,0 +1,32 @@ +# This file is part of https://github.com/random-archer/mkinitcpio-systemd-tool + +# Configure custom debug shell for initramfs + +[Unit] +Description=Initrd Debug Shell Service +Documentation=https://github.com/random-archer/mkinitcpio-systemd-tool/blob/master/README.md +ConditionPathExists=/etc/initrd-release +ConditionPathExists=/dev/tty8 +DefaultDependencies=no +IgnoreOnIsolate=yes + +[Service] +Environment=TERM=linux +ExecStart=/bin/sh +Restart=always +RestartSec=3s +StandardInput=tty +TTYPath=/dev/tty8 +TTYReset=yes +TTYVHangup=yes +KillMode=process +KillSignal=SIGTERM +IgnoreSIGPIPE=no + +[Install] +WantedBy=sysinit.target + +[X-SystemdTool] + +# enable service +InitrdService=enable diff --git a/meta-citadel-distro/recipes-core/citadel-initramfs/files/initrd-release b/meta-citadel-distro/recipes-core/citadel-initramfs/files/initrd-release new file mode 100644 index 0000000..28e6d99 --- /dev/null +++ b/meta-citadel-distro/recipes-core/citadel-initramfs/files/initrd-release @@ -0,0 +1,5 @@ +ID="citadel-distro" +NAME="Subgraph OS Citadel" +VERSION="1.0" +VERSION_ID="1.0" +PRETTY_NAME="Subgraph OS Citadel 1.0"