Skip to content

Update to bookworm and add ZRAM block device support#19

Merged
flowzone-app[bot] merged 5 commits intomainfrom
alexgg/zram
Jun 11, 2025
Merged

Update to bookworm and add ZRAM block device support#19
flowzone-app[bot] merged 5 commits intomainfrom
alexgg/zram

Conversation

@alexgg
Copy link
Contributor

@alexgg alexgg commented Jun 7, 2025

The bookworm update was not planned but Ubuntu 24.02 kept segfaulting on the docker build.

The addition of the ZRAM device is required to run the OS tests in the following commit:
balena-os/meta-balena#3678

alexgg added 2 commits June 7, 2025 16:57
Other shells, like dash in Ubuntu, are not able to execure docker:
```
make: docker: Permission denied
make: *** [Makefile:58: check_path] Error 127
```

Signed-off-by: Alex Gonzalez <alexg@balena.io>
Debian bullseye kept segfaulting:
```
101.1  installed libc-bin package post-installation script subprocess returned error exit status 139
101.1 Processing triggers for ca-certificates (20210119) ...
101.3 Updating certificates in /etc/ssl/certs...
112.7 0 added, 0 removed; done.
112.7 Running hooks in /etc/ca-certificates/update.d...
112.7 done.
112.8 Errors were encountered while processing:
112.8  libc-bin
112.9 E: Sub-process /usr/bin/dpkg returned an error code (1)
```

Change-type: minor
Signed-off-by: Alex Gonzalez <alexg@balena.io>
# Linux/arm64 5.10.0 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="gcc (Debian 10.2.1-6) 10.2.1 20210110"
CONFIG_CC_VERSION_TEXT="gcc (Debian 12.2.0-14+deb12u1) 12.2.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have preferred these config changes be included with the bookworm commit, rather than the zram commit. As it stands, I can't tell which config lines are related to the zram feature.

@klutchell
Copy link
Contributor

5.10 failed to build on amd64, not sure why that would be or if it's related to zram or bookworm.

#33 4.009 In file included from sigchain.c:3:
#33 4.009 In function 'xrealloc',
#33 4.009     inlined from 'sigchain_push.isra' at sigchain.c:26:2:
#33 4.009 subcmd-util.h:56:23: error: pointer may be used after 'realloc' [-Werror=use-after-free]
#33 4.009    56 |                 ret = realloc(ptr, size);
#33 4.009       |                       ^~~~~~~~~~~~~~~~~~
#33 4.009 subcmd-util.h:52:21: note: call to 'realloc' here
#33 4.009    52 |         void *ret = realloc(ptr, size);
#33 4.009       |                     ^~~~~~~~~~~~~~~~~~
#33 4.009 subcmd-util.h:58:31: error: pointer may be used after 'realloc' [-Werror=use-after-free]
#33 4.009    58 |                         ret = realloc(ptr, 1);
#33 4.009       |                               ^~~~~~~~~~~~~~~
#33 4.009 subcmd-util.h:52:21: note: call to 'realloc' here
#33 4.009    52 |         void *ret = realloc(ptr, size);
#33 4.009       |                     ^~~~~~~~~~~~~~~~~~
#33 4.010 make[4]: *** [/src/tools/build/Makefile.build:96: /src/tools/objtool/help.o] Error 1
#33 4.010 make[4]: *** Waiting for unfinished jobs....
#33 4.018 In function 'xrealloc',
#33 4.018     inlined from 'sigchain_push' at sigchain.c:26:2,
#33 4.018     inlined from 'sigchain_push_common' at sigchain.c:53:2:
#33 4.018 subcmd-util.h:56:23: error: pointer may be used after 'realloc' [-Werror=use-after-free]
#33 4.018    56 |                 ret = realloc(ptr, size);
#33 4.018       |                       ^~~~~~~~~~~~~~~~~~
#33 4.018 subcmd-util.h:52:21: note: call to 'realloc' here
#33 4.018    52 |         void *ret = realloc(ptr, size);
#33 4.018       |                     ^~~~~~~~~~~~~~~~~~
#33 4.018 subcmd-util.h:58:31: error: pointer may be used after 'realloc' [-Werror=use-after-free]
#33 4.018    58 |                         ret = realloc(ptr, 1);
#33 4.018       |                               ^~~~~~~~~~~~~~~
#33 4.019 subcmd-util.h:52:21: note: call to 'realloc' here
#33 4.019    52 |         void *ret = realloc(ptr, size);
#33 4.019       |                     ^~~~~~~~~~~~~~~~~~
#33 4.025 cc1: all warnings being treated as errors
#33 4.026 make[4]: *** [/src/tools/build/Makefile.build:96: /src/tools/objtool/sigchain.o] Error 1

