2014-06-27 11:54:29 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2014-09-04 04:56:29 +00:00
|
|
|
if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then
|
|
|
|
set -x
|
|
|
|
fi
|
2014-06-27 11:54:29 +00:00
|
|
|
set -eu
|
|
|
|
set -o pipefail
|
|
|
|
|
2014-09-04 04:56:29 +00:00
|
|
|
|
2014-06-27 11:54:29 +00:00
|
|
|
[ -n "$TARGET_ROOT" ]
|
|
|
|
|
|
|
|
source $_LIB/img-functions
|
|
|
|
|
2014-12-13 17:14:06 +00:00
|
|
|
IMAGE_PATH=$(readlink -f $IMAGE_NAME)
|
2014-06-27 11:54:29 +00:00
|
|
|
cd $TARGET_ROOT
|
|
|
|
|
|
|
|
echo "#disabled" > ./tmp/fstab.new
|
|
|
|
sudo mv ./tmp/fstab.new ./etc/fstab
|
|
|
|
sudo ln -s ./sbin/init ./
|
|
|
|
|
2014-12-13 17:14:06 +00:00
|
|
|
sudo find . -path ./sys -prune -o -path ./proc -prune -o -print | sudo cpio -o -H newc | gzip > ${IMAGE_PATH}.initramfs
|
2014-06-27 11:54:29 +00:00
|
|
|
|
|
|
|
select_boot_kernel_initrd $TARGET_ROOT
|
2014-12-13 17:14:06 +00:00
|
|
|
sudo cp $BOOTDIR/$KERNEL ${IMAGE_PATH}.vmlinuz
|