Nature40 / pimod

Reconfigure Raspberry Pi images with an easy, Docker-like configuration file
GNU General Public License v3.0
127 stars 19 forks source link

Pifile gets sourced more than once #4

Closed gh0st42 closed 5 years ago

gh0st42 commented 5 years ago

It seems as if the Pifile is sourced more than once and therefore parts also get executed:

update-binfmts: warning: qemu-arm already enabled in kernel.
UPGRADING
INSTALLING MC
CHANGING PASSWORD
200+0 records in
200+0 records out
209715200 bytes (210 MB, 200 MiB) copied, 1.11478 s, 188 MB/s
e2fsck 1.43.4 (31-Jan-2017)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
rootfs: 39648/110880 files (0.1% non-contiguous), 271340/443392 blocks
resize2fs 1.43.4 (31-Jan-2017)
The filesystem is already 443392 (4k) blocks long.  Nothing to do!

Disk /dev/loop0: 2 GiB, 2076180480 bytes, 4055040 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x7ee80803

Device       Boot Start     End Sectors  Size Id Type
/dev/loop0p1       8192   98045   89854 43.9M  c W95 FAT32 (LBA)
/dev/loop0p2      98304 3645439 3547136  1.7G 83 Linux
loop deleted : /dev/loop0
UPGRADING
INSTALLING MC
CHANGING PASSWORD
Linux fdf54efd2a59 4.9.125-linuxkit #1 SMP Fri Sep 7 08:20:28 UTC 2018 armv7l GNU/Linux
Get:1 http://raspbian.raspberrypi.org/raspbian stretch InRelease [15.0 kB]
Get:2 http://archive.raspberrypi.org/debian stretch InRelease [25.4 kB]
Get:3 http://raspbian.raspberrypi.org/raspbian stretch/main armhf Packages [11.7 MB]
Get:4 http://archive.raspberrypi.org/debian stretch/main armhf Packages [200 kB]
Get:5 http://archive.raspberrypi.org/debian stretch/ui armhf Packages [41.6 kB]
Fetched 11.9 MB in 15s (755 kB/s)
Reading package lists... Done
UPGRADING
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
[...]

See all the ALL-CAPITAL strings in the output..

oxzi commented 5 years ago

The Pifile, which is just a Bash script, is sourced in every phase. However, before entering each phase, all functions will be loaded with an empty body from 00-commands.sh. The phase-specific functions are also defined in the phase script and will override the empty functions. This happens in the for-loop inside the execute_pifile function in the pimod.sh file.

update-binfmts's message indicates that you are using an older release - it was removed in bb6812d94c9fddf8ead609439a8ad35a8c4eba88. Please update your repository.