[:de]Ich habe mal mein "altes" Script überarbeitet zum erstellen von einem Debian Image.
Die git Quellen sollte man entsprechend anpassen , da sie derzeit auf meine Testing zeigen und noch nicht alles funktioniert (jedenfalls M2 Ultra) der Rest sind aktuelle Quellen darin.
Verzeichnis zum erstellen mkdir build cd build Sources laden hier für den Banana M2 Ultra (r40) git clone --depth 1 -b r40 https://github.com/wens/u-boot-sunxi git clone --depth 1 -b r40 https://github.com/a1d3s/linux Image für die SD Karte erstellen 4GB dd if=/dev/zero of=image.img bs=1M count=3900 Image als Laufwerk laden losetup /dev/loop0 image.img Image partitonieren und formatieren fdisk /dev/loop0 partx -av /dev/loop0 mkfs.vfat /dev/loop0p1 mkfs.ext4 /dev/loop0p2 Arbeitsverzeichnis erstellen mkdir /mnt/rootfs mount /dev/loop0p2 /mnt/rootfs/ mount /dev/loop0p1 /mnt/rootfs/boot Variablen setzen zum bearbeiten targetdir=/mnt/rootfs Version von Debian angeben wheezy/jessie/sid/testing sind möglich distro=jessie debootstrap um ein neues Debian bauen debootstrap --arch=armhf --foreign $distro $targetdir cp /usr/bin/qemu-arm-static $targetdir/usr/bin/ cp /etc/resolv.conf $targetdir/etc Chroot in das neue Debian chroot $targetdir Variablen im Chroot neu setzen distro=jessie export LANG=C /debootstrap/debootstrap --second-stage Einstellungen für APT cat Lokalisierung und Zeitzone einstellen apt-get update apt-get install locales dialog -y dpkg-reconfigure locales dpkg-reconfigure tzdata Extra Pakete installieren apt-get install openssh-server ntpdate sudo wireless-tools wpasupplicant mc dbus slim -y Passwort setzen und Benutzer erstellen passwd root useradd -m -G users,sudo,ssh -s /bin/bash bpi passwd bpi Netzwerk vorbereiten cat Computername einstellen echo bpi > /etc/hostname Konsole erstellen echo T0:2345:respawn:/sbin/getty -L ttyS0 115200 vt100 >> /etc/inittab rc.local anpassen ssh keys sollen beim start neu erstellt werden ` nano /etc/rc.local -> vor exit 0 einfügen
test -f /etc/ssh/sshhostdsakey || dpkg-reconfigure openssh-server Chroot verlassen exit Kernel bauen (defconfig je nach Board auswählen) cd linux/ make ARCH=arm CROSSCOMPILE=arm-linux-gnueabihf- bananam2defconfig make ARCH=arm CROSSCOMPILE=arm-linux-gnueabihf- menuconfig make -j8 ARCH=arm CROSSCOMPILE=arm-linux-gnueabihf- LOADADDR=0x40008000 uImage modules dtbs make ARCH=arm CROSSCOMPILE=arm-linux-gnueabihf- modulesinstall INSTALLMODPATH=$targetdir/lib/modules Kernel und DTB kopieren *DTB je nach Board anpassen* cp arch/arm/boot/uImage $targetdir/boot cp arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dtb $targetdir/boot Bootscript erstellen *DTB je nach Board anpassen* cd .. nano boot.cmd fatload mmc 0 0x46000000 uImage fatload mmc 0 0x49000000 sun8i-r40-bananapi-m2-ultra.dtb setenv bootargs console=ttyS0,115200 root=/dev/mmcblk0p2 rw rootwait panic=10 ${extra} env set fdthigh ffffffff bootm 0x46000000 - 0x49000000
mkimage -C none -A arm -T script -d boot.cmd boot.scr
cp boot.scr $targetdir/boot U-Boot Bootloader bauen cd ../u-boot-sunxi make CROSSCOMPILE=arm-linux-gnueabihf- BananapiM2Ultradefconfig make CROSS_COMPILE=arm-linux-gnueabihf- `
Bootsektor löschen dd if=/dev/zero of=/dev/loop0 bs=1k count=1023 seek=1 Bootsektor schreiben dd if=u-boot-sunxi-with-spl.bin of=/dev/loop0 bs=1024 seek=8 Aufräumen rm $targetdir/etc/ssh/ssh_host* rm $targetdir/etc/resolv.conf rm $targetdir/usr/bin/qemu-arm-static [:]