From 7ce8f0ef40e9a43c5ce89b7b9bbbb974779f67f5 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Fri, 15 Nov 2019 19:44:39 +0000 Subject: s6-l-i-m: don't fail when rc.shutdown.final doesn't exist stage4 will print an error message when it tries to spawn it, but since it will reboot right afterwards, who cares. --- src/init/s6-linux-init-maker.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/init/s6-linux-init-maker.c b/src/init/s6-linux-init-maker.c index 6fba294..ff2caf5 100644 --- a/src/init/s6-linux-init-maker.c +++ b/src/init/s6-linux-init-maker.c @@ -359,7 +359,7 @@ static void auto_script (char const *base, char const *file, writetobuf_func_t_r fd_close(fd) ; } -static void copy_script (char const *base, char const *name) +static void copy_script (char const *base, char const *name, int mandatory) { size_t baselen = strlen(base) ; size_t namelen = strlen(name) ; @@ -372,7 +372,7 @@ static void copy_script (char const *base, char const *name) memcpy(src, skeldir, skellen) ; src[skellen] = '/' ; memcpy(src + skellen + 1, name, namelen + 1) ; - if (!filecopy_unsafe(src, dst, 0755)) + if (!filecopy_unsafe(src, dst, 0755) && mandatory) { cleanup(base) ; strerr_diefu4sys(111, "copy ", src, " to ", dst) ; @@ -551,10 +551,10 @@ static inline void make_image (char const *base) static inline void make_scripts (char const *base) { auto_dir(base, "scripts", 0, 0, 0755) ; - copy_script(base, "runlevel") ; - copy_script(base, STAGE2) ; - copy_script(base, STAGE3) ; - copy_script(base, STAGE4) ; + copy_script(base, "runlevel", 1) ; + copy_script(base, STAGE2, 1) ; + copy_script(base, STAGE3, 1) ; + copy_script(base, STAGE4, 0) ; } static inline void make_bins (char const *base) -- cgit v1.2.3