logo

make-initrd

Unnamed repository; edit this file 'description' to name the repository. git clone https://anongit.hacktivis.me/git/make-initrd.git/
commit: 5b55619bf298b3c2d8270cf17aba6f39fd9fdcb0
parent fe28b74570b270a916155de57e1c38a0f6cf93b5
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Tue,  6 Jan 2026 12:55:22 +0100

make-initrd.sh: use install(1) instead of cp(1) to reduce some perms

Diffstat:

Mmake-initrd.sh6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/make-initrd.sh b/make-initrd.sh @@ -40,7 +40,7 @@ mknod -m 620 dev/tty1 c 4 1 for elf in $elves; do origin=$(command -v "$elf") - cp "$origin" bin/ || die + cp -p "$origin" bin/ || die done for mod in $modules; do @@ -53,7 +53,7 @@ done test -f ./load_modules.sh && chmod +x ./load_modules.sh if [ -f /root/initrd-keyfile ]; then - cp /root/initrd-keyfile ./keyfile || die "copying keyfile" + install -c -m 400 /root/initrd-keyfile ./keyfile || die "copying keyfile" fi cp "${WORKDIR}/init" . || die "copying init" @@ -67,7 +67,7 @@ done if find . -print0 | cpio --null -ov --format=newc | xz -9 --check=crc32 > "../${out_base}.img"; then test -e "/boot/${out_base}.img" && mv "/boot/${out_base}.img" "/boot/${out_base}.img.old" - cp "../${out_base}.img" /boot + install -c -m 400 "../${out_base}.img" /boot/ fi cd "${WORKDIR}"