We can either fix this, or just disable the linux510 build variant since it's unused now.

@alexgg alexgg force-pushed the alexgg/zram branch 2 times, most recently from 2979edf to 0b1a842 Compare June 10, 2025 17:54
@alexgg
Copy link
Contributor Author

alexgg commented Jun 10, 2025

v5.10 would need to be fetched from an LTS repository probably to build with GCC 12. Not sure whether we want to spend time on building with an LTS branch that is probably untested with firecracker specially if this is now unused as you say.

btw, I have tried patching this first problem but other follows so I stopped going down the rabbit hole.

5.10 failed to build on amd64, not sure why that would be or if it's related to zram or bookworm.

#33 4.009 In file included from sigchain.c:3:
#33 4.009 In function 'xrealloc',
#33 4.009     inlined from 'sigchain_push.isra' at sigchain.c:26:2:
#33 4.009 subcmd-util.h:56:23: error: pointer may be used after 'realloc' [-Werror=use-after-free]
#33 4.009    56 |                 ret = realloc(ptr, size);
#33 4.009       |                       ^~~~~~~~~~~~~~~~~~
#33 4.009 subcmd-util.h:52:21: note: call to 'realloc' here
#33 4.009    52 |         void *ret = realloc(ptr, size);
#33 4.009       |                     ^~~~~~~~~~~~~~~~~~
#33 4.009 subcmd-util.h:58:31: error: pointer may be used after 'realloc' [-Werror=use-after-free]
#33 4.009    58 |                         ret = realloc(ptr, 1);
#33 4.009       |                               ^~~~~~~~~~~~~~~
#33 4.009 subcmd-util.h:52:21: note: call to 'realloc' here
#33 4.009    52 |         void *ret = realloc(ptr, size);
#33 4.009       |                     ^~~~~~~~~~~~~~~~~~
#33 4.010 make[4]: *** [/src/tools/build/Makefile.build:96: /src/tools/objtool/help.o] Error 1
#33 4.010 make[4]: *** Waiting for unfinished jobs....
#33 4.018 In function 'xrealloc',
#33 4.018     inlined from 'sigchain_push' at sigchain.c:26:2,
#33 4.018     inlined from 'sigchain_push_common' at sigchain.c:53:2:
#33 4.018 subcmd-util.h:56:23: error: pointer may be used after 'realloc' [-Werror=use-after-free]
#33 4.018    56 |                 ret = realloc(ptr, size);
#33 4.018       |                       ^~~~~~~~~~~~~~~~~~
#33 4.018 subcmd-util.h:52:21: note: call to 'realloc' here
#33 4.018    52 |         void *ret = realloc(ptr, size);
#33 4.018       |                     ^~~~~~~~~~~~~~~~~~
#33 4.018 subcmd-util.h:58:31: error: pointer may be used after 'realloc' [-Werror=use-after-free]
#33 4.018    58 |                         ret = realloc(ptr, 1);
#33 4.018       |                               ^~~~~~~~~~~~~~~
#33 4.019 subcmd-util.h:52:21: note: call to 'realloc' here
#33 4.019    52 |         void *ret = realloc(ptr, size);
#33 4.019       |                     ^~~~~~~~~~~~~~~~~~
#33 4.025 cc1: all warnings being treated as errors
#33 4.026 make[4]: *** [/src/tools/build/Makefile.build:96: /src/tools/objtool/sigchain.o] Error 1

We can either fix this, or just disable the linux510 build variant since it's unused now.

@alexgg
Copy link
Contributor Author

alexgg commented Jun 10, 2025

The alternative is not to update to bookworm on 5.10 even if this does not build in my computer and just not make the zram addition. We would then have a 5.10 backup kernel we could use if needed.

Your call @klutchell

v5.10 would need to be fetched from an LTS repository probably to build with GCC 12. Not sure whether we want to spend time on building with an LTS branch that is probably untested with firecracker specially if this is now unused as you say.

btw, I have tried patching this first problem but other follows so I stopped going down the rabbit hole.

5.10 failed to build on amd64, not sure why that would be or if it's related to zram or bookworm.

#33 4.009 In file included from sigchain.c:3:
#33 4.009 In function 'xrealloc',
#33 4.009     inlined from 'sigchain_push.isra' at sigchain.c:26:2:
#33 4.009 subcmd-util.h:56:23: error: pointer may be used after 'realloc' [-Werror=use-after-free]
#33 4.009    56 |                 ret = realloc(ptr, size);
#33 4.009       |                       ^~~~~~~~~~~~~~~~~~
#33 4.009 subcmd-util.h:52:21: note: call to 'realloc' here
#33 4.009    52 |         void *ret = realloc(ptr, size);
#33 4.009       |                     ^~~~~~~~~~~~~~~~~~
#33 4.009 subcmd-util.h:58:31: error: pointer may be used after 'realloc' [-Werror=use-after-free]
#33 4.009    58 |                         ret = realloc(ptr, 1);
#33 4.009       |                               ^~~~~~~~~~~~~~~
#33 4.009 subcmd-util.h:52:21: note: call to 'realloc' here
#33 4.009    52 |         void *ret = realloc(ptr, size);
#33 4.009       |                     ^~~~~~~~~~~~~~~~~~
#33 4.010 make[4]: *** [/src/tools/build/Makefile.build:96: /src/tools/objtool/help.o] Error 1
#33 4.010 make[4]: *** Waiting for unfinished jobs....
#33 4.018 In function 'xrealloc',
#33 4.018     inlined from 'sigchain_push' at sigchain.c:26:2,
#33 4.018     inlined from 'sigchain_push_common' at sigchain.c:53:2:
#33 4.018 subcmd-util.h:56:23: error: pointer may be used after 'realloc' [-Werror=use-after-free]
#33 4.018    56 |                 ret = realloc(ptr, size);
#33 4.018       |                       ^~~~~~~~~~~~~~~~~~
#33 4.018 subcmd-util.h:52:21: note: call to 'realloc' here
#33 4.018    52 |         void *ret = realloc(ptr, size);
#33 4.018       |                     ^~~~~~~~~~~~~~~~~~
#33 4.018 subcmd-util.h:58:31: error: pointer may be used after 'realloc' [-Werror=use-after-free]
#33 4.018    58 |                         ret = realloc(ptr, 1);
#33 4.018       |                               ^~~~~~~~~~~~~~~
#33 4.019 subcmd-util.h:52:21: note: call to 'realloc' here
#33 4.019    52 |         void *ret = realloc(ptr, size);
#33 4.019       |                     ^~~~~~~~~~~~~~~~~~
#33 4.025 cc1: all warnings being treated as errors
#33 4.026 make[4]: *** [/src/tools/build/Makefile.build:96: /src/tools/objtool/sigchain.o] Error 1

We can either fix this, or just disable the linux510 build variant since it's unused now.

@klutchell
Copy link
Contributor

klutchell commented Jun 10, 2025

@alexgg just remove the linux510 build variant since it's unused anyway IMO.

alexgg added 2 commits June 11, 2025 09:40
Change-type: patch
Signed-off-by: Alex Gonzalez <alexg@balena.io>
This is required to run some new tests on the OS automation suite.

Change-type: minor
Signed-off-by: Alex Gonzalez <alexg@balena.io>
@alexgg alexgg requested a review from klutchell June 11, 2025 13:20
@flowzone-app flowzone-app bot enabled auto-merge June 11, 2025 13:29
}
docker_images: ghcr.io/product-os/github-runner-kernel
bake_targets: linux510,linux61
bake_targets: linux61
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT, can we make this a minor?

This kernel no longer builds on Debian bookworm with GCC12 - it is also
no longer used.

Change-type: minor
Signed-off-by: Alex Gonzalez <alexg@balena.io>
@alexgg alexgg requested a review from klutchell June 11, 2025 14:03
@flowzone-app flowzone-app bot merged commit 7db1305 into main Jun 11, 2025
50 checks passed
@flowzone-app flowzone-app bot deleted the alexgg/zram branch June 11, 2025 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants