public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Liam McLoughlin" <hexxeh@hexxeh.net>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gentoaster:master commit in: /
Date: Sun,  5 Jun 2011 23:32:11 +0000 (UTC)	[thread overview]
Message-ID: <4d2593cdefcdc24edd46d2e28a8dd4d38769501d.hexxeh@gentoo> (raw)

commit:     4d2593cdefcdc24edd46d2e28a8dd4d38769501d
Author:     Liam McLoughlin <hexxeh <AT> hexxeh <DOT> net>
AuthorDate: Sat Jun  4 17:01:12 2011 +0000
Commit:     Liam McLoughlin <hexxeh <AT> hexxeh <DOT> net>
CommitDate: Sat Jun  4 17:01:12 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoaster.git;a=commit;h=4d2593cd

Fixed offset but now mounting fails

---
 create_image.sh |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/create_image.sh b/create_image.sh
index e403df9..61ab9e7 100755
--- a/create_image.sh
+++ b/create_image.sh
@@ -4,7 +4,7 @@ IMAGE_BASENAME="${1}"
 IMAGE_NAME="${IMAGE_BASENAME}.image"
 IMAGE_OUT="${IMAGE_BASENAME}.vdi"
 BOOT_MEGABYTES=64
-SWAP_MEGABYTES=512
+SWAP_MEGABYTES=128
 IMAGE_MEGABYTES="${2}"
 IMAGE_BYTES=$(( ${IMAGE_MEGABYTES} * 1024 * 1024 ))
 TIMEZONE="Europe/London"
@@ -33,7 +33,7 @@ umount -d rootfs/dev &>> ${LOG_FILE}
 umount -d rootfs/proc &>> ${LOG_FILE}
 umount -d rootfs/boot &>> ${LOG_FILE}
 umount -d rootfs &>> ${LOG_FILE}
-#losetup -d ${LOOP_DEV_ROOT}
+losetup -d ${LOOP_DEV_ROOT}
 }
 cleanup_mounts
 
@@ -43,10 +43,10 @@ echo -e "\x55\xaa" | dd bs=1 count=2 seek=510 of=${IMAGE_NAME} conv=notrunc &>>
 LOOP_DEV_IMAGE=`losetup -f`
 losetup ${LOOP_DEV_IMAGE} ${IMAGE_NAME} &>> ${LOG_FILE}
 
-sfdisk ${LOOP_DEV_IMAGE} -uM &>> ${LOG_FILE} << EOF
+sfdisk ${LOOP_DEV_IMAGE} -H64 -S32 &>> ${LOG_FILE} << EOF
 1,${BOOT_MEGABYTES},83,*
-,${SWAP_MEGABYTES},82,-
-,,83,-
+$(( 1+ ${BOOT_MEGABYTES} )),${SWAP_MEGABYTES},82,-
+$(( 1+ ${BOOT_MEGABYTES} + ${SWAP_MEGABYTES} )),,83,-
 EOF
 sleep 2
 losetup -d ${LOOP_DEV_IMAGE}
@@ -55,19 +55,19 @@ losetup -d ${LOOP_DEV_IMAGE}
 echo "Creating filesystems"
 
 LOOP_DEV_BOOT=`losetup -f`
-losetup -o 512 ${LOOP_DEV_BOOT} ${IMAGE_NAME}
+losetup -o $(( 512 * 2048 )) ${LOOP_DEV_BOOT} ${IMAGE_NAME}
 mkfs -t ext2 ${LOOP_DEV_BOOT} &>> ${LOG_FILE}
 sleep 2
 losetup -d ${LOOP_DEV_BOOT}
 
 LOOP_DEV_ROOT=`losetup -f`
