From: <abe...@us...> - 2015-12-16 03:58:28
|
Revision: 7409 http://sourceforge.net/p/astlinux/code/7409 Author: abelbeck Date: 2015-12-16 03:58:25 +0000 (Wed, 16 Dec 2015) Log Message: ----------- astlinux-makeimage, build our own HOST fdisk that is compatible with our './scripts/bximage' binary blob Modified Paths: -------------- branches/1.0/boot/runnix/runnix.mk branches/1.0/scripts/astlinux-makeimage Added Paths: ----------- branches/1.0/package/fdisk/ branches/1.0/package/fdisk/fdisk.mk Modified: branches/1.0/boot/runnix/runnix.mk =================================================================== --- branches/1.0/boot/runnix/runnix.mk 2015-12-15 00:29:22 UTC (rev 7408) +++ branches/1.0/boot/runnix/runnix.mk 2015-12-16 03:58:25 UTC (rev 7409) @@ -15,7 +15,7 @@ $(DL_DIR)/$(RUNNIX_SOURCE): $(WGET) -P $(DL_DIR) $(RUNNIX_SITE)/$(RUNNIX_SOURCE) -$(RUNNIX_DIR)/.unpacked: $(DL_DIR)/$(RUNNIX_SOURCE) +$(RUNNIX_DIR)/.unpacked: $(DL_DIR)/$(RUNNIX_SOURCE) | host-fdisk $(RUNNIX_CAT) $(DL_DIR)/$(RUNNIX_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) - touch $(RUNNIX_DIR)/.unpacked Added: branches/1.0/package/fdisk/fdisk.mk =================================================================== --- branches/1.0/package/fdisk/fdisk.mk (rev 0) +++ branches/1.0/package/fdisk/fdisk.mk 2015-12-16 03:58:25 UTC (rev 7409) @@ -0,0 +1,48 @@ +############################################################# +# +# fdisk - HOST-Only +# +# Used by: ./scripts/astlinux-makeimage +# +############################################################# +FDISK_VERSION = $(FDISK_VERSION_MAJOR).1 +FDISK_VERSION_MAJOR = 2.20 +FDISK_SOURCE = util-linux-$(FDISK_VERSION).tar.bz2 +FDISK_SITE = http://www.kernel.org/pub/linux/utils/util-linux/v$(FDISK_VERSION_MAJOR) + +HOST_FDISK_DEPENDENCIES = host-pkg-config +HOST_FDISK_CONF_ENV = scanf_cv_type_modifier=no + +HOST_FDISK_CONF_OPT += --disable-rpath --disable-makeinstall-chown --without-ncurses + +HOST_FDISK_CONF_OPT += \ + --disable-agetty \ + --disable-arch \ + --disable-cramfs \ + --disable-ddate \ + --disable-fallocate \ + --disable-fsck \ + --disable-kill \ + --disable-libblkid \ + --disable-libmount \ + --disable-libuuid \ + --disable-last \ + --disable-mesg \ + --disable-mount \ + --disable-partx \ + --disable-pivot_root \ + --disable-raw \ + --disable-rename \ + --disable-reset \ + --disable-schedutils \ + --disable-switch_root \ + --disable-unshare \ + --disable-uuidd \ + --disable-wall \ + --disable-write + +define HOST_FDISK_INSTALL_CMDS + $(INSTALL) -m 0755 -D $(@D)/fdisk/fdisk $(HOST_DIR)/usr/sbin/fdisk +endef + +$(eval $(call AUTOTARGETS,package,fdisk,host)) Modified: branches/1.0/scripts/astlinux-makeimage =================================================================== --- branches/1.0/scripts/astlinux-makeimage 2015-12-15 00:29:22 UTC (rev 7408) +++ branches/1.0/scripts/astlinux-makeimage 2015-12-16 03:58:25 UTC (rev 7409) @@ -7,8 +7,13 @@ PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin -REQUIRED_CMDS="which sudo mkdosfs mkfs fdisk losetup gzip" +HOST_BIN="./output/host/usr/sbin" +# Package host-fdisk builds: +REQUIRED_HOST_CMDS="fdisk" + +REQUIRED_CMDS="which sudo mkdosfs mkfs losetup gzip" + RUNNIX_VER="$(awk -F'=' '/^RUNNIX_VER/ { print $2; exit }' boot/runnix/runnix.mk)" RUNNIX_DIR="output/build/runnix-${RUNNIX_VER// /}" @@ -60,6 +65,12 @@ fi error=0 +for i in $REQUIRED_HOST_CMDS; do + if [ ! -x "$HOST_BIN/$i" ]; then + error=1 + echo "astlinux-makeimage: Required HOST command \"$i\" is missing." >&2 + fi +done for i in $REQUIRED_CMDS; do if ! which $i >/dev/null 2>&1; then error=1 @@ -154,14 +165,14 @@ echo -e "n\np\n1\n\n\nt\n6\na\n1" fi echo "w" -) | sudo fdisk -C $CYL -H $HEADS -S $SECTORS ${LOOPD}0 +) | sudo $HOST_BIN/fdisk -c=dos -u=cylinders -C $CYL -H $HEADS -S $SECTORS ${LOOPD}0 temp="${LOOPD}0" PREFIXLEN=${#temp} PREFIX="^${temp//\//\/}" # need to filter out bootable marker ('*') so it doesn't show up as $2 -eval $(sudo fdisk -u -l ${LOOPD}0 | tr '*' ' ' | awk "/${PREFIX}/ { printf \"%s=%s\\n\", substr(\$1, $PREFIXLEN+1), \$2; }") +eval $(sudo $HOST_BIN/fdisk -c=dos -u=sectors -l ${LOOPD}0 | tr '*' ' ' | awk "/${PREFIX}/ { printf \"%s=%s\\n\", substr(\$1, $PREFIXLEN+1), \$2; }") if [ -z "$p1" -o \( $AST_SIZE -gt 0 -a -z "$p2" \) ]; then echo "Couldn't extract partition offsets." >&2 @@ -223,7 +234,7 @@ fi if [ -n "$DUMP_PARTITIONS" ]; then - sudo fdisk -l -u ${LOOPD}0 + sudo $HOST_BIN/fdisk -c=dos -u=sectors -l ${LOOPD}0 fi sudo losetup -d ${LOOPD}0 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |