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

config.sh unable to save config #40

Closed
Siecje opened this issue Sep 13, 2024 · 1 comment · Fixed by #48
Closed

config.sh unable to save config #40

Siecje opened this issue Sep 13, 2024 · 1 comment · Fixed by #48
Assignees

Comments

@Siecje
Copy link
Contributor

Siecje commented Sep 13, 2024

I'm not using the pi user. My user is in the rpi-sb-provisioner group.

When I run config.sh and enter values and try to save I get a PermissionError.

╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ /usr/share/rpi-sb-provisioner/config/config.py:119 in on_button_pressed                                                                                                                                                                                                      │
│                                                                                                                                                                                                                                                                              │
│   116 │   │   if "close_help_screen" in event.button.id:                                       ╭─────────────────────────────────── locals ────────────────────────────────────╮                                                                                             │
│   117 │   │   │   self.pop_screen()                                                            │ event = Pressed()                                                             │                                                                                             │
│   118 │   │   if "write_button" in event.button.id:                                            │  self = App(title='rpi-sb-provisioner config editor', classes={'-dark-mode'}) │                                                                                             │
│ ❱ 119 │   │   │   f = open("/etc/rpi-sb-provisioner/config", "w+")                             ╰───────────────────────────────────────────────────────────────────────────────╯                                                                                             │
│   120 │   │   │   for param in params_to_save:                                                                                                                                                                                                                               │
│   121 │   │   │   │   if param != "":                                                                                                                                                                                                                                        │
│   122 │   │   │   │   │   f.write(param + "=" + params_to_save[param] + "\n")                                                                                                                                                                                                │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
PermissionError: [Errno 13] Permission denied: '/etc/rpi-sb-provisioner/config'

/etc/rpi-sb-provsioner/ has permissions drwxr-xr-x 2 root root 4096 Sep 13 08:58 .

If the command should be sudo config.sh the README should be updated.

If I use sudo config.sh and fill out all of the fields. /etc/rpi-sb-provisioner/config is created with

CUSTOMER_KEY_FILE_PEM=
CUSTOMER_KEY_PKCS11_NAME=
GOLD_MASTER_OS_FILE=
RPI_DEVICE_STORAGE_TYPE=
RPI_DEVICE_FAMILY=
RPI_DEVICE_BOOTLOADER_CONFIG_FILE=/var/lib/rpi-sb-provisioner/bootloader.config
RPI_DEVICE_LOCK_JTAG=
RPI_DEVICE_EEPROM_WP_SET=
RPI_DEVICE_SERIAL_STORE=/usr/local/etc/rpi-sb-provisioner/seen
DEMO_MODE_ONLY=
RPI_SB_WORKDIR=

If the file already exists sudo config.sh will not modify it.

@tdewey-rpi tdewey-rpi self-assigned this Sep 13, 2024
@tdewey-rpi
Copy link
Collaborator

Agreed, the most sensible path forward for the configuration script is to make it a sudo tool.

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 a pull request may close this issue.

2 participants