mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-05-10 01:08:28 +02:00
installer: Rework downloading ISO and allow using a custom URL
This commit is contained in:
@@ -12,21 +12,45 @@
|
||||
#
|
||||
########################################################################
|
||||
|
||||
dhcpcd_up()
|
||||
{
|
||||
LEASE_FILE="/var/ipfire/dhcpc/dhcpcd-${interface}.info"
|
||||
|
||||
export_lease() {
|
||||
set | grep "^new_" | sed "s|^new_||g" | \
|
||||
sed "s|'||g" | \
|
||||
sort > /var/ipfire/dhcpc/dhcpcd-$interface.info
|
||||
|
||||
DNS=`grep "domain_name_servers" /var/ipfire/dhcpc/dhcpcd-$interface.info | cut -d"=" -f2`
|
||||
DNS1=`echo $DNS | cut -d" " -f1`
|
||||
DNS2=`echo $DNS | cut -d" " -f2`
|
||||
|
||||
echo "nameserver $DNS1" > /etc/resolv.conf
|
||||
echo "nameserver $DNS2" >> /etc/resolv.conf
|
||||
|
||||
sed "s|'||g" | sort > ${LEASE_FILE}
|
||||
}
|
||||
|
||||
case "$reason" in
|
||||
BOUND|INFORM|REBIND|REBOOT|RENEW|TIMEOUT|STATIC) dhcpcd_up;;
|
||||
make_resolvconf() {
|
||||
local DNS="$(grep 'domain_name_servers' ${LEASE_FILE} | cut -d'=' -f2)"
|
||||
local DNS1="$(echo ${DNS} | cut -d' ' -f1)"
|
||||
local DNS2="$(echo ${DNS} | cut -d' ' -f2)"
|
||||
|
||||
(
|
||||
echo "nameserver ${DNS1}"
|
||||
echo "nameserver ${DNS2}"
|
||||
) > /etc/resolv.conf
|
||||
}
|
||||
|
||||
case "${reason}" in
|
||||
PREINIT)
|
||||
# Configure MTU
|
||||
if [ -n "${new_interface_mtu}" ] && [ ${new_interface_mtu} -gt 576 ]; then
|
||||
echo "Setting MTU to ${new_interface_mtu}"
|
||||
ip link set "${interface}" mtu "${new_interface_mtu}"
|
||||
fi
|
||||
;;
|
||||
|
||||
BOUND|INFORM|REBIND|REBOOT|RENEW|TIMEOUT|STATIC)
|
||||
# Export all information about the newly received lease
|
||||
# to file
|
||||
export_lease
|
||||
|
||||
# Create system configuration files
|
||||
make_resolvconf
|
||||
;;
|
||||
|
||||
EXPIRE|FAIL|IPV4LL|NAK|NOCARRIER|RELEASE|STOP)
|
||||
rm -f "${LEASE_FILE}"
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -35,17 +35,18 @@ install() {
|
||||
inst_multiple tar gzip lzma xz
|
||||
|
||||
# Networking
|
||||
inst_multiple dhcpcd ethtool hostname ip ping wget
|
||||
inst_multiple dhcpcd ethtool hostname ip ping sort wget
|
||||
inst /usr/bin/start-networking.sh
|
||||
inst /var/ipfire/dhcpc/dhcpcd-run-hooks
|
||||
inst /var/ipfire/dhcpc/dhcpcd.conf
|
||||
for file in /var/ipfire/dhcpc/dhcpcd-hooks/*; do
|
||||
inst "${file}"
|
||||
done
|
||||
inst /var/ipfire/dhcpc/dhcpcd-run-hooks
|
||||
inst "$moddir/70-dhcpcd.exe" "/var/ipfire/dhcpc/dhcpcd-hooks/70-dhcpcd.exe"
|
||||
|
||||
inst /etc/host.conf /etc/hosts /etc/protocols
|
||||
inst /etc/nsswitch.conf /etc/resolv.conf
|
||||
inst_libdir_file "libnss_dns.so.*"
|
||||
|
||||
# Misc. tools
|
||||
inst_multiple cut grep eject killall md5sum touch
|
||||
inst_multiple cut grep eject id killall md5sum touch
|
||||
inst_multiple -o fdisk cfdisk df ps top
|
||||
|
||||
# Hardware IDs
|
||||
|
||||
Reference in New Issue
Block a user