Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Inspiration from hiroom2.com. Kudos!

...

  1. Download a ready made rootfs from the Open Build Service.

    We will use openSUSE Tumbleweed on our RPi 3B+:

    the latest

    openSUSE-Tumbleweed-ARM-JeOS.aarch64-rootfs

    tar.xz file

  2. Extract the downloaded rootfs

     $ cd /tmp
    
     $ mkdir openSUSE_Tumbleweed
    
     $ xz -d /tmp/openSUSE-Tumbleweed-ARM-JeOS.aarch64-rootfs.aarch64-2020.05.10-Snapshot20200512Snapshot20200526.tar.xz
    
    $ cd openSUSE_Tumbleweed $ tar xvf /tmp/openSUSE-Tumbleweed-ARM-JeOS.aarch64-rootfs.aarch64-2020.05.10-Snapshot20200512Snapshot20200526.tar.xz
  3. Create a virtual loop back device that will hold the rootfs:

     $ cd /tmp
    
     $ dd if=/dev/zero of=07f32691-opensuse-rootfs.img bs=400M count=10
    
     $ sudo mkfs.ext4 07f32691-opensuse-rootfs.img
    
     $ sudo losetup -fP 07f32691-opensuse-rootfs.img
  4. Check which loopback devices are allocated by the kernel:

     $ losetup -a
     /dev/loop0: []: (/tmp/07f32691-opensuse-rootfs.img)
  5. Mount the virtual block device

     $ mkdir 07f32691-rootfs-mount
     
     $ sudo mount -o loop /dev/loop0 07f32691-rootfs-mount
  6. Copy the content of an existing rootfs image to the mounted block device

     $ cp -R /tmp/downloaded_rootfs/*  07f32691-rootfs-mount/
  7. Unmount the file and move it to the place where it will be served.

     $ sudo umount 07f32691-rootfs-mount
    
     $ sudo losetup -D
    
     $ sudo mkdir /srv/iscsi
    
     $ sudo mv 07f32691-opensuse-rootfs.img /srv/iscsi
  8. Prepare the iscsi target and publish it

     $ sudo tgtadm --lld iscsi --op new --mode target --tid 1 -T iqn.org.micromec:rpi3-1-opensuse-rootfs
    
     $ sudo tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /srv/iscsi/07f32691-opensuse-rootfs.img
    
     $ sudo tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL
    

    Note

    If your iscsi server has other targets then you will need to pick a different tid.

    At this point the rootfs is available on the local network.

  9. Save the configuration on the netboot server to remain persistent

     $ sudo tgt-admin --dump | sudo tee  /etc/tgt/conf.d/micromec-cluster.conf
    

...