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:16:42 +0200
committerjohannst <johannes.stoelp@gmail.com>2021-07-15 21:16:42 +0200
commit617d73fc9eff5b08a80b873fd97f66caa7e80fc9 (patch)
tree170fe178500cbc7815f5a9fbb4751bb9b14c2cc0 /content/20191027-kernel-debugging-qemu/build_initrd.sh
parent1a088951089023d4ee18f01a0b83b71287c4d847 (diff)
downloadblog-617d73fc9eff5b08a80b873fd97f66caa7e80fc9.tar.gz
blog-617d73fc9eff5b08a80b873fd97f66caa7e80fc9.zip
added dockerfile for kernel dev
Diffstat (limited to 'content/20191027-kernel-debugging-qemu/build_initrd.sh')
-rwxr-xr-x[-rw-r--r--]content/20191027-kernel-debugging-qemu/build_initrd.sh12
1 files changed, 8 insertions, 4 deletions
diff --git a/content/20191027-kernel-debugging-qemu/build_initrd.sh b/content/20191027-kernel-debugging-qemu/build_initrd.sh
index 74f9896..fd82990 100644..100755
--- a/content/20191027-kernel-debugging-qemu/build_initrd.sh
+++ b/content/20191027-kernel-debugging-qemu/build_initrd.sh
@@ -1,8 +1,12 @@
#!/bin/bash
+if test $(id -u) -ne 0; then
+ SUDO=sudo
+fi
+
set -e
-BUSYBOX=busybox-1.31.0
+BUSYBOX=busybox-1.33.1
INITRD=$PWD/initramfs.cpio.gz
## Build busybox
@@ -40,9 +44,9 @@ 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
+$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 \