Skip to content

Commit 0c45aa6

Browse files
Create initramfs image
1 parent b84da51 commit 0c45aa6

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
@@ -47,6 +47,24 @@ jobs:
4747
make INSTALL_MOD_PATH=${{ github.workspace }}/iso/boot INSTALL_PATH=${{ github.workspace }}/iso/boot modules_install install
4848
ls -l ${{ github.workspace }}/iso/boot
4949
50+
# https://docs.kernel.org/filesystems/ramfs-rootfs-initramfs.html
51+
# https://docs.kernel.org/filesystems/ramfs-rootfs-initramfs.html#contents-of-initramfs
52+
- name: Create initramfs image
53+
run: |
54+
mkdir initramfs
55+
cat > hello.c << EOF
56+
#include <stdio.h>
57+
#include <unistd.h>
58+
59+
int main(int argc, char *argv[])
60+
{
61+
printf("Hello world!\n");
62+
sleep(999999999);
63+
}
64+
EOF
65+
gcc -static hello.c -o initramfs/init
66+
(cd initramfs; find . | cpio -o -H newc | gzip) > iso/boot/initramfs.cpio.gz
67+
5068
# https://www.gnu.org/software/grub/manual/grub/html_node/Making-a-GRUB-bootable-CD_002dROM.html
5169
- name: Make a GRUB bootable CD-ROM
5270
run: |

0 commit comments

Comments
 (0)