netinstall question

I have a question regarding the mk_mmc.sh script in Robert Nelson's netinstall.

It appears that even if I request no swap space:

sudo conf_swapsize_mb=0 ./mk_mmc.sh --mmc /dev/sdc --dtb am335x-boneblack --firmware --serial-mode

the script insists on making a minimal swap partition:

         Device Boot Start End Blocks Id System
/dev/mmcblk0p1 * 2048 198655 98304 e W95 FAT16 (LBA)
/dev/mmcblk0p2 200702 15642623 7720961 5 Extended
/dev/mmcblk0p5 200704 15394815 7597056 83 Linux
/dev/mmcblk0p6 15396864 15642623 122880 82 Linux swap / Solaris

Is this really essential, or even desirable on a system residing on SD card? If my embedded system runs out of RAM, I would prefer it to crash and restart, rather than thrashing the SD card to death :wink:

I can change this by editing the mk_mmc.sh script, but I am concerned that I may be missing a critical point.

Regards,

Dave.

Hi Dave, you can setup the partition layout anyway you want at the
"debian-installer" partition stage, just don't tweak the initial 100Mb
fat partition..

Just don't be "too" creative, the script at the end of install can
figure out what most people setup:
https://github.com/RobertCNelson/netinstall/blob/master/lib/debian-finish.sh#L37

Regards,

No fear! Thanks Robert. I was more concerned as to a swap partition on media with a limited write life? Regards, Dave.

Thanks Robert. I was more concerned as to why default a swap partition on
media with a limited write life?

Well it was enabled back in the day, with my 128Mb beagleboard and it
just ran much smoother with gnome with swap. :wink:

Never really gave it much thought since..

Regards,

Thanks for the honest answer Robert. Unfortunately I have been the victim of SD cards wearing out due to multiple writes, usually in systems installed in remote locations :frowning: Since then, I have been very frugal on what writes to SD.

Regards,

Dave.

How about this. :wink:

https://github.com/RobertCNelson/netinstall/commit/0ff008b13a6f819755416375004fd5d4962613d3

Regards,

Excellent!!!

Oops:

dlambert@development ~/netinstall $ sudo ./mk_mmc.sh --mmc /dev/sdc --dtb am335x-boneblack --firmware --no-swap --serial-mode
./mk_mmc.sh: line 922: syntax error near unexpected token `else'

I am no shell guru, but maybe there should be a 'then' for the 'else'?

--- a/mk_mmc.sh
+++ b/mk_mmc.sh
@@ -910,7 +910,7 @@ finish_installing_device () {

  setup_parition_recipe () {
         #This (so far) has been leaving the first Partition Alone...
- if [ "x${no_swap}" = "xenabled" ] ;
+ if [ "x${no_swap}" = "xenabled" ] ; then
         cat > ${TEMPDIR}/initrd-tree/partition_recipe <<-__EOF__
                         500 1000 -1 ext4
                                 method{ format } format{ }

Ah crap. :wink:

fixed:
https://github.com/RobertCNelson/netinstall/commit/6d037544e08644a5ac8090ba04484f5b8972250f

Regards,