Changelog:
20150121:
20150131:
20161102:
—-
To this you'll need:
This guide will cover the process to recreate the official Ubuntu Minimal image. Tested and written on a Ubuntu 16.04 64Bits x86 Machine.
sudo apt-get install debootstrap qemu-user-static
mkdir ~/ubuntu cd ubuntu export ubuntu=`pwd`
dd if=/dev/zero of=./image.img bs=1M count=4096
fdisk image.img n p 1 <return> +128M t c n p 2 <return> <return> w
sudo losetup /dev/loop0 ./image.img sudo partprobe /dev/loop0 sudo mkfs.vfat -n boot /dev/loop0p1 sudo mkfs.ext4 -L rootfs /dev/loop0p2 sudo tune2fs /dev/loop0p2 -U e139ce78-9841-40fe-8823-96a304a09859 sudo tune2fs -O ^has_journal /dev/loop0p2
wget https://raw.githubusercontent.com/mdrjr/c1_uboot_binaries/master/bl1.bin.hardkernel wget https://raw.githubusercontent.com/mdrjr/c1_uboot_binaries/master/u-boot.bin wget https://raw.githubusercontent.com/mdrjr/c1_uboot_binaries/master/sd_fusing.sh chmod +x sd_fusing.sh sudo ./sd_fusing.sh /dev/loop0
mkdir -p target sudo mount /dev/loop0p2 target sudo mkdir -p target/media/boot sudo mount /dev/loop0p1 target/media/boot sudo mkdir -p target/usr/bin sudo cp /usr/bin/qemu-arm-static target/usr/bin sudo debootstrap --variant=buildd --arch armhf xenial target http://ports.ubuntu.com
sudo chroot target cat << EOF > /etc/apt/sources.list deb http://ports.ubuntu.com/ubuntu-ports/ xenial main universe restricted deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial main universe restricted deb http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main universe restricted deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main universe restricted deb http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-backports main restricted deb http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-security main restricted deb http://ports.ubuntu.com/ubuntu-ports/ xenial-security universe deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-security universe deb http://ports.ubuntu.com/ubuntu-ports/ xenial-security multiverse deb-src http://ports.ubuntu.com/ubuntu-ports/ xenial-security multiverse EOF apt-get update apt-get install software-properties-common u-boot-tools isc-dhcp-client ubuntu-minimal ssh apt-key adv --keyserver keyserver.ubuntu.com --recv-keys D986B59D echo "deb http://deb.odroid.in/c1/ xenial main" > /etc/apt/sources.list.d/odroid.list apt-get update apt-get install linux-image-c1 bootini
At this point.. You'll have several errors, That's fine.
You can ignore it right now.
cp /boot/uImage* /media/boot/uImage
cat << EOF > /etc/network/interfaces.d/lo auto lo iface lo inet loopback EOF cat << EOF > /etc/network/interfaces.d/eth0 auto eth0 iface eth0 inet dhcp EOF
echo "LABEL=boot /media/boot vfat defaults 0 0" >> /etc/fstab echo "UUID=e139ce78-9841-40fe-8823-96a304a09859 / ext4 errors=remount-ro,noatime 0 1" >> /etc/fstab
passwd root
sed -i s/"PermitRootLogin without-password"/"PermitRootLogin yes"/g /etc/ssh/sshd_config
exit sudo umount target/media/boot sudo umount target sudo sync sudo losetup -d /dev/loop0
dd if=image.img of=/dev/sdX bs=1M
sudo apt-get install u-boot