I was working on this bug 6395 , but in order to test my changes I needed to load a custom /etc/system file,
as I'm using PIADM(1M) the steps are the following:
[root@smartos-dev /zones/boot]# ls -lrt total 12 drwxr-xr-x 4 root root 5 Apr 8 02:50 platform-20210408T001154Z drwxr-xr-x 3 root root 3 Apr 20 16:02 etc drwxr-xr-x 4 root root 5 Apr 20 19:07 platform-20210420T172124Z drwxr-xr-x 4 root root 15 Apr 20 22:43 boot-20210408T001154Z drwxr-xr-x 3 root root 4 Apr 20 23:08 custom drwxr-xr-x 4 root root 16 Apr 20 23:35 boot-20210420T172124Z lrwxrwxrwx 1 root root 23 Apr 20 23:35 boot -> ./boot-20210420T172124Z lrwxrwxrwx 1 root root 27 Apr 20 23:35 platform -> ./platform-20210420T172124Z
[root@smartos-dev /zones/boot/custom]# ls -lrt total 3 -rw-r--r-- 1 root root 102 Apr 20 22:47 loader.conf.local drwxr-xr-x 2 root root 3 Apr 21 00:20 etc [root@smartos-dev /zones/boot/custom]#
system_load="YES" system_type="file" system_name="/custom/etc/system" system_flags="name=/etc/system"
I just copied the /etc/system file to /zones/boot/custom/etc/ and added the following for my test.
set segkpsize=0x80000
Create an iso from the smartos-live repo using the gmake-iso target.
Install the new platform image using the iso created in the previous step
$ piadm install /opt/platform.iso
$ piadm activate
Reboot
$ shutdown
Now your custom /etc/system file should be in /system/boot/etc/system.
In case you are not able to boot because of a misconfiguration on the custom system file, you will need
to choose boot to boot loader, then type:
disable-module system
and your file won't be used at boot so you will be able to get into the system and fix it.
Thank you very much sjorge, danmcd and jbk on #smartos irc channel, for guiding me through this and point me to the documentation.
References