FS#41865 - [archiso] Re-Builds Fail Due To Re-Adding User

Attached to Project: Release Engineering
Opened by Paul A. Hinchberger III (BrainwreckedTech) - Monday, 08 September 2014, 00:20 GMT
Last edited by Gerardo Exequiel Pozzi (djgera) - Thursday, 11 September 2014, 05:13 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

When using archiso to initially build a customized Arch ISO, the build works fine. However, a re-build will fail with the default script due to the combination of set -e and useradd returning a non-zero exit code when trying to add a user that already exists.

Fix:

Use "! id arch" to conditionally execute.

if ! id arch; then
useradd ...
fi

- or -

! id arch && useradd ...

Additional info:

* package version: archiso 19-1
* affected file: /usr/share/archiso/configs/releng/airootfs/root/customize_airootfs.sh

Steps to reproduce:

Follow directions at https://wiki.archlinux.org/index.php/Archiso to use archiso to build and initial Arch ISO
Follow directions at https://wiki.archlinux.org/index.php/Archiso#Rebuild_the_ISO to immediately rebuild the ISO
Barring any other problems, the process will halt at the useradd command.
This task depends upon

Closed by  Gerardo Exequiel Pozzi (djgera)
Thursday, 11 September 2014, 05:13 GMT
Reason for closing:  Not a bug
Comment by Gerardo Exequiel Pozzi (djgera) - Tuesday, 09 September 2014, 04:12 GMT
Rebuilding process, as described on the wiki is not a good idea(if you do such thing remove all "stage marks", why not just remove all working files?). These marks are just to allow building in stages.
If you know what are you doing (archiso internals), just rebuild that part and only it. Indeed official docs, does not provide such instructions. Also configs/releng just serve as one purpose: prepare official ISO and maybe as "extended example beyond baseline profile", just to take to make your own profile.
Comment by Paul A. Hinchberger III (BrainwreckedTech) - Tuesday, 09 September 2014, 22:14 GMT
> If you know what are you doing ... just rebuild that part and only it.

Then the problem still exists when that part involves customize_airootfs.sh itself. It's one thing when code the user added breaks the process. It's another when code the user didn't touch/affect breaks the process.
Comment by Gerardo Exequiel Pozzi (djgera) - Wednesday, 10 September 2014, 22:34 GMT
So I need to change every part of code, both in configs/releng, where is not needed, and in mkarchiso. To match the new rule of "allow rebuild" after removing all stage files... test if archiso.img exist, if not create; test if efiboot.img exist if not create; test if vmlinuz is copied if not...
Comment by Paul A. Hinchberger III (BrainwreckedTech) - Thursday, 11 September 2014, 00:29 GMT
Or, you can just make it clear that rebuilding is not supported. "Rebuilding....is not a good idea," and "If you know what you are doing...," conflict on that account.

You could also suggest the wiki should be changed, and someone might have actually done that.

Instead, more effort has been put into arguing than what the change warrants. A change that (AFAICT from my testing) affects nothing else and found itself tied to other things I haven't seen anyone ask for.
Comment by Gerardo Exequiel Pozzi (djgera) - Thursday, 11 September 2014, 05:13 GMT
The official documentation is here [#1]. Sorry I can not follow the wiki changes, since the archiso wiki page, talks about many things outside archiso and my time is limited.

[#1] https://projects.archlinux.org/archiso.git/tree/docs

Loading...