mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-08-01 15:07:49 +00:00
Merge pull request #1764 from chrisnovakovic/initramfs-enable-dns
initramfs: enable DNS if network is up
This commit is contained in:
commit
c023719429
3
packages/devel/glibc/config/nsswitch-init.conf
Normal file
3
packages/devel/glibc/config/nsswitch-init.conf
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# This is just enough to get DNS resolution working in the initramfs
|
||||||
|
|
||||||
|
hosts: dns
|
@ -159,7 +159,7 @@ post_makeinstall_target() {
|
|||||||
|
|
||||||
# create default configs
|
# create default configs
|
||||||
mkdir -p $INSTALL/etc
|
mkdir -p $INSTALL/etc
|
||||||
cp $PKG_DIR/config/nsswitch.conf $INSTALL/etc
|
cp $PKG_DIR/config/nsswitch-target.conf $INSTALL/etc/nsswitch.conf
|
||||||
cp $PKG_DIR/config/host.conf $INSTALL/etc
|
cp $PKG_DIR/config/host.conf $INSTALL/etc
|
||||||
cp $PKG_DIR/config/gai.conf $INSTALL/etc
|
cp $PKG_DIR/config/gai.conf $INSTALL/etc
|
||||||
|
|
||||||
@ -184,8 +184,16 @@ makeinstall_init() {
|
|||||||
cp -PR $PKG_BUILD/.$TARGET_NAME/math/libm.so* $INSTALL/usr/lib
|
cp -PR $PKG_BUILD/.$TARGET_NAME/math/libm.so* $INSTALL/usr/lib
|
||||||
cp -PR $PKG_BUILD/.$TARGET_NAME/nptl/libpthread.so* $INSTALL/usr/lib
|
cp -PR $PKG_BUILD/.$TARGET_NAME/nptl/libpthread.so* $INSTALL/usr/lib
|
||||||
cp -PR $PKG_BUILD/.$TARGET_NAME/rt/librt.so* $INSTALL/usr/lib
|
cp -PR $PKG_BUILD/.$TARGET_NAME/rt/librt.so* $INSTALL/usr/lib
|
||||||
|
cp -PR $PKG_BUILD/.$TARGET_NAME/resolv/libnss_dns.so* $INSTALL/usr/lib
|
||||||
|
cp -PR $PKG_BUILD/.$TARGET_NAME/resolv/libresolv.so* $INSTALL/usr/lib
|
||||||
|
|
||||||
if [ "$TARGET_ARCH" = "arm" -a "$TARGET_FLOAT" = "hard" ]; then
|
if [ "$TARGET_ARCH" = "arm" -a "$TARGET_FLOAT" = "hard" ]; then
|
||||||
ln -sf ld.so $INSTALL/usr/lib/ld-linux.so.3
|
ln -sf ld.so $INSTALL/usr/lib/ld-linux.so.3
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
post_makeinstall_init() {
|
||||||
|
# create default configs
|
||||||
|
mkdir -p $INSTALL/etc
|
||||||
|
cp $PKG_DIR/config/nsswitch-init.conf $INSTALL/etc/nsswitch.conf
|
||||||
|
}
|
||||||
|
@ -1003,6 +1003,10 @@
|
|||||||
[ -f "/sysroot/usr/lib/systemd/systemd" ] || error "final_check" "Could not find systemd!"
|
[ -f "/sysroot/usr/lib/systemd/systemd" ] || error "final_check" "Could not find systemd!"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# If the network is up (due to the use of the "ip" kernel parameter) and a DNS
|
||||||
|
# server is known, allow the libc resolver to use it
|
||||||
|
grep '^\(nameserver\|domain\) ' /proc/net/pnp | grep -v '^nameserver 0\.0\.0\.0$' > /etc/resolv.conf
|
||||||
|
|
||||||
if [ "${boot%%=*}" = "FILE" ]; then
|
if [ "${boot%%=*}" = "FILE" ]; then
|
||||||
error "check arguments" "boot argument can't be FILE type..."
|
error "check arguments" "boot argument can't be FILE type..."
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user