build_release() { local RELEASE_DIR="$1" local ROOTFS_SQFS="$2" local fname=$(find $PKGDEPLOYDIR/linux/ -name 'vmlinuz*') local linux_image=$(basename $fname) local rootfs_image=$(basename $ROOTFS_SQFS) cp -r "$fname" "$RELEASE_DIR" cp "$ROOTFS_SQFS" "$RELEASE_DIR" cp "$SCRIPTDIR/cfg/$CFG/install.sh" "$RELEASE_DIR" cp "$SCRIPTDIR/cfg/$CFG/genimage.sh" "$RELEASE_DIR" cp "/usr/share/syslinux/mbr.bin" "$RELEASE_DIR" sed -i 's/ROOTFSFILE/'$rootfs_image'/g' "$RELEASE_DIR/install.sh" sed -i 's/KERNELFILE/'$linux_image'/g' "$RELEASE_DIR/install.sh" sed -i 's/ROOTFSFILE/'$rootfs_image'/g' "$RELEASE_DIR/genimage.sh" sed -i 's/KERNELFILE/'$linux_image'/g' "$RELEASE_DIR/genimage.sh" cat > "$RELEASE_DIR/syslinux.cfg" << _EOF timeout 0 totaltimeout 50 default linux label linux kernel /$linux_image append root=/dev/sda1 root_sfs=/$rootfs_image _EOF }