[Magisk] bnsmb:
Hi

the instructions from this post https://xdaforums.com/t/how-to-change-files-in-the-boot-image-using-magisk.4495645/ only work for ROMs that use a "standard" boot image with a kernel and ramdisk cpio file.

I do not have a Pixel phone to check but after checking the image files for the Pixel 6a from here

https://developers.google.com/android/images

the Pixel 6a does not use that format for the boot partition : There is only the kernel in the boot image file:

[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/test/bluejay-ap2a.240605.024/boot_image ] $ du -hs ../boot.img
24M ../boot.img
[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/test/bluejay-ap2a.240605.024/boot_image ] $

[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/test/bluejay-ap2a.240605.024/boot_image ] $ magiskboot unpack -h ../boot.img
Parsing boot image: [../boot.img]
HEADER_VER [4]
KERNEL_SZ [24967056]
RAMDISK_SZ [0]
PAGESIZE [4096]
CMDLINE []
KERNEL_FMT [lz4_legacy]
VBMETA
[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/test/bluejay-ap2a.240605.024/boot_image ] $

[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/test/bluejay-ap2a.240605.024/boot_image ] $ ls -lh *
-rw-rw-rw-. 1 xtrnaw7 xtrnaw7 9 Jun 19 15:17 header
-rw-r--r--. 1 xtrnaw7 xtrnaw7 50M Jun 19 15:17 kernel
[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/test/bluejay-ap2a.240605.024/boot_image ] $

Therefor the method described in that post does not work for that phone .

