diff --git a/ports/gptfdisk.hash b/ports/gptfdisk.hash new file mode 100644 index 0000000..8e45234 --- /dev/null +++ b/ports/gptfdisk.hash @@ -0,0 +1 @@ +8799b535db3d55dca0fef5c73f383d4536ddc50d diff --git a/ports/gptfdisk.port b/ports/gptfdisk.port new file mode 100644 index 0000000..f39e855 --- /dev/null +++ b/ports/gptfdisk.port @@ -0,0 +1,9 @@ +LICENSE := GPLv2 +VERSION := 0.8.1 +DOWNLOADS := gptfdisk.git + +URL(gptfdisk) := https://github.com/kini/gptfdisk.git +REV(gptfdisk) := 0541b56fee4e92822340a2b2387508dd58d0ca7c +DIR(gptfdisk) := src/app/gptfdisk + +PATCHES := src/app/sgdisk/patches/*.patch diff --git a/run/sgdisk.run b/run/sgdisk.run new file mode 100644 index 0000000..813cc7f --- /dev/null +++ b/run/sgdisk.run @@ -0,0 +1,140 @@ +create_boot_directory + + +import_from_depot [depot_user]/src/[base_src] \ + [depot_user]/src/acpi_drv \ + [depot_user]/src/ahci_drv \ + [depot_user]/src/init \ + [depot_user]/src/libc \ + [depot_user]/src/ncurses \ + [depot_user]/src/platform_drv \ + [depot_user]/src/posix \ + [depot_user]/src/report_rom \ + [depot_user]/src/stdcxx \ + [depot_user]/src/vfs + + +build { app/sgdisk } + +set config { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2000-01-01 00:00 + + + + + + + + + + + + + + + + + + + +} + +install_config $config + + +build_boot_image { + sgdisk + libuuid.lib.so + popt.lib.so +} + + +# Create empty image file! +set image_file "bin/image.raw" +set image_size 20 +eval "exec -ignorestderr dd if=/dev/zero of=$image_file bs=1M count=$image_size" + + +append qemu_args " -nographic -device ahci,id=ahci " +append qemu_args " -drive id=disk,file=$image_file,format=raw,if=none -device ide-hd,drive=disk,bus=ahci.0 -boot d " + + +run_genode_until ".*child \"sgdisk\" exited.*\n" 20 diff --git a/src/app/sgdisk/patches/add_missing_include.patch b/src/app/sgdisk/patches/add_missing_include.patch new file mode 100644 index 0000000..1fdde3c --- /dev/null +++ b/src/app/sgdisk/patches/add_missing_include.patch @@ -0,0 +1,11 @@ +index 3735b9f..ec083cf 100644 +--- src/app/gptfdisk/diskio-unix.cc ++++ src/app/gptfdisk/diskio-unix.cc +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + #include + + #ifdef __linux__ diff --git a/src/app/sgdisk/patches/fix_uuid_header_path.patch b/src/app/sgdisk/patches/fix_uuid_header_path.patch new file mode 100644 index 0000000..27bee02 --- /dev/null +++ b/src/app/sgdisk/patches/fix_uuid_header_path.patch @@ -0,0 +1,11 @@ +--- src/app/gptfdisk/guid.h ++++ src/app/gptfdisk/guid.h +@@ -26,7 +26,7 @@ + #endif + typedef unsigned char my_uuid_t[16]; + #else // Not Windows +-#include ++#include + typedef uuid_t my_uuid_t; + #endif + diff --git a/src/app/sgdisk/target.mk b/src/app/sgdisk/target.mk new file mode 100644 index 0000000..d252a34 --- /dev/null +++ b/src/app/sgdisk/target.mk @@ -0,0 +1,35 @@ +TARGET = sgdisk + +LIBS += libc stdcxx posix libuuid popt ncurses + +GPTFDISK_PORT_DIR := $(call select_from_ports,gptfdisk) +GPTFDISK_DIR := $(GPTFDISK_PORT_DIR)/src/app/gptfdisk + +SRC_CC := attributes.cc +SRC_CC += basicmbr.cc +SRC_CC += bsd.cc +SRC_CC += crc32.cc +SRC_CC += diskio-unix.cc +SRC_CC += diskio.cc +SRC_CC += gpt.cc +SRC_CC += gptcl.cc +SRC_CC += gptcurses.cc +SRC_CC += gptpart.cc +SRC_CC += gpttext.cc +SRC_CC += guid.cc +SRC_CC += mbr.cc +SRC_CC += mbrpart.cc +SRC_CC += parttypes.cc +SRC_CC += sgdisk.cc +SRC_CC += support.cc + + +CC_CXX_OPT += -fpermissive + +# too much to cope with... +CC_WARN = + +vpath %.cc $(REP_DIR)/src/app/gptfdisk +vpath %.cc $(GPTFDISK_DIR) + +CC_CXX_WARN_STRICT =