Skip to content

Instantly share code, notes, and snippets.

@braian87b
Last active March 7, 2017 02:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save braian87b/7a50f5634b6b39748cf72d42ff7d4476 to your computer and use it in GitHub Desktop.
Save braian87b/7a50f5634b6b39748cf72d42ff7d4476 to your computer and use it in GitHub Desktop.
Testing ext-root rootfs on SD Card for PogoPlug Mobile
# This commands executed on OpenWrt on 128mb internal Flash on a PogoPlug Mobile
# Yet something is missing to make it work, but I think I am close
# Install some stuff
opkg install usbutils
opkg install fdisk
opkg install kmod-usb-storage block-mount kmod-fs-ext4
opkg install e2fsprogs
# List Partitions on SD
fdisk -l /dev/mmcblk0
# Clean Partition Table
dd if=/dev/zero of=/dev/mmcblk0 bs=64k count=1
# Create 1 entire primary partition
cat <<'__EOF__' | fdisk /dev/mmcblk0
n
p
1
w
q
__EOF__
# list partitions on SD
fdisk -l /dev/mmcblk0
#Disk /dev/mmcblk0: 7.4 GiB, 7948206080 bytes, 15523840 sectors
#Units: sectors of 1 * 512 = 512 bytes
#Sector size (logical/physical): 512 bytes / 512 bytes
#I/O size (minimum/optimal): 512 bytes / 512 bytes
#Disklabel type: dos
#Disk identifier: 0xd69f6a7f
#
#Device Boot Start End Sectors Size Id Type
#/dev/mmcblk0p1 2048 15523839 15521792 7.4G 83 Linux
mkfs.ext3 /dev/mmcblk0p1 -L rootfs
# Download OpenWrt rootfs
cd /tmp
wget http://downloads.openwrt.org/chaos_calmer/15.05.1/kirkwood/generic/openwrt-15.05.1-kirkwood-generic-rootfs.tar.gz
wget http://downloads.openwrt.org/chaos_calmer/15.05.1/kirkwood/generic/openwrt-15.05.1-kirkwood-zImage
wget http://downloads.openwrt.org/chaos_calmer/15.05.1/kirkwood/generic/md5sums
# check that zImage and rootfs.tar.gz are OK
md5sum -c md5sums 2>/dev/null | grep OK
# create mount point
mkdir /mnt/mmcblk0p1
# mount SD partition
mount /dev/mmcblk0p1 /mnt/mmcblk0p1
# extract rootfs.tar.gz to ext rootfs at /mnt/mmcblk0p1
cd /mnt/mmcblk0p1
tar xvzf /tmp/openwrt*rootfs.tar.gz
# create boot directory and copy those files.
mkdir boot
cp /boot/zImage ./boot/zImage
cp /boot/kirkwood-pogoplug_v4.dtb ./boot/kirkwood-pogoplug_v4.dtb
# unmount
sync
cd ~/
umount /mnt/mmcblk0p1
# reboot to test
reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment