4 This layer contains some recipes and configuration adjustments to allow network boot through NBD (network block device).
9 All patches must be submitted via the AGL Gerrit instance at
10 https://gerrit.automotivelinux.org. See this wiki page for
13 https://wiki.automotivelinux.org/agl-distro/contributing
16 Jan-Simon Möller <jsmoeller@linuxfoundation.org>
22 This layer creates a new supplementary initrd image which can be downloaded through TFTP with the kernel.
23 At boot time, the init script will try to mount the rootfs based on the following kernel command line parameters:
25 * nbd.server: IP address to reach the NBD server
26 * nbd.dev: nbd device to use (default: /dev/nbd0)
27 * nbd.debug: activate debug mode (init script is then interruptible)
31 * nbd.port: TCP port on which server is listening (default: 10809)
35 * nbd.namev3: The name of the image served by nbd-server.
38 The layer meta-netboot contains recipes for the following components:
39 * busybox: activate the built-in NBD client
40 * initramfs-netboot: contains the init script started by the kernel: basically, this script mounts the real root filesystem, then pivot_root on it and finally exec systemd.
41 * initramfs-netboot-image: image to specify for building the initrd
43 To enable the build of the netboot initrd and ext4 rootfs, add the following line in conf/local.conf:
51 On the server side (assuming that the build dir is stored in $BUILD) we can run:
53 * a TFTP server, for example tftpd-hpa started with $BUILD/tmp/deploy/images as the TFTP dir:
55 /usr/sbin/in.tftpd --listen --user tftp --address 0.0.0.0:69 --secure $BUILD/tmp/deploy/images
57 * a NBD server, for example xnbd-server, used to expose the whole ext4 rootfs as a network block device:
59 xnbd-server --target --lport 10809 $BUILD/tmp/deploy/images/$MACHINE/agl-demo-platform-$MACHINE.ext4
65 On the target board, a specific setup should also be done.\
66 For Renesas Gen3 board, u-boot is updated and environment is more like :
68 ------------------------------------------------------------------
69 setenv bootargs_console 'console=ttySC0,115200 ignore_loglevel'
70 setenv bootargs_extra 'rw rootfstype=ext4 rootwait rootdelay=2'
71 setenv bootargs_root 'root=/dev/ram0 ramdisk_size=16384 ip=dhcp'
72 setenv bootargs_video 'vmalloc=384M video=HDMI-A-1:1920x1080-32@60'
73 setenv serverip '<your_serverip>'
74 setenv 'bootdaddr' '0x48000000'
75 setenv 'bootdfile' 'Image-r8a77951-ulcb.dtb'
76 setenv 'bootdload_net' 'tftp ${bootdaddr} h3ulcb/${bootdfile}'
77 setenv 'bootkaddr' '0x48080000'
78 setenv 'bootkfile' 'Image'
79 setenv 'bootkload_net' 'tftp ${bootkaddr} h3ulcb/${bootkfile}'
80 setenv 'bootiaddr' '0x5C3F9520'
81 setenv 'bootifile' 'initramfs-netboot-image-h3ulcb.ext4.gz'
82 setenv 'bootiload_net' 'tftp ${bootiaddr} h3ulcb/${bootifile}'
83 setenv 'load_net' 'run bootkload_net; run bootdload_net; run bootiload_net; setenv initrd_size ${filesize}'
85 setenv 'bootcmd' 'setenv bootargs ${bootargs_console} ${bootargs_video} ${bootargs_root} ${bootargs_extra} nbd.server=${serverip}; run load_net; booti ${bootkaddr} ${bootiaddr}:${initrd_size} ${bootdaddr}'
86 ------------------------------------------------------------------