diff --git a/board/businesscard/v1/genimage.cfg b/board/businesscard/v1/genimage.cfg index 02a70d8..178a4fb 100644 --- a/board/businesscard/v1/genimage.cfg +++ b/board/businesscard/v1/genimage.cfg @@ -1,6 +1,7 @@ flash w25q64 { - pebsize = 4096 - numpebs = 2048 + pebsize = 65536 + lebsize = 65408 + numpebs = 128 minimum-io-unit-size = 1 sub-page-size = 1 vid-header-offset = 64 @@ -41,6 +42,15 @@ image flashdrive.img { size = 65K } +image persist.ubifs { + ubifs { + extraargs = "--compr=zlib --jrn-size=64KiB --log-lebs=2" + } + size=1280K + flashtype = w25q64 + mountpoint = /root +} + image root.ubi { ubi {} partition kernel { @@ -59,6 +69,9 @@ image root.ubi { image = flashdrive.img read-only = true } + partition persist { + image = persist.ubifs + } } image boot.vfat { diff --git a/board/businesscard/v1/linux_defconfig b/board/businesscard/v1/linux_defconfig index 64d0805..5a81f9b 100644 --- a/board/businesscard/v1/linux_defconfig +++ b/board/businesscard/v1/linux_defconfig @@ -31,6 +31,7 @@ CONFIG_SUNXI_RSB=y CONFIG_MTD=y CONFIG_MTD_M25P80=y CONFIG_MTD_SPI_NOR=y +# CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BLOCK=y CONFIG_INPUT_POLLDEV=y @@ -95,6 +96,10 @@ CONFIG_PHY_SUN4I_USB=y # CONFIG_DNOTIFY is not set CONFIG_VFAT_FS=y CONFIG_TMPFS=y +CONFIG_UBIFS_FS=y +CONFIG_UBIFS_FS_ADVANCED_COMPR=y +# CONFIG_UBIFS_FS_LZO is not set +# CONFIG_UBIFS_FS_XATTR is not set CONFIG_SQUASHFS=y CONFIG_SQUASHFS_FILE_DIRECT=y # CONFIG_SQUASHFS_ZLIB is not set diff --git a/board/businesscard/v1/post-build.sh b/board/businesscard/v1/post-build.sh index b5dc5da..2d74798 100755 --- a/board/businesscard/v1/post-build.sh +++ b/board/businesscard/v1/post-build.sh @@ -1,3 +1,5 @@ #!/bin/sh grep -q "GADGET_SERIAL" "${TARGET_DIR}/etc/inittab" \ || echo '/dev/ttyGS0::respawn:/sbin/getty -L /dev/ttyGS0 0 vt100 # GADGET_SERIAL' >> "${TARGET_DIR}/etc/inittab" +grep -q "ubi0:persist" "${TARGET_DIR}/etc/fstab" \ + || echo 'ubi0:persist /root ubifs defaults 0 0' >> "${TARGET_DIR}/etc/fstab" diff --git a/board/businesscard/v1/uboot_defconfig b/board/businesscard/v1/uboot_defconfig index 78d7734..7996ffb 100644 --- a/board/businesscard/v1/uboot_defconfig +++ b/board/businesscard/v1/uboot_defconfig @@ -47,6 +47,7 @@ CONFIG_SPI_FLASH_ATMEL=y CONFIG_SPI_FLASH_GIGADEVICE=y CONFIG_SPI_FLASH_MACRONIX=y CONFIG_SPI_FLASH_WINBOND=y +# CONFIG_SPI_FLASH_USE_4K_SECTORS is not set CONFIG_SPI_FLASH_MTD=y CONFIG_PHY_SUN4I_USB=y CONFIG_PINCTRL=y diff --git a/patches/genimage/0001-prefix-mountpoints-with-mp.patch b/patches/genimage/0001-prefix-mountpoints-with-mp.patch new file mode 100644 index 0000000..1c3d27d --- /dev/null +++ b/patches/genimage/0001-prefix-mountpoints-with-mp.patch @@ -0,0 +1,29 @@ +commit f2b104aa68a0dff3f0bf6b481f9724722cb01939 +Author: George Hilliard +Date: Wed Aug 7 00:35:20 2019 -0500 + + Prefix mountpoints with mp- to avoid conflict with "root" + + Specifying an image with mountpoint "/root" would cause the mountpoint's + location to be "root", which conflicts with the location for the actual + filesystem root. + + Fix this by appending a prefix. + + Closes #67 on GitHub. + + Signed-off-by: George Hilliard + +diff --git a/genimage.c b/genimage.c +index ca2c6d6..aafd3b7 100644 +--- a/genimage.c ++++ b/genimage.c +@@ -392,7 +392,7 @@ static struct mountpoint *add_mountpoint(const char *path) + path_sanitized = sanitize_path(path); + mp = xzalloc(sizeof(*mp)); + mp->path = strdup(path); +- xasprintf(&mp->mountpath, "%s/%s", tmppath(), path_sanitized); ++ xasprintf(&mp->mountpath, "%s/mp-%s", tmppath(), path_sanitized); + list_add_tail(&mp->list, &mountpoints); + free(path_sanitized); +