Hi,

this patch adds the util-linux-ng application sfdisk to create a partition table
in a script based way.

For example:
sfdisk /dev/hdc << EOF
0,407
,407
;
;
EOF

creates the following partition table:
% sfdisk -l /dev/hdc
Disk /dev/hdc: 16 heads, 63 sectors, 2045 cylinders
Units = cylinders of 516096 bytes, blocks of 1024 bytes, counting from
0
   Device Boot Start     End   #cyls   #blocks   Id  System
/dev/hdc1          0+    406     407-   205096+  83  Linux native
/dev/hdc2        407     813     407    205128   83  Linux native
/dev/hdc3        814    2044    1231    620424   83  Linux native
/dev/hdc4          0       -       0         0    0  Empty

Please apply.

Thanks,
    Julius

Signed-off-by: Julius Schulz-Zander <jul...@net.t-labs.tu-berlin.de>

---


Index: package/util-linux-ng/Makefile
===================================================================
--- package/util-linux-ng/Makefile      2009-05-09 10:26:05.000000000 -0700
+++ package/util-linux-ng/Makefile      2009-07-18 21:54:19.000000000 -0700
@@ -46,6 +46,16 @@
  This package contains a utility for managing disk partition tables.
 endef
+define Package/sfdisk
+$(call Package/util-linux/Default)
+  SUBMENU:=disc
+  TITLE:=Partition table manipulation utility
+endef
+
+define Package/sfdisk/description
+ This package contains a utility for managing disk partition tables.
+endef
+
 define Package/losetup
 $(call Package/util-linux/Default)
   TITLE:=Loopback devices setup and control utility
@@ -100,7 +110,7 @@
 define Build/Compile
        $(MAKE) -C $(PKG_BUILD_DIR)/disk-utils mkswap
        $(MAKE) -C $(PKG_BUILD_DIR)/mount swapon losetup umount mount
-       $(MAKE) -C $(PKG_BUILD_DIR)/fdisk fdisk cfdisk
+       $(MAKE) -C $(PKG_BUILD_DIR)/fdisk fdisk cfdisk sfdisk
        $(MAKE) -C $(PKG_BUILD_DIR)/hwclock hwclock
        $(MAKE) -C $(PKG_BUILD_DIR)/sys-utils flock
 endef
@@ -114,6 +124,11 @@
        $(INSTALL_DIR) $(1)/sbin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/fdisk/cfdisk $(1)/sbin/
 endef
+define Package/sfdisk/install
+       $(INSTALL_DIR) $(1)/sbin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/fdisk/sfdisk $(1)/sbin/
+endef
+
define Package/losetup/install
        $(INSTALL_DIR) $(1)/sbin
@@ -137,6 +152,7 @@
 endef
define Package/flock/install
+$(eval $(call BuildPackage,sfdisk))
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/sys-utils/flock $(1)/usr/bin/
 endef
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to