]> spindle.queued.net Git - xodist/commitdiff
mkext3/mkjffs2: rework fstab/olpc.fth file generation during image creation
authorAndres Salomon <dilinger@collabora.co.uk>
Sat, 30 May 2009 00:13:25 +0000 (20:13 -0400)
committerAndres Salomon <dilinger@collabora.co.uk>
Sat, 30 May 2009 00:25:36 +0000 (20:25 -0400)
Rather than creating them from a script, copy them out of configs/*.  This
will also let us specify the partition layout in the fstab files.

Signed-off-by: Andres Salomon <dilinger@collabora.co.uk>
30 files changed:
configs/debian-lenny-i386/fstab-ext3 [new file with mode: 0644]
configs/debxo-awesome/fstab-ext3 [new file with mode: 0644]
configs/debxo-awesome/fstab-jffs2 [new file with mode: 0644]
configs/debxo-awesome/olpc.fth-ext3 [new file with mode: 0644]
configs/debxo-awesome/olpc.fth-jffs2 [new file with mode: 0644]
configs/debxo-gnome/fstab-ext3 [new file with mode: 0644]
configs/debxo-gnome/fstab-jffs2 [new file with mode: 0644]
configs/debxo-gnome/olpc.fth-ext3 [new file with mode: 0644]
configs/debxo-gnome/olpc.fth-jffs2 [new file with mode: 0644]
configs/debxo-kde/fstab-ext3 [new file with mode: 0644]
configs/debxo-kde/fstab-jffs2 [new file with mode: 0644]
configs/debxo-kde/olpc.fth-ext3 [new file with mode: 0644]
configs/debxo-kde/olpc.fth-jffs2 [new file with mode: 0644]
configs/debxo-lxde/fstab-ext3 [new file with mode: 0644]
configs/debxo-lxde/fstab-jffs2 [new file with mode: 0644]
configs/debxo-lxde/olpc.fth-ext3 [new file with mode: 0644]
configs/debxo-lxde/olpc.fth-jffs2 [new file with mode: 0644]
configs/debxo-sugar/fstab-ext3 [new file with mode: 0644]
configs/debxo-sugar/fstab-jffs2 [new file with mode: 0644]
configs/debxo-sugar/olpc.fth-ext3 [new file with mode: 0644]
configs/debxo-sugar/olpc.fth-jffs2 [new file with mode: 0644]
configs/debxo-xfce/fstab-ext3 [new file with mode: 0644]
configs/debxo-xfce/fstab-jffs2 [new file with mode: 0644]
configs/debxo-xfce/olpc.fth-ext3 [new file with mode: 0644]
configs/debxo-xfce/olpc.fth-jffs2 [new file with mode: 0644]
configs/generic/fstab-ext3 [new file with mode: 0644]
configs/generic/fstab-jffs2 [new file with mode: 0644]
functions.sh
mkext3.sh
mkjffs2.sh

diff --git a/configs/debian-lenny-i386/fstab-ext3 b/configs/debian-lenny-i386/fstab-ext3
new file mode 100644 (file)
index 0000000..b1fdd0f
--- /dev/null
@@ -0,0 +1,6 @@
+# /etc/fstab: static file system information 
+#
+# <file system>        <mount point>   <type>  <options>       <dump>  <pass>
+proc           /proc           proc    defaults        0       0       # <partition size in MB>
+LABEL=Boot     /boot           ext3    defaults        0       2       # 50
+LABEL=Root     /               ext3    errors=remount-ro  0    1       # 400
diff --git a/configs/debxo-awesome/fstab-ext3 b/configs/debxo-awesome/fstab-ext3
new file mode 100644 (file)
index 0000000..0d7b766
--- /dev/null
@@ -0,0 +1,7 @@
+# /etc/fstab: static file system information 
+#
+# <file system>        <mount point>   <type>  <options>       <dump>  <pass>
+proc           /proc           proc    defaults        0       0       # <partition size in MB>
+LABEL=DebXO    /               ext3    errors=remount-ro 0     1       # 1024
+none           /ofw            promfs  defaults        0       0
+tmpfs          /var/cache/apt/cache tmpfs defaults     0       0
diff --git a/configs/debxo-awesome/fstab-jffs2 b/configs/debxo-awesome/fstab-jffs2
new file mode 100644 (file)
index 0000000..8b43fa1
--- /dev/null
@@ -0,0 +1,8 @@
+# /etc/fstab: static file system information 
+#
+# <file system>        <mount point>   <type>  <options>       <dump>  <pass>
+proc           /proc           proc    defaults        0       0       # <partition size in MB>
+mtd:boot       /boot           jffs2   defaults,noatime 1      1       # 50
+mtd:root       /               jffs2   defaults,noatime 1      1
+none           /ofw            promfs  defaults        0       0
+tmpfs          /var/cache/apt/cache tmpfs defaults     0       0
diff --git a/configs/debxo-awesome/olpc.fth-ext3 b/configs/debxo-awesome/olpc.fth-ext3
new file mode 100644 (file)
index 0000000..58a5fec
--- /dev/null
@@ -0,0 +1,25 @@
+\ OLPC boot script
+
+\ fetch the /chosen/bootpath property
+" /chosen" find-package  if                       ( phandle )
+  " bootpath" rot  get-package-property  0=  if   ( propval$ )
+    get-encoded-string                            ( bootpath$ )
+    [char] \ left-parse-string  2nip              ( dn$ )
+
+    \ store the first part of bootpath (up to the '\') in $DN
+    dn-buf place                                  ( )
+  then
+then
+
+" ro root=LABEL=DebXO video=lxfb fbcon=font:SUN12x22" to boot-file
+game-key-mask h# 80 and if
+       \ boot from backup kernel
+       " ${DN}\vmlinuz.old" expand$ to boot-device
+       " ${DN}\initrd.img.old" expand$ to ramdisk
+else
+       \ boot from regular kernel
+       " ${DN}\vmlinuz" expand$ to boot-device
+       " ${DN}\initrd.img" expand$ to ramdisk
+then
+dcon-unfreeze
+boot
diff --git a/configs/debxo-awesome/olpc.fth-jffs2 b/configs/debxo-awesome/olpc.fth-jffs2
new file mode 100644 (file)
index 0000000..d338716
--- /dev/null
@@ -0,0 +1,25 @@
+\ OLPC boot script
+
+\ fetch the /chosen/bootpath property
+" /chosen" find-package  if                       ( phandle )
+  " bootpath" rot  get-package-property  0=  if   ( propval$ )
+    get-encoded-string                            ( bootpath$ )
+    [char] \ left-parse-string  2nip              ( dn$ )
+
+    \ store the first part of bootpath (up to the '\') in $DN
+    dn-buf place                                  ( )
+  then
+then
+
+" ro root=mtd:root rootfstype=jffs2 video=lxfb fbcon=font:SUN12x22" to boot-file
+game-key-mask h# 80 and if
+       \ boot from backup kernel
+       " ${DN}\vmlinuz.old" expand$ to boot-device
+       " ${DN}\initrd.img.old" expand$ to ramdisk
+else
+       \ boot from regular kernel
+       " ${DN}\vmlinuz" expand$ to boot-device
+       " ${DN}\initrd.img" expand$ to ramdisk
+then
+dcon-unfreeze
+boot
diff --git a/configs/debxo-gnome/fstab-ext3 b/configs/debxo-gnome/fstab-ext3
new file mode 100644 (file)
index 0000000..d4a99fe
--- /dev/null
@@ -0,0 +1,7 @@
+# /etc/fstab: static file system information 
+#
+# <file system>        <mount point>   <type>  <options>       <dump>  <pass>
+proc           /proc           proc    defaults        0       0       # <partition size in MB>
+LABEL=DebXO    /               ext3    errors=remount-ro 0     1       # 1024
+none           /ofw            promfs  defaults        0       0 #x
+tmpfs          /var/cache/apt/cache tmpfs defaults     0       0
diff --git a/configs/debxo-gnome/fstab-jffs2 b/configs/debxo-gnome/fstab-jffs2
new file mode 100644 (file)
index 0000000..8b43fa1
--- /dev/null
@@ -0,0 +1,8 @@
+# /etc/fstab: static file system information 
+#
+# <file system>        <mount point>   <type>  <options>       <dump>  <pass>
+proc           /proc           proc    defaults        0       0       # <partition size in MB>
+mtd:boot       /boot           jffs2   defaults,noatime 1      1       # 50
+mtd:root       /               jffs2   defaults,noatime 1      1
+none           /ofw            promfs  defaults        0       0
+tmpfs          /var/cache/apt/cache tmpfs defaults     0       0
diff --git a/configs/debxo-gnome/olpc.fth-ext3 b/configs/debxo-gnome/olpc.fth-ext3
new file mode 100644 (file)
index 0000000..58a5fec
--- /dev/null
@@ -0,0 +1,25 @@
+\ OLPC boot script
+
+\ fetch the /chosen/bootpath property
+" /chosen" find-package  if                       ( phandle )
+  " bootpath" rot  get-package-property  0=  if   ( propval$ )
+    get-encoded-string                            ( bootpath$ )
+    [char] \ left-parse-string  2nip              ( dn$ )
+
+    \ store the first part of bootpath (up to the '\') in $DN
+    dn-buf place                                  ( )
+  then
+then
+
+" ro root=LABEL=DebXO video=lxfb fbcon=font:SUN12x22" to boot-file
+game-key-mask h# 80 and if
+       \ boot from backup kernel
+       " ${DN}\vmlinuz.old" expand$ to boot-device
+       " ${DN}\initrd.img.old" expand$ to ramdisk
+else
+       \ boot from regular kernel
+       " ${DN}\vmlinuz" expand$ to boot-device
+       " ${DN}\initrd.img" expand$ to ramdisk
+then
+dcon-unfreeze
+boot
diff --git a/configs/debxo-gnome/olpc.fth-jffs2 b/configs/debxo-gnome/olpc.fth-jffs2
new file mode 100644 (file)
index 0000000..d338716
--- /dev/null
@@ -0,0 +1,25 @@
+\ OLPC boot script
+
+\ fetch the /chosen/bootpath property
+" /chosen" find-package  if                       ( phandle )
+  " bootpath" rot  get-package-property  0=  if   ( propval$ )
+    get-encoded-string                            ( bootpath$ )
+    [char] \ left-parse-string  2nip              ( dn$ )
+
+    \ store the first part of bootpath (up to the '\') in $DN
+    dn-buf place                                  ( )
+  then
+then
+
+" ro root=mtd:root rootfstype=jffs2 video=lxfb fbcon=font:SUN12x22" to boot-file
+game-key-mask h# 80 and if
+       \ boot from backup kernel
+       " ${DN}\vmlinuz.old" expand$ to boot-device
+       " ${DN}\initrd.img.old" expand$ to ramdisk
+else
+       \ boot from regular kernel
+       " ${DN}\vmlinuz" expand$ to boot-device
+       " ${DN}\initrd.img" expand$ to ramdisk
+then
+dcon-unfreeze
+boot
diff --git a/configs/debxo-kde/fstab-ext3 b/configs/debxo-kde/fstab-ext3
new file mode 100644 (file)
index 0000000..0d7b766
--- /dev/null
@@ -0,0 +1,7 @@
+# /etc/fstab: static file system information 
+#
+# <file system>        <mount point>   <type>  <options>       <dump>  <pass>
+proc           /proc           proc    defaults        0       0       # <partition size in MB>
+LABEL=DebXO    /               ext3    errors=remount-ro 0     1       # 1024
+none           /ofw            promfs  defaults        0       0
+tmpfs          /var/cache/apt/cache tmpfs defaults     0       0
diff --git a/configs/debxo-kde/fstab-jffs2 b/configs/debxo-kde/fstab-jffs2
new file mode 100644 (file)
index 0000000..8b43fa1
--- /dev/null
@@ -0,0 +1,8 @@
+# /etc/fstab: static file system information 
+#
+# <file system>        <mount point>   <type>  <options>       <dump>  <pass>
+proc           /proc           proc    defaults        0       0       # <partition size in MB>
+mtd:boot       /boot           jffs2   defaults,noatime 1      1       # 50
+mtd:root       /               jffs2   defaults,noatime 1      1
+none           /ofw            promfs  defaults        0       0
+tmpfs          /var/cache/apt/cache tmpfs defaults     0       0
diff --git a/configs/debxo-kde/olpc.fth-ext3 b/configs/debxo-kde/olpc.fth-ext3
new file mode 100644 (file)
index 0000000..58a5fec
--- /dev/null
@@ -0,0 +1,25 @@
+\ OLPC boot script
+
+\ fetch the /chosen/bootpath property
+" /chosen" find-package  if                       ( phandle )
+  " bootpath" rot  get-package-property  0=  if   ( propval$ )
+    get-encoded-string                            ( bootpath$ )
+    [char] \ left-parse-string  2nip              ( dn$ )
+
+    \ store the first part of bootpath (up to the '\') in $DN
+    dn-buf place                                  ( )
+  then
+then
+
+" ro root=LABEL=DebXO video=lxfb fbcon=font:SUN12x22" to boot-file
+game-key-mask h# 80 and if
+       \ boot from backup kernel
+       " ${DN}\vmlinuz.old" expand$ to boot-device
+       " ${DN}\initrd.img.old" expand$ to ramdisk
+else
+       \ boot from regular kernel
+       " ${DN}\vmlinuz" expand$ to boot-device
+       " ${DN}\initrd.img" expand$ to ramdisk
+then
+dcon-unfreeze
+boot
diff --git a/configs/debxo-kde/olpc.fth-jffs2 b/configs/debxo-kde/olpc.fth-jffs2
new file mode 100644 (file)
index 0000000..d338716
--- /dev/null
@@ -0,0 +1,25 @@
+\ OLPC boot script
+
+\ fetch the /chosen/bootpath property
+" /chosen" find-package  if                       ( phandle )
+  " bootpath" rot  get-package-property  0=  if   ( propval$ )
+    get-encoded-string                            ( bootpath$ )
+    [char] \ left-parse-string  2nip              ( dn$ )
+
+    \ store the first part of bootpath (up to the '\') in $DN
+    dn-buf place                                  ( )
+  then
+then
+
+" ro root=mtd:root rootfstype=jffs2 video=lxfb fbcon=font:SUN12x22" to boot-file
+game-key-mask h# 80 and if
+       \ boot from backup kernel
+       " ${DN}\vmlinuz.old" expand$ to boot-device
+       " ${DN}\initrd.img.old" expand$ to ramdisk
+else
+       \ boot from regular kernel
+       " ${DN}\vmlinuz" expand$ to boot-device
+       " ${DN}\initrd.img" expand$ to ramdisk
+then
+dcon-unfreeze
+boot
diff --git a/configs/debxo-lxde/fstab-ext3 b/configs/debxo-lxde/fstab-ext3
new file mode 100644 (file)
index 0000000..0d7b766
--- /dev/null
@@ -0,0 +1,7 @@
+# /etc/fstab: static file system information 
+#
+# <file system>        <mount point>   <type>  <options>       <dump>  <pass>
+proc           /proc           proc    defaults        0       0       # <partition size in MB>
+LABEL=DebXO    /               ext3    errors=remount-ro 0     1       # 1024
+none           /ofw            promfs  defaults        0       0
+tmpfs          /var/cache/apt/cache tmpfs defaults     0       0
diff --git a/configs/debxo-lxde/fstab-jffs2 b/configs/debxo-lxde/fstab-jffs2
new file mode 100644 (file)
index 0000000..8b43fa1
--- /dev/null
@@ -0,0 +1,8 @@
+# /etc/fstab: static file system information 
+#
+# <file system>        <mount point>   <type>  <options>       <dump>  <pass>
+proc           /proc           proc    defaults        0       0       # <partition size in MB>
+mtd:boot       /boot           jffs2   defaults,noatime 1      1       # 50
+mtd:root       /               jffs2   defaults,noatime 1      1
+none           /ofw            promfs  defaults        0       0
+tmpfs          /var/cache/apt/cache tmpfs defaults     0       0
diff --git a/configs/debxo-lxde/olpc.fth-ext3 b/configs/debxo-lxde/olpc.fth-ext3
new file mode 100644 (file)
index 0000000..58a5fec
--- /dev/null
@@ -0,0 +1,25 @@
+\ OLPC boot script
+
+\ fetch the /chosen/bootpath property
+" /chosen" find-package  if                       ( phandle )
+  " bootpath" rot  get-package-property  0=  if   ( propval$ )
+    get-encoded-string                            ( bootpath$ )
+    [char] \ left-parse-string  2nip              ( dn$ )
+
+    \ store the first part of bootpath (up to the '\') in $DN
+    dn-buf place                                  ( )
+  then
+then
+
+" ro root=LABEL=DebXO video=lxfb fbcon=font:SUN12x22" to boot-file
+game-key-mask h# 80 and if
+       \ boot from backup kernel
+       " ${DN}\vmlinuz.old" expand$ to boot-device
+       " ${DN}\initrd.img.old" expand$ to ramdisk
+else
+       \ boot from regular kernel
+       " ${DN}\vmlinuz" expand$ to boot-device
+       " ${DN}\initrd.img" expand$ to ramdisk
+then
+dcon-unfreeze
+boot
diff --git a/configs/debxo-lxde/olpc.fth-jffs2 b/configs/debxo-lxde/olpc.fth-jffs2
new file mode 100644 (file)
index 0000000..d338716
--- /dev/null
@@ -0,0 +1,25 @@
+\ OLPC boot script
+
+\ fetch the /chosen/bootpath property
+" /chosen" find-package  if                       ( phandle )
+  " bootpath" rot  get-package-property  0=  if   ( propval$ )
+    get-encoded-string                            ( bootpath$ )
+    [char] \ left-parse-string  2nip              ( dn$ )
+
+    \ store the first part of bootpath (up to the '\') in $DN
+    dn-buf place                                  ( )
+  then
+then
+
+" ro root=mtd:root rootfstype=jffs2 video=lxfb fbcon=font:SUN12x22" to boot-file
+game-key-mask h# 80 and if
+       \ boot from backup kernel
+       " ${DN}\vmlinuz.old" expand$ to boot-device
+       " ${DN}\initrd.img.old" expand$ to ramdisk
+else
+       \ boot from regular kernel
+       " ${DN}\vmlinuz" expand$ to boot-device
+       " ${DN}\initrd.img" expand$ to ramdisk
+then
+dcon-unfreeze
+boot
diff --git a/configs/debxo-sugar/fstab-ext3 b/configs/debxo-sugar/fstab-ext3
new file mode 100644 (file)
index 0000000..0d7b766
--- /dev/null
@@ -0,0 +1,7 @@
+# /etc/fstab: static file system information 
+#
+# <file system>        <mount point>   <type>  <options>       <dump>  <pass>
+proc           /proc           proc    defaults        0       0       # <partition size in MB>
+LABEL=DebXO    /               ext3    errors=remount-ro 0     1       # 1024
+none           /ofw            promfs  defaults        0       0
+tmpfs          /var/cache/apt/cache tmpfs defaults     0       0
diff --git a/configs/debxo-sugar/fstab-jffs2 b/configs/debxo-sugar/fstab-jffs2
new file mode 100644 (file)
index 0000000..8b43fa1
--- /dev/null
@@ -0,0 +1,8 @@
+# /etc/fstab: static file system information 
+#
+# <file system>        <mount point>   <type>  <options>       <dump>  <pass>
+proc           /proc           proc    defaults        0       0       # <partition size in MB>
+mtd:boot       /boot           jffs2   defaults,noatime 1      1       # 50
+mtd:root       /               jffs2   defaults,noatime 1      1
+none           /ofw            promfs  defaults        0       0
+tmpfs          /var/cache/apt/cache tmpfs defaults     0       0
diff --git a/configs/debxo-sugar/olpc.fth-ext3 b/configs/debxo-sugar/olpc.fth-ext3
new file mode 100644 (file)
index 0000000..58a5fec
--- /dev/null
@@ -0,0 +1,25 @@
+\ OLPC boot script
+
+\ fetch the /chosen/bootpath property
+" /chosen" find-package  if                       ( phandle )
+  " bootpath" rot  get-package-property  0=  if   ( propval$ )
+    get-encoded-string                            ( bootpath$ )
+    [char] \ left-parse-string  2nip              ( dn$ )
+
+    \ store the first part of bootpath (up to the '\') in $DN
+    dn-buf place                                  ( )
+  then
+then
+
+" ro root=LABEL=DebXO video=lxfb fbcon=font:SUN12x22" to boot-file
+game-key-mask h# 80 and if
+       \ boot from backup kernel
+       " ${DN}\vmlinuz.old" expand$ to boot-device
+       " ${DN}\initrd.img.old" expand$ to ramdisk
+else
+       \ boot from regular kernel
+       " ${DN}\vmlinuz" expand$ to boot-device
+       " ${DN}\initrd.img" expand$ to ramdisk
+then
+dcon-unfreeze
+boot
diff --git a/configs/debxo-sugar/olpc.fth-jffs2 b/configs/debxo-sugar/olpc.fth-jffs2
new file mode 100644 (file)
index 0000000..d338716
--- /dev/null
@@ -0,0 +1,25 @@
+\ OLPC boot script
+
+\ fetch the /chosen/bootpath property
+" /chosen" find-package  if                       ( phandle )
+  " bootpath" rot  get-package-property  0=  if   ( propval$ )
+    get-encoded-string                            ( bootpath$ )
+    [char] \ left-parse-string  2nip              ( dn$ )
+
+    \ store the first part of bootpath (up to the '\') in $DN
+    dn-buf place                                  ( )
+  then
+then
+
+" ro root=mtd:root rootfstype=jffs2 video=lxfb fbcon=font:SUN12x22" to boot-file
+game-key-mask h# 80 and if
+       \ boot from backup kernel
+       " ${DN}\vmlinuz.old" expand$ to boot-device
+       " ${DN}\initrd.img.old" expand$ to ramdisk
+else
+       \ boot from regular kernel
+       " ${DN}\vmlinuz" expand$ to boot-device
+       " ${DN}\initrd.img" expand$ to ramdisk
+then
+dcon-unfreeze
+boot
diff --git a/configs/debxo-xfce/fstab-ext3 b/configs/debxo-xfce/fstab-ext3
new file mode 100644 (file)
index 0000000..0d7b766
--- /dev/null
@@ -0,0 +1,7 @@
+# /etc/fstab: static file system information 
+#
+# <file system>        <mount point>   <type>  <options>       <dump>  <pass>
+proc           /proc           proc    defaults        0       0       # <partition size in MB>
+LABEL=DebXO    /               ext3    errors=remount-ro 0     1       # 1024
+none           /ofw            promfs  defaults        0       0
+tmpfs          /var/cache/apt/cache tmpfs defaults     0       0
diff --git a/configs/debxo-xfce/fstab-jffs2 b/configs/debxo-xfce/fstab-jffs2
new file mode 100644 (file)
index 0000000..8b43fa1
--- /dev/null
@@ -0,0 +1,8 @@
+# /etc/fstab: static file system information 
+#
+# <file system>        <mount point>   <type>  <options>       <dump>  <pass>
+proc           /proc           proc    defaults        0       0       # <partition size in MB>
+mtd:boot       /boot           jffs2   defaults,noatime 1      1       # 50
+mtd:root       /               jffs2   defaults,noatime 1      1
+none           /ofw            promfs  defaults        0       0
+tmpfs          /var/cache/apt/cache tmpfs defaults     0       0
diff --git a/configs/debxo-xfce/olpc.fth-ext3 b/configs/debxo-xfce/olpc.fth-ext3
new file mode 100644 (file)
index 0000000..58a5fec
--- /dev/null
@@ -0,0 +1,25 @@
+\ OLPC boot script
+
+\ fetch the /chosen/bootpath property
+" /chosen" find-package  if                       ( phandle )
+  " bootpath" rot  get-package-property  0=  if   ( propval$ )
+    get-encoded-string                            ( bootpath$ )
+    [char] \ left-parse-string  2nip              ( dn$ )
+
+    \ store the first part of bootpath (up to the '\') in $DN
+    dn-buf place                                  ( )
+  then
+then
+
+" ro root=LABEL=DebXO video=lxfb fbcon=font:SUN12x22" to boot-file
+game-key-mask h# 80 and if
+       \ boot from backup kernel
+       " ${DN}\vmlinuz.old" expand$ to boot-device
+       " ${DN}\initrd.img.old" expand$ to ramdisk
+else
+       \ boot from regular kernel
+       " ${DN}\vmlinuz" expand$ to boot-device
+       " ${DN}\initrd.img" expand$ to ramdisk
+then
+dcon-unfreeze
+boot
diff --git a/configs/debxo-xfce/olpc.fth-jffs2 b/configs/debxo-xfce/olpc.fth-jffs2
new file mode 100644 (file)
index 0000000..d338716
--- /dev/null
@@ -0,0 +1,25 @@
+\ OLPC boot script
+
+\ fetch the /chosen/bootpath property
+" /chosen" find-package  if                       ( phandle )
+  " bootpath" rot  get-package-property  0=  if   ( propval$ )
+    get-encoded-string                            ( bootpath$ )
+    [char] \ left-parse-string  2nip              ( dn$ )
+
+    \ store the first part of bootpath (up to the '\') in $DN
+    dn-buf place                                  ( )
+  then
+then
+
+" ro root=mtd:root rootfstype=jffs2 video=lxfb fbcon=font:SUN12x22" to boot-file
+game-key-mask h# 80 and if
+       \ boot from backup kernel
+       " ${DN}\vmlinuz.old" expand$ to boot-device
+       " ${DN}\initrd.img.old" expand$ to ramdisk
+else
+       \ boot from regular kernel
+       " ${DN}\vmlinuz" expand$ to boot-device
+       " ${DN}\initrd.img" expand$ to ramdisk
+then
+dcon-unfreeze
+boot
diff --git a/configs/generic/fstab-ext3 b/configs/generic/fstab-ext3
new file mode 100644 (file)
index 0000000..3da3ce5
--- /dev/null
@@ -0,0 +1,9 @@
+# Default fstab for ext3 images - copy & customize this for a new image build
+
+# /etc/fstab: static file system information 
+#
+# <file system>        <mount point>   <type>  <options>       <dump>  <pass>
+proc           /proc           proc    defaults        0       0       # <partition size in MB>
+LABEL=Boot     /boot           ext3    defaults        0       2       # 50
+LABEL=Swap     none            swap    sw              0       0       # 256
+LABEL=Root     /               ext3    errors=remount-ro  0    1       # 1024
diff --git a/configs/generic/fstab-jffs2 b/configs/generic/fstab-jffs2
new file mode 100644 (file)
index 0000000..885da99
--- /dev/null
@@ -0,0 +1,8 @@
+# Default fstab for jffs2 images - copy & customize this for a new image build
+
+# /etc/fstab: static file system information 
+#
+# <file system>        <mount point>   <type>  <options>       <dump>  <pass>
+proc           /proc           proc    defaults        0       0       # <partition size in MB>
+mtd:root       /               jffs2   defaults,noatime 0      0       # 50
+mtd:boot       /boot           jffs2   defaults,noatime 0      0       #
index 82e055611d2357be37a3414b3b40fd5ef9711ebf..8e2b34c07d5efb3ed1861d3e9edc43efbcf8b160 100644 (file)
@@ -28,75 +28,6 @@ check_for_cmds()
        return 0
 }
 
-# @mntpt - path to mounted root directory
-# @fstype - the root filesystem type (in a form that 'mount' understands)
-create_fstab()
-{
-       mntpt="$1"
-       fstype="$2"
-
-       if [ "${fstype}" = "jffs2" ]; then
-               r=mtd:root
-       else
-               r="LABEL=${IMG_LABEL}"
-       fi
-
-       echo "${r} / ${fstype} defaults,noatime 1 1" >${mntpt}/etc/fstab
-       if [ "${fstype}" = "jffs2" ]; then
-               echo "mtd:boot /boot jffs2 defaults,noatime 1 1" >>${mntpt}/etc/fstab
-       fi
-
-       cat >>${mntpt}/etc/fstab<<EOF
-proc /proc proc defaults 0 0
-none /ofw promfs defaults 0 0
-tmpfs /var/cache/apt/cache tmpfs defaults 0 0
-EOF
-}
-
-# @mntpt - path to mounted root directory
-# @fstype - the root filesystem type (in a form that 'mount' understands)
-create_ofwboot()
-{
-       mntpt="$1"
-       fstype="$2"
-
-       if [ "${fstype}" = "jffs2" ]; then
-               r="mtd:root"
-               rfs="rootfstype=jffs2"
-       else
-               r="LABEL=${IMG_LABEL}"
-               rfs=""
-       fi
-
-       cat >${mntpt}/boot/olpc.fth<<EOF
-\\ OLPC boot script
-
-\\ fetch the /chosen/bootpath property
-" /chosen" find-package  if                       ( phandle )
-  " bootpath" rot  get-package-property  0=  if   ( propval\$ )
-    get-encoded-string                            ( bootpath\$ )
-    [char] \ left-parse-string  2nip              ( dn\$ )
-
-    \ store the first part of bootpath (up to the '\\') in \$DN
-    dn-buf place                                  ( )
-  then
-then
-
-" ro root=${r} ${rfs} video=lxfb fbcon=font:SUN12x22" to boot-file
-game-key-mask h# 80 and if
-       \\ boot from backup kernel
-       " \${DN}\\vmlinuz.old" expand\$ to boot-device
-       " \${DN}\\initrd.img.old" expand\$ to ramdisk
-else
-       \\ boot from regular kernel
-       " \${DN}\\vmlinuz" expand\$ to boot-device
-       " \${DN}\\initrd.img" expand\$ to ramdisk
-then
-dcon-unfreeze
-boot
-EOF
-}
-
 start_logging()
 {
     logpipe="$1".pipe
index d362715c25c376f5f8da4fa11c191410704ded40..d723f9f45ebd3b5c9664cbfcaf85828be67473df 100755 (executable)
--- a/mkext3.sh
+++ b/mkext3.sh
@@ -1,6 +1,6 @@
 #!/bin/bash -e
 #
-# Copyright © 2008  Andres Salomon <dilinger@queued.net>
+# Copyright © 2008-2009  Andres Salomon <dilinger@collabora.co.uk>
 #
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -23,6 +23,8 @@ ROOT_DIR=""
 
 . ./functions.sh
 
+CONFIG_TYPE=generic
+
 # @img - fs image to attach loop device to
 # @offset - if the image is partitioned, the offset to attach at
 #
@@ -149,7 +151,6 @@ mk_ext3_fs()
        # populate the filesystem
        mk_mount "$img" "ext3" "$partition_start"
        cp -ra "$root_dir"/* "$MOUNT_POINT" || true
-       create_fstab "$MOUNT_POINT" "ext3"
        grub_install "$img" "$MOUNT_POINT"
        rm_mount "$MOUNT_POINT"
 }
@@ -162,6 +163,7 @@ usage()
        echo "Options:" 1>&2
        echo "  -l <label>    Image label" 1>&2
        echo "  -s <size>     Root filesystem size (in MB)" 1>&2
+       echo "  --config-type <config>    directory name in configs/ to use" 1>&2
        echo "" 1>&2
        exit 1
 }
@@ -169,6 +171,14 @@ usage()
 while test $# != 0
 do
        case $1 in
+       --config-type)
+               CONFIG_TYPE=$2
+               [ -d ./configs/${CONFIG_TYPE} ] || {
+                       echo "Error: can't find directory './configs/${CONFIG_TYPE}/'!" 1>&2
+                       exit 2
+               }
+               shift
+               ;;
        -l)
                IMG_LABEL=$2
                shift
@@ -205,8 +215,19 @@ if [ ! -d "$ROOT_DIR" ]; then
 fi
 
 check_for_cmds losetup parted mke2fs tune2fs grub || exit 1
-create_fstab ${ROOT_DIR} ext3
-create_ofwboot ${ROOT_DIR} ext3
+
+# create image's /etc/fstab
+if [ ! -f ./configs/${CONFIG_TYPE}/fstab-ext3 ]; then
+       echo "*** Unable to find fstab-ext3!" 1>&2
+       exit 1
+fi
+sed 's/[[:space:]]#.*//' ./configs/${CONFIG_TYPE}/fstab-ext3 > ${ROOT_DIR}/etc/fstab
+
+# TODO: this needs to go into an OFW package; here it's a hack
+# create image's /boot/olpc.fth
+if [ -f ./configs/${CONFIG_TYPE}/olpc.fth-ext3 ]; then
+       cp ./configs/${CONFIG_TYPE}/olpc.fth-ext3 ${ROOT_DIR}/boot/olpc.fth
+fi
 
 create_bootable_img ${IMG_NAME} ${ROOT_SIZE}
 mk_ext3_fs ${IMG_NAME} ${IMG_LABEL} ${ROOT_DIR}
