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

Order / presence of command-line options matters #54

Open
skoenig opened this issue Jul 1, 2024 · 1 comment
Open

Order / presence of command-line options matters #54

skoenig opened this issue Jul 1, 2024 · 1 comment

Comments

@skoenig
Copy link

skoenig commented Jul 1, 2024

Hi - it appears that, contrary to the documentation, certain command line options besides --script-filename are also mandatory. When I run the script as shown in the first example, it throws an error:

./create-alpine-disk-image --script-filename create.sh

create-alpine-disk-image version 0.3-DEV
./create-alpine-disk-image: 18: readonly: CADI_DEFAULT_ESP_PART_SIZE: is read only

The error occurs due to the missing --arch option, which leads to double-sourcing of ./definitions/virtual//defines and attempts to reassign read-only variables (see error.log).

Also, the order of options matters. Here is a working example with a couple of more options that leads to the same issue:

./create-alpine-disk-image --script-filename create.sh \
     --virtual generic \
     --cloud-configuration-type none 

create-alpine-disk-image version 0.3-DEV
./create-alpine-disk-image: 18: readonly: CADI_DEFAULT_ESP_PART_SIZE: is read only

When reversing the order of the two additional command-line options, the script runs successfully:

/create-alpine-disk-image --script-filename create.sh \
    --cloud-configuration-type none \
    --virtual generic

create-alpine-disk-image version 0.3-DEV

Using the following settings:

  Image arch: x86_64
  Image class: virtual, VM type: generic
  Config software type: none

  Alpine release: edge

  OS device type: generic		OS device media: disk
  OS device sector size: 512 bytes

  Boot type: bios			Bootloader: grub
  Root filesystem type: ext4

  Console device type: generic	Console output type: generic
  Keyboard type: generic
  Enable graphics: false

  Cron daemon: busybox		DHCP client: generic
  Login package: util-linux	NTP daemon: chrony
  SSH daemon: openssh		Syslog server: rsyslog
  User management: shadow

Created tailored script 'create.sh'.
This script must be run as user 'root'.

So there is some weird option parsing going on here.

@dermotbradley
Copy link
Owner

Hello.

Unfortunately, as of a few months ago, I stopped my official involvement in Alpine and dropped maintainership of the Alpine packages I used to look after.

I still am using and developing/expanding this script locally (as I'm also still using Alpine, though in a modified form) but I'm no longer posting updates to it here on Github, partly because the current version of the script now makes use of quite a few modified (including changes that Alpine devs wouldn't accept) locally-hosted Alpine packages.

I guess I should add a note regarding that to the README.

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

No branches or pull requests

2 participants