Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs/nerves systems guide improvement #1032

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Damirados
Copy link

This is still WIP.

Started to take it into direction where it completely replaces "Customizing your nerves system guide"

to be included in your `nerves_defconfig`.

```bash
cp build/busybox-1.27.2/.config ../src/<full system name>/busybox_defconfig
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using <full system name> here is not ideal.

Likely scenario is that you would want to add new system to config.exs
run

mix ns.clone
# Then actually just populate o directory with something like
mix ns.build --configure
# where it would just create o directory with config without building it

Ideally that would provide us with shell script that could export NERVES_DEFCONFIG_DIR
then this could be.

cp build/busybox-1.27.2/.config ${NERVES_DEFCONFIG_DIR}/busybox_defconfig

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would also be good idea for build to accept --only

mix ns.build --only custom_rpi3

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed this, but the line:

cp build/busybox-1.27.2/.config ${NERVES_DEFCONFIG_DIR}/busybox_defconfig

should be

make busybox-update-config

This takes care of copying the Busybox config to the right place and will properly error out if the fragment config feature is being used.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I tried this with rpi3 system and

make busybox-update-config

results in

cp -f /home/damir/Projects/nerves/nerves_systems/o/rpi3/build/busybox-1.36.1/.config /home/damir/Projects/nerves/nerves_systems/src/nerves_system_br/board/nerves-common/busybox.config

Which now applies it to all other systems which is IMO not wanted behavior.

In case when fragments are set it does error

Unable to perform busybox-update-config when fragment files are set
make[1]: *** [package/busybox/busybox.mk:464: busybox-update-config] Error 1
make: *** [Makefile:23: _all] Error 2

How this guide states it in current version would be correct for using fragments.

I guess my question is what would be correct way to automate

cp build/busybox-1.27.2/.config ../src/<full system name>/busybox_defconfig

Maybe add new make option `make busybox-update-fragment-config that would basically call

cp build/busybox-1.27.2/.config ${NERVES_DEFCONFIG_DIR}/busybox_defconfig

and maybe set fragments at the same time.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, you're right, if you have never modified the busybox.config then it goes to the default one.

I'd do this:

cp build/busybox-1.27.2/.config ../src/<full system name>/busybox.config

Then run make menuconfig to set BR2_PACKAGE_BUSYBOX_CONFIG to ${NERVES_DEFCONFIG_DIR}/busybox.config, and then make savedefconfig.

Then when I wanted to update it in the future, make busybox-update-config will work.

Side note: Busybox only knows how to save .config files. Linux and Buildroot can save .config and _defconfig versions where the defconfig version only has the nondefault settings.

git push
```

Now you can go to your `nerves_systems/config/config.exs` and add it to your systems.
Copy link
Author

@Damirados Damirados Dec 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should include another section of how to now add custom system in a project and use it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea.

Comment on lines +33 to +36
> #### Compatibility Note {: .info}
>
> This command is compatible with Debian 11 and 12, and Ubuntu 20.04, 22.04. Older distributions may require adjustments.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> #### Compatibility Note {: .info}
>
> This command is compatible with Debian 11 and 12, and Ubuntu 20.04, 22.04. Older distributions may require adjustments.

I think the compatibility note is implied now that you added Arch and Fedora and can be deleted to make the text shorter.


git add mix.exs
git commit -m "Change project info"
git push
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
git push
git push origin main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants