en:bpi-r2:debian
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:bpi-r2:debian [2018/01/12 20:43] – [debootstrap] frank | en:bpi-r2:debian [2023/06/08 17:06] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Debian ====== | ||
+ | ===== debootstrap ===== | ||
+ | |||
+ | https:// | ||
+ | |||
+ | [[ubuntu]] | ||
+ | |||
+ | :!: in jessie/ | ||
+ | |||
+ | <code bash> | ||
+ | sudo apt-get install qemu-user-static debootstrap binfmt-support | ||
+ | distro=buster | ||
+ | arch=armhf | ||
+ | #for bpi-r64 use arch=arm64 | ||
+ | targetdir=$(pwd)/ | ||
+ | mkdir $targetdir | ||
+ | sudo debootstrap --arch=$arch --foreign $distro $targetdir | ||
+ | sudo cp / | ||
+ | #for r64 use | ||
+ | # sudo cp / | ||
+ | sudo cp / | ||
+ | sudo distro=$distro chroot $targetdir | ||
+ | export LANG=C | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | like it's done in source hostname, | ||
+ | |||
+ | * hostname (/ | ||
+ | < | ||
+ | bpi-r2 | ||
+ | </ | ||
+ | * / | ||
+ | < | ||
+ | deb http:// | ||
+ | deb-src http:// | ||
+ | deb http:// | ||
+ | deb-src http:// | ||
+ | deb http:// | ||
+ | deb-src http:// | ||
+ | </ | ||
+ | * fstab (boot,root) | ||
+ | < | ||
+ | # <file system> | ||
+ | / | ||
+ | / | ||
+ | </ | ||
+ | * Dns-server in / | ||
+ | < | ||
+ | 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: | ||
+ | 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/ | ||
+ | |||
+ | |||
+ | Uploaded work so far on my [[https:// | ||
+ | |||
+ | Image (sd+emmc in separate img' | ||
+ | [[https:// | ||
+ | |||
+ | (deb_stretch_…) | ||
+ | |||
+ | on EMMC-Image SSH-Login is not possible as root because of missing option in ssh-server | ||
+ | |||
+ | add the following line to / | ||
+ | |||
+ | PermitRootLogin yes | ||
+ | |||
+ | ===== change working Image ===== | ||
+ | |||
+ | * clear logs (echo -n ""> | ||
+ | * delete backup-files, | ||
+ | * clear cache (e.g. APT), | ||
+ | * remove unused Kernel-Modules (/ | ||
+ | * delete own Users | ||
+ | * reset PW for root | ||
+ | |||
+ | fill free space in the Image with null-file (for better packing): | ||
+ | |||
+ | <code bash> | ||
+ | loopdev=$(losetup -f) #get first free loopdevice | ||
+ | losetup ${loopdev} / | ||
+ | partprobe ${loopdev} | ||
+ | mount ${loopdev}p2 /mnt | ||
+ | |||
+ | #if you want to install/ | ||
+ | cp / | ||
+ | chroot /mnt | ||
+ | |||
+ | #overwrite free space | ||
+ | dd if=/ | ||
+ | rm / | ||
+ | |||
+ | losetup -d ${loopdev} | ||
+ | </ | ||
+ | |||
+ | https:// | ||
+ | |||
+ | |||
+ | alternative https:// | ||
+ | |||
+ | ===== 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 / | ||
+ | |||
+ | wan:dhcp # maybe needs additional "auto wan" to go up on boot | ||
+ | lan0: 192.168.0.10/ | ||
+ | lan1+lan2 are in a bridge with address 192.168.40.1/ | ||
+ | lan3 unconfigured | ||
+ | | ||
+ | |||
+ | to add default-gateway / DNS server do this | ||
+ | |||
+ | ip route add default via <your router ip> | ||
+ | nano / | ||
+ | |||
+ | ==== keyboard ==== | ||
+ | |||
+ | for configuring keyboard you have to install console-setup then you will be prompted for keyboard-layout | ||
+ | |||
+ | apt-get install console-setup |