| Server IP : 216.250.13.251 / Your IP : 216.73.216.164 Web Server : nginx/1.24.0 System : Linux gunay 6.8.0-134-generic #134-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 26 18:43:11 UTC 2026 x86_64 User : root ( 0) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /usr/share/initramfs-tools/hooks/ |
Upload File : |
#!/bin/sh
set -e
# initramfs hook to include dhcpcd as DHCP client
PREREQ=""
# Output pre-requisites
prereqs()
{
echo "$PREREQ"
}
case "$1" in
prereqs)
prereqs
exit 0
;;
esac
. /usr/share/initramfs-tools/hook-functions
if ! [ -x /usr/sbin/dhcpcd ]; then
exit 0
fi
copy_exec /usr/sbin/dhcpcd
copy_exec /usr/lib/dhcpcd/dhcpcd-run-hooks
copy_file config /usr/lib/dhcpcd/dhcpcd-hooks/30-hostname
copy_file config /usr/share/initramfs-tools/dhcpcd-hooks/10-mtu /usr/lib/dhcpcd/dhcpcd-hooks/10-mtu
copy_file config /usr/share/initramfs-tools/dhcpcd-hooks/70-net-conf /usr/lib/dhcpcd/dhcpcd-hooks/70-net-conf
mkdir -p "${DESTDIR}/var/lib/dhcpcd"
mkdir -p "${DESTDIR}/etc"
cat >"${DESTDIR}/etc/dhcpcd.conf" <<EOF
# Options from default configuration
persistent
vendorclassid
option domain_name_servers, domain_name, domain_search
option classless_static_routes
option interface_mtu
option host_name
option rapid_commit
require dhcp_server_identifier
slaac private
# initramfs-tools specific options
duid ll
env hostname_fqdn=no
EOF
grep ^dhcpcd: /etc/passwd >>"${DESTDIR}/etc/passwd" || true
# find the multiarch lib dir (for example /lib/x86_64-linux-gnu)
multiarch_dir=$(ldd /usr/sbin/dhcpcd | sed -En 's;^.*/lib(/lib[^/]*prof)?/([^/]+)/libc\.so\..*$;\2;p')
copy_exec "/usr/lib/${multiarch_dir}/dhcpcd/dev/udev.so"