|
|
@ -5,14 +5,17 @@ set -ex |
|
|
|
initramfs_dir=$(mktemp -d /tmp/cdist-preos.XXXXXXX) |
|
|
|
initramfs_dir=$(mktemp -d /tmp/cdist-preos.XXXXXXX) |
|
|
|
# initramfs_dir=$1 |
|
|
|
# initramfs_dir=$1 |
|
|
|
|
|
|
|
|
|
|
|
for dir in bin sbin etc proc sys newroot; do |
|
|
|
for dir in bin sbin etc proc sys newroot usr/bin usr/sbin; do |
|
|
|
mkdir -p ${initramfs_dir}/$dir |
|
|
|
mkdir -p ${initramfs_dir}/$dir |
|
|
|
done |
|
|
|
done |
|
|
|
touch ${initramfs_dir}/etc/mdev.conf |
|
|
|
touch ${initramfs_dir}/etc/mdev.conf |
|
|
|
|
|
|
|
|
|
|
|
cp init "${initramfs_dir}/init" |
|
|
|
cp init "${initramfs_dir}/init" |
|
|
|
cp $(which busybox) "${initramfs_dir}/bin" |
|
|
|
cp $(which busybox) "${initramfs_dir}/bin" |
|
|
|
ln -fs busybox "${initramfs_dir}/bin/sh" |
|
|
|
|
|
|
|
|
|
|
|
for link in sh mount; do |
|
|
|
|
|
|
|
ln -fs busybox "${initramfs_dir}/bin/$link" |
|
|
|
|
|
|
|
done |
|
|
|
|
|
|
|
|
|
|
|
cd "${initramfs_dir}" |
|
|
|
cd "${initramfs_dir}" |
|
|
|
find . | cpio -H newc -o | gzip |
|
|
|
find . | cpio -H newc -o | gzip |