{"id":1245,"date":"2017-01-05T13:48:49","date_gmt":"2017-01-05T12:48:49","guid":{"rendered":"https:\/\/piprojects.net\/?p=1245"},"modified":"2017-01-05T13:48:49","modified_gmt":"2017-01-05T12:48:49","slug":"debian-image-bauen","status":"publish","type":"post","link":"https:\/\/www.piprojects.net\/en\/debian-image-bauen\/","title":{"rendered":"(Deutsch) Debian Image bauen"},"content":{"rendered":"<p class=\"qtranxs-available-languages-message qtranxs-available-languages-message-en\">Sorry, this entry is only available in <a href=\"https:\/\/www.piprojects.net\/de\/wp-json\/wp\/v2\/posts\/1245\" class=\"qtranxs-available-language-link qtranxs-available-language-link-de\" title=\"Deutsch\">Deutsch<\/a>.<\/p><p>Ich habe mal mein &#8220;altes&#8221; Script \u00fcberarbeitet zum erstellen von einem Debian Image.<\/p>\n<p>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.<\/p>\n<p><u>Verzeichnis zum erstellen<\/u><br \/>\n<code><br \/>\nmkdir build<br \/>\ncd build<br \/>\n<\/code><br \/>\n<u>Sources laden<\/u> <i>hier f\u00fcr den Banana M2 Ultra (r40) <\/i><br \/>\n<code><br \/>\ngit clone --depth 1 -b r40 https:\/\/github.com\/wens\/u-boot-sunxi<br \/>\ngit clone --depth 1 -b r40 https:\/\/github.com\/a1d3s\/linux<br \/>\n<\/code><br \/>\n<u>Image f\u00fcr die SD Karte erstellen 4GB<\/u><br \/>\n<code><br \/>\ndd if=\/dev\/zero of=image.img bs=1M count=3900<br \/>\n<\/code><br \/>\n<u>Image als Laufwerk laden<\/u><br \/>\n<code><br \/>\nlosetup \/dev\/loop0 image.img<br \/>\n<\/code><br \/>\n<u>Image partitonieren und formatieren<\/u><br \/>\n<code><br \/>\nfdisk \/dev\/loop0<br \/>\npartx -av \/dev\/loop0<br \/>\nmkfs.vfat \/dev\/loop0p1<br \/>\nmkfs.ext4 \/dev\/loop0p2<br \/>\n<\/code><br \/>\n<u>Arbeitsverzeichnis erstellen<\/u><br \/>\n<code><br \/>\nmkdir \/mnt\/rootfs<br \/>\nmount \/dev\/loop0p2 \/mnt\/rootfs\/<br \/>\nmount \/dev\/loop0p1 \/mnt\/rootfs\/boot<br \/>\n<\/code><br \/>\n<u>Variablen setzen zum bearbeiten<\/u><br \/>\n<code><br \/>\ntargetdir=\/mnt\/rootfs<br \/>\n<\/code><br \/>\n<u>Version von Debian angeben wheezy\/jessie\/sid\/testing sind m\u00f6glich<\/u><br \/>\n<code><br \/>\ndistro=jessie<br \/>\n<\/code><br \/>\n<u>debootstrap um ein neues Debian bauen<\/u><br \/>\n<code><br \/>\ndebootstrap --arch=armhf --foreign $distro $targetdir<br \/>\ncp \/usr\/bin\/qemu-arm-static $targetdir\/usr\/bin\/<br \/>\ncp \/etc\/resolv.conf $targetdir\/etc<br \/>\n<\/code><br \/>\n<u>Chroot in das neue Debian<\/u><br \/>\n<code><br \/>\nchroot $targetdir<br \/>\n<\/code><br \/>\n<u>Variablen im Chroot neu setzen<\/u><br \/>\n<code><br \/>\ndistro=jessie<br \/>\nexport LANG=C<br \/>\n\/debootstrap\/debootstrap --second-stage<br \/>\n<\/code><br \/>\n<u>Einstellungen f\u00fcr APT<\/u><br \/>\n<code><br \/>\ncat <<EOT > \/etc\/apt\/sources.list<br \/>\ndeb http:\/\/ftp.uk.debian.org\/debian $distro main contrib non-free<br \/>\ndeb-src http:\/\/ftp.uk.debian.org\/debian $distro main contrib non-free<br \/>\ndeb http:\/\/ftp.uk.debian.org\/debian $distro-updates main contrib non-free<br \/>\ndeb-src http:\/\/ftp.uk.debian.org\/debian $distro-updates main contrib non-free<br \/>\ndeb http:\/\/security.debian.org\/debian-security $distro\/updates main contrib non-free<br \/>\ndeb-src http:\/\/security.debian.org\/debian-security $distro\/updates main contrib non-free<br \/>\nEOT<\/p>\n<p>cat <<EOT > \/etc\/apt\/apt.conf.d\/71-no-recommends<br \/>\nAPT::Install-Recommends \"0\";<br \/>\nAPT::Install-Suggests \"0\";<br \/>\nEOT<br \/>\n<\/code><br \/>\n<u>Lokalisierung und Zeitzone einstellen<\/u><br \/>\n<code><br \/>\napt-get update<br \/>\napt-get install locales dialog -y<br \/>\ndpkg-reconfigure locales<br \/>\ndpkg-reconfigure tzdata<br \/>\n<\/code><br \/>\n<u>Extra Pakete installieren<\/u><br \/>\n<code><br \/>\napt-get install openssh-server ntpdate sudo wireless-tools wpasupplicant mc dbus slim -y<br \/>\n<\/code><br \/>\n<u>Passwort setzen und Benutzer erstellen<\/u><br \/>\n<code><br \/>\npasswd root<br \/>\nuseradd -m -G users,sudo,ssh -s \/bin\/bash bpi<br \/>\npasswd bpi<br \/>\n<\/code><br \/>\n<u>Netzwerk vorbereiten<\/u><br \/>\n<code><br \/>\ncat <<EOT > \/etc\/network\/interfaces<br \/>\nauto lo<br \/>\niface lo inet loopback<br \/>\nauto eth0<br \/>\nallow-hotplug eth0<br \/>\niface eth0 inet dhcp<br \/>\nEOT<br \/>\n<\/code><br \/>\n<u>Computername einstellen<\/u><br \/>\n<code><br \/>\necho bpi > \/etc\/hostname<br \/>\n<\/code><br \/>\n<u>Konsole erstellen<\/u><br \/>\n<code><br \/>\necho T0:2345:respawn:\/sbin\/getty -L ttyS0 115200 vt100 >> \/etc\/inittab<br \/>\n<\/code><br \/>\n<u>rc.local anpassen<\/u><br \/>\n<i>ssh keys sollen beim start neu erstellt werden<\/i><br \/>\n<code><br \/>\nnano \/etc\/rc.local<br \/>\n-> vor exit 0 einf\u00fcgen<\/p>\n<p>test -f \/etc\/ssh\/ssh_host_dsa_key || dpkg-reconfigure openssh-server<br \/>\n<\/code><br \/>\n<u>Chroot verlassen<\/u><br \/>\n<code><br \/>\nexit<br \/>\n<\/code><br \/>\n<u>Kernel bauen (defconfig je nach Board ausw\u00e4hlen)<\/u><br \/>\n<code><br \/>\ncd linux\/<br \/>\nmake ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bananam2_defconfig<br \/>\nmake ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig<br \/>\nmake -j8 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- LOADADDR=0x40008000 uImage modules dtbs<br \/>\nmake ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- modules_install INSTALL_MOD_PATH=$targetdir\/lib\/modules<br \/>\n<\/code><br \/>\n<u>Kernel und DTB kopieren<\/u><br \/>\n<i>DTB je nach Board anpassen<\/i><br \/>\n<code><br \/>\ncp arch\/arm\/boot\/uImage $targetdir\/boot<br \/>\ncp arch\/arm\/boot\/dts\/sun8i-r40-bananapi-m2-ultra.dtb $targetdir\/boot<br \/>\n<\/code><br \/>\n<u>Bootscript erstellen<\/u><br \/>\n<i>DTB je nach Board anpassen<\/i><br \/>\n<code><br \/>\ncd ..<br \/>\nnano boot.cmd<br \/>\nfatload mmc 0 0x46000000 uImage<br \/>\nfatload mmc 0 0x49000000 sun8i-r40-bananapi-m2-ultra.dtb<br \/>\nsetenv bootargs console=ttyS0,115200 root=\/dev\/mmcblk0p2 rw rootwait panic=10 ${extra}<br \/>\nenv set fdt_high ffffffff<br \/>\nbootm 0x46000000 - 0x49000000<\/p>\n<p>mkimage -C none -A arm -T script -d boot.cmd boot.scr<\/p>\n<p>cp boot.scr $targetdir\/boot<br \/>\n<\/code><br \/>\n<u>U-Boot Bootloader bauen<\/u><br \/>\n<code><br \/>\ncd ..\/u-boot-sunxi<br \/>\nmake CROSS_COMPILE=arm-linux-gnueabihf- Bananapi_M2_Ultra_defconfig<br \/>\nmake CROSS_COMPILE=arm-linux-gnueabihf-<br \/>\n<\/code><\/p>\n<p><u>Bootsektor l\u00f6schen<\/u><br \/>\n<code><br \/>\ndd if=\/dev\/zero of=\/dev\/loop0 bs=1k count=1023 seek=1<br \/>\n<\/code><br \/>\n<u>Bootsektor schreiben<\/u><br \/>\n<code><br \/>\ndd if=u-boot-sunxi-with-spl.bin of=\/dev\/loop0 bs=1024 seek=8<br \/>\n<\/code><br \/>\n<u>Aufr\u00e4umen<\/u><br \/>\n<code><br \/>\nrm $targetdir\/etc\/ssh\/ssh_host*<br \/>\nrm $targetdir\/etc\/resolv.conf<br \/>\nrm $targetdir\/usr\/bin\/qemu-arm-static<br \/>\n<\/code><\/p>","protected":false},"excerpt":{"rendered":"<p>Sorry, this entry is only available in Deutsch.Ich habe mal mein &#8220;altes&#8221; Script \u00fcberarbeitet 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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":876,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Debian Image bauen","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[32,3],"tags":[],"class_list":["post-1245","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","category-linux"],"jetpack_publicize_connections":[],"wpmagazine_modules_lite_featured_media_urls":{"thumbnail":["https:\/\/i0.wp.com\/www.piprojects.net\/wp-content\/uploads\/2015\/01\/bin-bash-extended.sh-600x600-260x260.png?resize=150%2C150&ssl=1",150,150,true],"cvmm-medium":["https:\/\/i0.wp.com\/www.piprojects.net\/wp-content\/uploads\/2015\/01\/bin-bash-extended.sh-600x600-260x260.png?resize=260%2C260&ssl=1",260,260,true],"cvmm-medium-plus":["https:\/\/i0.wp.com\/www.piprojects.net\/wp-content\/uploads\/2015\/01\/bin-bash-extended.sh-600x600-260x260.png?resize=260%2C207&ssl=1",260,207,true],"cvmm-portrait":["https:\/\/i0.wp.com\/www.piprojects.net\/wp-content\/uploads\/2015\/01\/bin-bash-extended.sh-600x600-260x260.png?resize=260%2C260&ssl=1",260,260,true],"cvmm-medium-square":["https:\/\/i0.wp.com\/www.piprojects.net\/wp-content\/uploads\/2015\/01\/bin-bash-extended.sh-600x600-260x260.png?resize=260%2C260&ssl=1",260,260,true],"cvmm-large":["https:\/\/i0.wp.com\/www.piprojects.net\/wp-content\/uploads\/2015\/01\/bin-bash-extended.sh-600x600-260x260.png?resize=260%2C260&ssl=1",260,260,true],"cvmm-small":["https:\/\/i0.wp.com\/www.piprojects.net\/wp-content\/uploads\/2015\/01\/bin-bash-extended.sh-600x600-260x260.png?resize=130%2C95&ssl=1",130,95,true],"full":["https:\/\/i0.wp.com\/www.piprojects.net\/wp-content\/uploads\/2015\/01\/bin-bash-extended.sh-600x600-260x260.png?fit=260%2C260&ssl=1",260,260,false]},"categories_names":{"32":{"name":"","link":"https:\/\/www.piprojects.net\/en\/category\/howtos\/"},"3":{"name":"Linux","link":"https:\/\/www.piprojects.net\/en\/category\/linux\/"}},"tags_names":[],"comments_number":"0","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5ktuF-k5","jetpack-related-posts":[{"id":406,"url":"https:\/\/www.piprojects.net\/en\/bananapi-kernel-3-18-rc5\/","url_meta":{"origin":1245,"position":0},"title":"BananaPi Kernel-3.18-rc5BananaPi Kernel-3.18-rc5","author":"Stefan","date":"Tuesday November 18th, 2014","format":false,"excerpt":"So nun hier alle meine Schritte f\u00fcr ein funktionierendes Debian Jessie mit Kernel-3.18 (auf die \u00c4nderungen im git werde ich hier nicht eingehen, aber man kann diese sich an im git selbst ansehen und nachverfolgen) Wer keine Lust auf basteln hat hier der Download Ich selbst setze derzeit ein LUbuntu\u2026","rel":"","context":"In &quot;Linux&quot;","block_context":{"text":"Linux","link":"https:\/\/www.piprojects.net\/en\/category\/linux\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":341,"url":"https:\/\/www.piprojects.net\/en\/banana-pi-kernel-3-18-rc-bauen\/","url_meta":{"origin":1245,"position":1},"title":"(Deutsch) Banana Pi Kernel 3.18-rc bauen","author":"Stefan","date":"Wednesday November  5th, 2014","format":false,"excerpt":"Sorry, this entry is only available in Deutsch.Hier erstmal eine grobe Zusammenfassung der Schritte, eine genau Beschreibung folgt noch cat < 2048,524288,L 526336,,L EOT mkfs.vfat \/dev\/mmcblk0p1 mkfs.ext4 \/dev\/mmcblk0p2 apt-get install bc libncurses5-dev gcc-arm-gnueabihf u-boot-tools build-essential binutils-arm-linux-gnueabihf libusb-1.0-0 libusb-1.0-0-dev git wget fakeroot mkdir bpi cd bpi git clone -b sunxi-next https:\/\/github.com\/linux-sunxi\/linux-sunxi\u2026","rel":"","context":"In &quot;Linux&quot;","block_context":{"text":"Linux","link":"https:\/\/www.piprojects.net\/en\/category\/linux\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1424,"url":"https:\/\/www.piprojects.net\/en\/sms-gateway-im-eigenbau\/","url_meta":{"origin":1245,"position":2},"title":"SMS Gateway DIY","author":"Stefan","date":"Tuesday February 16th, 2021","format":false,"excerpt":"Setup SMS Gateway with playSMS and gammu Generally:The aim is to have an SMS gateway for sending 2FA passwords and also for messages from monitoring Hardware: Raspberry Pi 4\u00a0 4GB Raspberry Pi HAT SIM7600X-H (H = Europa , T = China ) SD Karte min 8GB Original Netzteil USB-C Geh\u00e4use\u2026","rel":"","context":"In &quot;Linux&quot;","block_context":{"text":"Linux","link":"https:\/\/www.piprojects.net\/en\/category\/linux\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":431,"url":"https:\/\/www.piprojects.net\/en\/script-for-resize-root-partition\/","url_meta":{"origin":1245,"position":3},"title":"Skript zum anpassen der root PartitionScript for resize root partition","author":"Stefan","date":"Wednesday December 10th, 2014","format":false,"excerpt":"Hallo, hier ein kleine Skript um die root Partition zu verg\u00f6\u00dfern [Shell] #!\/bin\/bash fdisk_first() { p2_start=`fdisk -l \/dev\/mmcblk0 | grep mmcblk0p2 | awk '{print $2}'` echo \"Found the start point of mmcblk0p2: $p2_start\" fdisk \/dev\/mmcblk0 > \/dev\/null d 2 n p 2 $p2_start p w __EOF__ sync touch \/root\/.resize echo\u2026","rel":"","context":"In &quot;Linux&quot;","block_context":{"text":"Linux","link":"https:\/\/www.piprojects.net\/en\/category\/linux\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":427,"url":"https:\/\/www.piprojects.net\/en\/debian-jessie-with-kernel-3-18-final-for-banana-pi\/","url_meta":{"origin":1245,"position":4},"title":"Debian Jessie with Kernel-3.18 final for Banana PiDebian Jessie with Kernel-3.18 final for Banana Pi","author":"Stefan","date":"Tuesday December  9th, 2014","format":false,"excerpt":"Today i build an new image with final kernel and cec and fbtft enabled i updated git also https:\/\/github.com\/a1d3s\/linuxlinux this one changed to kernel-3.19-rc2 ( no changes from original tree for now) https:\/\/github.com\/a1d3s\/linux-3.18 is the old one Download Image Username:bpi password:bpi for root root:root root is diabled over ssh for\u2026","rel":"","context":"In &quot;Linux&quot;","block_context":{"text":"Linux","link":"https:\/\/www.piprojects.net\/en\/category\/linux\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":23,"url":"https:\/\/www.piprojects.net\/en\/rsync-transfer-automatisiert-zwischen-client-und-server\/","url_meta":{"origin":1245,"position":5},"title":"(Deutsch) rsync Transfer automatisiert zwischen client und Server","author":"Stefan","date":"Friday February 24th, 2012","format":false,"excerpt":"Sorry, this entry is only available in Deutsch.Das Vorhaben und der Grund f\u00fcr diesen aufwand mal vorweg: Ich hatte die Aufgabe eine L\u00f6sung zu suchen wie Daten von einem externen Rechner der stets Messdaten produziert, automatisiert zu \u00dcbertragen auf einen Server und dies auf einem gesichertem Wege. FTP war dort\u2026","rel":"","context":"In &quot;Linux&quot;","block_context":{"text":"Linux","link":"https:\/\/www.piprojects.net\/en\/category\/linux\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.piprojects.net\/wp-content\/uploads\/2015\/01\/bin-bash-extended.sh-600x600-260x260.png?fit=260%2C260&ssl=1","_links":{"self":[{"href":"https:\/\/www.piprojects.net\/en\/wp-json\/wp\/v2\/posts\/1245","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.piprojects.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.piprojects.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.piprojects.net\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.piprojects.net\/en\/wp-json\/wp\/v2\/comments?post=1245"}],"version-history":[{"count":2,"href":"https:\/\/www.piprojects.net\/en\/wp-json\/wp\/v2\/posts\/1245\/revisions"}],"predecessor-version":[{"id":1247,"href":"https:\/\/www.piprojects.net\/en\/wp-json\/wp\/v2\/posts\/1245\/revisions\/1247"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.piprojects.net\/en\/wp-json\/wp\/v2\/media\/876"}],"wp:attachment":[{"href":"https:\/\/www.piprojects.net\/en\/wp-json\/wp\/v2\/media?parent=1245"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.piprojects.net\/en\/wp-json\/wp\/v2\/categories?post=1245"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.piprojects.net\/en\/wp-json\/wp\/v2\/tags?post=1245"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}