summaryrefslogtreecommitdiff
path: root/src/init
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2019-11-15 19:44:39 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2019-11-15 19:44:39 +0000
commit7ce8f0ef40e9a43c5ce89b7b9bbbb974779f67f5 (patch)
tree657e3b0020434afac0cf232b55ddf314f271e892 /src/init
parent2d90ab0d77ace2a10498c7a5f56c052281a56ed4 (diff)
downloads6-linux-init-7ce8f0ef40e9a43c5ce89b7b9bbbb974779f67f5.tar.xz
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.
Diffstat (limited to 'src/init')
-rw-r--r--src/init/s6-linux-init-maker.c12
1 files 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)