User Tools

Site Tools

Translations of this page:
en

en:bpi-r2:debian

Debian

debootstrap

https://blog.night-shade.org.uk/2013/12/building-a-pure-debian-armhf-rootfs/

ubuntu

:!: 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
targetdir=$(pwd)/debian_stretch
distro=stretch
mkdir $targetdir
sudo debootstrap --arch=armhf --foreign $distro $targetdir
sudo cp /usr/bin/qemu-arm-static $targetdir/usr/bin/
sudo cp /etc/resolv.conf $targetdir/etc
sudo chroot $targetdir
distro=stretch
export LANG=C
/debootstrap/debootstrap --second-stage

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

  • hostname (/etc/hostname)
bpi-r2
  • /etc/apt/sources.list
deb http://ftp.us.debian.org/debian stretch main contrib non-free
deb-src http://ftp.us.debian.org/debian stretch main contrib non-free
deb http://ftp.us.debian.org/debian stretch-updates main contrib non-free
deb-src http://ftp.us.debian.org/debian stretch-updates main contrib non-free
deb http://security.debian.org/debian-security stretch/updates main contrib non-free
deb-src http://security.debian.org/debian-security stretch/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
nameserver 192.168.0.5
  • 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
  address 192.168.0.10
  netmask 255.255.255.0
  gateway 192.168.0.5
  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

(deb_stretch_…)

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}

https://softwarebakery.com/shrinking-images-on-linux

alternative https://wiki.debian.org/DebianInstaller/Arm/OtherPlatforms

my Image for BPI-R2

network

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
lan0: 192.168.0.10/24
lan1+lan2 are in a bridge with address 192.168.40.1/24
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

keyboard

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

apt-get install console-setup

Discussion

en/bpi-r2/debian.txt · Last modified: 2018/11/18 14:16 by frank