Yocto: Install different config files based on MACHINE type or target image

后端 未结 3 1237
悲&欢浪女
悲&欢浪女 2020-12-20 07:15

I\'ve got a couple of HW platforms (same cpu, etc.) that require different asound.conf files.

The way that I\'m controlling the target platform is via the MACHINE va

3条回答
  •  不思量自难忘°
    2020-12-20 07:56

    The above answer by clsulliv worked better than advertised. For future reference below is the append file I used:

    FILESEXTRAPATHS_prepend:= "${THISDIR}/${PN}:"
    
    SRC_URI += " \
       file://machine1_asound.conf \
       file://machine2_asound.conf \
       "
    
    
    do_install_append_machine1() {
    
        echo "    machine1"
        echo "    installing ${WORKDIR}/machine1_asound.conf to ${D}${sysconfdir}/asound.conf"
        install -m 644 ${WORKDIR}/machine1_asound.conf ${D}${sysconfdir}/asound.conf
    }
    
    
    do_install_append_machine2() {
    
        echo "    machine2"
        echo "    installing ${WORKDIR}/machine2_asound.conf to ${D}${sysconfdir}/asound.conf"
        install -m 644 ${WORKDIR}/machine2_asound.conf ${D}${sysconfdir}/asound.conf
    }
    

    Thanks for the help!

提交回复
热议问题