For convenience I added compiled kernel files (uImage, dts, boot.scr) to the bin folder if you just want to update your system. Just copy the files to /BOOT.
General:
sudo apt install git build-essential
For u-boot build:
sudo apt install gcc-arm-linux-gnueabihf \
bison flex swig python3-distutils python3-dev
For Linux Kernel 5.7:
sudo apt install libssl-dev u-boot-tools
For generating Debian rootfs:
sudo apt install multistrap qemu-user-static
thanks @omgmog
Run:
./auto-create-image.sh
Copy image to SD card (Replace /dev/sdX with your SD card):
sudo dd bs=4M if=clockworkpi-debian.img of=/dev/sdX conv=fsync
If you have problems, try using bs=1M
.
Use lsblk
to make sure you are working with the SD card. Replace /dev/sdX
with your device.
sudo fdisk /dev/sdX
- Delete all existent partitions. Use
d
to delete. - Create two new primary partitions. Use option
n
to create.
First Partition Start = 8192 End = 93814
Second partition Start = 94218 End = XXX
- End = Size available for your OS. You can use any size.
- Define
vfat
type for first partition. Uset
,1
to select first partition, and use codec
forW95 FAT32 (LBA)
- Define
ext
type for second partition. Uset
,2
to select second partition, and use83
forLinux
.
You must have a similar table (Use p
to check):
Device Boot Start End Sectors Size Id Type
/dev/sdb1 8192 93814 85623 41.8M c W95 FAT32 (LBA)
/dev/sdb2 94208 62521343 62427136 29.8G 83 Linux
- Use
w
to write new partition table.
sudo mkfs.vfat /dev/sdX1
sudo fatlabel /dev/sdX1 BOOT
sudo mkfs.ext4 /dev/sdX2 -L rootfs
git clone git://git.denx.de/u-boot.git --depth=1
cd u-boot
cp ../cpi-u-boot.patch .
git apply cpi-u-boot.patch
export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabihf-
make clockworkpi-cpi3_defconfig
make
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=1024 seek=8
cd ..
You can use mainline. I use smaeul's for better power management support.
git clone https://github.com/smaeul/linux.git --branch=patch/irqchip-v2 --depth=1
cd linux
cp ../cpi-kernel-5.7.smaeul.patch .
git apply cpi-kernel-5.7.smaeul.patch
export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabihf-
make clockworkpi_cpi3_defconfig
make
mkimage -A arm -O linux -T kernel -C none -a 0x40008000 -e 0x40008000 -n "Linux kernel" -d arch/arm/boot/zImage uImage
chmod +x uImage
sudo cp -p uImage /media/$USER/BOOT/
sudo cp -p arch/arm/boot/dts/sun8i-r16-clockworkpi-cpi3.dtb /media/$USER/BOOT/
sudo cp -p arch/arm/boot/dts/sun8i-r16-clockworkpi-cpi3-hdmi.dtb /media/$USER/BOOT/
cd ..
mkimage -C none -A arm -T script -d boot.cmd boot.scr
sudo cp -p boot.scr /media/$USER/BOOT/
If you want to have wifi already connected, change the contents of wpa_supplicant.conf
with your information.
sudo ./create-debian.sh
sudo rsync -axHAX --progress target-rootfs/ /media/$USER/rootfs/
sudo umount /media/$USER/rootfs
Don't interrupt the script. It uses chroot.
umount will take a while, be patient.
Insert SD cart in the device and boot.
If you have a error with apt like:
dpkg: error processing package base-files (--configure):
installed base-files package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of bash:
Run on the device:
apt clean
apt remove base-files
apt install base-files bash
Use alsamixer
to unmute AIF1 Slot 0
:
Navigate with cursor and use M
to unmute.
https://wiki.debian.org/Locale
- HDMI audio doesn't work, the sound is being routed to GameShell speakers. To have HDMI out connect the HDMI cable and reboot.
Charging/Power LED doesn't work.FIXED
https://www.acmesystems.it/debian_wheezy
https://github.com/jubinson/debian-rootfs.git
https://github.com/clockworkpi/USB-Ethernet
https://linux-sunxi.org/U-Boot