payload: {"push_id":4448195422,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"5e5e92b7c3e751affa067a365f1787cd8e5ffb10","before":"836d5395a556f345fce8ffee933ec8d967f86930","commits":[{"sha":"5e5e92b7c3e751affa067a365f1787cd8e5ffb10","author":{"name":"Christian Mauderer","email":"6e153e0b007d41886131fe1b3c497d3f384be07d@c-mauderer.de"},"message":"ath79: generate firmware image for aircube-isp\n\nThis adds a \"factory\" image for the aircube-isp devices. Note that the\nfirmware can't be uploaded without prior special preparation. For the\nmost recent instructions on how to do that, visit the OpenWRT wiki page\nof the Ubiquiti airCube ISP for details:\n\nhttps://openwrt.org/toh/ubiquiti/ubiquiti_aircube_isp\n\nCurrent procedure:\n\nWith the original firmware 2.5.0 it is possible to upload and execute a\nscript via the configuration. To do that download and unpack the\noriginal configuration, adapt uhttpd config to execute another lua\nhandler (placed in the config directory) and pack and upload it again.\n\nThe lua handler can call a script that mounts an overlayfs and modifies\nthe \"fwupdate.real\" binary so that an unsigned image is accepted. The\noverlayfs is necessary because a security system (called tomoyo) doesn't\nallow binaries in other locations than /sbin/fwupdate.real (and maybe\nsome more) to access the flash when executed via network.\n\nA big thanks to Torvald Menningen (Snap) from the OpenWRT forum for\nfinding out how to patch the binary so that it accepts an unsigned\nimage.\n\nThe current step-by-step procedure is:\n\n- Use a version 2.5.0 of the original firmware. This is important\n  because a binary file will be modified.\n- Download a configuration.\n- Unpack it (it's just a tar gz file without an ending).\n- Add the following to uhttpd:\n\n``````\nconfig 'uhttpd' 'other'\n\tlist listen_http    0.0.0.0:8080\n\tlist listen_http    [::]:8080\n\toption 'home'       '/tmp/persistent/config/patch/www'\n\toption lua_prefix   '/lua'\n\toption lua_handler  '/tmp/persistent/config/patch/handler.lua'\n``````\n\n- Create a `patch` subfolder.\n- Create a `patch/www` subfolder.\n- Create a `patch/handler.lua` with the following content:\n\n``````\nfunction handle_request(env)\n    uhttpd.send(\"Status: 200 OK\\r\\n\")\n    uhttpd.send(\"Content-Type: text/plain\\r\\n\\r\\n\")\n\n    local command = \"/bin/sh /tmp/persistent/config/patch/patch.sh 2>&1\"\n\n    local proc = assert(io.popen(command))\n    for line in proc:lines() do\n        uhttpd.send(line..\"\\r\\n\")\n    end\n    proc:close()\nend\n``````\n\n- Create a `patch/patch.sh` with the following content:\n\n``````\n#!/bin/sh -x\n\nset -e\nset -u\nset -x\n\nUBNTBOX_PATCHED=\"/tmp/fwupdate.real\"\nMD5FILE=\"/tmp/patchmd5\"\n\ncat <<EOF > ${MD5FILE}\nc33235322da5baca5a7b237c09bc8df1  /sbin/fwupdate.real\nEOF\n\n# check md5 of files that will be patched\nif ! md5sum -c ${MD5FILE}\nthen\n        echo \"******** Error when checking files. Refuse to do anything. ********\"\n        exit 0\nfi\n\n# prepare some overlay functionality\nLOWERDIR=\"/tmp/lower_root\"\nmkdir -p ${LOWERDIR}\nmount -t squashfs -oro /dev/mtdblock3 ${LOWERDIR}\noverlay_some_path()\n{\n        PATH_TO_OVERLAY=$1\n        ALIAS=$2\n        UPPERDIR=\"/tmp/over_${ALIAS}\"\n        WORKDIR=\"/tmp/over_${ALIAS}_work\"\n\n        mkdir -p ${UPPERDIR}\n        mkdir -p ${WORKDIR}\n\n        mount -t overlay -o lowerdir=${LOWERDIR}${PATH_TO_OVERLAY},upperdir=${UPPERDIR},workdir=${WORKDIR} overlay ${PATH_TO_OVERLAY}\n}\n\n# patch the ubntbox binary.\noverlay_some_path \"/sbin\" \"sbin\"\necho -en '\\x10' | dd of=/sbin/fwupdate.real conv=notrunc bs=1 count=1 seek=24598\n\necho \"******** Done ********\"\n``````\n\n- Repack the configuration.\n- Upload it via the normal web interface.\n- Wait about a minute. The webserver should restart.\n- Now there is a second web server at port 8080 which can call the lua\n  script. Visit the page with a web browser. Link is for example\n  http://192.168.1.1:8080/lua\n- You should see the output of the script with a \"*** Done ***\" at the\n  end. Note that the patches are not permanent. If you restart the\n  router you have to re-visit the link (but not re-upload the config).\n- Now you can upload an unsigned binary via the normal web interface.\n\nSigned-off-by: Christian Mauderer <oss@c-mauderer.de>","distinct":true,"url":"https://api.github.com/repos/openwrt/openwrt/commits/5e5e92b7c3e751affa067a365f1787cd8e5ffb10"}]}
other: {"actor":{"display_login":"jow-"}}