diff --git a/createimg.sh b/createimg.sh old mode 100755 new mode 100644 index 4b3e7fe..55d1e04 --- a/createimg.sh +++ b/createimg.sh @@ -1,31 +1,57 @@ #!/bin/sh +echo "Createimg.sh" -# TOTAL=`stat -c %s iglunix.img` - -# SECTOR=$(($TOTAL / 512)) - -# dd if=/dev/zero count=$((3145727 - $SECTOR)) >> iglunix.img - +rm iglunix.img dd if=../tiny-linux-bootloader/disk of=iglunix.img -#dd if=/dev/zero count=32768 > iglunix.img -dd if=/dev/zero bs=1 count=0 seek=1G of=./iglunix.img + +source build_utils + +FILE_SIZE=$(stat -c %s iglunix.img) +echo "FILE_SIZE=${FILE_SIZE}" +PARTITION_START=$(($FILE_SIZE / 512)) +PARTITION_START=$(($PARTITION_START + 1)) +echo "PARTITION_START=${PARTITION_START}" + +#create room for a partition +ls -al iglunix.img -h +dd if=/dev/zero bs=1 count=0 seek=1G of=iglunix.img +ls -al iglunix.img -h echo "o n p 1 -45505 - -a -1 +${PARTITION_START} w " | fdisk iglunix.img +PARTITION_START2=$((${PARTITION_START} * 512)) +echo "PARTITION_START2: ${PARTITION_START2}" +LOOPBACK=$(losetup -o ${PARTITION_START2} -s -f iglunix.img) +echo "LOOPBACK: ${LOOPBACK}" +mke2fs -t ext4 -L "__IGLUNIX_ROOT" ${LOOPBACK} -#dd conv=notrunc bs=1 count=446 if=../tiny-linux-bootloader/disk of=iglunix.img -#dd conv=notrunc bs=1 skip=510 seek=510 if=../tiny-linux-bootloader/disk of=iglunix.img +ROOT=/mnt/__IGLUNIX_ROOT +umount ${ROOT} +rm -rf ${ROOT} + +mkdir -p ${ROOT} +mount ${LOOPBACK} ${ROOT} + +packages=(musl mksh bmake gmake libressl cmake curl rsync flex byacc om4 zlib samurai libffi python ca-certificates zlib expat gettext-tiny git kati netbsd-curses kakoune iglunix rust toybox busybox less file pci-ids e2fsprogs linux-pam kbd) +cp_packages ${ROOT} + +echo "Using the host keymap" +cp /etc/vconsole.conf ${ROOT}/etc/vconsole.conf + +echo "Unmounting & closing loopback" + +umount ${ROOT} + +losetup -d ${LOOPBACK} +exit # losetup -o 32256 /dev/loop0 iglunix.img # mkfs.vfat /dev/loop0 diff --git a/iglupkg.sh b/iglupkg.sh index 832adc4..5f1fd75 100755 --- a/iglupkg.sh +++ b/iglupkg.sh @@ -1,5 +1,5 @@ #!/bin/sh -export JOBS="64" +export JOBS="$(nproc)" export RUSTFLAGS="-C target-cpu=native" export CC=clang diff --git a/pkgs/tiny-linux-bootloader/bsect.patch b/pkgs/tiny-linux-bootloader/bsect.patch new file mode 100644 index 0000000..d8466ba --- /dev/null +++ b/pkgs/tiny-linux-bootloader/bsect.patch @@ -0,0 +1,10 @@ +--- bsect.asm ++++ bsect.asm +@@ -15,7 +15,6 @@ + ; You should have received a copy of the GNU General Public License + ; along with this program. If not, see . + +-%define DEBUG + %include "config.inc" + + [BITS 16] diff --git a/pkgs/tiny-linux-bootloader/build.sh b/pkgs/tiny-linux-bootloader/build.sh index 78cdc71..6dc5e3a 100644 --- a/pkgs/tiny-linux-bootloader/build.sh +++ b/pkgs/tiny-linux-bootloader/build.sh @@ -6,6 +6,7 @@ fetch() { tar -xf $pkgname-$pkgver.tar.xz cd $pkgname-$pkgver patch -p1 < ../../build.patch + patch -p1 < ../../bsect.patch } package() {