Skip to content

Commit b2adeaf

Browse files
committed
Merge branch 'master' into OS-7458
2 parents 4b88733 + 69e149a commit b2adeaf

File tree

7 files changed

+63
-35
lines changed

7 files changed

+63
-35
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<!--
88
Copyright 2019 Joyent, Inc.
9-
Copyright 2024 MNX Cloud, Inc.
9+
Copyright 2025 MNX Cloud, Inc.
1010
-->
1111

1212
# Triton Contribution Guidelines
@@ -55,7 +55,7 @@ tracking -- primarily to allow interaction with those without access to JIRA.
5555

5656
## Code of Conduct
5757

58-
All persons and/or organizations contributing to, or intercting with our
58+
All persons and/or organizations contributing to, or interacting with our
5959
repositories or communities are required to abide by the
6060
[illumos Code of Conduct][coc].
6161

Jenkinsfile

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
/*
88
* Copyright 2022 Joyent, Inc.
9-
* Copyright 2023 MNX Cloud, Inc.
9+
* Copyright 2024 MNX Cloud, Inc.
1010
*/
1111

1212
@Library('[email protected]') _
@@ -45,8 +45,8 @@ pipeline {
4545
'<dd>platform root password [default: randomly chosen]</dd>\n' +
4646
'<dt>-S</dt>\n' +
4747
'<dd>do *not* run smatch [default is to run smatch]</dd>\n' +
48-
'<dt>-s gcc7</dt>\n' +
49-
'<dd>shadow compilers, comma delimited (gcc7,gcc#) [default: none]</dd>\n' +
48+
'<dt>-s gcc14</dt>\n' +
49+
'<dd>shadow compilers, comma delimited (gcc14,gcc#) [default: none]</dd>\n' +
5050
'</dl>'
5151
)
5252
text(
@@ -250,12 +250,12 @@ export PLAT_CONFIGURE_ARGS="-d $PLAT_CONFIGURE_ARGS"
250250
}
251251
}
252252
}
253-
stage('gcc7') {
253+
stage('gcc14') {
254254
agent {
255255
node {
256256
label 'platform:true && image_ver:21.4.0 && pkgsrc_arch:x86_64 && ' +
257257
'dram:16gb && !virt:kvm && fs:pcfs && fs:ufs && jenkins_agent:3'
258-
customWorkspace "workspace/smartos-${BRANCH_NAME}-gcc7"
258+
customWorkspace "workspace/smartos-${BRANCH_NAME}-gcc14"
259259
}
260260
}
261261
when {
@@ -272,18 +272,18 @@ export PLAT_CONFIGURE_ARGS="-d $PLAT_CONFIGURE_ARGS"
272272
steps {
273273
sh('git clean -fdx')
274274
sh('''
275-
export PLAT_CONFIGURE_ARGS="-p gcc7 -r $PLAT_CONFIGURE_ARGS"
275+
export PLAT_CONFIGURE_ARGS="-p gcc14 -r $PLAT_CONFIGURE_ARGS"
276276
# enough to make sure we don't pollute the main Manta dir
277-
# Also for now we implicitly promise that the gcc7 deliverables are DEBUG,
278-
# but we could choose to make -gcc7 *and* -debug-gcc7 stages later and alter
277+
# Also for now we implicitly promise that the gcc14 deliverables are DEBUG,
278+
# but we could choose to make -gcc14 *and* -debug-gcc14 stages later and alter
279279
# PLATFORM_DEBUG_SUFFIX accordingly.
280-
export PLATFORM_DEBUG_SUFFIX=-gcc7
281-
./tools/build_jenkins -c -d -S gcc7
280+
export PLATFORM_DEBUG_SUFFIX=-gcc14
281+
./tools/build_jenkins -c -d -S gcc14
282282
''')
283283
}
284284
post {
285285
always {
286-
archiveArtifacts artifacts: 'output/gcc7/**',
286+
archiveArtifacts artifacts: 'output/gcc14/**',
287287
onlyIfSuccessful: false,
288288
allowEmptyArchive: true
289289
cleanWs cleanWhenSuccess: true,
@@ -292,7 +292,7 @@ export PLATFORM_DEBUG_SUFFIX=-gcc7
292292
cleanWhenNotBuilt: true,
293293
deleteDirs: true
294294
joySlackNotifications(
295-
channel: 'smartos', comment: 'gcc7')
295+
channel: 'smartos', comment: 'gcc14')
296296
}
297297
}
298298
}

configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ AR=/usr/bin/ar; export AR
414414
if [[ -z "\$MAKE" ]]; then
415415
MAKE="\$SRC/tools/proto/root_i386-nd/opt/onbld/bin/i386/dmake"; export MAKE
416416
fi
417-
LEX=/opt/local/bin/lex; export LEX
417+
# As of illumos#16873, we no longer need to define LEX, as it's in tools.
418418
# As of illumos#16319, we no longer need to define YACC, as it's in tools.
419419
BISON=/opt/local/bin/bison; export BISON
420420
GM4=/opt/local/bin/gm4; export GM4

man/smartdc/man/man1/sdc-factoryreset.1.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,41 @@
33

44
## SYNOPSIS
55

6-
`sdc-factoryreset [-h | --help]`
6+
`sdc-factoryreset [-h | --help] {-s}`
77

88

99
## DESCRIPTION
1010

1111
This command resets a machine to its originally installed state. Specifically,
1212
it reboots the machine, imports all ZFS pools, and destroys them individually.
13-
It does this by setting a ZFS user property on the system pool.
13+
It does this by setting a ZFS user property on the system pool. Using the
14+
`-s` flag will instead shut down the machine; putting it into a state where
15+
upon next reboot, the machine will import all ZFS pool and destroy them
16+
individually.
1417

1518
If this command is invoked unintentionally, an administrator can prevent the
16-
system from resetting itself by booting in rescue mode (noimport=true as a GRUB
19+
system from resetting itself by booting in rescue mode (noimport=true as a
1720
boot option) and clearing the smartdc:factoryreset property from the var
18-
dataset. If the system is booting without the noimport=true GRUB option, the
19-
only way to stop the pending factory reset is to power cycle the machine, and
20-
boot again into rescue mode. The service which does the actual factory reset
21-
starts well before an administrator would be able to login to the box, even if
22-
that administrator has console access.
21+
dataset. Use of the `-s` option makes this easier to accomplish.
22+
23+
If the affected system boots without the noimport=true option, the only way
24+
to stop the pending factory reset is to power cycle the machine, and boot
25+
again into rescue mode. The service which does the actual factory reset
26+
starts well before an administrator would be able to login to the box, even
27+
if that administrator has console access.
2328

2429

2530
## OPTIONS
2631

2732
`-h`
2833
Show the help and usage mesage
2934

35+
`-s`
36+
Instead of immediately rebooting, shut down the machine instead
37+
(using poweroff(8)).
38+
3039

3140
## COPYRIGHT
3241

33-
sdc-factoryreset Copyright (c) 2014, Joyent, Inc.
42+
Copyright (c) 2014, Joyent, Inc.
43+
Copyright 2024 MNX Cloud, Inc.

src/smartdc/bin/sdc-factoryreset.sh

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#
99
# Copyright (c) 2014, Joyent, Inc.
10+
# Copyright 2024 MNX Cloud, Inc.
1011
#
1112

1213
#
@@ -27,7 +28,7 @@ function abort()
2728

2829
function usage()
2930
{
30-
printf "\nUsage: $myname [-h | --help]\n\n"
31+
printf "\nUsage: $myname [-h | --help] {-s}\n\n"
3132
printf "Resets a machine to its originally installed state. See "
3233
printf "sdc-factoryreset(1)\nfor more information.\n"
3334
exit 1
@@ -37,18 +38,22 @@ if [[ -n $1 ]] && [[ $1 = "--help" ]]; then
3738
usage
3839
fi
3940

40-
while getopts "h" opt
41+
final_command="reboot"
42+
final_verb="Rebooting"
43+
44+
while getopts "hs" opt
4145
do
4246
case "$opt" in
4347
h) usage;;
48+
s) final_command="poweroff"; final_verb="Powering off";;
4449
*) usage;;
4550
esac
4651
done
4752

