]> Zhao Yanbai Git Server - minix.git/commitdiff
arm_sdimage.sh: use native minix partition util 63/863/3
authorBen Gras <ben@minix3.org>
Thu, 26 Sep 2013 11:42:31 +0000 (13:42 +0200)
committerGerrit Code Review <gerrit@gerrit>
Fri, 27 Sep 2013 12:13:43 +0000 (14:13 +0200)
. make filesystems on primary partitions to make it
  easier on the minix partition util
. so sfdisk isn't required as an external tool
. also make partition and hitherto x86-only utilities
  arch-independent

Change-Id: Ib4e07e45d038d084dde1858917d3deb7f0616532

commands/Makefile
distrib/sets/lists/minix/md.i386
distrib/sets/lists/minix/mi
releasetools/arm_sdimage.sh
releasetools/gen_cmdline.txt.sh

index bfe16beb3294bfa9613769b89db5742643e0e072..9adb1353225b76a2475ed8ba357aa930de177ea7 100644 (file)
@@ -31,13 +31,10 @@ SUBDIR=     add_route arp ash at backup btrace \
        unstack update uud uue version vol \
        whereis which write writeisofs fetch \
        zdump zmodem pkgin_cd pkgin_all \
-       worldstone updateboot update_bootcfg
-
-.if ${MACHINE_ARCH} == "i386"
-SUBDIR+=       atnormalize dosread fdisk loadfont \
+       worldstone updateboot update_bootcfg \
+       atnormalize dosread fdisk loadfont \
        autopart part partition playwave  \
        recwave repartition screendump
-.endif
 
 .if ${MACHINE_ARCH} == "earm"
 SUBDIR+=       eepromread
index 35d8762ecaf0e362f938d95554eda3ca44462253..df78faacc0df82ed3915231c56824d672f89c1d9 100644 (file)
 ./sbin/hgfs                            minix-sys
 ./sbin/vbfs                            minix-sys
 ./sbin/virtio_blk                      minix-sys
-./usr/bin/atnormalize                  minix-sys
-./usr/bin/autopart                     minix-sys
-./usr/bin/dosdir                       minix-sys
-./usr/bin/dosread                      minix-sys
-./usr/bin/doswrite                     minix-sys
-./usr/bin/fdisk                                minix-sys
-./usr/bin/loadfont                     minix-sys
-./usr/bin/part                         minix-sys
-./usr/bin/partition                    minix-sys
-./usr/bin/playwave                     minix-sys
-./usr/bin/recwave                      minix-sys
-./usr/bin/repartition                  minix-sys
-./usr/bin/screendump                   minix-sys
 ./usr/include/gcc-4.5/abmintrin.h      minix-sys       gcccmds
 ./usr/include/gcc-4.5/ammintrin.h      minix-sys       gcccmds
 ./usr/include/gcc-4.5/avxintrin.h      minix-sys       gcccmds
index 726e1778de2d18a635af021bd1488c25d4de117b..591b55c5038f5eb59ef0e67f7c6e0b61e0431520 100644 (file)
 ./usr/bin/atf-run                      minix-sys       atf
 ./usr/bin/atf-sh                       minix-sys       atf
 ./usr/bin/atf-version                  minix-sys       atf,!kyua
+./usr/bin/atnormalize                   minix-sys
+./usr/bin/autopart                      minix-sys
 ./usr/bin/awk                          minix-sys
 ./usr/bin/backup                       minix-sys
 ./usr/bin/badblocks                    minix-sys       obsolete
 ./usr/bin/diff                         minix-sys
 ./usr/bin/dirname                      minix-sys
 ./usr/bin/diskctl                      minix-sys
+./usr/bin/dosdir                        minix-sys
+./usr/bin/dosread                       minix-sys
+./usr/bin/doswrite                      minix-sys
 ./usr/bin/du                           minix-sys
 ./usr/bin/dumpcore                     minix-sys
 ./usr/bin/egrep                                minix-sys
 ./usr/bin/expand                       minix-sys
 ./usr/bin/factor                       minix-sys
 ./usr/bin/fbdctl                       minix-sys
