aboutsummaryrefslogtreecommitdiffhomepage
path: root/content/20191027-kernel-debugging-qemu/build_initrd.sh
diff options
context:
space:
mode:
authorjohannst <johannes.stoelp@gmail.com>2021-07-15 21:20:14 +0200
committerjohannst <johannes.stoelp@gmail.com>2021-07-15 21:20:14 +0200
commit82e9ac4163b46b59e121194f84ac370818482923 (patch)
treeb52adf8f5b2bafe7904f563c33ec23f46cb7c87c /content/20191027-kernel-debugging-qemu/build_initrd.sh
parent617d73fc9eff5b08a80b873fd97f66caa7e80fc9 (diff)
downloadblog-82e9ac4163b46b59e121194f84ac370818482923.tar.gz
blog-82e9ac4163b46b59e121194f84ac370818482923.zip
use proper date fmt in content file names that zola can automatically can derive the date
Diffstat (limited to 'content/20191027-kernel-debugging-qemu/build_initrd.sh')
-rwxr-xr-xcontent/20191027-kernel-debugging-qemu/build_initrd.sh54
1 files changed, 0 insertions, 54 deletions
diff --git a/content/20191027-kernel-debugging-qemu/build_initrd.sh b/content/20191027-kernel-debugging-qemu/build_initrd.sh
deleted file mode 100755
index fd82990..0000000
--- a/content/20191027-kernel-debugging-qemu/build_initrd.sh
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/bash
-
-if test $(id -u) -ne 0; then
- SUDO=sudo
-fi
-
-set -e
-
-BUSYBOX=busybox-1.33.1
-INITRD=$PWD/initramfs.cpio.gz
-
-## Build busybox
-
-echo "[+] configure & build $BUSYBOX ..."
-[[ ! -d $BUSYBOX ]] && {
- wget https://busybox.net/downloads/$BUSYBOX.tar.bz2
- bunzip2 $BUSYBOX.tar.bz2 && tar xf $BUSYBOX.tar
-}
-
-cd $BUSYBOX
-make defconfig
-sed -i 's/# CONFIG_STATIC .*/CONFIG_STATIC=y/' .config
-make -j4 busybox
-make install
-
-## Create initrd
-
-echo "[+] create initrd $INITRD ..."
-
-cd _install
-
-# 1. create initrd folder structure
-mkdir -p bin sbin etc proc sys usr/bin usr/sbin dev
-
-# 2. create init process
-cat <<EOF > init
-#!/bin/sh
-
-mount -t proc none /proc
-mount -t sysfs none /sys
-
-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
-find . -print0 \
- | cpio --null -ov --format=newc \
- | gzip -9 > $INITRD