swapfile forced to partition that doesn't necessarily exist in openmiko-gen.sh
jangliss opened this issue · comments
Describe the bug
In utilities/openmiko-gen.sh
the configuration file that is built enables swap and specifies the path to be a partition on an sdcard.
openmiko-gen.sh
Specs
On line 78-83 in openmiko-gen.sh
the swap is turned on, and the path is set to dev/mmcblk0p1
openmiko/utilities/openmiko-gen.sh
Line 80 in 00f72a6
Unless somebody has partitioned their sdcard to have 2 partitions, and the first partition is of type swap, this will cause a failure.
In addition, SD_PARTITION
is overwritten to be the second partition on the sdcard, which is used in /usr/bin/general_init.sh
.
To Reproduce
cd ./utilities
mkdir -p config/overlay/etc
./openmiko-gen.sh config/overlay/etc
- Observe configuration having swap specified as a block device, and it turning on swap. The default configuration located in
overlay_minimal/etc/openmiko.conf
does not enable swap, nor specify the block device.
Expected behavior
Add a new option for enabling swap in the openmiko-gen.sh
script. When attempting to swapon
the partition, make sure it exists first.