Welcome! Log In Create A New Profile

Advanced

fw_printenv+depmod errors, startup script [pogoplug e02]

Posted by jst818 
fw_printenv+depmod errors, startup script [pogoplug e02]
January 24, 2020 04:50AM
Due irreversibly corrupted ext3 roofs did restore from old copy (used this method for backup/restore https://forum.doozan.com/read.php?2,12096,24034#msg-24034 and installing kernel 5.4.2 , now i am getting some errors (and unable to resolve them).

One of them is output result for command fw_printenv, which is "command not found".
Should be something like this https://forum.doozan.com/read.php?2,93254 .
Before backup/restore it was doing fine.

Packages u-boot-tools, uboot-envtools, uboot-mkimage are installed.


Second one i noticed during
apt-get update && apt-get upgrade && apt-get dist-upgrade && apt-get autoremove && apt-get autoclean

/var/log/apt/term.log
there are a lot of depmod errors
Quote

update-initramfs: Generating /boot/initrd.img-5.1.0-kirkwood-tld-1
depmod: ERROR: ../libkmod/libkmod.c:515 lookup_builtin_file() could not open builtin file '/var/tmp/mkinitramfs_cmd2tx/lib/modules/5.1.0-kirkwood-tld-1/modules.builtin.bin'
depmod: ERROR: ../libkmod/libkmod.c:515 lookup_builtin_file() could not open builtin file '/var/tmp/mkinitramfs_cmd2tx/lib/modules/5.1.0-kirkwood-tld-1/modules.builtin.bin'
depmod: ERROR: ../libkmod/libkmod.c:515 lookup_builtin_file() could not open builtin file '/var/tmp/mkinitramfs_cmd2tx/lib/modules/5.1.0-kirkwood-tld-1/modules.builtin.bin'
depmod: ERROR: ../libkmod/libkmod.c:515 lookup_builtin_file() could not open builtin file '/var/tmp/mkinitramfs_cmd2tx/lib/modules/5.1.0-kirkwood-tld-1/modules.builtin.bin'
At this time i still had installed/running kernel 5.1.0, (now 5.4.2).


Third one: since kernel 5.x there is systemd responsible for startup of apps/services, i am unable to add one script to be started after boot.
Followed this guide: https://linuxconfig.org/how-to-automatically-execute-shell-script-at-startup-boot-on-systemd-linux


touch /etc/systemd/system/startup.service
[Unit]
After=networking.service

[Service]
ExecStart=/root/startup.sh

[Install]
WantedBy=default.target

Startup shell script
/root/startup.sh
#!/bin/sh

hdparm -B 255 /dev/sda
ntpdate -u 0.europe.pool.ntp.org
openvpn --config /etc/openvpn/my_vpnprovider.ovpn --daemon --log /tmp/openvpn.log
//With "#!/bin/bash" got the same result.


Next steps:
//Configure and Install
chmod 744 /root/startup.sh
chmod 664 /etc/systemd/system/startup.service

systemctl daemon-reload
systemctl enable startup.service
systemctl start startup.service

After reboot to test it - script works a couple of minutes, openvpn is not visible on "ps aux | grep vpn" ;
if i do
systemctl status startup.service
i got notification that script has just been killed.
1st and 2nd command in script are ran/stop, 3rd should be running as deamon in bakcground whole time after boot.


After some poking around I gave up on systemd
and tryed with crontab @reboot /full_path/to/script https://learn.pimoroni.com/tutorial/sandyj/running-scripts-at-boot
it is not working either.
crontab service is otherwise running and doing some other stuff on daily basis.

In the end i found quick&dirty method with addding /full_path/to/script /etc/rc.local (before "exit 0") and doing "chmod +x /etc/rc.local"
but this is not what i prefer.
------------
HW pogoplug e02, kernel from https://forum.doozan.com/read.php?2,12096 , sources.apt are from bullseye

/etc/apt/sources.list
deb http://deb.debian.org/debian/ bullseye  main contrib non-free
deb-src http://deb.debian.org/debian/ bullseye  main contrib non-free

deb http://deb.debian.org/debian/ bullseye-updates main contrib non-free
deb-src http://deb.debian.org/debian/ bullseye-updates main contrib non-free

U-Boot is 2017.07
strings /dev/mtd0 | grep U-Boot
U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:13:18 -0700)

Should i provide anything more specific please tell what you need.



Edited 3 time(s). Last edit at 01/24/2020 05:00AM by jst818.
Re: fw_printenv+depmod errors, startup script [pogoplug e02]
January 24, 2020 01:08PM
jst818,

What would recommend is to restore the rootfs to when you still have sysvinit, and do Debian upgrade to bullseye (if it is already bullseye then do apt-get upgrade).

After it is done, you can choose to activate systemd or staying with sysvinit.

-bodhi
===========================
Forum Wiki
bodhi's corner
Author:

Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: