diff --git a/Config.in b/Config.in index fd2e243..e0b5626 100644 --- a/Config.in +++ b/Config.in @@ -1,5 +1,6 @@ source "$BR2_EXTERNAL_BUSINESSCARD_PATH/package/sunxi-tools-f1c100s/Config.in.host" source "$BR2_EXTERNAL_BUSINESSCARD_PATH/package/sunxi-tools-f1c100s/Config.in" +source "$BR2_EXTERNAL_BUSINESSCARD_PATH/package/businesscard-flashdrive/Config.in" source "$BR2_EXTERNAL_BUSINESSCARD_PATH/package/2048/Config.in" source "$BR2_EXTERNAL_BUSINESSCARD_PATH/package/fortune-mod/Config.in" source "$BR2_EXTERNAL_BUSINESSCARD_PATH/package/robotfindskitten/Config.in" diff --git a/board/businesscard/v1/genimage.cfg b/board/businesscard/v1/genimage.cfg index c55c467..ec9e29d 100644 --- a/board/businesscard/v1/genimage.cfg +++ b/board/businesscard/v1/genimage.cfg @@ -20,28 +20,6 @@ image flash.bin { } } -image flashdrive.vfat { - vfat { - files = { - "George Hilliard resume.pdf", - "README.txt" - } - } - size = 64K -} - -image flashdrive.img { - hdimage {} - partition businesscard { - partition-type = 0xc - image = "flashdrive.vfat" - } - // Hardcode a size here to help the ubi builder, which cannot infer a size - // of this image or wait until this image is built, due to the design of - // genimage. - size = 65K -} - image persist.ubifs { ubifs { extraargs = "--compr=zlib --jrn-size=192KiB --log-lebs=2" diff --git a/configs/thirtythreeforty_businesscard_defconfig b/configs/thirtythreeforty_businesscard_defconfig index 2e97ceb..2ad917f 100644 --- a/configs/thirtythreeforty_businesscard_defconfig +++ b/configs/thirtythreeforty_businesscard_defconfig @@ -59,11 +59,10 @@ BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y BR2_TARGET_UBOOT_FORMAT_CUSTOM=y BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-sunxi-with-spl.bin" BR2_TARGET_UBOOT_CUSTOM_DTS_PATH="$(BR2_EXTERNAL_BUSINESSCARD_PATH)/board/businesscard/v1/dts/*" -BR2_PACKAGE_HOST_GENIMAGE=y BR2_PACKAGE_HOST_MKPASSWD=y BR2_PACKAGE_HOST_MTD=y -BR2_PACKAGE_HOST_MTOOLS=y BR2_PACKAGE_HOST_SUNXI_TOOLS_F1C100S=y +BR2_PACKAGE_BUSINESSCARD_FLASHDRIVE=y BR2_PACKAGE_2048=y BR2_PACKAGE_FORTUNE_MOD=y BR2_PACKAGE_FORTUNE_MOD_COOKIES="computers;humorists;linuxcookie;literature;pratchett;startrek;wisdom" diff --git a/package/businesscard-flashdrive/Config.in b/package/businesscard-flashdrive/Config.in new file mode 100644 index 0000000..5e87928 --- /dev/null +++ b/package/businesscard-flashdrive/Config.in @@ -0,0 +1,11 @@ +config BR2_PACKAGE_BUSINESSCARD_FLASHDRIVE + bool "businesscard-flashdrive" + select BR2_PACKAGE_HOST_GENIMAGE + select BR2_PACKAGE_HOST_DOSFSTOOLS + select BR2_PACKAGE_HOST_MTOOLS + help + The "flash drive" image that appears when you plug my business card into + a PC. + + https://github.com/thirtythreeforty + diff --git a/package/businesscard-flashdrive/businesscard-flashdrive.mk b/package/businesscard-flashdrive/businesscard-flashdrive.mk new file mode 100644 index 0000000..0a8e871 --- /dev/null +++ b/package/businesscard-flashdrive/businesscard-flashdrive.mk @@ -0,0 +1,33 @@ +################################################################################ +# +# businesscard-flashdrive +# +################################################################################ + +BUSINESSCARD_FLASHDRIVE_SITE = $(BUSINESSCARD_FLASHDRIVE_PKGDIR)files +BUSINESSCARD_FLASHDRIVE_SITE_METHOD = local +BUSINESSCARD_FLASHDRIVE_LICENSE = Proprietary +BUSINESSCARD_FLASHDRIVE_DEPENDENCIES = host-genimage host-dosfstools host-mtools +BUSINESSCARD_INSTALL_IMAGES = YES +BUSINESSCARD_INSTALL_TARGET = NO + +define BUSINESSCARD_FLASHDRIVE_BUILD_CMDS + rm -rf "$(@D)/tmp" + mkdir -p $(@D)/dummyroot + $(HOST_DIR)/bin/genimage \ + --config $(@D)/genimage.cfg \ + --inputpath $(@D) \ + --outputpath $(@D) \ + --tmppath $(@D)/tmp \ + --rootpath $(@D)/dummyroot \ + --mcopy $(HOST_DIR)/bin/mcopy \ + --mkdosfs $(HOST_DIR)/sbin/mkdosfs + +endef + +define BUSINESSCARD_FLASHDRIVE_INSTALL_TARGET_CMDS + mkdir -p $(BINARIES_DIR) + cp $(@D)/flashdrive.img $(BINARIES_DIR)/flashdrive.img +endef + +$(eval $(generic-package)) diff --git a/package/businesscard-flashdrive/files/George Hilliard resume.pdf b/package/businesscard-flashdrive/files/George Hilliard resume.pdf new file mode 100644 index 0000000..51e7117 Binary files /dev/null and b/package/businesscard-flashdrive/files/George Hilliard resume.pdf differ diff --git a/package/businesscard-flashdrive/files/Photography/DSCF1746.jpg b/package/businesscard-flashdrive/files/Photography/DSCF1746.jpg new file mode 100644 index 0000000..c361511 Binary files /dev/null and b/package/businesscard-flashdrive/files/Photography/DSCF1746.jpg differ diff --git a/package/businesscard-flashdrive/files/Photography/DSCF2939.jpg b/package/businesscard-flashdrive/files/Photography/DSCF2939.jpg new file mode 100644 index 0000000..446a22e Binary files /dev/null and b/package/businesscard-flashdrive/files/Photography/DSCF2939.jpg differ diff --git a/package/businesscard-flashdrive/files/Photography/DSCF8816.jpg b/package/businesscard-flashdrive/files/Photography/DSCF8816.jpg new file mode 100644 index 0000000..136cb60 Binary files /dev/null and b/package/businesscard-flashdrive/files/Photography/DSCF8816.jpg differ diff --git a/package/businesscard-flashdrive/files/Photography/DSCF9255.jpg b/package/businesscard-flashdrive/files/Photography/DSCF9255.jpg new file mode 100644 index 0000000..2c0ce6e Binary files /dev/null and b/package/businesscard-flashdrive/files/Photography/DSCF9255.jpg differ diff --git a/package/businesscard-flashdrive/files/Photography/NaturalBridges.jpg b/package/businesscard-flashdrive/files/Photography/NaturalBridges.jpg new file mode 100644 index 0000000..b2c8cb9 Binary files /dev/null and b/package/businesscard-flashdrive/files/Photography/NaturalBridges.jpg differ diff --git a/package/businesscard-flashdrive/files/README.txt b/package/businesscard-flashdrive/files/README.txt new file mode 100644 index 0000000..8c534a2 --- /dev/null +++ b/package/businesscard-flashdrive/files/README.txt @@ -0,0 +1,55 @@ +ABOUT ME + +I am an embedded systems engineer. My specialty is designing software and +hardware for small microcontrollers and especially small Linux devices like this +business card. I do this both professionally and as a hobby. I am also fluent +in several computer languages, and comfortable working on any level of the +stack, from low-level drivers to cleanly-designed backend servers to smooth, +fluid Android apps. + +I'm also a decent amateur photographer, vehicle mechanic, and cook. + +If you'd like to work with me on business or a cool project, please don't +hesitate to reach out. (You have my card!) + +ABOUT THIS CARD + +This is a small Linux computer running a custom-built Linux distribution. It +has a $1.40 system-on-a-chip with 32MB RAM and 8MB storage; everything runs in +this very constrained environment. It is configured to appear as a "USB +gadget" -- a complete Linux device playing the role of a peripheral. + +In this case, the card emulates a very small flash drive. This readme is on +the flash drive alongside my resume and some of my photography (unfortunately +not many photos will fit in the remaining space, but it is enough for a sample). + +The card also emulates a serial port. You can use this to log into the card's +Linux shell and run programs -- it is a complete computer. On Windows, you can +use PuTTY or similar to connect to the COM port (you may need to open Device +Manager to discover which COM port number it has been assigned). On Linux, you +can use screen. Try this example command: + + sudo screen /dev/ttyUSB0 + +You should get a "Welcome" message and a login prompt once you connect (if not, +press Enter a few times). The username is "root" and there is no password. + +The card's functionality is limited by the "business card" form factor, so I +have mainly provided some amusements, as follows. Type any of the commands to +start them: + + micropython - a complete implementation of Python 3.4 + rogue - the original dungeon-crawling game (type Ctrl-C to quit) + fortune - random, hopefully interesting, quips from a bunch of sources + 2048 - the simple puzzle game + +The usual POSIX utilities such as vi and grep are present too. And finally, +there is a very small writable partition that will allow you to save your +progress in rogue, or write small Python programs. + +This operating system is based on the Buildroot distribution, which I ported to +the hardware which I designed. All the parts for the card cost me about $3. +You can get the source code at github.com/thirtythreeforty/businesscard-linux. + +Enjoy! +-- George Hilliard diff --git a/package/businesscard-flashdrive/files/genimage.cfg b/package/businesscard-flashdrive/files/genimage.cfg new file mode 100644 index 0000000..3be1c21 --- /dev/null +++ b/package/businesscard-flashdrive/files/genimage.cfg @@ -0,0 +1,18 @@ +image flashdrive.vfat { + vfat { + files = { + "Photography", + "George Hilliard resume.pdf", + "README.txt" + } + } + size = 1728K +} + +image flashdrive.img { + hdimage {} + partition businesscard { + partition-type = 0xc + image = "flashdrive.vfat" + } +}