4853
trap abort SIGINT
4954

50-
printf "WARNING: This machine will reboot and destroy its ZFS pools after "
51-
printf "rebooting.\n"
55+
printf "WARNING: This machine will $final_command and destroy its ZFS pools "
56+
printf "during the next boot.\n"
5257

5358
read -p "Do you want to proceed with the factory reset? (y/n) " -n 1
5459

@@ -59,15 +64,15 @@ if [[ $REPLY =~ ^[Yy]$ ]]; then
5964
read -p "Are you sure? (y/n) " -n 1
6065

6166
if [[ $REPLY =~ ^[Yy]$ ]]; then
62-
printf "\n\nRebooting in 5 seconds ... "
67+
printf "\n\n$final_verb in 5 seconds ... "
6368
sleep 5
6469
printf "now!\n"
6570

6671
SYS_ZPOOL=$(svcprop -p config/zpool smartdc/init)
6772
[[ -n ${SYS_ZPOOL} ]] || SYS_ZPOOL=zones
6873

6974
zfs set smartdc:factoryreset=yes ${SYS_ZPOOL}/var
70-
reboot
75+
$final_command
7176
else
7277
abort
7378
fi

src/smartdc/lib/smartos_prompt_config.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,6 +1069,8 @@ elif [[ -f ${USBMNT}/private/answers.json ]]; then
10691069
answer_file=${USBMNT}/private/answers.json
10701070
elif [[ -f ${USBMOUNTPOINT}/private/answers.json ]]; then
10711071
answer_file=${USBMOUNTPOINT}/private/answers.json
1072+
elif [[ -f /system/boot/answers.json ]]; then
1073+
answer_file=/system/boot/answers.json
10721074
fi
10731075

