From 39b9430cf8a3356c06b9c909c24bb54bb615ba0c Mon Sep 17 00:00:00 2001 From: aheirman <48590738+aheirman@users.noreply.github.com> Date: Sat, 13 Feb 2021 13:11:06 +0100 Subject: [PATCH] Createimg now creates a working 1G partition --- createimg.sh | 22 ++++++++++++++-------- pkgs/tiny-linux-bootloader/bsect.patch | 10 ++++++++++ pkgs/tiny-linux-bootloader/build.sh | 1 + 3 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 pkgs/tiny-linux-bootloader/bsect.patch diff --git a/createimg.sh b/createimg.sh index 1139811..ea708a6 100755 --- a/createimg.sh +++ b/createimg.sh @@ -1,25 +1,31 @@ #!/bin/sh +rm iglunix.img + dd if=../tiny-linux-bootloader/disk of=iglunix.img -exit -TOTAL=`stat -c %s iglunix.img` -SECTOR=$(($TOTAL / 512)) - -dd if=/dev/zero count=$((3145727 - $SECTOR)) >> iglunix.img +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 -32256 +${PARTITION_START} -a -1 w " | fdisk iglunix.img +exit + # losetup -o 32256 /dev/loop0 iglunix.img # mkfs.vfat /dev/loop0 # mount /dev/loop0 ./isoroot 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() {