Skip to content

Commit 947b06d

Browse files
committed
Remove duplicated code, handle minwrites in _normal the same way we handle
it in _gpt. Initial patch from jmmv@.
1 parent 7584142 commit 947b06d

File tree

6 files changed

+77
-258
lines changed

6 files changed

+77
-258
lines changed

distrib/utils/embedded/conf/evbarm.conf

Lines changed: 2 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $NetBSD: evbarm.conf,v 1.42 2023/09/27 00:24:13 riastradh Exp $
1+
# $NetBSD: evbarm.conf,v 1.43 2024/12/27 19:02:19 christos Exp $
22
# evbarm shared config
33
#
44
image=$HOME/${board}.img
@@ -65,66 +65,8 @@ drivedata: 0
6565
EOF
6666
}
6767

68-
make_fstab_evbarm_gpt() {
69-
cat > ${mnt}/etc/fstab << EOF
70-
# NetBSD /etc/fstab
71-
# See /usr/share/examples/fstab/ for more examples.
72-
NAME=${gpt_label_ffs:-netbsd-root} / ffs rw,noatime 1 1
73-
NAME=${gpt_label_boot:-EFI} /boot msdos rw 1 1
74-
ptyfs /dev/pts ptyfs rw
75-
procfs /proc procfs rw
76-
tmpfs /var/shm tmpfs rw,-m1777,-sram%25
77-
EOF
78-
}
79-
80-
make_fstab_evbarm_normal() {
81-
cat > ${mnt}/etc/fstab << EOF
82-
# NetBSD /etc/fstab
83-
# See /usr/share/examples/fstab/ for more examples.
84-
ROOT.a / ffs rw,noatime 1 1
85-
ROOT.e /boot msdos rw 1 1
86-
ptyfs /dev/pts ptyfs rw
87-
procfs /proc procfs rw
88-
tmpfs /var/shm tmpfs rw,-m1777,-sram%25
89-
EOF
90-
}
91-
92-
# From Richard Neswold's:
93-
# http://rich-tbp.blogspot.com/2013/03/netbsd-on-rpi-minimizing-disk-writes.html
94-
# Also for the postfix stuff below
95-
make_fstab_evbarm_minwrites() {
96-
cat > ${mnt}/etc/fstab << EOF
97-
# NetBSD /etc/fstab
98-
# See /usr/share/examples/fstab/ for more examples.
99-
ROOT.a / ffs rw,log,noatime,nodevmtime 1 1
100-
ROOT.e /boot msdos rw 1 1
101-
ptyfs /dev/pts ptyfs rw
102-
procfs /proc procfs rw
103-
tmpfs /tmp tmpfs rw,-s32M
104-
tmpfs /var/log tmpfs rw,union,-s32M
105-
tmpfs /var/run tmpfs rw,union,-s1M
106-
tmpfs /var/mail tmpfs rw,union,-s10M
107-
tmpfs /var/spool/postfix tmpfs rw,union,-s20M
108-
tmpfs /var/db/postfix tmpfs rw,union,-s1M
109-
tmpfs /var/chroot tmpfs rw,union,-s10M
110-
tmpfs /var/shm tmpfs rw,-m1777,-sram%25
111-
EOF
112-
}
113-
11468
make_fstab_evbarm() {
115-
if $gpt; then
116-
make_fstab_evbarm_gpt
117-
elif $minwrites; then
118-
make_fstab_evbarm_minwrites
119-
else
120-
make_fstab_evbarm_normal
121-
fi
122-
echo "./etc/fstab type=file uname=root gname=wheel mode=0644" \
123-
>> "$tmp/selected_sets"
124-
125-
# Missing mount points from fstab
126-
echo "./proc type=dir uname=root gname=wheel mode=0755" \
127-
>> "$tmp/selected_sets"
69+
make_fstab_default EFI
12870
}
12971

13072
customize_evbarm() {

distrib/utils/embedded/conf/evbmips.conf

Lines changed: 2 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $NetBSD: evbmips.conf,v 1.4 2023/09/27 00:24:13 riastradh Exp $
1+
# $NetBSD: evbmips.conf,v 1.5 2024/12/27 19:02:19 christos Exp $
22
# evbmips shared config
33
#
44
image=$HOME/${board}.img
@@ -65,66 +65,8 @@ drivedata: 0
6565
EOF
6666
}
6767

68-
make_fstab_evbmips_gpt() {
69-
cat > ${mnt}/etc/fstab << EOF
70-
# NetBSD /etc/fstab
71-
# See /usr/share/examples/fstab/ for more examples.
72-
NAME=${gpt_label_ffs:-netbsd-root} / ffs rw,noatime 1 1
73-
NAME=${gpt_label_boot:-boot} /boot msdos rw 1 1
74-
ptyfs /dev/pts ptyfs rw
75-
procfs /proc procfs rw
76-
tmpfs /var/shm tmpfs rw,-m1777,-sram%25
77-
EOF
78-
}
79-
80-
make_fstab_evbmips_normal() {
81-
cat > ${mnt}/etc/fstab << EOF
82-
# NetBSD /etc/fstab
83-
# See /usr/share/examples/fstab/ for more examples.
84-
ROOT.a / ffs rw,noatime 1 1
85-
ROOT.e /boot msdos rw 1 1
86-
ptyfs /dev/pts ptyfs rw
87-
procfs /proc procfs rw
88-
tmpfs /var/shm tmpfs rw,-m1777,-sram%25
89-
EOF
90-
}
91-
92-
# From Richard Neswold's:
93-
# http://rich-tbp.blogspot.com/2013/03/netbsd-on-rpi-minimizing-disk-writes.html
94-
# Also for the postfix stuff below
95-
make_fstab_evbmips_minwrites() {
96-
cat > ${mnt}/etc/fstab << EOF
97-
# NetBSD /etc/fstab
98-
# See /usr/share/examples/fstab/ for more examples.
99-
ROOT.a / ffs rw,log,noatime,nodevmtime 1 1
100-
ROOT.e /boot msdos rw 1 1
101-
ptyfs /dev/pts ptyfs rw
102-
procfs /proc procfs rw
103-
tmpfs /tmp tmpfs rw,-s32M
104-
tmpfs /var/log tmpfs rw,union,-s32M
105-
tmpfs /var/run tmpfs rw,union,-s1M
106-
tmpfs /var/mail tmpfs rw,union,-s10M
107-
tmpfs /var/spool/postfix tmpfs rw,union,-s20M
108-
tmpfs /var/db/postfix tmpfs rw,union,-s1M
109-
tmpfs /var/chroot tmpfs rw,union,-s10M
110-
tmpfs /var/shm tmpfs rw,-m1777,-sram%25
111-
EOF
112-
}
113-
11468
make_fstab_evbmips() {
115-
if $gpt; then
116-
make_fstab_evbmips_gpt
117-
elif $minwrites; then
118-
make_fstab_evbmips_minwrites
119-
else
120-
make_fstab_evbmips_normal
121-
fi
122-
echo "./etc/fstab type=file uname=root gname=wheel mode=0644" \
123-
>> "$tmp/selected_sets"
124-
125-
# Missing mount points from fstab
126-
echo "./proc type=dir uname=root gname=wheel mode=0755" \
127-
>> "$tmp/selected_sets"
69+
make_fstab_default boot
12870
}
12971

13072
customize_evbmips() {

distrib/utils/embedded/conf/evbppc.conf

Lines changed: 2 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $NetBSD: evbppc.conf,v 1.1 2024/01/20 21:35:59 jmcneill Exp $ */
1+
# $NetBSD: evbppc.conf,v 1.2 2024/12/27 19:02:19 christos Exp $ */
22
# evbppc shared config
33
#
44
image=$HOME/${board}.img
@@ -65,66 +65,8 @@ drivedata: 0
6565
EOF
6666
}
6767

