History log of /openbsd-current/usr.sbin/installboot/loongson_installboot.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.10 06-Nov-2022 krw

Nuke some 'set but not used' pathlen variables.

ok beck@


# 1.9 19-Oct-2022 kn

Replace "newfs/fsck_ext2fs" with "newfs/msdos -t ext2fs", constify

OK miod


# 1.8 27-Sep-2022 kn

fix passing explicit stage files

This fixes installboot regress on octeon; same diff as
macppc_installboot.c r1.6, powerpc64_installboot r1.7 and
octeon_installboot r1.8.

loongson was the last architecture requiring this fix. I don't have a
machine to test it myself (loongson isn't built anymore, anyway) but given
the same diff works on four other architectures, this should just work.


Revision tags: OPENBSD_7_2_BASE
# 1.7 14-Sep-2022 kn

Backout "Reflect script failure in exit code"

amd64 install using (G)PT seems busted as reported by tb


# 1.6 11-Sep-2022 miod

Fix build after previous


# 1.5 09-Sep-2022 kn

Reflect script failure in exit code

installboot(8) runs newfs(8) and fsck(8) via system(3) but only checks
failures of the function itself, always returning zero no matter what the
programs/shell returned.

This is bad for regress tests relying on correct return codes.

create_filesystem() itself must not exit as write_filesystem() calls it and
cleans up temporary files upon failure.

Make it return -1 if the script returned non-zero so write_filesystem()
handles it as error, cleans up and makes installboot exit 1.

Stop ignoring create_filesystem()'s return code in md_prepareboot() and
exit the same way.

Here's the change in behaviour on arm64 (newfs fails because of the
vnd/disklabel race, see "Race in disk_attach_callback?" on tech@):

# installboot -vp vnd0 ; echo $?
newfsing 6694ae5b0d7596ed.i
newfs_msdos: /dev/r6694ae5b0d7596ed.i: No such file or directory
0
# ./obj/installboot -vp vnd0 ; echo $?
newfsing 6694ae5b0d7596ed.i
newfs_msdos: /dev/r6694ae5b0d7596ed.i: No such file or directory
1

Tested on amd64 arm64 macppc octeon powerpc64 sparc64
OK millert


Revision tags: OPENBSD_7_0_BASE OPENBSD_7_1_BASE
# 1.4 20-Jul-2021 kettenis

Add -p option to "prepare" (newfs) a filesystem that will be used for
the bootloader. This is a no-op on architectures where such a filesystem
isn't needed.

ok krw@, deraadt@


Revision tags: OPENBSD_6_8_BASE OPENBSD_6_9_BASE
# 1.3 19-Jul-2020 visa

Should use ufs_args here after all.

While here, make messages more correct.


# 1.2 18-Jul-2020 deraadt

use correct structure for mounting, duh
ok visa kettenis


# 1.1 27-Jun-2020 deraadt

convert macppc, octeon, and loongson to use MI installboot, removing
special case scripting in install.md.
(macppc still requires manual steps for HFS bootmode)
tested by krw, visa, gkoehler


# 1.9 19-Oct-2022 kn

Replace "newfs/fsck_ext2fs" with "newfs/msdos -t ext2fs", constify

OK miod


# 1.8 27-Sep-2022 kn

fix passing explicit stage files

This fixes installboot regress on octeon; same diff as
macppc_installboot.c r1.6, powerpc64_installboot r1.7 and
octeon_installboot r1.8.

loongson was the last architecture requiring this fix. I don't have a
machine to test it myself (loongson isn't built anymore, anyway) but given
the same diff works on four other architectures, this should just work.


Revision tags: OPENBSD_7_2_BASE
# 1.7 14-Sep-2022 kn

Backout "Reflect script failure in exit code"

amd64 install using (G)PT seems busted as reported by tb


# 1.6 11-Sep-2022 miod

Fix build after previous


# 1.5 09-Sep-2022 kn

Reflect script failure in exit code

installboot(8) runs newfs(8) and fsck(8) via system(3) but only checks
failures of the function itself, always returning zero no matter what the
programs/shell returned.

This is bad for regress tests relying on correct return codes.

create_filesystem() itself must not exit as write_filesystem() calls it and
cleans up temporary files upon failure.

Make it return -1 if the script returned non-zero so write_filesystem()
handles it as error, cleans up and makes installboot exit 1.

Stop ignoring create_filesystem()'s return code in md_prepareboot() and
exit the same way.

Here's the change in behaviour on arm64 (newfs fails because of the
vnd/disklabel race, see "Race in disk_attach_callback?" on tech@):