(Note that I only checked this one https://dl.google.com/dl/android/aosp/bluejay-ap2a.240605.024-factory-6fcf1c35.zip which seems to be the newest one)

This ramdisk file was created by Magisk; it contains the executable file "init" from Magisk and some other directories and files that are required by Magisk

AFAIK that error can be ignored

I checked some of the other img files in the zip file for the Pixel 6a and there is a ramdisk in the file for the partition vendor_boot:

[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/test/bluejay-ap2a.240605.024 ] $ mkdir vendor_boot_image
[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/test/bluejay-ap2a.240605.024 ] $

[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/test/bluejay-ap2a.240605.024 ] $ cd vendor_boot_image/
[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/test/bluejay-ap2a.240605.024/vendor_boot_image ] $

[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/test/bluejay-ap2a.240605.024/vendor_boot_image ] $ ls
[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/test/bluejay-ap2a.240605.024/vendor_boot_image ] $

[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/test/bluejay-ap2a.240605.024/vendor_boot_image ] $ magiskboot unpack ../image-bluejay-ap2a.240605.024/vendor_boot.img
Parsing boot image: [../image-bluejay-ap2a.240605.024/vendor_boot.img]
VENDOR_BOOT_HDR
HEADER_VER [4]
RAMDISK_SZ [30638698]
DTB_SZ [534086]
PAGESIZE [2048]
NAME []
CMDLINE [exynos_mfc.load_sequential=1 exynos_drm.load_sequential=1 pcie-exynos-core.load_sequential=1 g2d.load_sequential=1 disable_dma32=on dyndbg="func alloc_contig_dump_pages +p" earlycon=exynos4210,0x10A00000 console=ttySAC0,115200 androidboot.console=ttySAC0 printk.devkmsg=on cma_sysfs.experimental=Y swiotlb=noforce at24.write_timeout=100 log_buf_len=1024K bootconfig]
RAMDISK_FMT [raw]
VBMETA
[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/test/bluejay-ap2a.240605.024/vendor_boot_image ] $

[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/test/bluejay-ap2a.240605.024/vendor_boot_image ] $ ls -ltr
total 1
-rw-r--r--. 1 xtrnaw7 xtrnaw7 30638698 Jun 19 16:00 ramdisk.cpio
-rw-r--r--. 1 xtrnaw7 xtrnaw7 534086 Jun 19 16:00 dtb
[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/test/bluejay-ap2a.240605.024/vendor_boot_image ] $
[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/test/bluejay-ap2a.240605.024/vendor_boot_image ] $ mkdir ramdisk
[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/test/bluejay-ap2a.240605.024/vendor_boot_image ] $ cd ramdisk
[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/test/bluejay-ap2a.240605.024/vendor_boot_image/ramdisk ] $ cat ../ramdisk.cpio | lz4 -d | cpio -idm
86022 blocks
[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/test/bluejay-ap2a.240605.024/vendor_boot_image/ramdisk ] $

[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/test/bluejay-ap2a.240605.024/vendor_boot_image/ramdisk ] $ ls -ltr
total 27
-rw-r--r--. 1 xtrnaw7 xtrnaw7 3253 Jan 1 1970 vendor_service_contexts
-rw-r--r--. 1 xtrnaw7 xtrnaw7 12807 Jan 1 1970 vendor_property_contexts
-rw-r--r--. 1 xtrnaw7 xtrnaw7 60989 Jan 1 1970 vendor_file_contexts
drwxr-xr-x. 2 xtrnaw7 xtrnaw7 2 Jan 1 1970 vendor
drwxr-xr-x. 2 xtrnaw7 xtrnaw7 2 Jan 1 1970 tmp
-rw-r--r--. 1 xtrnaw7 xtrnaw7 0 Jan 1 1970 system_ext_service_contexts
-rw-r--r--. 1 xtrnaw7 xtrnaw7 2258 Jan 1 1970 system_ext_property_contexts
-rw-r--r--. 1 xtrnaw7 xtrnaw7 227 Jan 1 1970 system_ext_file_contexts
drwxr-xr-x. 2 xtrnaw7 xtrnaw7 2 Jan 1 1970 system_ext
drwxr-xr-x. 2 xtrnaw7 xtrnaw7 2 Jan 1 1970 system_dlkm
drwxr-xr-x. 2 xtrnaw7 xtrnaw7 2 Jan 1 1970 sys
drwxr-x--x. 2 xtrnaw7 xtrnaw7 2 Jan 1 1970 storage
-rw-r--r--. 1 xtrnaw7 xtrnaw7 929866 Jan 1 1970 sepolicy
drwxr-xr-x. 2 xtrnaw7 xtrnaw7 2 Jan 1 1970 second_stage_resources
drwxrwxrwx. 2 xtrnaw7 xtrnaw7 2 Jan 1 1970 sdcard
-rw-r--r--. 1 xtrnaw7 xtrnaw7 21081 Jan 1 1970 prop.default
-rw-r--r--. 1 xtrnaw7 xtrnaw7 160 Jan 1 1970 product_service_contexts
-rw-r--r--. 1 xtrnaw7 xtrnaw7 430 Jan 1 1970 product_property_contexts
-rw-r--r--. 1 xtrnaw7 xtrnaw7 0 Jan 1 1970 product_file_contexts
drwxr-xr-x. 2 xtrnaw7 xtrnaw7 2 Jan 1 1970 product
drwxr-xr-x. 2 xtrnaw7 xtrnaw7 2 Jan 1 1970 proc
drwxr-xr-x. 2 xtrnaw7 xtrnaw7 2 Jan 1 1970 postinstall
-rw-r--r--. 1 xtrnaw7 xtrnaw7 39356 Jan 1 1970 plat_service_contexts
-rw-r--r--. 1 xtrnaw7 xtrnaw7 108886 Jan 1 1970 plat_property_contexts
-rw-r--r--. 1 xtrnaw7 xtrnaw7 45125 Jan 1 1970 plat_file_contexts
drwxr-xr-x. 2 xtrnaw7 xtrnaw7 2 Jan 1 1970 oem
-rw-r--r--. 1 xtrnaw7 xtrnaw7 426 Jan 1 1970 odm_property_contexts
-rw-r--r--. 1 xtrnaw7 xtrnaw7 0 Jan 1 1970 odm_file_contexts
drwxr-xr-x. 2 xtrnaw7 xtrnaw7 2 Jan 1 1970 mnt
drwxr-xr-x. 2 xtrnaw7 xtrnaw7 2 Jan 1 1970 metadata
-rwxr-x---. 1 xtrnaw7 xtrnaw7 527 Jan 1 1970 init.recovery.gs101.rc
-rwxr-x---. 1 xtrnaw7 xtrnaw7 527 Jan 1 1970 init.recovery.bluejay.rc
lrwxrwxrwx. 1 xtrnaw7 xtrnaw7 16 Jan 1 1970 init -> /system/bin/init
lrwxrwxrwx. 1 xtrnaw7 xtrnaw7 11 Jan 1 1970 etc -> /system/etc
drwxr-xr-x. 2 xtrnaw7 xtrnaw7 2 Jan 1 1970 dev
lrwxrwxrwx. 1 xtrnaw7 xtrnaw7 12 Jan 1 1970 default.prop -> prop.default
drwxr-xr-x. 2 xtrnaw7 xtrnaw7 2 Jan 1 1970 debug_ramdisk
drwxr-xr-x. 2 xtrnaw7 xtrnaw7 2 Jan 1 1970 data_mirror
drwxrwx--x. 2 xtrnaw7 xtrnaw7 2 Jan 1 1970 data
lrwxrwxrwx. 1 xtrnaw7 xtrnaw7 17 Jan 1 1970 d -> /sys/kernel/debug
dr-xr-xr-x. 2 xtrnaw7 xtrnaw7 2 Jan 1 1970 config
lrwxrwxrwx. 1 xtrnaw7 xtrnaw7 50 Jan 1 1970 bugreports -> /data/user_de/0/com.android.shell/files/bugreports
drwxr-xr-x. 2 xtrnaw7 xtrnaw7 2 Jan 1 1970 bootstrap-apex
lrwxrwxrwx. 1 xtrnaw7 xtrnaw7 11 Jan 1 1970 bin -> /system/bin
drwxr-xr-x. 2 xtrnaw7 xtrnaw7 2 Jan 1 1970 apex
drwxr-xr-x. 2 xtrnaw7 xtrnaw7 2 Jan 1 1970 acct
drwxr-xr-x. 4 xtrnaw7 xtrnaw7 4 Jun 19 16:00 first_stage_ramdisk
drwxr-xr-x. 2 xtrnaw7 xtrnaw7 3 Jun 19 16:00 linkerconfig
drwxr-xr-x. 3 xtrnaw7 xtrnaw7 3 Jun 19 16:00 lib
drwxr-xr-x. 2 xtrnaw7 xtrnaw7 3 Jun 19 16:00 odm_dlkm
drwxr-xr-x. 2 xtrnaw7 xtrnaw7 12 Jun 19 16:00 odm
drwxr-xr-x. 3 xtrnaw7 xtrnaw7 3 Jun 19 16:00 res
drwxr-xr-x. 5 xtrnaw7 xtrnaw7 5 Jun 19 16:00 system
drwxr-xr-x. 2 xtrnaw7 xtrnaw7 3 Jun 19 16:00 vendor_dlkm
[ OmniRom 14 Dev - xtrnaw7@t15g /devpool001/develop/test/bluejay-ap2a.240605.024/vendor_boot_image/ramdisk ] $

In principle it should be possible to change files in this cpio file like described in my Howto but I did not test it . And keep in mind that the cpio file for the vendor_boot partition is compressed with lz4.

But IMHO, changing files in the boot partition should only be the last attempt to change some files, as you will have to replace the files again after each OS update.

If possible, I recommend changing the files with a Magisk module - this way the changes will survive an operating system update.

regards

Bernd