10741076
#

tools/generate-manifest-from-ips.nawk

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#
1010
# Copyright 2019 Joyent, Inc.
11+
# Copyright 2025 MNX Cloud, Inc.
1112
#
1213

1314
#
@@ -128,13 +129,23 @@ function emit_line() {
128129

129130
if (action_name == "file" || action_name == "dir") {
130131
print name " " replace_macros(attrs["path"]) " " mode " " owner " " group;
131-
} else if (action_name == "link" || action_name == "hardlink") {
132+
} else if (action_name == "link") {
133+
#
134+
# SmartOS manifests expect the literal value of a symbolic
135+
# link target. Unlike hard links, we need to scribble in
136+
# something that can cope with relative paths either in the
137+
# proto area or in the actual filesystem. Take IPS at its word
138+
# for symbolic links.
139+
#
140+
print name " " replace_macros(attrs["path"]) "=" replace_macros(attrs["target"]);
141+
} else if (action_name == "hardlink") {
132142

133143
#
134-
# SmartOS manifests expect full paths in targets, but IPS manifests
135-
# don't require that. Try to catch these cases by looking for link
136-
# targets that are either relative, or contain no directory
137-
# separators, and prepend the parent directory of the source path.
144+
# SmartOS manifests expect full paths in targets for hard
145+
# links, but IPS manifests don't require that. Try to catch
146+
# these cases by looking for link targets that are either
147+
# relative, or contain no directory separators, and prepend
148+
# the parent directory of the source path.
138149
#
139150
if (match(attrs["target"], "^\.") != 0 || match(attrs["target"], "/") == 0) {
140151
split(attrs["path"], path_comps, "/");

0 commit comments

Comments
 (0)