-losetup -o $(( 512  + ( ${BOOT_MEGABYTES} * 1024 * 1024 ) + ( ${SWAP_MEGABYTES} * 1024 * 1024 ) )) ${LOOP_DEV_ROOT} ${IMAGE_NAME}
+losetup -o $(( ( 512 * 2048 )  + ( ${BOOT_MEGABYTES} * 1024 * 1024 ) + ( ${SWAP_MEGABYTES} * 1024 * 1024 ) )) ${LOOP_DEV_ROOT} ${IMAGE_NAME}
 mkfs -t ext3 ${LOOP_DEV_ROOT} &>> ${LOG_FILE}
 #sleep 2
 #losetup -d ${LOOP_DEV_ROOT}
 
 LOOP_DEV_SWAP=`losetup -f`
-losetup -o $(( 512 + ( ${BOOT_MEGABYTES} * 1024 * 1024 ) )) ${LOOP_DEV_SWAP} ${IMAGE_NAME}
+losetup -o $(( ( 512 * 2048 ) + ( ${BOOT_MEGABYTES} * 1024 * 1024 ) )) ${LOOP_DEV_SWAP} ${IMAGE_NAME}
 mkswap ${LOOP_DEV_SWAP} &>> ${LOG_FILE}
 sleep 2 
 losetup -d ${LOOP_DEV_SWAP}
@@ -76,10 +76,10 @@ echo "Mounting fileystems"
 
 echo "Mount root"
 mkdir -p rootfs
-mount -o loop,offset=$(( 512  + ( ${BOOT_MEGABYTES} * 1024 * 1024 ) + ( ${SWAP_MEGABYTES} * 1024 * 1024 ) )) ${IMAGE_NAME} rootfs
+mount -o loop,offset=$(( ( 512 * 2048 )  + ( ${BOOT_MEGABYTES} * 1024 * 1024 ) + ( ${SWAP_MEGABYTES} * 1024 * 1024 ) )) ${IMAGE_NAME} rootfs
 echo "Mount boot"
 mkdir -p rootfs/boot
-mount -o loop,offset=512 ${IMAGE_NAME} rootfs/boot
+mount -o loop,offset=$(( 512 * 2048 )) ${IMAGE_NAME} rootfs/boot
 cd rootfs
 
 # Setup Gentoo



             reply	other threads:[~2011-06-05 23:32 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-05 23:32 Liam McLoughlin [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-08-23 21:29 [gentoo-commits] proj/gentoaster:master commit in: / Liam McLoughlin
2011-08-19 13:09 Liam McLoughlin
2011-08-15  2:24 Liam McLoughlin
2011-08-15  2:00 Liam McLoughlin
2011-08-15  1:54 Liam McLoughlin
2011-08-14 15:46 Liam McLoughlin
2011-08-12 23:18 Liam McLoughlin
2011-08-12 23:17 Liam McLoughlin
2011-08-12 23:17 Liam McLoughlin
2011-08-11 20:31 [gentoo-commits] proj/gentoaster:webui " Liam McLoughlin
2011-08-12 23:18 ` [gentoo-commits] proj/gentoaster:master " Liam McLoughlin
2011-07-15 20:41 [gentoo-commits] proj/gentoaster:webui " Liam McLoughlin
2011-08-12 23:17 ` [gentoo-commits] proj/gentoaster:master " Liam McLoughlin
2011-07-11 14:00 Liam McLoughlin
2011-07-10 23:53 Liam McLoughlin
2011-07-08 22:41 Liam McLoughlin
2011-07-08 18:47 Liam McLoughlin
2011-07-08 18:35 Liam McLoughlin
2011-07-08 18:27 Liam McLoughlin
2011-07-08 17:27 Liam McLoughlin
2011-07-08  2:45 Liam McLoughlin
2011-06-16  1:01 Liam McLoughlin
2011-06-16  1:01 Liam McLoughlin
2011-06-14 21:28 Liam McLoughlin
2011-06-14 21:03 Liam McLoughlin
2011-06-14 20:44 Liam McLoughlin
2011-06-08  0:06 Liam McLoughlin
2011-06-05 23:32 Liam McLoughlin
2011-06-05 23:32 Liam McLoughlin
2011-06-04  3:47 Liam McLoughlin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4d2593cdefcdc24edd46d2e28a8dd4d38769501d.hexxeh@gentoo \
    --to=hexxeh@hexxeh.net \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox