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

                       
                                
                      
                   
                                                                 
           

              

                                

                                                                      
 

                                                                           



                                                                      
                                        
                                                                            


                
                                              

                                                



                                                     
#!/usr/bin/env bash
# -*- coding: utf-8 -*-
# region imports
source '/usr/lib/rebash/core.sh'
core.import exceptions
core.import logging
type emergency_shell >/dev/null 2>&1 || source /lib/dracut-lib.sh
# endregion
exceptions.try
{
logging.set_commands_level debug
logging.set_level debug
[[ "$SLX_LOG_FILE_PATH" == "" ]] && SLX_LOG_FILE_PATH=/var/log/openslx
logging.set_log_file "$SLX_LOG_FILE_PATH"

systemd_system_unit_path="$(dirname \
    "$(systemctl show -p FragmentPath dracut-mount.service | cut -c 14-)")"
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
{
    logging.error "$exceptions_last_traceback"
    emergency_shell "error in ${BASH_SOURCE[0]}"
}
# region vim modline
# vim: set tabstop=4 shiftwidth=4 expandtab:
# vim: foldmethod=marker foldmarker=region,endregion:
# endregion