meta-digi-del: Fix netbase postinst to work also in target install.

https://jira.digi.com/browse/DEL-428

Signed-off-by: Alex Gonzalez <alex.gonzalez@digi.com>
This commit is contained in:
Alex Gonzalez 2013-05-17 16:59:28 +02:00
parent c2da364830
commit 08d2833e27
1 changed files with 18 additions and 12 deletions

View File

@ -17,22 +17,28 @@ do_install_append(){
pkg_postinst_${PN} () { pkg_postinst_${PN} () {
#!/bin/sh #!/bin/sh
cat << EOF > $D${sysconfdir}/network/interfaces INTERFACES_PATH=$D/etc/network/interfaces
EOF if test "x$D" != "x"; then
KERNEL_CONFIG_PATH=${STAGING_KERNEL_DIR}/.config
else
KERNEL_CONFIG_PATH=/boot/config*
fi
/bin/grep -q "CONFIG_BLK_DEV_LOOP=" ${STAGING_KERNEL_DIR}/.config > ${INTERFACES_PATH}
/bin/grep -q "CONFIG_BLK_DEV_LOOP=" ${KERNEL_CONFIG_PATH}
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
cat << EOF >> $D${sysconfdir}/network/interfaces cat << EOF >> ${INTERFACES_PATH}
# The loopback interface # The loopback interface
auto lo auto lo
iface lo inet loopback iface lo inet loopback
EOF EOF
fi fi
/bin/grep -q "CONFIG_FEC=" ${STAGING_KERNEL_DIR}/.config /bin/grep -q "CONFIG_FEC=" ${KERNEL_CONFIG_PATH}
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
# Primary wired interface # Primary wired interface
cat << EOF >> $D${sysconfdir}/network/interfaces cat << EOF >> ${INTERFACES_PATH}
auto eth0 auto eth0
# Use for dhcp # Use for dhcp
# iface eth0 inet dhcp # iface eth0 inet dhcp
@ -46,9 +52,9 @@ EOF
fi fi
# Secondary wired interface on MXC platforms # Secondary wired interface on MXC platforms
/bin/grep -q "CONFIG_SMSC911X=" ${STAGING_KERNEL_DIR}/.config /bin/grep -q "CONFIG_SMSC911X=" ${KERNEL_CONFIG_PATH}
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
cat << EOF >> $D${sysconfdir}/network/interfaces cat << EOF >> ${INTERFACES_PATH}
auto eth1 auto eth1
# Use for dhcp # Use for dhcp
# iface eth1 inet dhcp # iface eth1 inet dhcp
@ -62,9 +68,9 @@ EOF
fi fi
# Secondary wired interface on MXS platforms # Secondary wired interface on MXS platforms
/bin/grep -q "CONFIG_CCARDIMX28_ENET1=" ${STAGING_KERNEL_DIR}/.config /bin/grep -q "CONFIG_CCARDIMX28_ENET1=" ${KERNEL_CONFIG_PATH}
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
cat << EOF >> $D${sysconfdir}/network/interfaces cat << EOF >> ${INTERFACES_PATH}
auto eth1 auto eth1
# Use for dhcp # Use for dhcp
# iface eth1 inet dhcp # iface eth1 inet dhcp
@ -78,9 +84,9 @@ EOF
fi fi
# Wireless interface # Wireless interface
/bin/grep -q "CONFIG_WIRELESS=" ${STAGING_KERNEL_DIR}/.config /bin/grep -q "CONFIG_WIRELESS=" ${KERNEL_CONFIG_PATH}
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
cat << EOF >> $D${sysconfdir}/network/interfaces cat << EOF >> ${INTERFACES_PATH}
auto wlan0 auto wlan0
# Use for dhcp # Use for dhcp
# iface wlan0 inet dhcp # iface wlan0 inet dhcp