68-
make_fstab_evbppc_gpt() {
69-
cat > ${mnt}/etc/fstab << EOF
70-
# NetBSD /etc/fstab
71-
# See /usr/share/examples/fstab/ for more examples.
72-
NAME=${gpt_label_ffs:-netbsd-root} / ffs rw,noatime 1 1
73-
NAME=${gpt_label_boot:-boot} /boot msdos rw 1 1
74-
ptyfs /dev/pts ptyfs rw
75-
procfs /proc procfs rw
76-
tmpfs /var/shm tmpfs rw,-m1777,-sram%25
77-
EOF
78-
}
79-
80-
make_fstab_evbppc_normal() {
81-
cat > ${mnt}/etc/fstab << EOF
82-
# NetBSD /etc/fstab
83-
# See /usr/share/examples/fstab/ for more examples.
84-
ROOT.a / ffs rw,noatime 1 1
85-
ROOT.e /boot msdos rw 1 1
86-
ptyfs /dev/pts ptyfs rw
87-
procfs /proc procfs rw
88-
tmpfs /var/shm tmpfs rw,-m1777,-sram%25
89-
EOF
90-
}
91-
92-
# From Richard Neswold's:
93-
# http://rich-tbp.blogspot.com/2013/03/netbsd-on-rpi-minimizing-disk-writes.html
94-
# Also for the postfix stuff below
95-
make_fstab_evbppc_minwrites() {
96-
cat > ${mnt}/etc/fstab << EOF
97-
# NetBSD /etc/fstab
98-
# See /usr/share/examples/fstab/ for more examples.
99-
ROOT.a / ffs rw,log,noatime,nodevmtime 1 1
100-
ROOT.e /boot msdos rw 1 1
101-
ptyfs /dev/pts ptyfs rw
102-
procfs /proc procfs rw
103-
tmpfs /tmp tmpfs rw,-s32M
104-
tmpfs /var/log tmpfs rw,union,-s32M
105-
tmpfs /var/run tmpfs rw,union,-s1M
106-
tmpfs /var/mail tmpfs rw,union,-s10M
107-
tmpfs /var/spool/postfix tmpfs rw,union,-s20M
108-
tmpfs /var/db/postfix tmpfs rw,union,-s1M
109-
tmpfs /var/chroot tmpfs rw,union,-s10M
110-
tmpfs /var/shm tmpfs rw,-m1777,-sram%25
111-
EOF
112-
}
113-
11468
make_fstab_evbppc() {
115-
if $gpt; then
116-
make_fstab_evbppc_gpt
117-
elif $minwrites; then
118-
make_fstab_evbppc_minwrites
119-
else
120-
make_fstab_evbppc_normal
121-
fi
122-
echo "./etc/fstab type=file uname=root gname=wheel mode=0644" \
123-
>> "$tmp/selected_sets"
124-
125-
# Missing mount points from fstab
126-
echo "./proc type=dir uname=root gname=wheel mode=0755" \
127-
>> "$tmp/selected_sets"
69+
make_fstab_default boot
12870
}
12971

13072
customize_evbppc() {

distrib/utils/embedded/conf/riscv.conf

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $NetBSD: riscv.conf,v 1.2 2023/09/27 00:24:13 riastradh Exp $
1+
# $NetBSD: riscv.conf,v 1.3 2024/12/27 19:02:19 christos Exp $
22
# riscv shared config
33
#
44
image=$HOME/${board}.img
@@ -63,42 +63,8 @@ drivedata: 0
6363
EOF
6464
}
6565

