Skip to content

Add Development Mode Support #11

@mihai-chiorean

Description

@mihai-chiorean

Description

Add optional development mode that includes WiFi configuration, SSH keys, and other developer conveniences.

Features

When DEVELOPMENT=true:

  • Auto-configure WiFi from wpa_supplicant.conf
  • Deploy SSH authorized_keys
  • Configure Docker group
  • Enable additional debugging tools

Implementation

1. Build Variable

# local.conf
DEVELOPMENT = "true"

2. Conditional Recipe Inclusion

# edgeos-image.bb
IMAGE_INSTALL += " \
    ${@bb.utils.contains('DEVELOPMENT', 'true', 'packagegroup-edgeos-dev', '', d)} \
    "

3. Development Package Group

# packagegroup-edgeos-dev.bb
RDEPENDS:${PN} = " \
    wpa-supplicant \
    docker \
    gdb \
    strace \
    tcpdump \
    "

4. Configuration Files

# edgeos-dev-config.bb
do_install() {
    if [ "${DEVELOPMENT}" = "true" ]; then
        # Install WiFi config
        install -d ${D}${sysconfdir}/wpa_supplicant
        install -m 600 ${WORKDIR}/wpa_supplicant.conf \
            ${D}${sysconfdir}/wpa_supplicant/
        
        # Install SSH keys
        install -d ${D}/home/root/.ssh
        install -m 600 ${WORKDIR}/authorized_keys \
            ${D}/home/root/.ssh/
    fi
}

5. Docker Group Setup

# Add user to docker group
EXTRA_USERS_PARAMS = "\
    groupadd -r docker; \
    usermod -a -G docker root; \
    "

Security Considerations

  • Development mode should NOT be enabled for production builds
  • Add clear warnings in documentation
  • Consider separate image targets (edgeos-image vs edgeos-image-dev)

Acceptance Criteria

  • Development features only included when variable set
  • WiFi auto-connects in dev mode
  • SSH key authentication works
  • Docker commands work without sudo
  • No development features in production builds
  • Clear documentation about security implications

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions