diff options
author | Andrew Cady <d@cryptonomic.net> | 2021-02-28 07:37:01 -0500 |
---|---|---|
committer | Andrew Cady <d@cryptonomic.net> | 2021-02-28 07:37:01 -0500 |
commit | da4c955eeb534c799b1a7378dc4d5dfaad2d21c2 (patch) | |
tree | 54aaa722a1925501c9b6dd129c6c342c70a497ad /fsmgr.hs | |
parent | 4ae45ba0bdc988499e8fd71984b4a0ba65080d81 (diff) |
config option "unit-files:" for systemd unit files
Diffstat (limited to 'fsmgr.hs')
-rw-r--r-- | fsmgr.hs | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -178,6 +178,13 @@ buildRoot config@DiskImageConfig{..} finalOut = do | |||
178 | in do | 178 | in do |
179 | forM_ (unpack <$> skelFiles) go | 179 | forM_ (unpack <$> skelFiles) go |
180 | forM_ (unpack <$> optionalSkelFiles) $ ignoreErrors . go | 180 | forM_ (unpack <$> optionalSkelFiles) $ ignoreErrors . go |
181 | {- 3.6 systemd unit files -} | ||
182 | let go s = do | ||
183 | target <- absPath mountpoint <&> (</> "etc/systemd/system") | ||
184 | cmd_ "mkdir -p" [target] | ||
185 | cmd_ "install --preserve-timestamps -m644 -t" [target] [s] | ||
186 | go :: String -> Action () | ||
187 | in forM_ (unpack <$> unitFiles) go | ||
181 | {- 4. custom setup commands -} | 188 | {- 4. custom setup commands -} |
182 | forM_ chrootCommands $ \c -> do | 189 | forM_ chrootCommands $ \c -> do |
183 | cmd_ "chroot" [mountpoint] "/bin/sh -c" [unpack c] | 190 | cmd_ "chroot" [mountpoint] "/bin/sh -c" [unpack c] |