[SOLVED] Package linux-odroid-c2 does not run scripts in /etc/kernel/postinst.d/

Post Reply
User avatar
mad_ady
Posts: 6860
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 236 times
Been thanked: 177 times
Contact:

[SOLVED] Package linux-odroid-c2 does not run scripts in /etc/kernel/postinst.d/

Unread post by mad_ady » Tue Mar 19, 2019 8:05 pm

So, I've migrated to kernel 3.16 from 3.14 on my C2s and the steps were:

Code: Select all

$ sudo apt-get remove linux-image-c2 linux-headers-c2 linux-image-3.14.79-117 linux-headers-3.14.79-117
$ sudo apt-get install linux-odroid-c2
The kernel boots fine, however I had some custom scripts that modified the dtb on new kernel install located at /etc/kernel/postinst.d/ which are no longer called when the kernel package is installed. DKMS is also affected:

Code: Select all

root@uy-scuti:~# apt-get install --reinstall linux-odroid-c2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libcec4 libp8-platform2
Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 0 B/18.1 MB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 259068 files and directories currently installed.)
Preparing to unpack .../linux-odroid-c2_3.16.63-38_arm64.deb ...
Unpacking linux-odroid-c2 (3.16.63-38) over (3.16.63-38) ...
Setting up linux-odroid-c2 (3.16.63-38) ...
update-initramfs: Generating /boot/initrd.img-3.16.63-38
I: The initramfs will attempt to resume from /dev/zram3
I: (UUID=97917b32-cc84-4986-a6fa-700810e3c761)
I: Set the RESUME variable to override this.
Image Name:   uInitrd
Created:      Tue Mar 19 12:51:49 2019
Image Type:   AArch64 Linux RAMDisk Image (uncompressed)
Data Size:    11885819 Bytes = 11607.25 KiB = 11.34 MiB
Load Address: 00000000
Entry Point:  00000000
root@uy-scuti:~# ls -l /etc/kernel/postinst.d/
total 28
-rwxr-xr-x 1 root root 2903 Mar 11 11:34 apt-auto-removal
-rwxr-xr-x 1 root root 1120 Jul 14  2011 dkms
-rwxr-xr-x 1 root root  341 May  2  2017 i2s-disable
-rwxr-xr-x 1 root root  868 Sep 27 19:21 initramfs-tools
-rwxr-xr-x 1 root root  406 Jan  6  2018 onewire-gpio
-rwxr-xr-x 1 root root  196 Jul 10  2014 pm-utils
-rwxr-xr-x 1 root root  185 Nov 27 18:20 unattended-upgrades
lrwxrwxrwx 1 root root   49 Jan 17 16:17 update-notifier -> /usr/share/update-notifier/notify-reboot-required
root@uy-scuti:~# cat /etc/kernel/postinst.d/onewire-gpio
#!/bin/bash

#set 1wire gpio for Odroid C2 after each kernel update
#requires device-tree-compiler
# sudo apt-get install device-tree-compiler

#https://forum.odroid.com/viewtopic.php?f=136&t=29383&p=209884#p209884
echo "Setting 1wire GPIO to J7 header"
/usr/bin/fdtput /media/boot/meson64_odroidc2.dtb /onewire gpios 37 10 0

The older 3.14 kernel packages were running those scripts, so I'm guessing something is missing in the package?
Last edited by mad_ady on Fri Nov 22, 2019 8:41 pm, edited 1 time in total.

User avatar
mad_ady
Posts: 6860
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 236 times
Been thanked: 177 times
Contact:

Re: Package linux-odroid-c2 does not run scripts in /etc/kernel/postinst.d/

Unread post by mad_ady » Fri Nov 22, 2019 8:41 pm

Sorry to bump this, but I thought I had already solved it.

My workaround for the problem is to put the kernel postinstall script in /usr/share/initramfs-tools/hooks/ and it gets called by initramfs which gets called on new kernel installs.
I think meveric pointed me to it a while ago, so thanks!

Post Reply

Return to “Issues”

Who is online

Users browsing this forum: No registered users and 1 guest