index c1ced52272ca526d821efe746e946d7ddddff4b1..f4cb5989e038c91d730c1947e47c42302ac9984b 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash -e
 #
-# Copyright © 2008  Andres Salomon <dilinger@queued.net>
+# Copyright © 2008-2009  Andres Salomon <dilinger@collabora.co.uk>
 #
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
 
 . ./functions.sh
 
+CONFIG_TYPE=generic
+
 usage()
 {
        echo "" 1>&2
-       echo "Usage: $0 <root directory> <img>" 1>&2
+       echo "Usage: $0 [<options>] <root directory> <img>" 1>&2
+       echo "" 1>&2
+       echo "Options:" 1>&2
+       echo "  --config-type <config>    directory name in configs/ to use" 1>&2
        echo "" 1>&2
        exit 1
 }
 
-if [ "$#" != "2" ]; then
-       usage
-fi
-
-ROOT_DIR=$1
-IMG_NAME=$2
+while test $# != 0
+do
+       case $1 in
+       --config-type)
+               CONFIG_TYPE=$2
+               [ -d ./configs/${CONFIG_TYPE} ] || {
+                       echo "Error: can't find directory './configs/${CONFIG_TYPE}/'!" 1>&2
+                       exit 2
+               }
+               shift
+               ;;
+       *)
+               if [ "$#" != "2" ]; then
+                       echo "Unknown option $1" 1>&2
+                       usage
+               else
+                       ROOT_DIR=$1
+                       IMG_NAME=$2
+                       shift
+               fi
+               ;;
+       esac
+       shift
+done
 
 if [ "${IMG_NAME}" == "${IMG_NAME/.img/.dat}" ]; then
        DAT_NAME=${IMG_NAME}.dat
@@ -46,8 +69,19 @@ if [ ! -d "${ROOT_DIR}" ]; then
 fi
 
 check_for_cmds mkfs.jffs2 sumtool || exit 1
-create_fstab ${ROOT_DIR} jffs2
-create_ofwboot ${ROOT_DIR} jffs2
+
+# create image's /etc/fstab
+if [ ! -f ./configs/${CONFIG_TYPE}/fstab-jffs2 ]; then
+       echo "*** Unable to find fstab-jffs2!" 1>&2
+       exit 1
+fi
+sed 's/[[:space:]]#.*//' ./configs/${CONFIG_TYPE}/fstab-jffs2 > ${ROOT_DIR}/etc/fstab
+
+# TODO: this needs to go into an OFW package; here it's a hack
+# create image's /boot/olpc.fth
+if [ -f ./configs/${CONFIG_TYPE}/olpc.fth-jffs2 ]; then
+       cp ./configs/${CONFIG_TYPE}/olpc.fth-jffs2 ${ROOT_DIR}/boot/olpc.fth
+fi
 
 create_jffs2()
 {