Skip to content

Commit 470b093

Browse files
Create initramfs image
1 parent 47f7cd2 commit 470b093

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

.github/workflows/makefile.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,24 @@ jobs:
4949
make INSTALL_MOD_PATH=${{ github.workspace }}/iso/boot INSTALL_PATH=${{ github.workspace }}/iso/boot modules_install install
5050
ls -l ${{ github.workspace }}/iso/boot
5151
52+
# https://docs.kernel.org/filesystems/ramfs-rootfs-initramfs.html
53+
# https://docs.kernel.org/filesystems/ramfs-rootfs-initramfs.html#contents-of-initramfs
54+
- name: Create initramfs image
55+
run: |
56+
mkdir initramfs
57+
cat > hello.c << EOF
58+
#include <stdio.h>
59+
#include <unistd.h>
60+
61+
int main(int argc, char *argv[])
62+
{
63+
printf("Hello world!\n");
64+
sleep(999999999);
65+
}
66+
EOF
67+
gcc -static hello.c -o initramfs/init
68+
(cd initramfs; find . | cpio -o -H newc | gzip) > iso/boot/initramfs.cpio.gz
69+
5270
# https://www.gnu.org/software/grub/manual/grub/html_node/Making-a-GRUB-bootable-CD_002dROM.html
5371
- name: Make a GRUB bootable CD-ROM
5472
run: |

0 commit comments

Comments
 (0)