So, it turns out you *do* have to modify the initramfs image, in order to
load a custom overlay file at boot. The hook for /etc/default/capemgr does
not seem to be in place for the image I'm using. Which is fine since this
is just an init script anyhow, which I feel is the wrong way to do this.
Call it personal preference.

work log:
william@beaglebone:~$ uname -r
4.4.14-ti-r34

william@beaglebone:~$ file /boot/initrd.img-4.4.14-ti-r34
/boot/initrd.img-4.4.14-ti-r34: gzip compressed data, last modified: Sat
Jul 16 16:51:58 2016, from Unix

william@beaglebone:~$ ls /boot |grep 4.4.14-ti-r34
System.map-4.4.14-ti-r34
config-4.4.14-ti-r34
initrd.img-4.4.14-ti-r34
vmlinuz-4.4.14-ti-r34

william@beaglebone:~$ cp /boot/initrd.img-4.4.14-ti-r34 .

explore:
william@beaglebone:~$ sudo mount -t sysfs initrd.img-4.4.14-ti-r34
/home/william/temp/
william@beaglebone:~$ cd temp/
william@beaglebone:~/temp$ cd ..
william@beaglebone:~$ sudo umount temp/

william@beaglebone:~$ cd dev
william@beaglebone:~/dev$ mkdir initrd
william@beaglebone:~/dev/initrd$ cp ../../initrd.img-4.4.14-ti-r34 .

william@beaglebone:~/dev/initrd$ gunzip -c initrd.img-4.4.14-ti-r34 | file -
/dev/stdin: ASCII cpio archive (SVR4 with no CRC)

william@beaglebone:~/dev/initrd$ gunzip -c initrd.img-4.4.14-ti-r34 | cpio
-i
21618 blocks

william@beaglebone:~/dev/initrd$ ls -l
total 4728
drwxr-xr-x 2 william nogroup    4096 Oct 15 08:01 bin
drwxr-xr-x 3 william nogroup    4096 Oct 15 08:01 conf
drwxr-xr-x 5 william nogroup    4096 Oct 15 08:01 etc
-rwxr-xr-x 1 william nogroup    7137 Oct 15 08:01 init
-rw-r--r-- 1 william nogroup 4801412 Oct 15 07:55 initrd.img-4.4.14-ti-r34
drwxr-xr-x 8 william nogroup    4096 Oct 15 08:01 lib
drwxr-xr-x 2 william nogroup    4096 Oct 15 08:01 run
drwxr-xr-x 2 william nogroup    4096 Oct 15 08:01 sbin
drwxr-xr-x 5 william nogroup    4096 Oct 15 08:01 scripts

