Menu

[r10367]: / experimental / nanobsd / nanobsd-patch / nanobsd.glabel.patch  Maximize  Restore  History

Download this file

123 lines (104 with data), 3.4 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
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
*** nanobsd.sh.orig 2009-07-05 19:58:26.000000000 +0200
--- nanobsd.sh 2009-07-05 20:54:22.000000000 +0200
***************
*** 128,133 ****
--- 128,139 ----
# Can be "file" or "swap"
NANO_MD_BACKING="file"
+ # Label name
+ # Alphacharacter only
+ NANO_GLABEL_SYS="nanobsd"
+ NANO_GLABEL_CFG="cfg"
+ NANO_GLABEL_DATA="data"
+
# Progress Print level
PPLEVEL=3
***************
*** 310,316 ****
echo "$NANO_RAM_TMPVARSIZE" > conf/base/var/md_size
# pick up config files from the special partition
! echo "mount -o ro /dev/${NANO_DRIVE}s3" > conf/default/etc/remount
# Put /tmp on the /var ramdisk (could be symlink already)
rmdir tmp || true
--- 316,322 ----
echo "$NANO_RAM_TMPVARSIZE" > conf/base/var/md_size
# pick up config files from the special partition
! echo "mount -o ro /dev/ufs/${NANO_GLABEL_CFG}" > conf/default/etc/remount
# Put /tmp on the /var ramdisk (could be symlink already)
rmdir tmp || true
***************
*** 332,342 ****
# Make root filesystem R/O by default
echo "root_rw_mount=NO" >> etc/defaults/rc.conf
! # save config file for scripts
! echo "NANO_DRIVE=${NANO_DRIVE}" > etc/nanobsd.conf
! echo "/dev/${NANO_DRIVE}s1a / ufs ro 1 1" > etc/fstab
! echo "/dev/${NANO_DRIVE}s3 /cfg ufs rw,noauto 2 2" >> etc/fstab
mkdir -p cfg
)
)
--- 338,347 ----
# Make root filesystem R/O by default
echo "root_rw_mount=NO" >> etc/defaults/rc.conf
! # Set the active partition or scripts
! echo "/dev/ufs/${NANO_GLABEL_SYS}1 / ufs ro 1 1" > etc/fstab
! echo "/dev/ufs/${NANO_GLABEL_CFG} /cfg ufs rw,noauto 2 2" >> etc/fstab
mkdir -p cfg
)
)
***************
*** 450,456 ****
bsdlabel ${MD}s1
# Create first image
! newfs ${NANO_NEWFS} /dev/${MD}s1a
mount /dev/${MD}s1a ${MNT}
df -i ${MNT}
echo "Copying worlddir..."
--- 455,461 ----
bsdlabel ${MD}s1
# Create first image
! newfs -L ${NANO_GLABEL_SYS}1 ${NANO_NEWFS} /dev/${MD}s1a
mount /dev/${MD}s1a ${MNT}
df -i ${MNT}
echo "Copying worlddir..."
***************
*** 465,485 ****
# Duplicate to second image (if present)
echo "Duplicating to second image..."
dd if=/dev/${MD}s1 of=/dev/${MD}s2 bs=64k
mount /dev/${MD}s2a ${MNT}
! for f in ${MNT}/etc/fstab ${MNT}/conf/base/etc/fstab
! do
! sed -i "" "s/${NANO_DRIVE}s1/${NANO_DRIVE}s2/g" $f
! done
! umount ${MNT}
fi
! # Create Config slice
! newfs ${NANO_NEWFS} /dev/${MD}s3
# XXX: fill from where ?
! # Create Data slice, if any.
if [ $NANO_DATASIZE -ne 0 ] ; then
! newfs ${NANO_NEWFS} /dev/${MD}s4
# XXX: fill from where ?
fi
--- 470,492 ----
# Duplicate to second image (if present)
echo "Duplicating to second image..."
dd if=/dev/${MD}s1 of=/dev/${MD}s2 bs=64k
+ tunefs -L ${NANO_GLABEL_SYS}2 /dev/${MD}s2
mount /dev/${MD}s2a ${MNT}
! for f in ${MNT}/etc/fstab ${MNT}/conf/base/etc/fstab
! do
! sed -i "" "s/${NANO_GLABEL_SYS}1/${NANO_GLABEL}2/g" $f
! done
! umount ${MNT}
!
fi
! # Create Config slice and set label
! newfs -L ${NANO_GLABEL_CFG} ${NANO_NEWFS} /dev/${MD}s3
# XXX: fill from where ?
! # Create Data slice and set label, if any.
if [ $NANO_DATASIZE -ne 0 ] ; then
! newfs -L ${NANO_GLABEL_DATA} ${NANO_NEWFS} /dev/${MD}s4
# XXX: fill from where ?
fi
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.