Skip to content

Instantly share code, notes, and snippets.

@mrunalp
Created August 18, 2015 23:22
Show Gist options
  • Save mrunalp/0a7325b33b4fb9e0d075 to your computer and use it in GitHub Desktop.
Save mrunalp/0a7325b33b4fb9e0d075 to your computer and use it in GitHub Desktop.
#!/bin/bash
while read line
do
echo $line > /tmp/myoutput
done < /dev/stdin
mkdir -p /var/log/journal/9876
mkdir -p /busybox/var/log/journal/9876
mount --bind /var/log/journal/9876 /busybox/var/log/journal/9876
mkdir -p /tmp/busybox/etc/
echo "9876" > /tmp/busybox/etc/machine-id
touch /busybox/etc/machine-id
mount --bind /tmp/busybox/etc/machine-id /busybox/etc/machine-id
echo "DONE"
@rhatdan
Copy link

rhatdan commented Aug 19, 2015

You need to mount tmpfs at /run and /tmp, also, and we probably want to tar up the underlying layer.

Something like this untested snippet.

tar -xf  /tmp/run.tgz /busybox/run
mount -o tmpfs /busybox/run
tar cf /tmp/run.tgz -C /busybox/run .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment