diff --git a/cfg/alix/release b/cfg/alix/release deleted file mode 100755 index aa1b5e5..0000000 --- a/cfg/alix/release +++ /dev/null @@ -1,30 +0,0 @@ -build_release() { - local RELEASE_DIR="$1" - - local ROOTFS_SQFS=$(find $PKGDEPLOYDIR/rootfs-${CFG}/ -name '*.img') - - 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 -} diff --git a/cfg/rpi3/release b/cfg/rpi3/release deleted file mode 100755 index e993ded..0000000 --- a/cfg/rpi3/release +++ /dev/null @@ -1,18 +0,0 @@ -build_release() { - local RELEASE_DIR="$1" - - local ROOTFS_SQFS=$(find $PKGDEPLOYDIR/rootfs-${CFG}/ -name '*.img') - - local rootfs_image=$(basename $ROOTFS_SQFS) - local bootdir="$RELEASE_DIR/boot" - - mkdir -p "$bootdir" - cp -r ${PKGDEPLOYDIR}/linux-rpi3/* "$bootdir" - cp -r ${PKGDEPLOYDIR}/boot-rpi3/* "$bootdir" - cp "$SCRIPTDIR/cfg/$CFG/cmdline.txt" "$bootdir" - cp "$ROOTFS_SQFS" "$bootdir" - sed -i 's/ROOTFSFILE/'$rootfs_image'/g' "$bootdir/cmdline.txt" - - cp "$SCRIPTDIR/cfg/$CFG/install.sh" "$RELEASE_DIR" - cp "$SCRIPTDIR/cfg/$CFG/genimage.sh" "$RELEASE_DIR" -} diff --git a/mk.sh b/mk.sh index 12e8fd1..d27041a 100755 --- a/mk.sh +++ b/mk.sh @@ -70,8 +70,7 @@ save_toolchain ############################### build packages ############################### echo "--- resolving package dependencies ---" -cat "$SCRIPTDIR/cfg/$CFG/PACKAGES" | sort -u > "$BUILDROOT/$CFG/rawpkg" - +echo "release-${CFG}" > "$BUILDROOT/$CFG/rawpkg" dependencies "$BUILDROOT/$CFG/rawpkg" "$PACKAGELIST" "pkg" cat "$PACKAGELIST" @@ -92,28 +91,3 @@ while read pkg; do restore_toolchain done < "$PACKAGELIST" -############################## release package ############################### - -echo "--- building release package ---" - -RELEASEDIR="$BUILDROOT/$CFG/release-$CFG" - -if [ -d "$RELEASEDIR" ]; then - rm -r "$RELEASEDIR" -fi - -mkdir -p "$RELEASEDIR" - -unset -f build_release -source "$SCRIPTDIR/cfg/$CFG/release" - -build_release "$RELEASEDIR" - -if [ -e "${BUILDROOT}/${CFG}/release-${CFG}.tar.gz" ]; then - rm "${BUILDROOT}/${CFG}/release-${CFG}.tar.gz" -fi - -pushd "$BUILDROOT/$CFG" > /dev/null -tar czf "${BUILDROOT}/${CFG}/release-${CFG}.tar.gz" "release-${CFG}" -popd > /dev/null - diff --git a/pkg/release-alix/build b/pkg/release-alix/build new file mode 100755 index 0000000..bb8cf8b --- /dev/null +++ b/pkg/release-alix/build @@ -0,0 +1,42 @@ +build() { + local SOURCE="$1" + local BUILD="$2" + local DEPLOY="$3" + + local ROOTFS_SQFS=$(find $PKGDEPLOYDIR/rootfs-${CFG}/ -name '*.img') + + local fname=$(find $PKGDEPLOYDIR/linux/ -name 'vmlinuz*') + local linux_image=$(basename $fname) + local rootfs_image=$(basename $ROOTFS_SQFS) + + cp -r "$fname" "$BUILD" + cp "$ROOTFS_SQFS" "$BUILD" + cp "$SCRIPTDIR/pkg/release-${CFG}/install.sh" "$BUILD" + cp "$SCRIPTDIR/pkg/release-${CFG}/genimage.sh" "$BUILD" + cp "/usr/share/syslinux/mbr.bin" "$BUILD" + + sed -i 's/ROOTFSFILE/'$rootfs_image'/g' "$BUILD/install.sh" + sed -i 's/KERNELFILE/'$linux_image'/g' "$BUILD/install.sh" + + sed -i 's/ROOTFSFILE/'$rootfs_image'/g' "$BUILD/genimage.sh" + sed -i 's/KERNELFILE/'$linux_image'/g' "$BUILD/genimage.sh" + +cat > "$BUILD/syslinux.cfg" << _EOF +timeout 0 +totaltimeout 50 +default linux +label linux + kernel /$linux_image + append root=/dev/sda1 root_sfs=/$rootfs_image +_EOF +} + +deploy() { + local SOURCE="$1" + local BUILD="$2" + local DEPLOY="$3" + + pushd "$PKGBUILDDIR" > /dev/null + tar czf "${DEPLOY}/release-${CFG}.tar.gz" "release-${CFG}" + popd > /dev/null +} diff --git a/cfg/alix/PACKAGES b/pkg/release-alix/depends similarity index 100% rename from cfg/alix/PACKAGES rename to pkg/release-alix/depends diff --git a/cfg/alix/genimage.sh b/pkg/release-alix/genimage.sh similarity index 100% rename from cfg/alix/genimage.sh rename to pkg/release-alix/genimage.sh diff --git a/cfg/alix/install.sh b/pkg/release-alix/install.sh similarity index 100% rename from cfg/alix/install.sh rename to pkg/release-alix/install.sh diff --git a/pkg/release-rpi3/build b/pkg/release-rpi3/build new file mode 100755 index 0000000..816f27c --- /dev/null +++ b/pkg/release-rpi3/build @@ -0,0 +1,30 @@ +build() { + local SOURCE="$1" + local BUILD="$2" + local DEPLOY="$3" + + local ROOTFS_SQFS=$(find $PKGDEPLOYDIR/rootfs-${CFG}/ -name '*.img') + + local rootfs_image=$(basename $ROOTFS_SQFS) + local bootdir="$BUILD/boot" + + mkdir -p "$bootdir" + cp -r ${PKGDEPLOYDIR}/linux-rpi3/* "$bootdir" + cp -r ${PKGDEPLOYDIR}/boot-rpi3/* "$bootdir" + cp "$SCRIPTDIR/pkg/release-${CFG}/cmdline.txt" "$bootdir" + cp "$ROOTFS_SQFS" "$bootdir" + sed -i 's/ROOTFSFILE/'$rootfs_image'/g' "$bootdir/cmdline.txt" + + cp "$SCRIPTDIR/pkg/release-${CFG}/install.sh" "$BUILD" + cp "$SCRIPTDIR/pkg/release-${CFG}/genimage.sh" "$BUILD" +} + +deploy() { + local SOURCE="$1" + local BUILD="$2" + local DEPLOY="$3" + + pushd "$PKGBUILDDIR" > /dev/null + tar czf "${DEPLOY}/release-${CFG}.tar.gz" "release-${CFG}" + popd > /dev/null +} diff --git a/cfg/rpi3/cmdline.txt b/pkg/release-rpi3/cmdline.txt similarity index 100% rename from cfg/rpi3/cmdline.txt rename to pkg/release-rpi3/cmdline.txt diff --git a/cfg/rpi3/PACKAGES b/pkg/release-rpi3/depends similarity index 100% rename from cfg/rpi3/PACKAGES rename to pkg/release-rpi3/depends diff --git a/cfg/rpi3/genimage.sh b/pkg/release-rpi3/genimage.sh similarity index 100% rename from cfg/rpi3/genimage.sh rename to pkg/release-rpi3/genimage.sh diff --git a/cfg/rpi3/install.sh b/pkg/release-rpi3/install.sh similarity index 100% rename from cfg/rpi3/install.sh rename to pkg/release-rpi3/install.sh