Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-7]: src Pull up following revision(s) (requested by skrll in tick...
details: https://anonhg.NetBSD.org/src/rev/cde5a3c25f76
branches: netbsd-7
changeset: 799541:cde5a3c25f76
user: snj <snj%NetBSD.org@localhost>
date: Thu Aug 06 21:13:43 2015 +0000
description:
Pull up following revision(s) (requested by skrll in ticket #909):
distrib/sets/lists/etc/mi: revision 1.237
distrib/sets/lists/tests/mi: revision 1.613
distrib/utils/embedded/conf/armv7.conf: revisions 1.1, 1.2
distrib/utils/embedded/conf/beagleboard.conf: delete
distrib/utils/embedded/conf/evbarm.conf: revisions 1.21, 1.22
distrib/utils/embedded/conf/rpi.conf: revisions 1.28, 1.29
distrib/utils/embedded/conf/rpi_inst.conf: revisions 1.7, 1.8
distrib/utils/embedded/conf/usermode.conf: revision 1.5
distrib/utils/embedded/conf/x86.conf: revision 1.5
distrib/utils/embedded/files/resize_disklabel: revision 1.1
distrib/utils/embedded/mkimage: revisions 1.49, 1.55-1.59
etc/defaults/rc.conf: revision 1.133
etc/etc.evbarm/Makefile.inc: revisions 1.72, 1.76
etc/rc.d/Makefile: revision 1.93 via patch
etc/rc.d/resize_root: revisions 1.1-1.3
etc/rc.d/root: revision 1.5
sbin/resize_ffs/Makefile: revision 1.5
sbin/resize_ffs/resize_ffs.8: revisions 1.14-1.16
sbin/resize_ffs/resize_ffs.c: revisions 1.39-1.44
share/man/man5/rc.conf.5: revision 1.158, 1.159
tests/sbin/resize_ffs/Makefile: revision 1.4
tests/sbin/resize_ffs/common.sh: revision 1.14
tests/sbin/resize_ffs/t_check.sh: revision 1.1
tests/sbin/resize_ffs/t_grow.sh: revision 1.9
tests/sbin/resize_ffs/t_grow_swapped.sh: revision 1.3
tests/sbin/resize_ffs/t_shrink.sh: revision 1.8
tests/sbin/resize_ffs/t_shrink_swapped.sh: revision 1.2
fix image building:
- round up the total size of the disk image
- fix fdisk offset for netbsd ffs images
--
Make get_dev_size work on regular files too.
--
Use `!= -1' instead of `== 0' out of paranoia.
--
- Add -c to check to see if grow/shrink is required
- Divide by DEV_BSIZE when returning size of file.
- Update manpage
--
New sentence, new line. Sort option descriptions.
--
Add resize_root boot operation. If resize_root=YES in rc.conf then
the system attempts to resize the root file system to fill it's
partition prior to mounting read-write. Useful for things like AMI
file system images. May eventually be used by arm images after
coming up with similar solution for increasing the parition size.
--
- Add new tests for -c check flag in resize_ffs
--
Bump date for previous.
it's -> its
--
Handle case in grow() where last cylinder group is too small for ufs2.
Align with code in shrink().
--
factor out geometry calculation and use this also in CheckOnly mode.
be a bit more verbose in Verbose mode.
--
Add support for auto-growing the root partition. Enable it for rpi.img.
--
initialize resize before pulling in board config
--
add KEYWORD: interactive, honour resize_root_flags and
resize_root_postcmd rc vars
--
if the -p flag is specified, display a progress bar while growing the
file-system
--
show resize_ffs progress bar when resizing root partition
--
fix typo in previous; pass -y unconditionally to resize_ffs, not -p
--
Rename beagleboard.img to armv7.img. The new image includes the same
kernels as beagleboard.img plus support for Raspberry Pi 2, ODROID-C1,
Cubieboard2, Cubietruck, Hummingbird A31, and Banana Pi.
--
Properly spell X' name. From X(7):
The X.Org Foundation requests that the following names be
used when
referring to this software:
X
X Window System
X Version 11
X Window System, Version 11
X11
--
Add some documentation:
Tell what this does, and what it expects from conf files
--
Cleanup: make_filesystems is not used any longer, purge remains
--
More cleanup:
Instead of first overwriting the *_evbarm functions with own code,
and then calling them from the regular functions, directly put the
code into the regular functions.
No more functions from evbarm.conf are used now.
Some variables are still used!
--
define TOOL_MKUBOOTIMAGE for mkimage
--
fix mkubootimage
diffstat:
distrib/sets/lists/etc/mi | 3 +-
distrib/sets/lists/tests/mi | 3 +-
distrib/utils/embedded/conf/armv7.conf | 122 +++++++++++++
distrib/utils/embedded/conf/beagleboard.conf | 67 -------
distrib/utils/embedded/conf/evbarm.conf | 19 ++-
distrib/utils/embedded/conf/rpi.conf | 7 +-
distrib/utils/embedded/conf/rpi_inst.conf | 27 +--
distrib/utils/embedded/conf/usermode.conf | 7 +-
distrib/utils/embedded/conf/x86.conf | 7 +-
distrib/utils/embedded/files/resize_disklabel | 71 +++++++
distrib/utils/embedded/mkimage | 30 +++-
etc/defaults/rc.conf | 3 +-
etc/etc.evbarm/Makefile.inc | 21 +-
etc/rc.d/Makefile | 4 +-
etc/rc.d/resize_root | 99 +++++++++++
etc/rc.d/root | 4 +-
sbin/resize_ffs/Makefile | 7 +-
sbin/resize_ffs/resize_ffs.8 | 13 +-
sbin/resize_ffs/resize_ffs.c | 232 ++++++++++++++++++-------
share/man/man5/rc.conf.5 | 11 +-
tests/sbin/resize_ffs/Makefile | 4 +-
tests/sbin/resize_ffs/common.sh | 4 +
tests/sbin/resize_ffs/t_check.sh | 56 ++++++
tests/sbin/resize_ffs/t_grow.sh | 4 +-
tests/sbin/resize_ffs/t_grow_swapped.sh | 4 +-
tests/sbin/resize_ffs/t_shrink.sh | 4 +-
tests/sbin/resize_ffs/t_shrink_swapped.sh | 4 +-
27 files changed, 633 insertions(+), 204 deletions(-)
diffs (truncated from 1440 to 300 lines):
diff -r 986111baac49 -r cde5a3c25f76 distrib/sets/lists/etc/mi
--- a/distrib/sets/lists/etc/mi Tue Aug 04 21:33:07 2015 +0000
+++ b/distrib/sets/lists/etc/mi Thu Aug 06 21:13:43 2015 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.232.4.2 2015/04/30 06:07:32 riz Exp $
+# $NetBSD: mi,v 1.232.4.3 2015/08/06 21:13:43 snj Exp $
#
# Note: end-user configuration files that are moved to another location
# should not be marked "obsolete"; they should just be removed from
@@ -265,6 +265,7 @@
./etc/rc.d/random_seed etc-sys-rc
./etc/rc.d/rarpd etc-bootserver-rc
./etc/rc.d/rbootd etc-bootserver-rc
+./etc/rc.d/resize_root etc-sys-rc
./etc/rc.d/rndctl etc-sys-rc
./etc/rc.d/root etc-sys-rc
./etc/rc.d/route6d etc-router-rc
diff -r 986111baac49 -r cde5a3c25f76 distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi Tue Aug 04 21:33:07 2015 +0000
+++ b/distrib/sets/lists/tests/mi Thu Aug 06 21:13:43 2015 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.584.2.2 2015/05/16 17:58:46 snj Exp $
+# $NetBSD: mi,v 1.584.2.3 2015/08/06 21:13:43 snj Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -3216,6 +3216,7 @@
./usr/tests/sbin/resize_ffs tests-sbin-tests
./usr/tests/sbin/resize_ffs/Atffile tests-sbin-tests atf
./usr/tests/sbin/resize_ffs/Kyuafile tests-sbin-tests atf,kyua
+./usr/tests/sbin/resize_ffs/t_check tests-sbin-tests atf
./usr/tests/sbin/resize_ffs/t_grow tests-sbin-tests atf
./usr/tests/sbin/resize_ffs/t_grow_swapped tests-sbin-tests atf
./usr/tests/sbin/resize_ffs/t_resize_ffs tests-obsolete obsolete
diff -r 986111baac49 -r cde5a3c25f76 distrib/utils/embedded/conf/armv7.conf
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/distrib/utils/embedded/conf/armv7.conf Thu Aug 06 21:13:43 2015 +0000
@@ -0,0 +1,122 @@
+# $NetBSD: armv7.conf,v 1.7.2.2 2015/08/06 21:13:43 snj Exp $
+# ARMv7 customization script used by mkimage
+#
+board=armv7
+console=fb
+
+. ${DIR}/conf/evbarm.conf
+
+kernels_beagle="BEAGLEBOARD BEAGLEBONE"
+kernels_awin="BPI CUBIEBOARD CUBIETRUCK HUMMINGBIRD_A31"
+kernels_rpi="RPI2"
+kernels_amlogic="ODROID-C1"
+
+make_label() {
+ make_label_evbarm
+}
+
+make_fstab() {
+ make_fstab_evbarm
+}
+
+customize() {
+ customize_evbarm
+ cat >> ${mnt}/etc/rc.conf << EOF
+mdnsd=YES
+wscons=YES
+devpubd=YES
+EOF
+}
+
+populate_beagle() {
+ bboard_kernelimg=netbsd-BEAGLEBOARD.ub
+ bboard_loadaddr=81000000
+ bbone_kernelimg=netbsd-BEAGLEBONE.ub
+ bbone_loadaddr=82000000
+
+ # Create a uEnv.txt to auto boot the correct kernel
+ cat >> ${mnt}/boot/uEnv.txt << EOF
+loaduimage=if test \$board = am335x; then fatload mmc 0 ${bbone_loadaddr} ${bbone_kernelimg}; bootm ${bbone_loadaddr} root=ld0a; else fatload mmc 0 ${bboard_loadaddr} ${bboard_kernelimg}; bootm
${bboard_loadaddr} root=ld0a; fi
+EOF
+}
+
+populate_awin() {
+ cat >> ${mnt}/boot/uEnv.txt << EOF
+bootargs=root=ld0a console=${console}
+uenvcmd=mmc dev 0; mmc rescan; if test \$fdtfile = sun7i-a20-cubieboard2.dtb; then setenv kernel netbsd-CUBIEBOARD2.ub; elif test \$fdtfile = sun7i-a20-cubietruck.dtb; then setenv kernel
netbsd-CUBIETRUCK.ub; elif test \$fdtfile = sun6i-a31-hummingbird.dtb; then setenv kernel netbsd-HUMMINGBIRD_A31.ub; elif test \$fdtfile = sun7i-a20-bananapi.dtb; then setenv kernel netbsd-BPI.ub;
fi; fatload mmc 0:1 82000000 ${kernel}; bootm 82000000
+EOF
+}
+
+populate_rpi() {
+ firmwaredir=${src}/external/broadcom/rpi-firmware/dist
+ firmwarefiles="LICENCE.broadcom bootcode.bin fixup.dat fixup_cd.dat start.elf start_cd.elf"
+
+ # RPI2 kernel needs to be installed as kernel7.img
+ if [ -f "${mnt}/boot/netbsd-RPI2.bin" ]; then
+ echo "${bar} renaming netbsd-RPI2.bin to kernel7.img ${bar}"
+ mv "${mnt}/boot/netbsd-RPI2.bin" "${mnt}/boot/kernel7.img"
+
+ cat > ${mnt}/boot/cmdline.txt << EOF
+root=ld0a console=${console}
+#fb=1280x1024 # to select a mode, otherwise try EDID
+#fb=disable # to disable fb completely
+EOF
+
+ echo "${bar} installing firmware files ${bar}"
+ (cd ${mnt}/boot &&
+ for f in ${firmwarefiles}; do
+ echo " $f"
+ cp ${firmwaredir}/${f} .
+ done
+ )
+
+ fi
+}
+
+populate_amlogic() {
+ odroidc1_kernelimg=netbsd-ODROID-C1.ub
+
+ # Create a boot.ini for Amlogic U-Boot
+ cat >> ${mnt}/boot/boot.ini << EOF
+ODROIDC-UBOOT-CONFIG
+
+setenv bootargs "root=ld0f awge0.mac-address=\${ethaddr} console=${console}"
+setenv bootcmd "fatload mmc 0:1 0x21000000 ${odroidc1_kernelimg}; bootm 0x21000000"
+run bootcmd
+EOF
+}
+
+populate() {
+ echo "${bar} looking for kernels in ${kernel} ${bar}"
+ kernels=""
+ # .ub kernels
+ for k in $kernels_beagle $kernels_awin $kernels_amlogic; do
+ f="${kernel}/netbsd-${k}.ub.gz"
+ test -f "${f}" && kernels="${kernels} ${f}"
+ done
+ # .bin kernels
+ for k in $kernels_rpi; do
+ f="${kernel}/netbsd-${k}.bin.gz"
+ test -f "${f}" && kernels="${kernels} ${f}"
+ done
+
+ # install kernels to /boot partition
+ for k in ${kernels}; do
+ tgt="$(basename ${k} | sed 's/\.gz$//')"
+ echo "${bar} installing ${k} to /boot/${tgt} ${bar}"
+ case "${k}" in
+ *.gz)
+ ${GZIP_CMD} -dc "${k}" > "${mnt}/boot/${tgt}"
+ ;;
+ *)
+ cp "${k}" "${mnt}/boot/${tgt}"
+ ;;
+ esac
+ done
+
+ # board specific configuration
+ populate_beagle
+ populate_awin
+ populate_rpi
+ populate_amlogic
+}
diff -r 986111baac49 -r cde5a3c25f76 distrib/utils/embedded/conf/beagleboard.conf
--- a/distrib/utils/embedded/conf/beagleboard.conf Tue Aug 04 21:33:07 2015 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-# $NetBSD: beagleboard.conf,v 1.17.4.1 2014/09/30 18:19:18 martin Exp $
-# BeagleBoard customization script used by mkimage
-#
-board=beagleboard
-
-. ${DIR}/conf/evbarm.conf
-
-bboard_kernelimg=bboard.ub
-bboard_loadaddr=81000000
-bbone_kernelimg=bbone.ub
-bbone_loadaddr=82000000
-
-make_filesystems() {
- make_filesystems_evbarm
-}
-
-make_label() {
- make_label_evbarm
-}
-
-make_fstab() {
- make_fstab_evbarm
-}
-
-customize() {
- customize_evbarm
- cat >> ${mnt}/etc/rc.conf << EOF
-mdnsd=YES
-EOF
-}
-
-populate() {
- bboard_kernel="$kernel"
- bbone_kernel="$(echo $bboard_kernel | sed 's/BEAGLEBOARD/BEAGLEBONE/g')"
-
- cat > ${mnt}/boot/uEnv.txt << EOF
-loaduimage=if test \$board = am335x; then fatload mmc 0 ${bbone_loadaddr} ${bbone_kernelimg}; bootm ${bbone_loadaddr} root=ld0a; else fatload mmc 0 ${bboard_loadaddr} ${bboard_kernelimg}; bootm
${bboard_loadaddr} root=ld0a; fi
-EOF
- if [ ! -f "${bboard_kernel}" ]; then
- echo ${PROG}: Missing ${bboard_kernel} 1>&2
- exit 1
- fi
- if [ ! -f "${bbone_kernel}" ]; then
- echo ${PROG}: Missing ${bbone_kernel} 1>&2
- exit 1
- fi
-
- echo "${bar} installing ${bboard_kernel} to /boot/${bboard_kernelimg} ${bar}"
- case "${bboard_kernel}" in
- *.gz)
- ${GZIP_CMD} -dc "${bboard_kernel}" > "${mnt}/boot/${bboard_kernelimg}"
- ;;
- *)
- cp "${bboard_kernel}" "${mnt}/boot/${bboard_kernelimg}"
- ;;
- esac
-
- echo "${bar} installing ${bbone_kernel} to /boot/${bbone_kernelimg} ${bar}"
- case "${bbone_kernel}" in
- *.gz)
- ${GZIP_CMD} -dc "${bbone_kernel}" > "${mnt}/boot/${bbone_kernelimg}"
- ;;
- *)
- cp "${bbone_kernel}" "${mnt}/boot/${bbone_kernelimg}"
- ;;
- esac
-}
diff -r 986111baac49 -r cde5a3c25f76 distrib/utils/embedded/conf/evbarm.conf
--- a/distrib/utils/embedded/conf/evbarm.conf Tue Aug 04 21:33:07 2015 +0000
+++ b/distrib/utils/embedded/conf/evbarm.conf Thu Aug 06 21:13:43 2015 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: evbarm.conf,v 1.15.4.4 2015/01/29 15:12:48 martin Exp $
+# $NetBSD: evbarm.conf,v 1.15.4.5 2015/08/06 21:13:43 snj Exp $
# evbarm shared config
#
image=$HOME/${board}.img
@@ -132,9 +132,26 @@
sshd=YES
dhcpcd=YES
EOF
+
+ if $resize; then
+ cat >> ${mnt}/etc/rc.conf << EOF
+resize_disklabel=YES
+resize_disklabel_disk=ld0
+resize_disklabel_part=a
+resize_root=YES
+resize_root_flags="-p"
+resize_root_postcmd="/sbin/reboot -n"
+EOF
+ fi
+
echo "./etc/rc.conf type=file uname=root gname=wheel mode=0644" \
>> "$tmp/selected_sets"
+ mkdir ${mnt}/etc/rc.d
+ cp ${DIR}/files/resize_disklabel ${mnt}/etc/rc.d/resize_disklabel
+ echo "./etc/rc.d/resize_disklabel type=file uname=root gname=wheel mode=0555" \
+ >> "$tmp/selected_sets"
+
if [ ! -f ${release}/dev/MAKEDEV ]; then
echo ${PROG}: Missing ${release}/dev/MAKEDEV 1>&2
exit 1
diff -r 986111baac49 -r cde5a3c25f76 distrib/utils/embedded/conf/rpi.conf
--- a/distrib/utils/embedded/conf/rpi.conf Tue Aug 04 21:33:07 2015 +0000
+++ b/distrib/utils/embedded/conf/rpi.conf Thu Aug 06 21:13:43 2015 +0000
@@ -1,19 +1,16 @@
-# $NetBSD: rpi.conf,v 1.24.4.3 2015/03/11 20:22:55 snj Exp $
+# $NetBSD: rpi.conf,v 1.24.4.4 2015/08/06 21:13:43 snj Exp $
# Raspberry Pi customization script used by mkimage
#
board=rpi
kernel=$src/sys/arch/evbarm/compile/RPI/netbsd-RPI.bin
+resize=true
. ${DIR}/conf/evbarm.conf
firmwaredir=$src/external/broadcom/rpi-firmware/dist
firmwarefiles="LICENCE.broadcom bootcode.bin fixup.dat fixup_cd.dat start.elf start_cd.elf"
-make_filesystems() {
- make_filesystems_evbarm
-}
-
make_fstab() {
make_fstab_evbarm
}
diff -r 986111baac49 -r cde5a3c25f76 distrib/utils/embedded/conf/rpi_inst.conf
--- a/distrib/utils/embedded/conf/rpi_inst.conf Tue Aug 04 21:33:07 2015 +0000
+++ b/distrib/utils/embedded/conf/rpi_inst.conf Thu Aug 06 21:13:43 2015 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: rpi_inst.conf,v 1.5.6.1 2015/01/28 11:27:03 martin Exp $
+# $NetBSD: rpi_inst.conf,v 1.5.6.2 2015/08/06 21:13:43 snj Exp $
# Raspberry Pi customization script used by mkimage
#
Home |
Main Index |
Thread Index |
Old Index