aboutsummaryrefslogtreecommitdiffhomepage
path: root/content/2019-10-27-kernel-debugging-qemu/build_initrd.sh
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2023-11-23 00:08:44 +0100
committerJohannes Stoelp <johannes.stoelp@gmail.com>2023-11-26 01:16:49 +0100
commit3e8ff92446ae772c202b581e2250e2eb2affe5cb (patch)
tree56f09f38b447d2c28d67f28ce5847d6a9f5a6a60 /content/2019-10-27-kernel-debugging-qemu/build_initrd.sh
parent4ba0f9c95a4d20803e19080918c9e06913834b35 (diff)
downloadblog-3e8ff92446ae772c202b581e2250e2eb2affe5cb.tar.gz
blog-3e8ff92446ae772c202b581e2250e2eb2affe5cb.zip
kernel-dbg: fix ramfs vs ramdisk and use devtmpfs and update
busybox/kernel version
Diffstat (limited to 'content/2019-10-27-kernel-debugging-qemu/build_initrd.sh')
-rwxr-xr-xcontent/2019-10-27-kernel-debugging-qemu/build_initrd.sh12
1 files changed, 4 insertions, 8 deletions
diff --git a/content/2019-10-27-kernel-debugging-qemu/build_initrd.sh b/content/2019-10-27-kernel-debugging-qemu/build_initrd.sh
index fd82990..f5bece4 100755
--- a/content/2019-10-27-kernel-debugging-qemu/build_initrd.sh
+++ b/content/2019-10-27-kernel-debugging-qemu/build_initrd.sh
@@ -6,7 +6,7 @@ fi
set -e
-BUSYBOX=busybox-1.33.1
+BUSYBOX=busybox-1.36.1
INITRD=$PWD/initramfs.cpio.gz
## Build busybox
@@ -20,7 +20,7 @@ echo "[+] configure & build $BUSYBOX ..."
cd $BUSYBOX
make defconfig
sed -i 's/# CONFIG_STATIC .*/CONFIG_STATIC=y/' .config
-make -j4 busybox
+make -j$(nproc --ignore=2) busybox
make install
## Create initrd
@@ -38,17 +38,13 @@ cat <<EOF > init
mount -t proc none /proc
mount -t sysfs none /sys
+mount -t devtmpfs none /dev
exec setsid cttyhack sh
EOF
chmod +x init
-# 3. create device nodes
-$SUDO mknod dev/tty c 5 0
-$SUDO mknod dev/tty0 c 4 0
-$SUDO mknod dev/ttyS0 c 4 64
-
-# 4. created compressed initrd
+# 3. created compressed initrd
find . -print0 \
| cpio --null -ov --format=newc \
| gzip -9 > $INITRD