# installboot -vp vnd0 ; echo $?
newfsing 6694ae5b0d7596ed.i
newfs_msdos: /dev/r6694ae5b0d7596ed.i: No such file or directory
0
# ./obj/installboot -vp vnd0 ; echo $?
newfsing 6694ae5b0d7596ed.i
newfs_msdos: /dev/r6694ae5b0d7596ed.i: No such file or directory
1

Tested on amd64 arm64 macppc octeon powerpc64 sparc64
OK millert


Revision tags: OPENBSD_7_0_BASE OPENBSD_7_1_BASE
# 1.4 20-Jul-2021 kettenis

Add -p option to "prepare" (newfs) a filesystem that will be used for
the bootloader. This is a no-op on architectures where such a filesystem
isn't needed.

ok krw@, deraadt@


Revision tags: OPENBSD_6_8_BASE OPENBSD_6_9_BASE
# 1.3 19-Jul-2020 visa

Should use ufs_args here after all.

While here, make messages more correct.


# 1.2 18-Jul-2020 deraadt

use correct structure for mounting, duh
ok visa kettenis


# 1.1 27-Jun-2020 deraadt

convert macppc, octeon, and loongson to use MI installboot, removing
special case scripting in install.md.
(macppc still requires manual steps for HFS bootmode)
tested by krw, visa, gkoehler


# 1.8 27-Sep-2022 kn

fix passing explicit stage files

This fixes installboot regress on octeon; same diff as
macppc_installboot.c r1.6, powerpc64_installboot r1.7 and
octeon_installboot r1.8.

loongson was the last architecture requiring this fix. I don't have a
machine to test it myself (loongson isn't built anymore, anyway) but given
the same diff works on four other architectures, this should just work.


Revision tags: OPENBSD_7_2_BASE
# 1.7 14-Sep-2022 kn

Backout "Reflect script failure in exit code"

amd64 install using (G)PT seems busted as reported by tb


# 1.6 11-Sep-2022 miod

Fix build after previous


# 1.5 09-Sep-2022 kn

Reflect script failure in exit code

installboot(8) runs newfs(8) and fsck(8) via system(3) but only checks
failures of the function itself, always returning zero no matter what the
programs/shell returned.

This is bad for regress tests relying on correct return codes.

create_filesystem() itself must not exit as write_filesystem() calls it and
cleans up temporary files upon failure.

Make it return -1 if the script returned non-zero so write_filesystem()
handles it as error, cleans up and makes installboot exit 1.

Stop ignoring create_filesystem()'s return code in md_prepareboot() and
exit the same way.

Here's the change in behaviour on arm64 (newfs fails because of the
vnd/disklabel race, see "Race in disk_attach_callback?" on tech@):

# installboot -vp vnd0 ; echo $?
newfsing 6694ae5b0d7596ed.i
newfs_msdos: /dev/r6694ae5b0d7596ed.i: No such file or directory
0
# ./obj/installboot -vp vnd0 ; echo $?
newfsing 6694ae5b0d7596ed.i
newfs_msdos: /dev/r6694ae5b0d7596ed.i: No such file or directory
1

Tested on amd64 arm64 macppc octeon powerpc64 sparc64
OK millert


Revision tags: OPENBSD_7_0_BASE OPENBSD_7_1_BASE
# 1.4 20-Jul-2021 kettenis

Add -p option to "prepare" (newfs) a filesystem that will be used for
the bootloader. This is a no-op on architectures where such a filesystem
isn't needed.

ok krw@, deraadt@


Revision tags: OPENBSD_6_8_BASE OPENBSD_6_9_BASE
# 1.3 19-Jul-2020 visa

Should use ufs_args here after all.

While here, make messages more correct.


