You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
512 B
31 lines
512 B
10 years ago
|
#!/bin/sh
|
||
|
set -ex
|
||
|
|
||
|
|
||
|
initramfs_dir=$(mktemp -d /tmp/cdist-preos.XXXXXXX)
|
||
|
# initramfs_dir=$1
|
||
|
|
||
10 years ago
|
for dir in bin sbin etc proc sys newroot usr/bin usr/sbin; do
|
||
10 years ago
|
mkdir -p ${initramfs_dir}/$dir
|
||
|
done
|
||
|
touch ${initramfs_dir}/etc/mdev.conf
|
||
|
|
||
|
cp init "${initramfs_dir}/init"
|
||
|
cp $(which busybox) "${initramfs_dir}/bin"
|
||
10 years ago
|
|
||
|
for link in sh mount; do
|
||
|
ln -fs busybox "${initramfs_dir}/bin/$link"
|
||
|
done
|
||
10 years ago
|
|
||
|
cd "${initramfs_dir}"
|
||
|
find . | cpio -H newc -o | gzip
|
||
|
|
||
|
exit 0
|
||
|
|
||
|
# TODO:
|
||
|
# - Kernel modules
|
||
|
# - ssh
|
||
|
# - various mkfs
|
||
|
# - libs
|
||
|
|