安全启动之hvb 在init阶段报错
报错日志:
[ 8.609830][ T1@C7] power_supply sc27xx-fgu: uevent: failed to send synthetic uevent
[ 8.617470][ T1@C7] [pid=1][ueventd][ERROR][ueventd.c:309]Write " /sys/devices/platform/soc/soc:aon/64400000.spi/spi_master/spi4/spi4.0/64400000.spi:pmic@0:fgu@800/power
[ 8.753418][ T1@C7] [pid=1][ueventd][ERROR][ueventd_device_handler.c:129][uevent] Failed to Restorecon " /dev/mapper/control "
[ 8.807050][ T1@C7] [pid=1][BEGET][ERROR][fs_hvb.c:523]error 0xffffffff, get ohos.boot.hvb.oem_swtype val from cmdline
[ 8.807107][ T1@C7] [pid=1][BEGET][ERROR][hvb_ops.c:82]error, Failed to open /dev/block/by-name/rvt, errno = 2
[ 8.817781][ T1@C7] [pid=1][BEGET][ERROR][hvb_ops.c:85]open /dev/block/by-name/rvt_system, fd=-1 errno = 2
rvt: error, loading data.
error verity partition: rvt
error, v[ 8.827872][ T1@C7] [pid=1][BEGET][ERROR][fs_hvb.c:184]error 0x2, hvb chain verify, vd is NULL
erity rvt partition.
[ 8.837414][ T1@C7] [pid=1][BEGET][ERROR][dm_verity.c:88]init fs hvb error, ret=2
[ 8.851519][ T1@C7] [pid=1][BEGET][ERROR][fstab_mount.c:482]set dm_verity init, ret = 0x2
[ 8.869349][ T1@C7] [pid=1][Init][WARNING][switch_root.c:162]Try to switch root in same device, skip switching root
[ 8.875577][ T1@C7] [pid=1][Init][ERROR][init.c:213]Failed to exec "/bin/init", err = 2
[ 8.893848][ T1@C7] sprd_serror_debug: panic hook handler
[ 8.893864][ T1@C7] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000ff00
[ 8.907521][ T1@C7] CPU: 7 PID: 1 Comm: init Not tainted 5.15.74 #1
[ 8.913753][ T1@C7] Hardware name: Unisoc UIS7885 Board (DT)
[ 8.919377][ T1@C7] Call trace:
[ 8.922492][ T1@C7] dump_backtrace.cfi_jt+0x0/0x8
[ 8.927252][ T1@C7] show_stack+0x28/0x38
[ 8.931232][ T1@C7] dump_stack_lvl+0x80/0xc8
[ 8.935560][ T1@C7] panic+0x184/0x448
[ 8.939281][ T1@C7] do_exit+0x7e8/0x98c
[ 8.943175][ T1@C7] do_group_exit+0xa8/0xb0
[ 8.947416][ T1@C7] __do_sys_waitid+0x0/0xa8c
[ 8.951828][ T1@C7] __wake_up_parent+0x0/0x40
[ 8.956243][ T1@C7] __se_sys_exit_group+0x0/0x1c
[ 8.960915][ T1@C7] invoke_syscall+0x68/0x178
[ 8.965329][ T1@C7] el0_svc_common.llvm.16694263722444070084+0xd4/0x120
[ 8.971993][ T1@C7] do_el0_svc+0x34/0xac
[ 8.975972][ T1@C7] el0_svc+0x30/0xe4
[ 8.979694][ T1@C7] el0t_64_sync_handler+0x88/0xec
[ 8.984541][ T1@C7] el0t_64_sync+0x1b4/0x1b8
[ 8.988868][ T1@C7] SMP: stopping secondary CPUs
[ 8.993961][ T0@C6] unisoc-dump-info: CPU6: stopping...
[ 8.999734][ T0@C5] unisoc-dump-info: CPU5: stopping...
[ 9.005508][ T0@C4] unisoc-dump-info: CPU4: stopping...
[ 9.011282][ T0@C3] unisoc-dump-info: CPU3: stopping...
[ 9.017644][ T0@C0] unisoc-dump-info: CPU0: stopping...
[ 9.024006][ T0@C2] unisoc-dump-info: CPU2: stopping...
[ 9.030367][ T0@C1] unisoc-dump-info: CPU1: stopping...
[ 9.036730][ T1@C7] ddr_cur_freq: 6
[ 9.041454][ T1@C7] sysdump: (sysdump_panic_event) ------ in (7)
[ 9.047464][ T1@C7] unisoc-mailbox smsg_senddie mailbox send die smsg
[ 9.053799][ T1@C7] unisoc-mailbox smsg_senddie mailbox send die smsg
[ 10.060237][ T1@C7] sysdump:
[ 10.063100][ T1@C7] sysdump: *****************************************************
[ 10.070629][ T1@C7] sysdump: * *
[ 10.078157][ T1@C7] sysdump: * Sysdump enter, preparing debug info to dump ... *
[ 10.085687][ T1@C7] sysdump: * *
[ 10.093215][ T1@C7] sysdump: *****************************************************
[ 10.100744][ T1@C7] sysdump:
[ 10.103700][ T1@C7] sysdump: reason: Attempted to kill init! exitcode=0x0000ff00, sprd_sysdump_info->crash_key: 0
[ 10.113937][ T1@C7] sysdump:
[ 10.116841][ T1@C7] sysdump: *****************************************************
[ 10.124370][ T1@C7] sysdump: * *
[ 10.131898][ T1@C7] sysdump: * Preparing debug info done ... *
[ 10.139427][ T1@C7] sysdump: * *
[ 10.146956][ T1@C7] sysdump: *****************************************************
[ 10.154485][ T1@C7] sysdump:
[ 11.157574][ T1@C7] Kernel Offset: 0x80000 from 0xffffffc008000000
[ 11.163646][ T1@C7] PHYS_OFFSET: 0x80000000
[ 11.167798][ T1@C7] CPU features: 0x2,00000b83,23300e42
[ 11.172992][ T1@C7] Memory Limit: none
1、生成rvt镜像命令:
./hvbtool.py make_rvt_image --salt 9f3a79b7f2bad5adb086bcb8cf37f991733f2696 --pubkey secureboot_key/config/rsa2048_public.pem --privkey secureboot_key/config/rsa2048_private.pem --partition rvt_a --partition_size 1048576 --algorithm SHA256_RSA2048 --rollback_index 0 --rollback_location 1 --chain_partition dtbo_a:secureboot_key/config/rsa2048_public_boot.pem --chain_partition system:secureboot_key/config/rsa2048_public_boot.pem --chain_partition vendor:secureboot_key/config/rsa2048_public_boot.pem --chain_partition l_agdsp_a:secureboot_key/config/rsa2048_public_boot.pem --chain_partition pm_sys_a:secureboot_key/config/rsa2048_public_boot.pem --output sign-img_a/rvt.img
2、dtbo_a hash签名命令
./hvbtool.py make_hash_footer --image images/dtbo.img --partition dtbo_a --partition_size 8388608 --salt 9f3a79b7f2bad5adb086bcb8cf37f991733f2696 --pubkey secureboot_key/config/rsa2048_public_boot.pem --privkey secureboot_key/config/rsa2048_private_boot.pem --algorithm SHA256_RSA2048 --rollback_index 0 --rollback_location 1 --output ./sign-img_a/signed_dtbo.img
3、system hashtree签名命令
./hvbtool.py make_hashtree_footer --image images/system.img --partition system --partition_size 3145728000 --salt 9f3a79b7f2bad5adb086bcb8cf37f991733f2696 --pubkey secureboot_key/config/rsa2048_public_boot.pem --privkey secureboot_key/config/rsa2048_private_boot.pem --algorithm SHA256_RSA2048 --rollback_index 0 --rollback_location 1 --output ./sign-img_a/signed_system.img
4、签名镜像解析:
$ ./hvbtool.py parse_image --image sign-img_a/rvt.img
Initial image length: 1048576
Image length(sign-img_a/rvt.img): 1048576 bytes
Initial image length: 1048576
[HVB footer]:
Maigc: HVB
Cert offset: 0x1000 bytes
Cert size: 1188 bytes
Image size: 3112 bytes
Partition size: 1048576 bytes
[HVB cert]:
HVB tool version: hvb tool 1.0
Original Image length: 3112 bytes
Image length: 4096 bytes (4K alignment)
Partition name: rvt_a
verity type(hash/hashtree): hash
salt size: 20 bytes
Hash algorithm: SHA256
digest size: 32 bytes
hashtree size: 0
fec size: 0
hashpayload:
salt: 9f3a79b7f2bad5adb086bcb8cf37f991733f2696
digest: 1a6338146e9b04679a136026aee3ec71b31a27cbb5de8b6549e1b1ee1f3e3a76
Algorithm: SHA256_RSA2048
Public key (sha256): 67bbe119d72c817fe1a5f0540de65561bc928b2e2589d5f27b45ce161e36f4af
[rvt info]:
Chain Partition descriptor:
Partition Name: dtbo_a
Public key (sha256): 31a36c848dfc30811e57df0e01a38f229ea2814e8117dd0dad6e591a132d1a23
Chain Partition descriptor:
Partition Name: system
Public key (sha256): 31a36c848dfc30811e57df0e01a38f229ea2814e8117dd0dad6e591a132d1a23
Chain Partition descriptor:
Partition Name: vendor
Public key (sha256): 31a36c848dfc30811e57df0e01a38f229ea2814e8117dd0dad6e591a132d1a23
Chain Partition descriptor:
Partition Name: l_agdsp_a
Public key (sha256): 31a36c848dfc30811e57df0e01a38f229ea2814e8117dd0dad6e591a132d1a23
Chain Partition descriptor:
Partition Name: pm_sys_a
Public key (sha256): 31a36c848dfc30811e57df0e01a38f229ea2814e8117dd0dad6e591a132d1a23
$ ./hvbtool.py parse_image --image sign-img_a/signed_dtbo.img
Initial image length: 8388608
Image length(sign-img_a/signed_dtbo.img): 8388608 bytes
Initial image length: 8388608
[HVB footer]:
Maigc: HVB
Cert offset: 0x1e000 bytes
Cert size: 1188 bytes
Image size: 118791 bytes
Partition size: 8388608 bytes
[HVB cert]:
HVB tool version: hvb tool 1.0
Original Image length: 118791 bytes
Image length: 122880 bytes (4K alignment)
Partition name: dtbo_a
verity type(hash/hashtree): hash
salt size: 20 bytes
Hash algorithm: SHA256
digest size: 32 bytes
hashtree size: 0
fec size: 0
hashpayload:
salt: 9f3a79b7f2bad5adb086bcb8cf37f991733f2696
digest: 1947851727801e1c44bf66d453cab41692d48cc05f2231d421d5bcfaae5d4452
Algorithm: SHA256_RSA2048
Public key (sha256): 31a36c848dfc30811e57df0e01a38f229ea2814e8117dd0dad6e591a132d1a23
$ ./hvbtool.py parse_image --image sign-img_a/signed_system.img
Initial image length: 3145728000
Image length(sign-img_a/signed_system.img): 3145728000 bytes
Initial image length: 3145728000
[HVB footer]:
Maigc: HVB
Cert offset: 0x60c18000 bytes
Cert size: 1188 bytes
Image size: 1610608640 bytes
Partition size: 3145728000 bytes
[HVB cert]:
HVB tool version: hvb tool 1.0
Original Image length: 1610608640 bytes
Image length: 1610608640 bytes (4K alignment)
Partition name: system
verity type(hash/hashtree): hashtree
salt size: 20 bytes
Hash algorithm: SHA256
digest size: 32 bytes
hashtree size: 12685312
fec size: 0
hashpayload:
salt: 9f3a79b7f2bad5adb086bcb8cf37f991733f2696
digest: d95db0a025ee73e7dd1cb7457dbb68c5500986b8b9f9e5931396a5871b96ab04
hashtree offset: 0x5ffff000
Algorithm: SHA256_RSA2048
Public key (sha256): 31a36c848dfc30811e57df0e01a38f229ea2814e8117dd0dad6e591a132d1a23
更多推荐

所有评论(0)