I had a working recent Debian image flashed to one of my HiKey960 boards, when I decided to “optimise” it and “move” /home
and /usr
from the internal flash memory to the SD card. Namely, I created /etc/fstab
as follows:
# device mountpoint filesystem options backup fsck
/dev/mmcblk0p1 none swap defaults 0 0
/dev/mmcblk0p2 /sd ext4 defaults 0 0
/sd/usr /usr none defaults,bind 0 0
/sd/home /home none defaults,bind 0 0
/sd/var /var none defaults,bind 0 0
/sd/tmp /tmp none defaults,bind 0 0
and copied /usr
to /sd/usr
, etc., using rsync
. Furthermore, I removed the original /usr
directory from the flash memory.
Unfortunately, on reboot, I got:
[ 4.597675] Btrfs loaded, crc32c=crc32c-generic
Scanning for Btrfs filesystems
done.
Begin: Will now check root file system ... fsck from util-linux 2.29.2
[/sbin/fsck.ext4 (1) -- /dev/sdd13] fsck.ext4 -a -C0 /dev/sdd13
rootfs: clean, 144975/1531648 files, 1282125/6309888 blocks
done.
[ 4.722658] EXT4-fs (sdd13): mounted filesystem with ordered data mode. Opts: (null)
done.
Begin: Mounting /usr file system ... mount: No such file or directory
done.
Begin: Running /scripts/local-bottom ... done.
Begin: Running /scripts/init-bottom ... done.
/sbin/init: error while loading shared libraries: liblz4.so.1: cannot open shared object file: No such file or directory
[ 4.815298] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00007f00
[ 4.815298]
[ 4.824450] CPU: 6 PID: 1 Comm: init Tainted: G S 4.15-hikey #1
[ 4.831581] Hardware name: HiKey960 (DT)
[ 4.835498] Call trace:
[ 4.837951] dump_backtrace+0x0/0x198
[ 4.841609] show_stack+0x14/0x20
[ 4.844923] dump_stack+0x98/0xb8
[ 4.848235] panic+0x114/0x27c
[ 4.851284] do_exit+0x95c/0x960
[ 4.854505] do_group_exit+0x34/0x98
[ 4.858075] __wake_up_parent+0x0/0x28
[ 4.861819] el0_svc_naked+0x20/0x24
[ 4.865393] SMP: stopping secondary CPUs
[ 4.869548] Kernel Offset: disabled
[ 4.873031] CPU features: 0x082004
[ 4.876425] Memory Limit: none
[ 4.879487] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00007f00
[ 4.879487]
[ 4.889422] WARNING: CPU: 6 PID: 1 at kernel/sched/core.c:1188 set_task_cpu+0x128/0x130
[ 4.897423] Modules linked in: btrfs xor zstd_decompress zstd_compress xxhash raid6_pq
[ 4.905350] CPU: 6 PID: 1 Comm: init Tainted: G S 4.15-hikey #1
[ 4.912480] Hardware name: HiKey960 (DT)
[ 4.916397] pstate: 60000085 (nZCv daIf -PAN -UAO)
[ 4.921183] pc : set_task_cpu+0x128/0x130
[ 4.925186] lr : try_to_wake_up+0x13c/0x3c0
[ 4.929362] sp : ffff000008033d20
[ 4.932669] x29: ffff000008033d20 x28: ffff0000090c9000
[ 4.937977] x27: ffff0000090e6c80 x26: 0000000000000000
[ 4.943284] x25: ffff0000090af000 x24: ffff0000090c9000
[ 4.948591] x23: 0000000000000080 x22: ffff8000bbe5ed7c
[ 4.953897] x21: 0000000000000004 x20: 0000000000000000
[ 4.959204] x19: ffff8000bbe5e580 x18: 0000000000000010
[ 4.964510] x17: 0000000000000000 x16: 0000000000000000
[ 4.969817] x15: 0000000000000000 x14: 0000000000000400
[ 4.975123] x13: 0000000000000000 x12: 0000000000000000
[ 4.980430] x11: ffff000008ac17f0 x10: ffff8000bffb0200
[ 4.985736] x9 : 0000000000000000 x8 : 0000000000000007
[ 4.991043] x7 : 000000000000034c x6 : ffff8000b9f49300
[ 4.996349] x5 : 00000000000000ff x4 : 0000000000000000
[ 5.001656] x3 : 0000000000000000 x2 : ffffffffffffffff
[ 5.006962] x1 : ffff0000090c9df0 x0 : 0000000000000040
[ 5.012269] Call trace:
[ 5.014707] set_task_cpu+0x128/0x130
[ 5.018363] try_to_wake_up+0x13c/0x3c0
[ 5.022191] wake_up_process+0x14/0x20
[ 5.025936] swake_up_locked+0x28/0x50
[ 5.029678] swake_up+0x20/0x38
[ 5.032815] rcu_gp_kthread_wake+0x34/0x48
[ 5.036907] note_gp_changes+0x84/0xb8
[ 5.040650] rcu_process_callbacks+0xb0/0x3f8
[ 5.045000] __do_softirq+0x114/0x214
[ 5.048656] irq_exit+0xc8/0xf8
[ 5.051792] __handle_domain_irq+0x60/0xb8
[ 5.055881] gic_handle_irq+0x58/0xb0
[ 5.059536] el1_irq+0xb0/0x128
[ 5.062670] panic+0x230/0x27c
[ 5.065717] do_exit+0x95c/0x960
[ 5.068938] do_group_exit+0x34/0x98
[ 5.072507] __wake_up_parent+0x0/0x28
[ 5.076248] el0_svc_naked+0x20/0x24
[ 5.079817] ---[ end trace 7d2b1daab1ca0cfd ]---
The way I interpret this the kernel tries to use liblz4.so.1
from /usr
before the SD card gets mounted, but it fails as the original /usr
no longer exists.
I thought that I only had to reflash rootfs to fix this, but unfortunately I have now tried many things but still can’t make it work. Please help!