This commit is contained in:
illiliti 2020-01-07 17:05:34 +03:00
parent 814dcf4cd7
commit bda2932d56
2 changed files with 5 additions and 5 deletions

View File

@ -22,7 +22,7 @@ kernel="$(uname -r)"
moddir="/lib/modules" moddir="/lib/modules"
# structure # structure
for d in bin dev etc usr/lib usr/bin mnt/root proc root sys; do for d in dev etc usr/lib usr/bin mnt/root proc root sys; do
mkdir -p "$tmpdir/$d" mkdir -p "$tmpdir/$d"
done done
@ -65,11 +65,11 @@ done
# install files # install files
cp ./init "$tmpdir/init" && chmod +x "$tmpdir/init" cp ./init "$tmpdir/init" && chmod +x "$tmpdir/init"
cp ./busybox "$tmpdir/bin/busybox" && chmod +x "$tmpdir/bin/busybox" cp ./busybox "$tmpdir/usr/bin/busybox" && chmod +x "$tmpdir/usr/bin/busybox"
# strip binaries and libraries # strip binaries and libraries
# uncomment this if your initramfs are huge # uncomment this if your initramfs are huge
#find "$tmpdir" -type f -executable -exec strip -s "{}" ";" find "$tmpdir" -type f -executable -exec strip -s "{}" ";"
# initialize config # initialize config
cat <<EOF > "$tmpdir/config" cat <<EOF > "$tmpdir/config"

4
init
View File

@ -1,10 +1,10 @@
#!/bin/busybox sh #!/usr/bin/busybox sh
# debugging # debugging
set -x set -x
# install busybox # install busybox
/bin/busybox --install -s /bin /usr/bin/busybox --install -s /usr/bin
panic() { echo "bruh moment :(" && sh; } panic() { echo "bruh moment :(" && sh; }