From owner-p4-projects@FreeBSD.ORG Fri Apr 10 21:58:06 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D2C3B1065673; Fri, 10 Apr 2009 21:58:05 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92425106566C for ; Fri, 10 Apr 2009 21:58:05 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 7E7D98FC1B for ; Fri, 10 Apr 2009 21:58:05 +0000 (UTC) (envelope-from rene@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n3ALw5mC005295 for ; Fri, 10 Apr 2009 21:58:05 GMT (envelope-from rene@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n3ALw5Ei005293 for perforce@freebsd.org; Fri, 10 Apr 2009 21:58:05 GMT (envelope-from rene@FreeBSD.org) Date: Fri, 10 Apr 2009 21:58:05 GMT Message-Id: <200904102158.n3ALw5Ei005293@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to rene@FreeBSD.org using -f From: Rene Ladan To: Perforce Change Reviews Cc: Subject: PERFORCE change 160465 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Apr 2009 21:58:07 -0000 http://perforce.freebsd.org/chv.cgi?CH=160465 Change 160465 by rene@rene_self on 2009/04/10 21:57:58 [WIP] solid-state: transform to diskless to rc.d Affected files ... .. //depot/projects/docproj_nl/en_US.ISO8859-1/articles/solid-state/article.sgml#10 edit Differences ... ==== //depot/projects/docproj_nl/en_US.ISO8859-1/articles/solid-state/article.sgml#10 (text+ko) ==== @@ -78,7 +78,7 @@ Specific topics to be covered include the types and attributes of solid state media suitable for disk use in FreeBSD, kernel options that are of interest in such an environment, the - rc.diskless mechanisms that automate the + rc.initdiskless mechanisms that automate the initialization of such systems and the need for read-only filesystems, and building filesystems from scratch. The article will conclude with some general strategies for small and read-only FreeBSD @@ -128,7 +128,7 @@ A few kernel options are of specific interest to those creating an embedded FreeBSD system. - First, all embedded FreeBSD systems that use flash memory as system + All embedded FreeBSD systems that use flash memory as system disk will be interested in memory disks and memory filesystems. Because of the limited number of writes that can be done to flash memory, the disk and the filesystems on the disk will most likely be mounted @@ -147,44 +147,36 @@ - <filename>rc.diskless</filename> and Read-Only Filesystems + <filename>rc.initdiskless</filename> and Read-Only Filesystems The post-boot initialization of an embedded FreeBSD system is - controlled by /etc/rc.diskless2 - (/etc/rc.diskless1 is for BOOTP diskless boot). + controlled by /etc/rc.initdiskless. + + + rc.initdiskless mounts /var as a memory filesystem, makes a configurable list of directories in /var with the &man.mkdir.1; command, changes modes - on some of those directories, and extracts a list of device entries to - copy to a writable (again, a memory filesystem) - /dev partition. In the execution of - /etc/rc.diskless2, one other + on some of those directories. In the execution of + /etc/rc.initdiskless, one other rc.conf variable comes into play - - varsize. The /etc/rc.diskless2 + varsize. The /etc/rc.initdiskless file creates a /var partition based on the value of this variable in rc.conf: varsize=8192 - Remember that this value is in sectors. The creation of the - /dev partition by - /etc/rc.diskless2, however, is governed by a - hard-coded value of 4096 sectors. It is trivial to change this entry in - the /etc/rc.diskless2 file itself, although you - should not need more space than that for - /dev. + Remember that this value is in sectors. It is important to remember that the - /etc/rc.diskless2 script assumes that you have + /etc/rc.initdiskless script assumes that you have already removed your conventional /tmp partition and replaced it with a symbolic link to /var/tmp. Because tmp is one of the directories created in - /var by the /etc/rc.diskless2 + /var by the /etc/rc.initdiskless script, and because /var is a memory filesystem (which is mounted read-write), /tmp will now be a directory that is read-write as well. @@ -213,10 +205,10 @@ /var/db/port.mkversion file does not exist. cron will not run properly as a result of missing cron tabs in the /var created by - /etc/rc.diskless2, and syslog and dhcp will + /etc/rc.initdiskless, and syslog and dhcp will encounter problems as well as a result of the read-only filesystem and missing items in the /var that - /etc/rc.diskless2 has created. These are only + /etc/rc.initdiskless has created. These are only temporary problems though, and are addressed, along with solutions to the execution of other common software packages in . @@ -360,7 +352,7 @@ In , it was pointed out that the /var filesystem constructed by - /etc/rc.diskless2 and the presence of a read-only + /etc/rc.initdiskless and the presence of a read-only root filesystem causes problems with many common software packages used with FreeBSD. In this article, suggestions for successfully running cron, syslog, ports installations, and the Apache web server will be @@ -369,7 +361,7 @@ cron - In /etc/rc.diskless2 there is a variable + In /etc/rc.initdiskless there is a variable named var_dirs. This variable consists of a space-delimited list of directories that will be created inside of /var after it is mounted as a memory filesystem. @@ -388,11 +380,11 @@ that need them, mount your / filesystem as read-write and copy those cron tabs to somewhere safe, like /etc/tabs, then add a line to the end of - /etc/rc.diskless2 that copies those crontabs into + /etc/rc.initdiskless that copies those crontabs into /var/cron/tabs after that directory has been created during system initialization. You may also need to add a line that changes modes and permissions on the directories you create and - the files you copy with /etc/rc.diskless2. + the files you copy with /etc/rc.initdiskless. @@ -400,9 +392,9 @@ syslog.conf specifies the locations of certain log files that exist in /var/log. These - files are not created by /etc/rc.diskless2 upon + files are not created by /etc/rc.initdiskless upon system initialization. Therefore, somewhere in - /etc/rc.diskless2, after the section that creates + /etc/rc.initdiskless, after the section that creates the directories in /var, you will need to add something like this: @@ -410,7 +402,7 @@ &prompt.root; chmod 0644 /var/log/* You will also need to add the log directory to the list of - directories that /etc/rc.diskless2 + directories that /etc/rc.initdiskless creates. @@ -441,7 +433,7 @@ &prompt.root; mkdir /etc/pkg - Now, add a line to /etc/rc.diskless2 that + Now, add a line to /etc/rc.initdiskless that links the /etc/pkg directory to /var/db/pkg. An example: @@ -463,7 +455,7 @@ apache_install/logs. Since this directory doubtless exists on a read-only filesystem, this will not work. It is necessary to add a new directory to the - /etc/rc.diskless2 list of directories to create + /etc/rc.initdiskless list of directories to create in /var, to link apache_install/logs to /var/log/apache. It is also necessary to set @@ -471,10 +463,10 @@ First, add the directory log/apache to the list of directories to be created in - /etc/rc.diskless2. + /etc/rc.initdiskless. Second, add these commands to - /etc/rc.diskless2 after the directory creation + /etc/rc.initdiskless after the directory creation section: &prompt.root; chmod 0774 /var/log/apache