Fixes to enable bootc #11

Open
kfox1111 wants to merge 2 commits from kfox1111/raspberrypi2:a9-bootc into a9
3 changed files with 27 additions and 11 deletions
Showing only changes of commit ab62994e26 - Show all commits

View File

@ -23,7 +23,7 @@ index e87791286ab4..6fda5b261683 100644
CONFIG_CRYPTO_USER=m CONFIG_CRYPTO_USER=m
CONFIG_CRYPTO_CRYPTD=m CONFIG_CRYPTO_CRYPTD=m
CONFIG_CRYPTO_AES=m CONFIG_CRYPTO_AES=m
@@ -1674,3 +1672,39 @@ CONFIG_SCHED_TRACER=y @@ -1674,3 +1672,43 @@ CONFIG_SCHED_TRACER=y
CONFIG_BLK_DEV_IO_TRACE=y CONFIG_BLK_DEV_IO_TRACE=y
# CONFIG_UPROBE_EVENTS is not set # CONFIG_UPROBE_EVENTS is not set
# CONFIG_STRICT_DEVMEM is not set # CONFIG_STRICT_DEVMEM is not set
@ -63,6 +63,10 @@ index e87791286ab4..6fda5b261683 100644
+CONFIG_FW_LOADER_COMPRESS=y +CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y +CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y +CONFIG_FW_LOADER_COMPRESS_ZSTD=y
+CONFIG_EROFS_FS=m
+CONFIG_EROFS_FS_XATTR=y
+CONFIG_EROFS_POSIX_ACL=y
+CONFIG_EROFS_FS_SECURITY=y
-- --
2.45.1 2.45.1

View File

@ -23,7 +23,7 @@ index 79c4332581eb..7b63683ff687 100644
CONFIG_CRYPTO_USER=m CONFIG_CRYPTO_USER=m
CONFIG_CRYPTO_CRYPTD=m CONFIG_CRYPTO_CRYPTD=m
CONFIG_CRYPTO_AES=m CONFIG_CRYPTO_AES=m
@@ -1677,3 +1675,39 @@ CONFIG_SCHED_TRACER=y @@ -1677,3 +1675,43 @@ CONFIG_SCHED_TRACER=y
CONFIG_BLK_DEV_IO_TRACE=y CONFIG_BLK_DEV_IO_TRACE=y
# CONFIG_UPROBE_EVENTS is not set # CONFIG_UPROBE_EVENTS is not set
# CONFIG_STRICT_DEVMEM is not set # CONFIG_STRICT_DEVMEM is not set
@ -63,6 +63,10 @@ index 79c4332581eb..7b63683ff687 100644
+CONFIG_FW_LOADER_COMPRESS=y +CONFIG_FW_LOADER_COMPRESS=y
+CONFIG_FW_LOADER_COMPRESS_XZ=y +CONFIG_FW_LOADER_COMPRESS_XZ=y
+CONFIG_FW_LOADER_COMPRESS_ZSTD=y +CONFIG_FW_LOADER_COMPRESS_ZSTD=y
+CONFIG_EROFS_FS=m
+CONFIG_EROFS_FS_XATTR=y
+CONFIG_EROFS_POSIX_ACL=y
+CONFIG_EROFS_FS_SECURITY=y
-- --
2.45.1 2.45.1

View File

@ -354,16 +354,24 @@ find %{buildroot}/usr/include \
%posttrans kernel%{?ksuffix} %posttrans kernel%{?ksuffix}
if [ -f /boot/kernel%{armtarget}.img ] || [ ! -f /boot/config-kernel.inc ];then if [ -d /boot ]; then
# if nothing exists, fall back to generating the file, but don't create it if [ -f /boot/kernel%{armtarget}.img ] || [ ! -f /boot/config-kernel.inc ];then
Review

I don't think this will work. There's nothing to mv at the time. You must put /usr/lib/ostree-boot/kernel-%{version}-%{release}.img before moving them to /usr/lib/modules.

