en:bpi-r2:netboot
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:bpi-r2:netboot [2018/10/01 19:20] – [NFS-server] frank | en:bpi-r2:netboot [2023/06/08 17:06] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Network-boot ====== | ||
+ | |||
+ | Some infos in debian-wiki: | ||
+ | |||
+ | ===== Dnsmasq as tftp-server ===== | ||
+ | < | ||
+ | # Enable the TFTP server | ||
+ | enable-tftp | ||
+ | tftp-root=/ | ||
+ | |||
+ | mkdir / | ||
+ | |||
+ | |||
+ | systemctl enable dnsmasq.service | ||
+ | systemctl start dnsmasq.service | ||
+ | |||
+ | or | ||
+ | |||
+ | service dnsmasq restart | ||
+ | </ | ||
+ | ===== tftp-boot ===== | ||
+ | |||
+ | * https:// | ||
+ | |||
+ | < | ||
+ | setenv ipaddr 192.168.0.11 | ||
+ | setenv netmask 255.255.255.0 | ||
+ | setenv serverip 192.168.0.10 | ||
+ | setenv bootfile uImage | ||
+ | setenv bootargs console=ttyS0, | ||
+ | </ | ||
+ | < | ||
+ | tftp 0x80200000 ${bootfile} | ||
+ | bootm 0x80200000 | ||
+ | </ | ||
+ | |||
+ | uenv.txt (using my uboot + reload bootmenu): | ||
+ | |||
+ | < | ||
+ | ipaddr=192.168.0.11 | ||
+ | netmask=255.255.255.0 | ||
+ | serverip=192.168.0.10 | ||
+ | |||
+ | bootfile=uImage | ||
+ | netbootargs=console=ttyS0, | ||
+ | |||
+ | bootmenu_1=2. Boot kernel from TFTP.=run bootnet | ||
+ | bootnet=printenv; | ||
+ | </ | ||
+ | |||
+ | this replaces bootmenu-entry #2 with tftp-boot and loads bootfile from tftp-server (serverip)...this part works so far with dnsmasq-tftp | ||
+ | |||
+ | ==== loading and display a file ==== | ||
+ | |||
+ | FIXME | ||
+ | |||
+ | needs strings-command (currently untested) | ||
+ | |||
+ | tftp ${loadaddr} 192.168.0.10: | ||
+ | strings ${loadaddr} ${filesize} | ||
+ | |||
+ | |||
+ | ===== InitRamFS ===== | ||
+ | |||
+ | FIXME Currently untested | ||
+ | |||
+ | Initrd-steps on ibm: https:// | ||
+ | |||
+ | to use a initramfs add this option (change filename) to your .config (tested with [[http:// | ||
+ | |||
+ | CONFIG_INITRAMFS_SOURCE=" | ||
+ | |||
+ | ==== IP-configration ==== | ||
+ | |||
+ | add this to your netbootargs: | ||
+ | |||
+ | ip=192.168.0.11: | ||
+ | | ||
+ | [[https:// | ||
+ | |||
+ | ip=< | ||
+ | ===== NFS-server ===== | ||
+ | |||
+ | * [[https:// | ||
+ | * https:// | ||
+ | |||
+ | debootstrap needs exec and dev-options on target-partition, | ||
+ | |||
+ | < | ||
+ | targetdir=bpi-r2-nfs-root | ||
+ | |||
+ | sudo apt-get install debootstrap qemu-user-static binfmt-support | ||
+ | |||
+ | sudo debootstrap --foreign --arch=armhf stretch $targetdir | ||
+ | sudo cp / | ||
+ | sudo chroot $targetdir / | ||
+ | |||
+ | sudo mkdir -p $targetdir/ | ||
+ | sudo mount --bind /dev/pts $targetdir/ | ||
+ | sudo mount --bind /proc $targetdir/ | ||
+ | #sudo mount --bind /home $targetdir/ | ||
+ | |||
+ | sudo chroot $targetdir | ||
+ | |||
+ | ln -s / | ||
+ | |||
+ | nano /etc/fstab | ||
+ | |||
+ | proc /proc proc defaults 0 0 | ||
+ | /dev/nfs / nfs nolock 0 0 | ||
+ | none /tmp tmpfs defaults 0 0 | ||
+ | none /var/tmp tmpfs defaults 0 0 | ||
+ | none / | ||
+ | none /media tmpfs defaults 0 0 | ||
+ | none /var/log tmpfs defaults 0 0 | ||
+ | # | ||
+ | |||
+ | nano / | ||
+ | |||
+ | deb http:// | ||
+ | deb-src http:// | ||
+ | |||
+ | deb http:// | ||
+ | deb-src http:// | ||
+ | |||
+ | |||
+ | nano / | ||
+ | nameserver 192.168.0.10 | ||
+ | |||
+ | #change root-passwort, | ||
+ | passwd | ||
+ | |||
+ | #change hostname | ||
+ | nano / | ||
+ | #add hostname also to loopback-device (127.0.0.1 + ::1) | ||
+ | nano /etc/hosts | ||
+ | |||
+ | apt-get update | ||
+ | |||
+ | #change network-config if you don't want to set it via uboot or dhcp | ||
+ | nano / | ||
+ | </ | ||
+ | NFS-Server-install: | ||
+ | <code bash> | ||
+ | sudo apt-get install nfs-kernel-server | ||
+ | #status | ||
+ | sudo service nfs-kernel-server status | ||
+ | #create root-folder | ||
+ | mkdir -p / | ||
+ | #add this folder to exports-file | ||
+ | echo "/ | ||
+ | #unpack the debootstrapped rootfs to it | ||
+ | </ | ||
+ | test on client | ||
+ | |||
+ | < | ||
+ | apt install nfs-common | ||
+ | mkdir /mnt/nfs | ||
+ | mount -t nfs 192.168.0.10:/ | ||
+ | </ | ||
+ | |||
+ | with fstab | ||
+ | < | ||
+ | #entry in /etc/fstab: | ||
+ | 192.168.0.10:/ | ||
+ | |||
+ | #create target-dir and mount it | ||
+ | sudo mkdir /media/nfs | ||
+ | sudo mount /media/nfs | ||
+ | </ | ||
+ | Uboot: | ||
+ | < | ||
+ | # | ||
+ | ipaddr=192.168.0.11 | ||
+ | netmask=255.255.255.0 | ||
+ | serverip=192.168.0.10 | ||
+ | bootfile=uImage_4.14.73 | ||
+ | |||
+ | set_netargs=setenv netargs " | ||
+ | |||
+ | nfs_ip=192.168.0.10 | ||
+ | nfs_rfs=/ | ||
+ | |||
+ | # | ||
+ | |||
+ | set_nfsargs=setenv nfsargs " | ||
+ | |||
+ | #new bootmenuentries (start at bootmenu_6) require reload bootmenu because uenv.txt is not loaded before display menu | ||
+ | bootnet=run set_netargs; | ||
+ | bootmenu_1=2. Boot kernel from TFTP.=run bootnet | ||
+ | </ | ||
+ | ===== other links ===== | ||
+ | |||
+ | * https:// | ||
+ | * https:// | ||
+ | * https:// | ||
+ | * https:// | ||
en/bpi-r2/netboot.txt · Last modified: 2023/06/08 17:06 by 127.0.0.1