diff options
author | ToshikazuOhiwa <toshikazu_ohiwa@mail.toyota.co.jp> | 2020-03-30 09:24:26 +0900 |
---|---|---|
committer | ToshikazuOhiwa <toshikazu_ohiwa@mail.toyota.co.jp> | 2020-03-30 09:24:26 +0900 |
commit | 5b80bfd7bffd4c20d80b7c70a7130529e9a755dd (patch) | |
tree | b4bb18dcd1487dbf1ea8127e5671b7bb2eded033 /meta-agl/meta-netboot/README | |
parent | 706ad73eb02caf8532deaf5d38995bd258725cb8 (diff) |
agl-basesystem
Diffstat (limited to 'meta-agl/meta-netboot/README')
-rw-r--r-- | meta-agl/meta-netboot/README | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/meta-agl/meta-netboot/README b/meta-agl/meta-netboot/README new file mode 100644 index 00000000..b571186b --- /dev/null +++ b/meta-agl/meta-netboot/README @@ -0,0 +1,65 @@ +meta-netboot +============ + +This layer contains some recipes and configuration adjustments to allow network boot through NBD (network block device). + +Content and usage +----------------- + +This layer creates a new supplementary initrd image which can be downloaded through TFTP with the kernel. +At boot time, the init script will try to mount the rootfs based on the following kernel command line parameters: +* nbd.server: IP address to reach the NBD server +* nbd.port: TCP port on which server is listening (default: 10809) +* nbd.dev: nbd device to use (default: /dev/nbd0) +* nbd.debug: activate debug mode (init script is then interruptible) + +The layer meta-netboot contains recipes for the following components: +* busybox: activate the built-in NBD client +* 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. +* initramfs-netboot-image: image to specify for building the initrd + +To enable the build of the netboot initrd and ext4 rootfs, add the following line in conf/local.conf: + +INHERIT += "netboot" + + +Server side +----------- + +On the server side (assuming that the build dir is stored in $BUILD) we can run: + +* a TFTP server, for example tftpd-hpa started with $BUILD/tmp/deploy/images as the TFTP dir: + + /usr/sbin/in.tftpd --listen --user tftp --address 0.0.0.0:69 --secure $BUILD/tmp/deploy/images + +* a NBD server, for example xnbd-server, used to expose the whole ext4 rootfs as a network block device: + + xnbd-server --target --lport 10809 $BUILD/tmp/deploy/images/$MACHINE/agl-demo-platform-$MACHINE.ext4 + + +Target side +----------- + +On the target board, a specific setup should also be done.\ +For Renesas Gen3 board, u-boot is updated and environment is more like : + +------------------------------------------------------------------ +setenv bootargs_console 'console=ttySC0,115200 ignore_loglevel' +setenv bootargs_extra 'rw rootfstype=ext4 rootwait rootdelay=2' +setenv bootargs_root 'root=/dev/ram0 ramdisk_size=16384 ip=dhcp' +setenv bootargs_video 'vmalloc=384M video=HDMI-A-1:1920x1080-32@60' +setenv serverip '<your_serverip>' +setenv 'bootdaddr' '0x48000000' +setenv 'bootdfile' 'Image-r8a7795-h3ulcb.dtb' +setenv 'bootdload_net' 'tftp ${bootdaddr} h3ulcb/${bootdfile}' +setenv 'bootkaddr' '0x48080000' +setenv 'bootkfile' 'Image' +setenv 'bootkload_net' 'tftp ${bootkaddr} h3ulcb/${bootkfile}' +setenv 'bootiaddr' '0x5C3F9520' +setenv 'bootifile' 'initramfs-netboot-image-h3ulcb.ext4.gz' +setenv 'bootiload_net' 'tftp ${bootraddr} h3ulcb/${bootrfile}' +setenv 'load_net' 'run bootkload_net; run bootdload_net; run bootiload_net; setenv initrd_size ${filesize}' + +setenv 'bootcmd' 'setenv bootargs ${bootargs_console} ${bootargs_video} ${bootargs_root} ${bootargs_extra} nbd.server=${serverip}; run load_net; booti ${bootkaddr} ${bootiaddr}:${initrd_size} ${bootdaddr}' +------------------------------------------------------------------ + |