Menu

[r5280]: / experimental / ix / patches / freebsd-nanobsd.patch  Maximize  Restore  History

Download this file

74 lines (64 with data), 1.9 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
--- tools/tools/nanobsd/nanobsd.sh 2010-06-13 20:09:06.000000000 -0600
+++ freebsd/8/tools/tools/nanobsd/nanobsd.sh 2010-07-15 15:39:12.000000000 -0600
@@ -354,6 +355,30 @@
done
)
+populate_slice ( ) (
+ local dev dir mnt
+ dev=$1
+ dir=$2
+ mnt=$3
+ test -z $2 && dir=/var/empty
+ test -d $d || dir=/var/empty
+ echo "Creating ${dev} with ${dir} (mounting on ${mnt})"
+ newfs ${NANO_NEWFS} ${dev}
+ mount ${dev} ${mnt}
+ cd ${dir}
+ find . -print | grep -Ev '/(CVS|\.svn)' | cpio -dumpv ${mnt}
+ df -i ${mnt}
+ umount ${mnt}
+)
+
+populate_cfg_slice ( ) (
+ populate_slice "$1" "$2" "$3"
+)
+
+populate_data_slice ( ) (
+ populate_slice "$1" "$2" "$3"
+)
+
create_i386_diskimage ( ) (
pprint 2 "build diskimage"
pprint 3 "log: ${NANO_OBJ}/_.di"
@@ -477,13 +503,11 @@
fi
# Create Config slice
- newfs ${NANO_NEWFS} /dev/${MD}s3
- # XXX: fill from where ?
+ populate_cfg_slice /dev/${MD}s3 "${NANO_CFGDIR}" ${MNT}
# Create Data slice, if any.
if [ $NANO_DATASIZE -ne 0 ] ; then
- newfs ${NANO_NEWFS} /dev/${MD}s4
- # XXX: fill from where ?
+ populate_data_slice /dev/${MD}s4 "${NANO_DATADIR}" ${MNT}
fi
if [ "${NANO_MD_BACKING}" = "swap" ] ; then
@@ -650,19 +674,19 @@
#######################################################################
# Convenience function:
-# Register $1 as customize function.
+# Register all args as customize function.
customize_cmd () {
- NANO_CUSTOMIZE="$NANO_CUSTOMIZE $1"
+ NANO_CUSTOMIZE="$NANO_CUSTOMIZE $*"
}
#######################################################################
# Convenience function:
-# Register $1 as late customize function to run just before
+# Register all args as late customize function to run just before
# image creation.
late_customize_cmd () {
- NANO_LATE_CUSTOMIZE="$NANO_LATE_CUSTOMIZE $1"
+ NANO_LATE_CUSTOMIZE="$NANO_LATE_CUSTOMIZE $*"
}
#######################################################################
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.