Fixes to enable bootc #11

Open
kfox1111 wants to merge 2 commits from kfox1111/raspberrypi2:a9-bootc into a9
Showing only changes of commit f16987bbfe - Show all commits

View File

@ -354,7 +354,13 @@ find %{buildroot}/usr/include \
%posttrans kernel%{?ksuffix} %posttrans kernel%{?ksuffix}
if [ -d /boot ]; then if [ -d /usr/lib/ostree-boot ]; then
mv /usr/lib/ostree-boot/config-%{version}-%{release} /usr/lib/modules/%{version}-%{release}
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?
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
ls /usr/lib/modules/%{version}-%{release}
elif [ -d /boot ]; then
if [ -f /boot/kernel%{armtarget}.img ] || [ ! -f /boot/config-kernel.inc ];then if [ -f /boot/kernel%{armtarget}.img ] || [ ! -f /boot/config-kernel.inc ];then
# if nothing exists, fall back to generating the file, but don't create it # if nothing exists, fall back to generating the file, but don't create it
# if we have moved to initramfs # if we have moved to initramfs
@ -365,12 +371,6 @@ if [ -d /boot ]; then
cp /usr/share/%{name}-kernel/%{version}-%{release}/boot/overlays/README /boot/overlays/ cp /usr/share/%{name}-kernel/%{version}-%{release}/boot/overlays/README /boot/overlays/
/usr/bin/dracut /boot/initramfs-%{version}-%{release}.img %{version}-%{release} /usr/bin/dracut /boot/initramfs-%{version}-%{release}.img %{version}-%{release}
cp /boot/config-kernel-%{version}-%{release}.inc /boot/config-kernel.inc 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
ls /usr/lib/modules/%{version}-%{release}
fi fi
%postun kernel%{?ksuffix} %postun kernel%{?ksuffix}