| Server IP : 195.134.90.114 / Your IP : 216.73.217.154 Web Server : Apache/2.4.58 System : Linux nepub 6.8.0-88-generic #89-Ubuntu SMP PREEMPT_DYNAMIC Sat Oct 11 01:02:46 UTC 2025 x86_64 User : www-data ( 33) PHP Version : 8.2.30 Disable Function : NONE 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"