+./usr/bin/fdisk                         minix-sys
 ./usr/bin/fetch                                minix-sys
 ./usr/bin/fgrep                                minix-sys
 ./usr/bin/file                         minix-sys
 ./usr/bin/lessecho                     minix-sys
 ./usr/bin/lesskey                      minix-sys
 ./usr/bin/lex                          minix-sys
+./usr/bin/loadfont                      minix-sys
 ./usr/bin/loadramdisk                  minix-sys
 ./usr/bin/logger                       minix-sys
 ./usr/bin/login                                minix-sys
 ./usr/bin/objdump                      minix-sys       binutils
 ./usr/bin/od                           minix-sys
 ./usr/bin/page                         minix-sys
+./usr/bin/part                          minix-sys
+./usr/bin/partition                     minix-sys
 ./usr/bin/passwd                       minix-sys
 ./usr/bin/paste                                minix-sys
 ./usr/bin/patch                                minix-sys
 ./usr/bin/ping                         minix-sys
 ./usr/bin/pkgin_all                    minix-sys
 ./usr/bin/pkgin_cd                     minix-sys
+./usr/bin/playwave                      minix-sys
 ./usr/bin/postinstall                  minix-sys
 ./usr/bin/poweroff                     minix-sys
 ./usr/bin/pr                           minix-sys
 ./usr/bin/readelf                      minix-sys       binutils
 ./usr/bin/readlink                     minix-sys
 ./usr/bin/reboot                       minix-sys
+./usr/bin/recwave                       minix-sys
 ./usr/bin/ref                          minix-sys       obsolete
 ./usr/bin/remsync                      minix-sys
+./usr/bin/repartition                   minix-sys
 ./usr/bin/restore                      minix-sys
 ./usr/bin/rev                          minix-sys
 ./usr/bin/rget                         minix-sys
 ./usr/bin/rput                         minix-sys
 ./usr/bin/rsh                          minix-sys
 ./usr/bin/rz                           minix-sys
+./usr/bin/screendump                    minix-sys
 ./usr/bin/sed                          minix-sys
 ./usr/bin/seq                          minix-sys
 ./usr/bin/sha1                         minix-sys
index 9bdebca6bc82619a83f73ebb978cea23e5116113..cc74873dcdb59c88dfd7e52391db85b06f676ccc 100755 (executable)
@@ -51,7 +51,7 @@ fi
 
 export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:$PATH
 
-for needed in sfdisk mcopy dd wget mkfs.vfat
+for needed in mcopy dd wget mkfs.vfat
 do
        if ! which $needed 2>&1 > /dev/null
        then
@@ -95,22 +95,19 @@ sh ${BUILDSH} -V SLOPPY_FLIST=yes -V MKBINUTILS=yes -V MKGCCCMDS=yes -j ${JOBS}
 # All sized are written in 512 byte blocks
 #
 # we create a disk image of about 2 gig's
-# for alignement reasons, prefer sizes which are multiples of 4096 bytes
-#
-: ${IMG_SIZE= $((   2*(2**30) / 512))}
-: ${FAT_SIZE= $((  10*(2**20) / 512))}
-: ${ROOT_SIZE=$((  64*(2**20) / 512))}
-: ${HOME_SIZE=$(( 128*(2**20) / 512))}
-: ${USR_SIZE= $((1536*(2**20) / 512))}
+: ${IMG_SIZE=$((     2*(2**30) / 512))}
+: ${FAT_SIZE=$((    10*(2**20) / 512))}
+: ${ROOT_SIZE=$((   64*(2**20) / 512))}
+: ${HOME_SIZE=$((  128*(2**20) / 512))}
+: ${USR_SIZE=$((  1536*(2**20) / 512))}
 
 #
 # create a fstab entry in /etc this is normally done during the
 # setup phase on x86
 #
 cat >${FSTAB} <<END_FSTAB
