Skip to content

Instantly share code, notes, and snippets.

View EmbeddedAndroid's full-sized avatar

0x1 EmbeddedAndroid

View GitHub Profile
@EmbeddedAndroid
EmbeddedAndroid / qemu-ifup
Created September 15, 2013 17:24
Mac OSX (10.8.X) /etc/qemu-ifup script for QEMU/KVM bridged networking.
#!/bin/bash
echo "Executing /etc/qemu-ifup"
echo "Creating bridge"
sysctl -w net.link.ether.inet.proxyall=1
sysctl -w net.inet.ip.forwarding=1
sysctl -w net.inet.ip.fw.enable=1
ifconfig bridge0 create
echo "Bringing up $1 for bridged mode"
ifconfig $1 0.0.0.0 up
echo "Add $1 to bridge"
@EmbeddedAndroid
EmbeddedAndroid / qemu-ifdown
Created September 15, 2013 17:38
Mac OSX (10.8.X) /etc/qemu-ifdown script for QEMU/KVM bridged networking.
#!/bin/bash
echo "Executing /etc/qemu-ifdown"
echo "Bringing TAP interface down"
ifconfig $1 down
echo "Removing interfaces"
ifconfig bridge0 deletem en0 deletem $1
echo "Bring down bridge"
ifconfig bridge0 down
echo "Removing bridge"
ifconfig bridge0 destroy
@EmbeddedAndroid
EmbeddedAndroid / gist:54d6a7f8a8f13e8fdf71
Last active July 13, 2018 08:07
nv-uboot on Chromebook2
1) Enter Developer Mode
Disclaimer. I will take no responsibility if you somehow brick your chrome book. You should only attempt the following if you are familiar with embedded system hackery :)
With the laptop turned off, hold down the escape and refresh keys, then press the power key
The device is now in Recovery Mode, pressing Ctrl-D will enable Developer Mode.
Confirm the action by pressing Enter.
@EmbeddedAndroid
EmbeddedAndroid / no-really-flash-it.sh
Created November 21, 2014 06:25
Nexus 9 flashing script. Use when encountering 'fastboot data length is too large' errors.
#!/bin/sh
apt-get install android-tools-fastboot unzip
fastboot flash bootloader $1
fastboot reboot-bootloader
sleep 5
unzip $2
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash system system.img
ip -6 route add <ipv6-prefix>::/<subnet> dev docker0
sysctl net.ipv6.conf.default.forwarding=1
sysctl net.ipv6.conf.all.forwarding=1
sysctl net.ipv6.conf.enP2p1s0.accept_ra=2
service ndppd restart
service docker restart
@EmbeddedAndroid
EmbeddedAndroid / build-arm64.sh
Created April 5, 2017 21:08
minideb build script for arm64
#!/bin/bash
cd /root
apt-get update
apt-get install -y debootstrap debian-archive-keyring git devscripts build-essential
git clone https://github.com/bitnami/minideb.git
cd minideb
./mkimage stretch-arm64.tar stretch
@EmbeddedAndroid
EmbeddedAndroid / build-armhf.sh
Created April 5, 2017 21:12
minideb build script for armhf
#!/bin/bash
cd /root
apt-get update
apt-get install -y debootstrap debian-archive-keyring git devscripts build-essential
git clone https://github.com/bitnami/minideb.git
cd minideb
./mkimage stretch-armhf.tar stretch
@EmbeddedAndroid
EmbeddedAndroid / refresh-slave.sh
Created April 6, 2017 03:05
Update your slave container
#!/bin/bash
sudo docker pull kernelci/lava-slave-docker-v2-lab-tbaker:latest
sudo docker stop lava-slave-01
sudo docker rm lava-slave-01
sudo docker run -dit -v /dev:/dev -e LAVA_SERVER_IP='192.168.1.21' -e LAVA_MASTER=192.168.1.16 --name=lava-slave-01 -h lava-slave-01 --privileged kernelci/lava-slave-docker-v2-lab-tbaker:latest
@EmbeddedAndroid
EmbeddedAndroid / build-minideb.sh
Last active July 11, 2017 19:05
Minideb Multiarch Build Script
#!/bin/bash
cd /root
install_packages debootstrap debian-archive-keyring git devscripts build-essential
GIT_SSL_NO_VERIFY=true git clone https://github.com/bitnami/minideb.git
cd minideb
./mkimage stretch-$ARCH.tar stretch
@EmbeddedAndroid
EmbeddedAndroid / test-alpine.sh
Created July 11, 2017 19:51
Alpine Build Script
#!/bin/bash
GIT_SSL_NO_VERIFY=true git clone https://github.com/EmbeddedAndroid/alpine-docker.git
cd alpine-docker
chmod a+x wrapper.sh mkimage-alpine.sh
if [ $ARCH = "arm64" ]; then
if [ $REL == "edge" ]; then
./wrapper.sh -a aarch64 -o alpine -r $REL
else