-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from jmarrero/iniramfs
initramfs-module: add example adding a module to the initramfs
- Loading branch information
Showing
3 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: "Build image: initramfs-module" | ||
|
||
env: | ||
IMAGE_NAME: "initramfs-module" | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- initramfs-module/* | ||
- .github/workflows/initramfs-module.yml | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- initramfs-module/* | ||
- .github/workflows/initramfs-module.yml | ||
|
||
jobs: | ||
build-image: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Build container image | ||
uses: redhat-actions/buildah-build@v2 | ||
with: | ||
context: ${{ env.IMAGE_NAME }} | ||
containerfiles: ${{ env.IMAGE_NAME }}/Containerfile | ||
image: ${{ env.IMAGE_NAME }} | ||
layers: false | ||
oci: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# This examples rebuilds the initramfs adding ostree, iscsi, ifcfg modules | ||
# omiting the network-legacy and nouveau modules. After the initramfs is built it is moved to | ||
# /lib/modules/$KERNEL_VERSION/initramfs.img where it will be used on ostree systems. | ||
FROM quay.io/fedora/fedora-coreos:stable | ||
USER root | ||
RUN KERNEL_VERSION=$(rpm -q kernel | cut -c 8-); \ | ||
# In FCOS we add configuration files for dracut to ensure that the "base image" has its | ||
# initramfs arguments embedded. They can be seen on: | ||
# https://github.com/coreos/fedora-coreos-config/tree/testing-devel/overlay.d/05core/usr/lib/dracut | ||
# This makes sure that required arguments are reused when running dracut in a container build like this one. | ||
# Other distributions like RHCOS might not provide/require the same arguments and will need to be added to the | ||
# dracut invocation. | ||
# The RCHOS arguments needed can be seen on: | ||
# https://github.com/openshift/os/blob/1f2c0eb7e370d2412db15fa28556f419ddf73c5d/common.yaml#L37 | ||
dracut --reproducible -v --add 'ostree' -f --omit-drivers 'nouveau' \ | ||
--add 'iscsi' --add 'ifcfg' --omit 'network-legacy' /lib/modules/$KERNEL_VERSION/initramfs.img $KERNEL_VERSION && \ | ||
ostree container commit |