# 1.2 18-Jul-2020 deraadt

use correct structure for mounting, duh
ok visa kettenis


# 1.1 27-Jun-2020 deraadt

convert macppc, octeon, and loongson to use MI installboot, removing
special case scripting in install.md.
(macppc still requires manual steps for HFS bootmode)
tested by krw, visa, gkoehler


# 1.7 14-Sep-2022 kn

Backout "Reflect script failure in exit code"

amd64 install using (G)PT seems busted as reported by tb


# 1.6 11-Sep-2022 miod

Fix build after previous


# 1.5 09-Sep-2022 kn

Reflect script failure in exit code

installboot(8) runs newfs(8) and fsck(8) via system(3) but only checks
failures of the function itself, always returning zero no matter what the
programs/shell returned.

This is bad for regress tests relying on correct return codes.

create_filesystem() itself must not exit as write_filesystem() calls it and
cleans up temporary files upon failure.

Make it return -1 if the script returned non-zero so write_filesystem()
handles it as error, cleans up and makes installboot exit 1.

Stop ignoring create_filesystem()'s return code in md_prepareboot() and
exit the same way.

Here's the change in behaviour on arm64 (newfs fails because of the
vnd/disklabel race, see "Race in disk_attach_callback?" on tech@):

# installboot -vp vnd0 ; echo $?
newfsing 6694ae5b0d7596ed.i
newfs_msdos: /dev/r6694ae5b0d7596ed.i: No such file or directory
0
# ./obj/installboot -vp vnd0 ; echo $?
newfsing 6694ae5b0d7596ed.i
newfs_msdos: /dev/r6694ae5b0d7596ed.i: No such file or directory
1

Tested on amd64 arm64 macppc octeon powerpc64 sparc64
OK millert


Revision tags: OPENBSD_7_0_BASE OPENBSD_7_1_BASE
# 1.4 20-Jul-2021 kettenis

Add -p option to "prepare" (newfs) a filesystem that will be used for
the bootloader. This is a no-op on architectures where such a filesystem
isn't needed.

ok krw@, deraadt@


Revision tags: OPENBSD_6_8_BASE OPENBSD_6_9_BASE
# 1.3 19-Jul-2020 visa

Should use ufs_args here after all.

While here, make messages more correct.


# 1.2 18-Jul-2020 deraadt

use correct structure for mounting, duh
ok visa kettenis


# 1.1 27-Jun-2020 deraadt

convert macppc, octeon, and loongson to use MI installboot, removing
special case scripting in install.md.
(macppc still requires manual steps for HFS bootmode)
tested by krw, visa, gkoehler


# 1.6 11-Sep-2022 miod

Fix build after previous


# 1.5 09-Sep-2022 kn

Reflect script failure in exit code

installboot(8) runs newfs(8) and fsck(8) via system(3) but only checks
failures of the function itself, always returning zero no matter what the
programs/shell returned.

This is bad for regress tests relying on correct return codes.

create_filesystem() itself must not exit as write_filesystem() calls it and
cleans up temporary files upon failure.

Make it return -1 if the script returned non-zero so write_filesystem()
handles it as error, cleans up and makes installboot exit 1.

Stop ignoring create_filesystem()'s return code in md_prepareboot() and
exit the same way.

Here's the change in behaviour on arm64 (newfs fails because of the
vnd/disklabel race, see "Race in disk_attach_callback?" on tech@):

# installboot -vp vnd0 ; echo $?
newfsing 6694ae5b0d7596ed.i
newfs_msdos: /dev/r6694ae5b0d7596ed.i: No such file or directory
0
# ./obj/installboot -vp vnd0 ; echo $?
newfsing 6694ae5b0d7596ed.i
newfs_msdos: /dev/r6694ae5b0d7596ed.i: No such file or directory
1

Tested on amd64 arm64 macppc octeon powerpc64 sparc64
OK millert


Revision tags: OPENBSD_7_0_BASE OPENBSD_7_1_BASE
# 1.4 20-Jul-2021 kettenis

Add -p option to "prepare" (newfs) a filesystem that will be used for
the bootloader. This is a no-op on architectures where such a filesystem
isn't needed.

ok krw@, deraadt@


Revision tags: OPENBSD_6_8_BASE OPENBSD_6_9_BASE
# 1.3 19-Jul-2020 visa

Should use ufs_args here after all.

While here, make messages more correct.


# 1.2 18-Jul-2020 deraadt

use correct structure for mounting, duh
ok visa kettenis


# 1.1 27-Jun-2020 deraadt

convert macppc, octeon, and loongson to use MI installboot, removing
special case scripting in install.md.
(macppc still requires manual steps for HFS bootmode)
tested by krw, visa, gkoehler


# 1.5 09-Sep-2022 kn

Reflect script failure in exit code

installboot(8) runs newfs(8) and fsck(8) via system(3) but only checks
failures of the function itself, always returning zero no matter what the
programs/shell returned.

This is bad for regress tests relying on correct return codes.

create_filesystem() itself must not exit as write_filesystem() calls it and
cleans up temporary files upon failure.

Make it return -1 if the script returned non-zero so write_filesystem()
handles it as error, cleans up and makes installboot exit 1.

Stop ignoring create_filesystem()'s return code in md_prepareboot() and
exit the same way.

Here's the change in behaviour on arm64 (newfs fails because of the
vnd/disklabel race, see "Race in disk_attach_callback?" on tech@):

# installboot -vp vnd0 ; echo $?
newfsing 6694ae5b0d7596ed.i
newfs_msdos: /dev/r6694ae5b0d7596ed.i: No such file or directory
0
# ./obj/installboot -vp vnd0 ; echo $?
newfsing 6694ae5b0d7596ed.i
newfs_msdos: /dev/r6694ae5b0d7596ed.i: No such file or directory
1

Tested on amd64 arm64 macppc octeon powerpc64 sparc64
OK millert


Revision tags: OPENBSD_7_0_BASE OPENBSD_7_1_BASE
# 1.4 20-Jul-2021 kettenis

Add -p option to "prepare" (newfs) a filesystem that will be used for
the bootloader. This is a no-op on architectures where such a filesystem
isn't needed.

ok krw@, deraadt@


Revision tags: OPENBSD_6_8_BASE OPENBSD_6_9_BASE
# 1.3 19-Jul-2020 visa

Should use ufs_args here after all.

While here, make messages more correct.


# 1.2 18-Jul-2020 deraadt

use correct structure for mounting, duh
ok visa kettenis


# 1.1 27-Jun-2020 deraadt

convert macppc, octeon, and loongson to use MI installboot, removing
special case scripting in install.md.
(macppc still requires manual steps for HFS bootmode)
tested by krw, visa, gkoehler


# 1.4 20-Jul-2021 kettenis

Add -p option to "prepare" (newfs) a filesystem that will be used for
the bootloader. This is a no-op on architectures where such a filesystem
isn't needed.

ok krw@, deraadt@


Revision tags: OPENBSD_6_8_BASE OPENBSD_6_9_BASE
# 1.3 19-Jul-2020 visa

Should use ufs_args here after all.

While here, make messages more correct.


# 1.2 18-Jul-2020 deraadt

use correct structure for mounting, duh
ok visa kettenis


# 1.1 27-Jun-2020 deraadt

convert macppc, octeon, and loongson to use MI installboot, removing
special case scripting in install.md.
(macppc still requires manual steps for HFS bootmode)
tested by krw, visa, gkoehler


# 1.3 19-Jul-2020 visa

Should use ufs_args here after all.

While here, make messages more correct.


# 1.2 18-Jul-2020 deraadt

use correct structure for mounting, duh
ok visa kettenis


# 1.1 27-Jun-2020 deraadt

convert macppc, octeon, and loongson to use MI installboot, removing
special case scripting in install.md.
(macppc still requires manual steps for HFS bootmode)
tested by krw, visa, gkoehler


# 1.2 18-Jul-2020 deraadt

use correct structure for mounting, duh
ok visa kettenis


# 1.1 27-Jun-2020 deraadt

convert macppc, octeon, and loongson to use MI installboot, removing
special case scripting in install.md.
(macppc still requires manual steps for HFS bootmode)
tested by krw, visa, gkoehler