File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -274,6 +274,12 @@ sudo modprobe bfq
274274sudo modprobe zram
275275```
276276
277+ ### Generate initramfs
278+
279+ Before booting the kernel, generate the initramfs:
280+
281+ ./scripts/generate-initramfs.sh
282+
277283### Installing a DKMS Module (example: v4l2loopback)
278284
279285``` bash
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -e
4+
5+ echo " === Hyperion BusyBox RootFS Builder ==="
6+
7+ WORKDIR=~ /hyperion-rootfs
8+ OUTFILE=~ /rootfs.cpio.gz
9+
10+ echo " [0/7] Installing required dependencies..."
11+
12+ sudo apt update
13+ sudo apt install -y \
14+ busybox-static \
15+ cpio \
16+ gzip
17+
18+ echo " [1/7] Cleaning previous build..."
19+
20+ rm -rf $WORKDIR
21+ mkdir -p $WORKDIR
22+ cd $WORKDIR
23+
24+ echo " [2/7] Creating filesystem structure..."
25+
26+ mkdir -p \
27+ bin \
28+ sbin \
29+ proc \
30+ sys \
31+ dev \
32+ etc \
33+ tmp \
34+ usr/bin \
35+ usr/sbin \
36+ mnt \
37+ root
38+
39+ echo " [3/7] Installing BusyBox..."
40+
41+ cp /bin/busybox bin/
42+
43+ echo " [4/7] Enabling ALL BusyBox commands..."
44+
45+ cd bin
46+ ./busybox --install -s .
47+ cd ..
48+
49+ echo " [5/7] Creating init script..."
50+
51+ cat << 'EOF ' > init
52+ #!/bin/sh
53+
54+ echo
55+ echo "Hyperion Initramfs Booting..."
56+ echo
57+
58+ mount -t proc none /proc
59+ mount -t sysfs none /sys
60+ mount -t devtmpfs none /dev
61+
62+ echo
63+ echo "Welcome to Hyperion Kernel!"
64+ echo
65+
66+ exec /bin/sh
67+ EOF
68+
69+ chmod +x init
70+
71+ echo " [6/7] Creating device nodes..."
72+
73+ sudo mknod -m 622 dev/console c 5 1 || true
74+ sudo mknod -m 666 dev/null c 1 3 || true
75+
76+ echo " [7/7] Packing initramfs..."
77+
78+ find . | cpio -o -H newc 2> /dev/null | gzip > $OUTFILE
79+
80+ echo
81+ echo " === Done! ==="
82+ echo
83+ echo " RootFS created:"
84+ echo " $OUTFILE "
85+ echo
86+ echo " Copy to Windows artifacts folder:"
87+ echo
88+ echo " cp $OUTFILE /mnt/c/Users/(USERNAME)/path/to/wherever/you/like/it"
You can’t perform that action at this time.
0 commit comments