-/dev/c0d0p1s0   /       mfs     rw                      0       1
-/dev/c0d0p1s1   /home   mfs     rw                      0       2
-/dev/c0d0p1s2   /usr    mfs     rw                      0       2
+/dev/c0d0p2   /home   mfs     rw                      0       2
+/dev/c0d0p3   /usr    mfs     rw                      0       2
 END_FSTAB
 
 rm -f ${DESTDIR}/SETS.*
@@ -131,38 +128,16 @@ dd if=/dev/zero of=${IMG_DIR}/usr.img bs=512 count=1 seek=$(($USR_SIZE -1)) 2>/d
 #
 dd if=/dev/zero of=${IMG} bs=512 count=1 seek=$(($IMG_SIZE -1))
 
-#
 # Do some math to determine the start addresses of the partitions.
-# Ensure the start of the partitions are always aligned, the end will 
-# always be as we assume the sizes are multiples of 4096 bytes, which
-# is always true as soon as you have an integer multiple of 1MB.
-#
+# Don't leave holes so the 'partition' invocation later is easy.
 FAT_START=2048
-EXTENDED_START=$(($FAT_START + $FAT_SIZE))
-EXTENDED_START=$(($EXTENDED_START + 8 - ($EXTENDED_START % 8)))
-ROOT_START=$(($EXTENDED_START + 1))
-ROOT_START=$(($ROOT_START + 8 - ($ROOT_START % 8)))
-HOME_START=$(($ROOT_START + $ROOT_SIZE + 1))
-HOME_START=$(($HOME_START + 8 - ($HOME_START % 8)))
-USR_START=$(($HOME_START + $HOME_SIZE + 1))
-USR_START=$(($USR_START + 8 - ($USR_START % 8)))
-EXTENDED_SIZE=$(($USR_START + $USR_SIZE - $EXTENDED_START))
-
-#
-# Generate the partitions using sfdisk to partition the
-#
-sfdisk -L --force --no-reread -q ${IMG} 1>/dev/null <<END_SFDISK
-# partition table of test.img
-unit: sectors
-
-test.img1 : start=     $FAT_START, size=    $FAT_SIZE, Id= c, bootable
-test.img2 : start=    $EXTENDED_START, size=  $EXTENDED_SIZE, Id= 5
-test.img3 : start=        0, size=        0, Id= 0
-test.img4 : start=        0, size=        0, Id= 0
-test.img5 : start=    $ROOT_START, size=   $ROOT_SIZE, Id=81
-test.img6 : start=   $HOME_START, size=   $HOME_SIZE, Id=81
-test.img7 : start=   $USR_START, size=   $USR_SIZE, Id=81
-END_SFDISK
+ROOT_START=$(($FAT_START + $FAT_SIZE))
+HOME_START=$(($ROOT_START + $ROOT_SIZE))
+USR_START=$(($HOME_START + $HOME_SIZE))
+
+# Write the partition table using the natively compiled
+# minix partition utility
+${CROSS_TOOLS}/nbpartition -m ${IMG} ${FAT_START} "c:${FAT_SIZE}*" 81:${ROOT_SIZE} 81:${HOME_SIZE} 81:${USR_SIZE}
 
 #
 # Format the fat partition and put the bootloaders
index 31c3c215d4d7809a09be0dadfda785683589c38c..ff8d87ee9adeeff7635fabfdee7febe6d78fcb20 100755 (executable)
@@ -27,4 +27,4 @@ do
 done
 
 
-echo console=$CONSOLE rootdevname=c0d0p1s0 verbose=$VERBOSE hz=$HZ
+echo console=$CONSOLE rootdevname=c0d0p1 verbose=$VERBOSE hz=$HZ