Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Debian stretch on Iomega|Lenovo EZ Media
# # STEP 1 - Debian x64 on Oracle VirtualBox
# Run Debian x64 on VirtualBox and open terminal
user@ubuntu:~$ sudo su
root@ubuntu:/home/user# apt-get install u-boot-tools parted gdisk -y
# Main working directory
root@ubuntu:/home/user# mkdir iomegaez
root@ubuntu:/home/user# cd iomegaez
# Download files
root@ubuntu:/home/user/iomegaez# wget https://www.dropbox.com/s/wsyuzr69se20um2/Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2
root@ubuntu:/home/user/iomegaez# wget wget https://forum.doozan.com/file.php?2,file=1456,filename=kirkwood-lenovo-iomega-ez.dtb,download=1 -O kirkwood-lenovo-iomega-ez.dtb
# Working rootfs directory
root@ubuntu:/home/user/iomegaez# mkdir Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi
# Extract files
root@ubuntu:/home/user/iomegaez# tar -jxvf Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi.tar.bz2 -C Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi
# Make kernel files
root@ubuntu:/home/user/iomegaez# cd ./Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi/boot/
root@ubuntu:/home/user/iomegaez/Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi/boot# cp -a zImage-4.12.1-kirkwood-tld-1 zImage.fdt
root@ubuntu:/home/user/iomegaez/Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi/boot# cat ../../kirkwood-lenovo-iomega-ez.dtb >> zImage.fdt
root@ubuntu:/home/user/iomegaez/Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi/boot# INITRD_IMAGE="initrd.img-4.12.1-kirkwood-tld-1"
root@ubuntu:/home/user/iomegaez/Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi/boot# LINUX_TLD="Linux-4.12.1-kirkwood-tld-1"
root@ubuntu:/home/user/iomegaez/Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi/boot# mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n $INITRD_IMAGE -d $INITRD_IMAGE uInitrd
Image Name: initrd.img-4.12.1-kirkwood-tld-1
Created: Sun Jul 14 20:52:09 2019
Image Type: ARM Linux RAMDisk Image (gzip compressed)
Data Size: 7245632 Bytes = 7075.81 KiB = 6.91 MiB
Load Address: 00000000
Entry Point: 00000000
root@ubuntu:/home/user/iomegaez/Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi/boot# mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n $LINUX_TLD -d zImage.fdt uImage
Image Name: Linux-4.12.1-kirkwood-tld-1
Created: Sun Jul 14 20:53:55 2019
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 3834623 Bytes = 3744.75 KiB = 3.66 MiB
Load Address: 00008000
Entry Point: 00008000
# Connect disk to Ubuntu VM and prepare disk
root@ubuntu:/home/user/iomegaez/Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi/boot# dd if=uImage of=/dev/sdb bs=1MiB seek=10
root@ubuntu:/home/user/iomegaez/Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi/boot# dd if=uInitrd of=/dev/sdb bs=1MiB seek=20
root@ubuntu:/home/user/iomegaez/Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi/boot# cd .. & cd ..
root@ubuntu:/home/user/iomegaez# parted -s /dev/sdb mklabel gpt mkpart swap linux-swap 100MiB 8.1GiB mkpart rootfs ext3 8.1GiB 24.1GiB mkpart Data ext3 24.1GiB 100%
# Prepare rootfs partition
root@ubuntu:/home/user/iomegaez# mkfs.ext3 /dev/sdb2 -L rootfs
root@ubuntu:/home/user/iomegaez# mkdir /mnt/sdb2 && mount /dev/sdb2 /mnt/sdb2
root@ubuntu:/home/user/iomegaez# tar -C ./Debian-4.12.1-kirkwood-tld-1-rootfs-bodhi/ -cvf - . | tar -C /mnt/sdb2 -xf -
root@ubuntu:/home/user/iomegaez# sync; sync; sync
root@ubuntu:/home/user/iomegaez# umount /mnt/sdb2 && rmdir /mnt/sdb2
root@ubuntu:/home/user/iomegaez# e2label /dev/sdb2 rootfs
# # STEP 2 - Serial monitor (speed: 115200)
Marvell>> printenv
Marvell>> setenv bootargs 'root=/dev/sda2 init=/bin/systemd fsck.mode=force fsck.repair=yes console=ttyS0,115200 mtdparts=spi_flash:0x7e000@0(u-boot),0x1000@0x7f000(env),0x1000@0x7e000(env2)'
Marvell>> setenv bootcmd 'ide read 0x40000 0x5000 0x2000; ide read 0x2100000 0xA000 0x4000; bootm 0x40000 0x2100000'
Marvell>> saveenv
Marvell>> boot
# # STEP 3 - SSH shell
root@debian:~# apt-get update
root@debian:~# apt-get full-upgrade -y
root@debian:~# apt autoremove
root@debian:~# apt-get install ca-certificates parted -y
root@debian:~# mkswap /dev/sda1
root@debian:~# swapon /dev/sda1
root@debian:~# free -h
root@debian:~# dpkg-reconfigure tzdata
root@debian:~# reboot
# # RESTORE DEFAULT Enviroment settings for STOCK FIRMWARE - Serial monitor (speed: 115200)
Marvell>> resetenv
Marvell>> reset
# # UPDATE KERNEL to last stable release (Linux Kernel Kirkwood: https://forum.doozan.com/read.php?2,12096)
root@debian:~# apt-get remove flash-kernel
root@debian:~# cd /boot
root@debian:~# wget https://www.dropbox.com/s/9nfk49x6ts34tp7/linux-5.1.11-kirkwood-tld-2-bodhi.tar.bz2
root@debian:~# tar -xjf linux-5.1.11-kirkwood-tld-2-bodhi.tar.bz2
root@debian:~# tar -xf linux-dtb-5.1.11-kirkwood-tld-2.tar
root@debian:~# dpkg -i linux-image-5.1.11-kirkwood-tld-2_2.0_armel.deb
root@debian:~# mv uImage uImage.orig
root@debian:~# cp -a zImage-5.1.11-kirkwood-tld-2 zImage.fdt
root@debian:~# cat dts/kirkwood-lenovo-iomega-ez.dtb >> zImage.fdt
root@debian:~# mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-5.1.11-kirkwood-tld-2 -d zImage.fdt uImage
root@debian:~# mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initramfs-5.1.11-kirkwood-tld-2 -d initrd.img-5.1.11-kirkwood-tld-2 uInitrd
root@debian:~# sync; sync; sync
root@debian:~# reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.