Skip to content
Snippets Groups Projects
Commit 98276b72 authored by Timmy Chan's avatar Timmy Chan
Browse files

Prevent kernel version earlier than 3.3

Kernels earlier than 3.3.x have many bugs.

The following are just examples of those:
 - Some kernels need exactly ext3 fs to boot
 - Some kernels has errors from glibc, need patch. "getline error",
 - Current Debian stable does not support kernels before 3.2
 - Error from m4 package, need patch. "freadahead.c error"
 - Error from ttyS0 at boot
 - Some kernels get stuck at "booting kernel"
 - Some kernels get stuck elsewhere
 - Network might fail even it has been tested working for later kernels
 - Package "inet" might fail at boot. "if_index.os error"
parent ede5fbd8
No related branches found
No related tags found
1 merge request!5Feat/cve linux kernel
......@@ -18,7 +18,7 @@ Supported CPU architectures:
- x86_64 (see Limitations)
Supported Linux kernels:
- 3.x (>3.2)
- 3.x (>3.3)
- 4.x
- 5.x
......@@ -31,12 +31,10 @@ Default config options we use for Buildroot:
|----------------|----------------|----------------------------|
| arch | i386 | Supports older kernels |
| defconfig name | i386 | Matches arch |
| kernel version | <_latest_> | Will prompt user |
| kernel version | 3.18.100 | Will prompt user |
| kernel header | Same as kernel | Will in theory always work |
| C++ support | y | Required for IPv6 support |
| gcc version | <_depends on kernel_> | Latest gcc which the kernel supports |
The user will get an option to modify these options manually.
Debian image setup additionally enables the following features:
- OpenSSL
......@@ -45,6 +43,16 @@ Debian image setup additionally enables the following features:
- Eth0 network
### Useful commands
List all running Qemu VM processes:
ps aux | grep qemu
Kill all running Qemu VM processes:
pkill -f qemu -9
### Project structure:
qemu
......@@ -108,7 +116,7 @@ Debian image setup additionally enables the following features:
- No way to detect a crashed qemu vm. A simple "ssh port is open" check on qemu booting is implemented,
but it is unreliable as a kernel could still have crashed even if the port is open.
- Kernels before 3.2.x are not supported. System will try running it, and sometimes it boots,
- Kernels before 3.3.x are not supported. System will try running it, and sometimes it boots,
sometimes doesn't. There are many compatibility issues on the old kernels mostly because of `glibc` updates.
- I have been trying out different package patches on glibc.
Some luck was shown, but the fixes were not consistent, as moving to a slightly older kernel
......@@ -119,7 +127,7 @@ Debian image setup additionally enables the following features:
- Only Debian OS are supported.
- The earliest Buildroot release is from 2012. The program do not necessarily support
compiling kernels earlier than 3.2.
compiling kernels earlier than 3.3.
- Different steps of the program is not run in parallel. Running Debian image setup and kernel compilation
simultaneously is not supported yet.
......
......@@ -67,7 +67,8 @@ def validate_buildroot_version(kwargs: dict):
year = datetime.datetime.now().year
# At year 2014, Buildroot had another menuconfig interface.
# buildroot version before 2015 is not supported
# buildroot version before 2019 is not supported
# TODO: Add support by including a collection of patches to solve different errors of old versions
while year > 2018:
# Buildroot before 2017 is not supported by kconfiglib, as it cannot correctly parse the config files
# package/libcrossguid/Config.in:15 error: couldn't parse [...]
......
......@@ -68,9 +68,16 @@ def setup(**kwargs):
verbose_log("Using working dir:", os.getcwd())
log("Validating and fixing input kwargs")
kwargs = derive_input_kwargs(**kwargs)
# Kernel versions earlier than 3.2 is not supported yet.
# TODO: Implement proper fix
kernel_version = kwargs['kernel_version'].split('.')
kernel_version_compare_num = int(kernel_version[0])*100 + int(kernel_version[1])
if kernel_version_compare_num < 303:
print("Kernel version earlier than 3.3 is not supported")
exit()
log("Creating a Qemu VM by these parameters:")
log(" Architecture: ", kwargs['arch'])
log(" Kernel version: ", kwargs['kernel_version'])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment