User Tools

Site Tools

Translations of this page:





:!: in jessie/Ubuntu 14.x (64bit) there are problems in second-stage: link, here debootstrap must be updated (first stage must be called again): download

sudo apt-get install qemu-user-static debootstrap binfmt-support
#for bpi-r64 use arch=arm64
mkdir $targetdir
sudo debootstrap --arch=$arch --foreign $distro $targetdir
sudo cp /usr/bin/qemu-arm-static $targetdir/usr/bin/
#for r64 use
# sudo cp /usr/bin/qemu-aarch64-static $targetdir/usr/bin/
sudo cp /etc/resolv.conf $targetdir/etc
sudo distro=$distro chroot $targetdir
export LANG=C
/debootstrap/debootstrap --second-stage

like it's done in source hostname,apt (local Server),…must be configured

  • hostname (/etc/hostname)
  • /etc/apt/sources.list
deb buster main contrib non-free
deb-src buster main contrib non-free
deb buster-updates main contrib non-free
deb-src buster-updates main contrib non-free
deb buster/updates main contrib non-free
deb-src buster/updates main contrib non-free
  • fstab (boot,root)
# <file system>		<dir>	<type>	<options>		<dump>	<pass>
/dev/mmcblk0p1		/boot	vfat	errors=remount-ro	0	1
/dev/mmcblk0p2		/	ext4	defaults		0	0
  • Dns-server in /etc/resolv.conf
  • Network-Configuration
auto eth0
iface eth0 inet manual
  pre-up ip link set $IFACE up
  post-down ip link set $IFACE down

auto lan0
iface lan0 inet static
  hwaddress ether 08:00:00:00:00:00 # if you want to set MAC manually
  pre-up ip link set $IFACE up
  post-down ip link set $IFACE down

in existing Jessie-Image clear root-partition (except lib/modules/<kernelversion>) and put contents of Bootstrap-folder (debian_stretch) to it

Uploaded work so far on my gdrive

Image (sd+emmc in separate img's): gdrive


on EMMC-Image SSH-Login is not possible as root because of missing option in ssh-server

add the following line to /etc/ssh/sshd_config and reboot/restart sshd:

PermitRootLogin yes

change working Image

  • clear logs (echo -n “”>logfile),
  • delete backup-files,
  • clear cache (e.g. APT),
  • remove unused Kernel-Modules (/lib/modules/)
  • delete own Users
  • reset PW for root

fill free space in the Image with null-file (for better packing):

loopdev=$(losetup -f) #get first free loopdevice
losetup ${loopdev} /path/to/file
partprobe ${loopdev}
mount ${loopdev}p2 /mnt
#if you want to install/update things
cp /usr/bin/qemu-arm-static /mnt/usr/bin/
chroot /mnt
#overwrite free space
dd if=/dev/zero of=/mnt/null.dat
rm /mnt/null.dat
losetup -d ${loopdev}


my Image for BPI-R2


you have ports wan, lan0-lan4 with kernel 4.14+

current config can be displayed using ip a or by editing /etc/network/interfaces

wan:dhcp # maybe needs additional "auto wan" to go up on boot
lan1+lan2 are in a bridge with address #currently also auto lanx+manual missing
lan3 unconfigured

to add default-gateway / DNS server do this

ip route add default via <your router ip>
nano /etc/resolv.conf #change ip of your gateway for DNS


for configuring keyboard you have to install console-setup then you will be prompted for keyboard-layout

apt-get install console-setup
en/bpi-r2/debian.txt · Last modified: 2023/06/08 17:06 by