"manifests/base/firmware/manifests/base/firmware/uboot.pp" did not exist on "7c308bde1aa35eecab658036c226eb82850d9853"
Commit b2582449 authored by James T. Lee's avatar James T. Lee
Browse files

Build Trusted Firmware-A for Pinebook Pro

parent c95b9c66
class nest::base::firmware { class nest::base::firmware {
package { 'sys-kernel/linux-firmware': case $facts['profile']['platform'] {
ensure => installed, 'beagleboneblack': {
} contain '::nest::base::firmware::uboot'
$files = {
'manjaro/brcm/BCM4345C5.hcd' => ['pinebookpro'],
'plugable/brcm/BCM20702A1-0a5c-21e8.hcd' => ['haswell'],
'raspberrypi/brcm/BCM4345C5.hcd' => ['raspberrypi'],
'raspberrypi/brcm/brcmfmac43456-sdio.bin' => ['pinebookpro', 'raspberrypi'],
'raspberrypi/brcm/brcmfmac43456-sdio.clm_blob' => ['pinebookpro', 'raspberrypi'],
'raspberrypi/brcm/brcmfmac43456-sdio.txt' => ['pinebookpro', 'raspberrypi'],
}
$files_categorized = $files.reduce([{}, {}]) |$memo, $file| {
$present = $memo[0]
$absent = $memo[1]
$source = $file[0]
$platforms = $file[1]
$target = regsubst($file[0], '^[^/]*/', '')
if $facts['profile']['platform'] in $platforms {
[$present + { $target => $source }, $absent]
} else {
[$present, $absent + { $target => $source }]
} }
}
$files_present = $files_categorized[0] 'pinebookpro': {
$files_absent = $files_categorized[1] - $files_categorized[0] contain '::nest::base::firmware::arm'
contain '::nest::base::firmware::uboot'
$files_present.each |$target, $source| { Class['nest::base::firmware::arm']
file { "/lib/firmware/${target}": ~> Class['nest::base::firmware::uboot']
mode => '0644',
owner => 'root',
group => 'root',
source => "puppet:///modules/nest/firmware/${source}",
# Makes the directory structure
require => Package['sys-kernel/linux-firmware'],
} }
}
$files_absent.each |$target, $source| { 'raspberrypi': {
file { "/lib/firmware/${target}": contain '::nest::base::firmware::raspberrypi'
ensure => absent,
} }
} }
} }
class nest::base::firmware::arm {
nest::lib::toolchain { 'arm-none-eabi':
gcc_only => true,
}
vcsrepo { '/usr/src/arm-trusted-firmware':
ensure => present,
provider => git,
source => 'https://github.com/ARM-software/arm-trusted-firmware.git',
revision => 'v2.4',
}
include '::nest::base::portage'
exec { "/usr/bin/make ${::nest::base::portage::makeopts} PLAT=rk3399":
cwd => '/usr/src/arm-trusted-firmware',
path => ['/usr/lib/distcc/bin', '/usr/bin', '/bin'],
environment => 'HOME=/root', # for distcc
timeout => 0,
refreshonly => true,
subscribe => Vcsrepo['/usr/src/arm-trusted-firmware'],
require => Nest::Lib::Toolchain['arm-none-eabi'],
}
}
class nest::base::firmware::raspberrypi {
}
class nest::base::firmware::uboot {
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment