summaryrefslogblamecommitdiffstats
path: root/builder/dnbd3-rootfs/hooks/copy-dnbd3-service-into-newroot.sh
blob: 35c2ef09e7fb8c78d0dfb9684a6cec6d1b6f65d6 (plain) (tree)
1
2
3
4
5
6
7
8
9
                   

                       
                                
                      

                   

              

                                
 







                                                                            




                                                



                                                     
#!/usr/bin/env bash
# -*- coding: utf-8 -*-
# region imports
source '/usr/lib/rebash/core.sh'
core.import exceptions
core.import logging
# endregion
exceptions.try
{
logging.set_commands_level debug
logging.set_level debug

systemd_system_unit_path="$(dirname "$(find / -name dracut-mount.service \
    -type f -print -quit)")"
new_systemd_system_unit_path="${NEWROOT}/lib/systemd/system"
cp "${systemd_system_unit_path}/dnbd3root.service" \
    "${new_systemd_system_unit_path}/dnbd3root.service"
mkdir --parents "${new_systemd_system_unit_path}/sysinit.target.wants"
ln --symbolic '../dnbd3root.service' \
    "${new_systemd_system_unit_path}/sysinit.target.wants/dnbd3root.service"
}
exceptions.catch
{
    emergency_shell "error in ${BASH_SOURCE[0]}"
}
# region vim modline
# vim: set tabstop=4 shiftwidth=4 expandtab:
# vim: foldmethod=marker foldmarker=region,endregion:
# endregion