66-
make_fstab_riscv_gpt() {
67-
cat > ${mnt}/etc/fstab << EOF
68-
# NetBSD /etc/fstab
69-
# See /usr/share/examples/fstab/ for more examples.
70-
NAME=${gpt_label_ffs:-netbsd-root} / ffs rw,noatime 1 1
71-
NAME=${gpt_label_boot:-EFI} /boot msdos rw 1 1
72-
ptyfs /dev/pts ptyfs rw
73-
procfs /proc procfs rw
74-
tmpfs /var/shm tmpfs rw,-m1777,-sram%25
75-
EOF
76-
}
77-
78-
make_fstab_riscv_normal() {
79-
cat > ${mnt}/etc/fstab << EOF
80-
# NetBSD /etc/fstab
81-
# See /usr/share/examples/fstab/ for more examples.
82-
ROOT.a / ffs rw,noatime 1 1
83-
ROOT.e /boot msdos rw 1 1
84-
ptyfs /dev/pts ptyfs rw
85-
procfs /proc procfs rw
86-
tmpfs /var/shm tmpfs rw,-m1777,-sram%25
87-
EOF
88-
}
89-
9066
make_fstab_riscv() {
91-
if $gpt; then
92-
make_fstab_riscv_gpt
93-
else
94-
make_fstab_riscv_normal
95-
fi
96-
echo "./etc/fstab type=file uname=root gname=wheel mode=0644" \
97-
>> "$tmp/selected_sets"
98-
99-
# Missing mount points from fstab
100-
echo "./proc type=dir uname=root gname=wheel mode=0755" \
101-
>> "$tmp/selected_sets"
67+
make_fstab_default EFI
10268
}
10369

10470
customize_riscv() {

distrib/utils/embedded/conf/x86.conf

Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $NetBSD: x86.conf,v 1.11 2023/09/27 00:24:13 riastradh Exp $
1+
# $NetBSD: x86.conf,v 1.12 2024/12/27 19:02:19 christos Exp $
22
# x86 shared config
33
#
44

@@ -53,47 +53,8 @@ drivedata: 0
5353
EOF
5454
}
5555

56-
make_fstab_normal() {
57-
cat > ${mnt}/etc/fstab << EOF
58-
# NetBSD /etc/fstab
59-
# See /usr/share/examples/fstab/ for more examples.
60-
/dev/${rootdev}0a / ffs rw,log 1 1
61-
ptyfs /dev/pts ptyfs rw
62-
procfs /proc procfs rw
63-
EOF
64-
}
65-
66-
# From Richard Neswold's:
67-
# http://rich-tbp.blogspot.com/2013/03/netbsd-on-rpi-minimizing-disk-writes.html
68-
# Also for the postfix stuff below
69-
make_fstab_minwrites() {
70-
cat > ${mnt}/etc/fstab << EOF
71-
# NetBSD /etc/fstab
72-
# See /usr/share/examples/fstab/ for more examples.
73-
/dev/${rootdev}0a / ffs rw,log,noatime,nodevmtime 1 1
74-
ptyfs /dev/pts ptyfs rw
75-
procfs /proc procfs rw
76-
tmpfs /tmp tmpfs rw,-s32M
77-
tmpfs /var/log tmpfs rw,union,-s32M
78-
tmpfs /var/run tmpfs rw,union,-s1M
79-
tmpfs /var/mail tmpfs rw,union,-s10M
80-
tmpfs /var/spool/postfix tmpfs rw,union,-s20M
81-
tmpfs /var/db/postfix tmpfs rw,union,-s1M
82-
tmpfs /var/chroot tmpfs rw,union,-s10M
83-
EOF
84-
}
85-
8656
make_fstab() {
87-
if $minwrites; then
88-
make_fstab_minwrites
89-
else
90-
make_fstab_normal
91-
fi
92-
echo "./etc/fstab type=file uname=root gname=wheel mode=0755" \
93-
>> "$tmp/selected_sets"
94-
95-
echo "./proc type=dir uname=root gname=wheel mode=0755" \
96-
>> "$tmp/selected_sets"
57+
make_fstab_default EFI
9758
}
9859

9960
customize() {

0 commit comments

Comments
 (0)