The pfSense Store

Author Topic: How can i make a image with custom configfiles???  (Read 3751 times)

0 Members and 1 Guest are viewing this topic.

Offline Thowie

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
    • Networkmonkey IT Blog
How can i make a image with custom configfiles???
« on: August 24, 2006, 01:56:42 pm »
Hello,
first of all, sorry for my bad English, i can better read than write  ;)

My question is, how can i do costum configfiles e.g. /home/pfsense/pfsense/etc/rc and other to a isoimage???

I edit the files in the Develversion in /home/pfsense/pfsense/* and then i use build_iso.sh in the /home/tool/build_tools/.
But after that, the edited files are overriden by the original.


can someone help me...

Thanks for this product it's very cool

Bye
Thomas


Offline MrMoo

  • Jr. Member
  • **
  • Posts: 86
  • Karma: +1/-0
    • View Profile
    • じゅんこ
Re: How can i make a image with custom configfiles???
« Reply #1 on: August 24, 2006, 09:50:29 pm »
Just mount the release ISO and edit the files in place?

Code: [Select]
mount -t cd9660 /dev/`mdconfig -af pfSense.iso` /mnt

Offline Thowie

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
    • Networkmonkey IT Blog
Re: How can i make a image with custom configfiles???
« Reply #2 on: September 01, 2006, 10:09:06 am »
Hi,
sry for this late answer...

To your post, the mounting of the Image dosn't work... :(

I searched in the buildTools and find a variable to make a custom overlay file, i think that is what i searched for... but don't know how i use this... ;(

so i hope anybody can help me...

Thanks...

and SORRY for my bad English ;)

Offline aldo

  • Full Member
  • ***
  • Posts: 202
  • Karma: +0/-0
    • View Profile
Re: How can i make a image with custom configfiles???
« Reply #3 on: September 09, 2006, 02:25:54 pm »
make up a directory tree of the files you want to edit

EXAMPLE

/etc/version
/usr/local/www/themes/new_theme

tar -cvzf yourthemename.tgz ./*

add the overlay *.tgz to your buiilder script in the overlay variable and run the builder_script that you want.

simple example ask for some more and i am sure i can help here.

maybe when we are finished you could get the guys to add it to the wiki

Offline Gertjan

  • Sr. Member
  • ****
  • Posts: 337
  • Karma: +0/-0
    • View Profile
Re: How can i make a image with custom configfiles???
« Reply #4 on: September 20, 2006, 01:20:30 pm »
Just mount the release ISO and edit the files in place?
Code: [Select]
mount -t cd9660 /dev/`mdconfig -af pfSense.iso` /mnt

Nearly  ;)

Code: [Select]
# # mount -t cd9660 /dev/md`mdconfig -a -t vnode -f /usr/obj.pfSense/pfSense.iso -n` /mnt
# ls /mnt
.cshrc                  conf.default            root
.profile                dev                     sbin
.project                dist                    scripts
COPYRIGHT               etc                     tmp
RELENG_1                lib                     trigger_initial_wizard
bin                     libexec                 usr
boot                    mnt                     uzip
boot.catalog            pkg_info.txt            var
cf                      proc
conf                    rescue
# df
Filesystem  1K-blocks    Used   Avail Capacity  Mounted on
/dev/ad0s1a   3807702 1588878 1914208    45%    /
devfs               1       1       0   100%    /dev
devfs               1       1       0   100%    /var/dhcpd/dev
/dev/md0        33870   33870       0   100%    /mnt

To unmount, you to know the device 'number' (name).
While a unmount /dev/`mdconfig -l` will do for the umount part, you have to mdconfig -l to know the actual name of the device, md0 in my case.
Then a mdconfig -d -u 0 will roll everything back to normal.

Nice to mount a ISO like this.... but the real pb is : can we write to the ISO ? - I'm still on that one (the sited option -o no readonly doesn't work  :(). I'll be back.

[edit] Back !

Bad news: doing it all by hand :
Code: [Select]
# mdconfig -a -t vnode -f /usr/obj.pfSense/pfSense.iso -o noreadonly
md0
# mount_cd9660 -o rw -s 0 /dev/md0 /mnt
# echo hello > /mnt/etc/test
/mnt/etc/test: Read-only file system.

The -o rw option (not documented for mount_cd9600, but is exists) isn't taken.
The final error message is my last word ..... :-[

Long live custom_overlay
« Last Edit: September 20, 2006, 02:43:15 pm by Gertjan »

Offline jeroen234

  • Sr. Member
  • ****
  • Posts: 505
  • Karma: +0/-0
    • View Profile
Re: How can i make a image with custom configfiles???
« Reply #5 on: September 20, 2006, 05:43:33 pm »
and if you copy it to a normal dir afther mounting ?
umount it
add/chance files
then make a new image

Offline Gertjan

  • Sr. Member
  • ****
  • Posts: 337
  • Karma: +0/-0
    • View Profile
Re: How can i make a image with custom configfiles???
« Reply #6 on: September 21, 2006, 02:02:51 am »
and if you copy it to a normal dir afther mounting ?
Well, if we're talking the pfSense ISO, no need to mount it. It's there already after a build_iso.sh.
Just modify the 'source tree', and execute the last couple of commands in this script file by hand.