william@beaglebone:~/dev/initrd$ ls lib/firmware/
william@beaglebone:~/dev/initrd$ rm lib/firmware/*.dtbo
william@beaglebone:~/dev/initrd$ cp ../controller-00A0.dtbo ./lib/firmware/
william@beaglebone:~/dev/initrd$ ls lib/firmware/
controller-00A0.dtbo

william@beaglebone:~/dev/initrd$ rm initrd.img-4.4.14-ti-r34

william@beaglebone:~/dev/initrd$ sudo find . | cpio -H newc -o | gzip -9 >
../../initrd.img-4.4.14-ti-r34
20126 blocks

william@beaglebone:~/dev/initrd$ du ../../initrd.img-4.4.14-ti-r34
4552    ../../initrd.img-4.4.14-ti-r34
william@beaglebone:~/dev/initrd$ du /boot/initrd.img-4.4.14-ti-r34
4692    /boot/initrd.img-4.4.14-ti-r34

william@beaglebone:~/dev/initrd$ cd ..
william@beaglebone:~/dev$ sudo cp /boot/initrd.img-4.4.14-ti-r34 .
william@beaglebone:~/dev$ ls |grep initrd
initrd
initrd.img-4.4.14-ti-r34
william@beaglebone:~/dev$ cd ..
william@beaglebone:~$ sudo rm /boot/initrd.img-4.4.14-ti-r34
william@beaglebone:~$ sudo cp initrd.img-4.4.14-ti-r34 /boot/
william@beaglebone:~$ ls -l /boot/
total 62368
-rw-r--r-- 1 root root     492 May  1 13:17 SOC.sh
-rw-r--r-- 1 root root 3300781 Jul  5 22:44 System.map-4.4.14-ti-r34
-rw-r--r-- 1 root root 3313309 Jul  5 22:49 System.map-4.4.14-ti-rt-r34
-rw-r--r-- 1 root root 3308481 Apr 27 15:33 System.map-4.4.8-ti-r22
-rw-r--r-- 1 root root 3217126 May  5 08:49 System.map-4.4.9-bone-rt-r10
-rw-r--r-- 1 root root  147440 Jul  5 22:44 config-4.4.14-ti-r34
-rw-r--r-- 1 root root  147105 Jul  5 22:49 config-4.4.14-ti-rt-r34
-rw-r--r-- 1 root root  143808 Apr 27 15:33 config-4.4.8-ti-r22
-rw-r--r-- 1 root root  141837 May  5 08:49 config-4.4.9-bone-rt-r10
drwxr-xr-x 6 root root    4096 Jul 16 16:51 dtbs
-rw-r--r-- 1 root root 4653669 Oct 15 10:03 initrd.img-4.4.14-ti-r34
-rw-r--r-- 1 root root 4820956 Jul 18 14:08 initrd.img-4.4.14-ti-rt-r34
-rw-r--r-- 1 root root 4770865 Jun  2 12:01 initrd.img-4.4.8-ti-r22
-rw-r--r-- 1 root root 4770871 Jun  2 12:15 initrd.img-4.4.9-bone-rt-r10
-rw-r--r-- 1 root root    1256 Oct 13 22:15 uEnv.txt
drwxr-xr-x 2 root root    4096 May  1 10:25 uboot
-rwxr-xr-x 1 root root 7779712 Jul  5 22:44 vmlinuz-4.4.14-ti-r34
-rwxr-xr-x 1 root root 7875600 Jul  5 22:49 vmlinuz-4.4.14-ti-rt-r34
-rwxr-xr-x 1 root root 7824792 Apr 27 15:33 vmlinuz-4.4.8-ti-r22
-rwxr-xr-x 1 root root 7608888 May  5 08:49 vmlinuz-4.4.9-bone-rt-r10

william@beaglebone:~$ sudo nano /boot/uEnv.txt
. . .

##Example v4.1.x
#cape_disable=bone_capemgr.disable_partno=
cape_enable=bone_capemgr.enable_partno=controller

. . .


william@beaglebone:~$ sudo reboot
william@beaglebone:~$ dmesg |grep controller
[    0.000000] Kernel command line: console=tty0 console=ttyO0,115200n8
bone_capemgr.enable_partno=controller root=/dev/mmcblk0p1 rootfstype=ext4
rootwait coherent_pool=1M quiet cape_universal=enable ipv6.disable=1
[    2.406540] bone_capemgr bone_capemgr: enabled_partno PARTNO
'controller' VER 'N/A' PR '0'
[    2.406580] bone_capemgr bone_capemgr: slot #4: 'Override Board
Name,00A0,Override Manuf,controller'
[    2.493083] bone_capemgr bone_capemgr: slot #4 dtbo
controller-00A0.dtbo' loaded; overlay id #0

Since I enable all three dual channel PWM's I figure checking the sysfs
structure would also be a good indication:

william@beaglebone:~$ ls /sys/class/pwm/
pwmchip0  pwmchip2  pwmchip4


Strictly speaking:
explore:
william@beaglebone:~$ sudo mount -t sysfs initrd.img-4.4.14-ti-r34
/home/william/temp/
william@beaglebone:~$ cd temp/
william@beaglebone:~/temp$ cd ..
william@beaglebone:~$ sudo umount temp/

and . . .


william@beaglebone:~/dev/initrd$ rm lib/firmware/*.dtbo

are not required steps. Just me exploring, and the last bit here I do not
require the stock overlay files for this system image . . .

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CALHSORphiWSkhi3iQpQcwu3QVMGy%2B9eYnpXthYmnzmAr6UhSYQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to