I don't think this will work. There's nothing to `mv` at the time. You must put `/usr/lib/ostree-boot/kernel-%{version}-%{release}.img` before moving them to `/usr/lib/modules`.
Review

Please check the status of the plain almalinux-bootc container. We're trying to install the kernel for RPi to the bootc container, right?

$ podman run --rm -it quay.io/almalinuxorg/almalinux-bootc /bin/bash
bash-5.1# find /boot
/boot
bash-5.1# find /usr/lib/ostree-boot
/usr/lib/ostree-boot
/usr/lib/ostree-boot/efi
Please check the status of the plain `almalinux-bootc` container. We're trying to install the kernel for RPi to the bootc container, right? ``` $ podman run --rm -it quay.io/almalinuxorg/almalinux-bootc /bin/bash bash-5.1# find /boot /boot bash-5.1# find /usr/lib/ostree-boot /usr/lib/ostree-boot /usr/lib/ostree-boot/efi ```
Review

It does work.... I'm running this kernel from this spec. I dont know what kind of games they played with installation as I did not expect it to work either, but they do something between when they extract the files to disk, and when the rpm scripts run that moves files around. By the time the script runs the files are where the scriplet expects.

It does work.... I'm running this kernel from this spec. I dont know what kind of games they played with installation as I did not expect it to work either, but they do something between when they extract the files to disk, and when the rpm scripts run that moves files around. By the time the script runs the files are where the scriplet expects.
Review

We can't extend the existing container with the new kernel. That would end up shipping two kernels due to the way container images layer. We have to build a new image with the kernel switched out in the config of the base image.

We can't extend the existing container with the new kernel. That would end up shipping two kernels due to the way container images layer. We have to build a new image with the kernel switched out in the config of the base image.
Review

It didn't work.

Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                             1/1
  Installing       : raspberrypi2-kernel4-6.6.51-20241008.v8.1.el9.aarch64                                                       1/1
  Running scriptlet: raspberrypi2-kernel4-6.6.51-20241008.v8.1.el9.aarch64                                                       1/1
mv: cannot stat '/usr/lib/ostree-boot/config-6.6.51-20241008.v8.1.el9': No such file or directory
mv: cannot stat '/usr/lib/ostree-boot/config-kernel-6.6.51-20241008.v8.1.el9.inc': No such file or directory
mv: cannot stat '/usr/lib/ostree-boot/initramfs-6.6.51-20241008.v8.1.el9.img': No such file or directory
mv: cannot stat '/usr/lib/ostree-boot/kernel-6.6.51-20241008.v8.1.el9.img': No such file or directory
build
kernel
modules.alias
modules.alias.bin
modules.builtin
modules.builtin.alias.bin
modules.builtin.bin
modules.builtin.modinfo
modules.dep
modules.dep.bin
modules.devname
modules.order
modules.softdep
modules.symbols
modules.symbols.bin
source

  Verifying        : raspberrypi2-kernel4-6.6.51-20241008.v8.1.el9.aarch64                                                       1/1
Installed products updated.
It didn't work. ``` Is this ok [y/N]: y Downloading Packages: Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : raspberrypi2-kernel4-6.6.51-20241008.v8.1.el9.aarch64 1/1 Running scriptlet: raspberrypi2-kernel4-6.6.51-20241008.v8.1.el9.aarch64 1/1 mv: cannot stat '/usr/lib/ostree-boot/config-6.6.51-20241008.v8.1.el9': No such file or directory mv: cannot stat '/usr/lib/ostree-boot/config-kernel-6.6.51-20241008.v8.1.el9.inc': No such file or directory mv: cannot stat '/usr/lib/ostree-boot/initramfs-6.6.51-20241008.v8.1.el9.img': No such file or directory mv: cannot stat '/usr/lib/ostree-boot/kernel-6.6.51-20241008.v8.1.el9.img': No such file or directory build kernel modules.alias modules.alias.bin modules.builtin modules.builtin.alias.bin modules.builtin.bin modules.builtin.modinfo modules.dep modules.dep.bin modules.devname modules.order modules.softdep modules.symbols modules.symbols.bin source Verifying : raspberrypi2-kernel4-6.6.51-20241008.v8.1.el9.aarch64 1/1 Installed products updated. ```
Review

