blob: c58ea15c735d426554f0f710ae41e57ec9b1bc55 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
#!/bin/sh
# copy the wpa_supplicant.service to the new system to prevent systemd
# killing the wpa_supplicant process
# this hook will be executed in pre-pivot as 00
# get the systemd path on the new system
systemd_system_unit_path="/etc/systemd/system"
new_systemd_system_unit_path="${NEWROOT}""$systemd_system_unit_path"
#### copy from the current to the new system
cp "/usr/bin/systemd-preserve-process-marker" "${NEWROOT}/usr/bin/systemd-preserve-process-marker"
#cp "/usr/bin/simple.script" "${NEWROOT}/usr/bin/simple.script"
## dhcpcd
cp "/etc/systemd/system/dhcp.service" "${new_systemd_system_unit_path}/dhcp.service"
cp "/usr/sbin/dhcpcd" "/sysroot/usr/sbin/dhcpcd"
mkdir -p /sysroot/libexec/
#mount -t tmpfs tmpfs /sysroot/libexec/
cp -r /libexec/* "${NEWROOT}/libexec/"
## wpa_supplicant
cp "/etc/systemd/system/wpa_supplicant.service" "${new_systemd_system_unit_path}/wpa_supplicant.service"
mkdir --parents "${NEWROOT}/etc"
cp /etc/wpa_supplicant.conf "${NEWROOT}/etc/wpa_supplicant.conf"
## certificate
mkdir --parents "${NEWROOT}/etc/ssl/certs"
cp /etc/ssl/certs/Deutsche_Telekom_Root_CA_2.pem "${NEWROOT}/etc/ssl/certs"
## linking in sysinit.target.wants
mkdir --parents "${new_systemd_system_unit_path}/sysinit.target.wants"
cd "${new_systemd_system_unit_path}/sysinit.target.wants"
! ln --symbolic '../wpa_supplicant.service'
! ln --symbolic '../dhcp.service'
# disable NetworkManager.service
rm /sysroot/etc/systemd/system/dbus-org.freedesktop.NetworkManager.service
rm /sysroot/etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service
rm /sysroot/etc/systemd/system/multi-user.target.wants/NetworkManager.service
### DEBUG ###
cp /root/debug-shell.service ${NEWROOT}/etc/systemd/system/debug-shell.service
! ln --symbolic '../debug-shell.service'
cp /usr/sbin/restart_wpa /sysroot/usr/sbin/restart_wpa
|