How did you install it. Did you try from the bootc tarball I sent?

How did you install it. Did you try from the bootc tarball I sent?
# if we have moved to initramfs # if nothing exists, fall back to generating the file, but don't create it
cp /boot/kernel-%{version}-%{release}.img /boot/kernel%{armtarget}.img # if we have moved to initramfs
cp /boot/kernel-%{version}-%{release}.img /boot/kernel%{armtarget}.img
fi
cp /usr/share/%{name}-kernel/%{version}-%{release}/boot/*.dtb /boot/
cp /usr/share/%{name}-kernel/%{version}-%{release}/boot/overlays/*.dtb* /boot/overlays/
cp /usr/share/%{name}-kernel/%{version}-%{release}/boot/overlays/README /boot/overlays/
/usr/bin/dracut /boot/initramfs-%{version}-%{release}.img %{version}-%{release}
cp /boot/config-kernel-%{version}-%{release}.inc /boot/config-kernel.inc
elif [ -d /usr/lib/ostree-boot ]; then
mv /usr/lib/ostree-boot/config-%{version}-%{release} /usr/lib/modules/%{version}-%{release}
mv /usr/lib/ostree-boot/config-kernel-%{version}-%{release}.inc /usr/lib/modules/%{version}-%{release}
mv /usr/lib/ostree-boot/initramfs-%{version}-%{release}.img /usr/lib/modules/%{version}-%{release}/initramfs
mv /usr/lib/ostree-boot/kernel-%{version}-%{release}.img /usr/lib/modules/%{version}-%{release}/vmlinuz

I'm afraid this doesn't work as intended. The almalinux-bootc image has /boot directory so it will never reach elif [ -d /usr/lib/ostree-boot ]; then block.

$ podman run --rm -it quay.io/almalinuxorg/almalinux-bootc ls -l /
total 36
lrwxrwxrwx.   2 root root    7 Jan  1  1970 bin -> usr/bin
drwxr-xr-x.   2 root root 4096 Jan  1  1970 boot
drwxr-xr-x.   5 root root  360 Nov 14 08:51 dev
drwxr-xr-x.   1 root root 4096 Nov 12 03:18 etc
lrwxrwxrwx.   2 root root    8 Jan  1  1970 home -> var/home
lrwxrwxrwx.   2 root root    7 Jan  1  1970 lib -> usr/lib
lrwxrwxrwx.   2 root root    9 Jan  1  1970 lib64 -> usr/lib64
lrwxrwxrwx.   2 root root    9 Jan  1  1970 media -> run/media
lrwxrwxrwx.   2 root root    7 Jan  1  1970 mnt -> var/mnt
drwxr-xr-x.   2 root root 4096 Jan  1  1970 opt
lrwxrwxrwx.   2 root root   14 Jan  1  1970 ostree -> sysroot/ostree
dr-xr-xr-x. 209 root root    0 Nov 14 08:51 proc
lrwxrwxrwx.   2 root root   12 Jan  1  1970 root -> var/roothome
drwxr-xr-x.   1 root root 4096 Nov 14 08:51 run
lrwxrwxrwx.   2 root root    8 Jan  1  1970 sbin -> usr/sbin
lrwxrwxrwx.   2 root root    7 Jan  1  1970 srv -> var/srv
dr-xr-xr-x.  12 root root    0 Oct 17 00:00 sys
drwxr-xr-x.   1 root root 4096 Jan  1  1970 sysroot
drwxrwxrwt.   2 root root 4096 Jan  1  1970 tmp
drwxr-xr-x.   1 root root 4096 Nov 14 00:47 usr
drwxr-xr-x.   3 root root 4096 Jan  1  1970 var
I'm afraid this doesn't work as intended. The `almalinux-bootc` image has `/boot` directory so it will never reach `elif [ -d /usr/lib/ostree-boot ]; then` block. ``` $ podman run --rm -it quay.io/almalinuxorg/almalinux-bootc ls -l / total 36 lrwxrwxrwx. 2 root root 7 Jan 1 1970 bin -> usr/bin drwxr-xr-x. 2 root root 4096 Jan 1 1970 boot drwxr-xr-x. 5 root root 360 Nov 14 08:51 dev drwxr-xr-x. 1 root root 4096 Nov 12 03:18 etc lrwxrwxrwx. 2 root root 8 Jan 1 1970 home -> var/home lrwxrwxrwx. 2 root root 7 Jan 1 1970 lib -> usr/lib lrwxrwxrwx. 2 root root 9 Jan 1 1970 lib64 -> usr/lib64 lrwxrwxrwx. 2 root root 9 Jan 1 1970 media -> run/media lrwxrwxrwx. 2 root root 7 Jan 1 1970 mnt -> var/mnt drwxr-xr-x. 2 root root 4096 Jan 1 1970 opt lrwxrwxrwx. 2 root root 14 Jan 1 1970 ostree -> sysroot/ostree dr-xr-xr-x. 209 root root 0 Nov 14 08:51 proc lrwxrwxrwx. 2 root root 12 Jan 1 1970 root -> var/roothome drwxr-xr-x. 1 root root 4096 Nov 14 08:51 run lrwxrwxrwx. 2 root root 8 Jan 1 1970 sbin -> usr/sbin lrwxrwxrwx. 2 root root 7 Jan 1 1970 srv -> var/srv dr-xr-xr-x. 12 root root 0 Oct 17 00:00 sys drwxr-xr-x. 1 root root 4096 Jan 1 1970 sysroot drwxrwxrwt. 2 root root 4096 Jan 1 1970 tmp drwxr-xr-x. 1 root root 4096 Nov 14 00:47 usr drwxr-xr-x. 3 root root 4096 Jan 1 1970 var ```

Also, /boot always exists because the directory is created during install stage.

%install
%if %{with_up}
# kernel
mkdir -p %{buildroot}/boot/overlays/
Also, `/boot` always exists because the directory is created during install stage. ``` %install %if %{with_up} # kernel mkdir -p %{buildroot}/boot/overlays/ ```

Actually, it did work when I created the pr. somehow it diverted the files from /boot away. by the time the script ran there wasnt a /boot. But, I'll rearrange it to check for bootc and go down that path if its there.

Actually, it did work when I created the pr. somehow it diverted the files from /boot away. by the time the script ran there wasnt a /boot. But, I'll rearrange it to check for bootc and go down that path if its there.

I was able to build a 9.5 based image from this flipped around patch.

I was able to build a 9.5 based image from this flipped around patch.
ls /usr/lib/modules/%{version}-%{release}
fi fi
cp /usr/share/%{name}-kernel/%{version}-%{release}/boot/*.dtb /boot/
cp /usr/share/%{name}-kernel/%{version}-%{release}/boot/overlays/*.dtb* /boot/overlays/
cp /usr/share/%{name}-kernel/%{version}-%{release}/boot/overlays/README /boot/overlays/
/usr/bin/dracut /boot/initramfs-%{version}-%{release}.img %{version}-%{release}
cp /boot/config-kernel-%{version}-%{release}.inc /boot/config-kernel.inc
%postun kernel%{?ksuffix} %postun kernel%{?ksuffix}
if [ -f /boot/kernel%{armtarget}.img ];then if [ -f /boot/kernel%{armtarget}.img ];then