profile
viewpoint
Joshua M. Clulow jclulow @oxidecomputer San Francisco, CA https://sysmgr.org Engineer. UNIX person. Member of the illumos core team. Building a new machine at @oxidecomputer! `@jmc:unix.house` on Matrix; LeftWing on freenode.

jclulow/illumos-kvm 50

KVM driver for illumos (now with 25% more AMD-V). Note: latest work is in branch "pre-ept"; use that one!

illumos/metadata-agent 4

Metadata agent for configuration of illumos guests on DigitalOcean

jclulow/illumos-docbooks 2

Updated versions of old Sun docbooks for illumos

jclulow/illumos-fmaweb-wip 2

illumos.org FMA Message Webapp (Work-in-Progress)

jclulow/c-manta-signing 1

Terrible C code to demonstrate the use of an SSH agent to sign Manta HTTPS requests

jclulow/dwm 1

My hacked up copy of dwm from http://dwm.suckless.org

jclulow/gobuild 1

small script to build Go release binaries for illumos

jclulow/hackernews-tools 1

Misc scripts for parsing (read: scraping) Hacker News.

Pull request review commentjoyent/smartos-live

RFD176 branch

 refresh_or_disable_pool() { 		err "Pool $pool is not bootable, and cannot be disabled or refreshed"  	if [[ "$flag" == "-d" ]]; then+		if [[ "$TRITON_HN" == "yes" ]]; then+			# NOTE: Disabling a Head Node's boot pool may+			# This might be where we call sdc-usbkey with+			# a forcing-flag to seek a stick!  Or at least to+			# scan for alternate bootable pools.

Oh I get it. Yeah, it's a sentence fragment. I either cut a line or didn't finish this. Will rework.

danmcd

comment created time in 3 minutes

push eventjoyent/smartos-live

Dan McDonald

commit sha 81fcf4f521a9bd3850167c7782c1dfa1376b0904

OS-8250 Create 16gb.img in smartos-live (#965) Actually-authored-by: Pedro Palazón Candel <pedro@joyent.com> Actually-reviewed-by: Dan McDonald <danmcd@joyent.com> Approved by: Mike Zeller <mike.zeller@joyent.com>

view details

Dan McDonald

commit sha da408ea934cfb46beffd0cedf6a75b0767d98e6d

blah

view details

Dan McDonald

commit sha 349727aa8f42b8f5aa6e08e59b90f6ee89c8abac

blah2

view details

Dan McDonald

commit sha f7d99f32b74fd6853c3c60e237d8f71943b34d43

Small KEBE comment update

view details

Dan McDonald

commit sha 19afc2abe8ca52837c204a13bc4cd1db3c9075f8

Checkpoint --> bootable -e and list now work, at least in the easy case.

view details

Dan McDonald

commit sha c6e4d727649fd2a167a38c306192590a9f65d366

Stake in ground for 'bootable -d'

view details

Dan McDonald

commit sha 3f7e55265c939764415b91f9d73fc30953d3bad1

Stake-in-the-ground for usb-key.sh

view details

Dan McDonald

commit sha 3f0434868dab78cf525fe281b1a32ee142cdeec4

USB key version check

view details

Dan McDonald

commit sha a8866ef13f92120ef36f13904825343021e5c067

Easy fixes from Brian's review. (Hard ones to come later.)

view details

push time in 23 minutes

push eventjoyent/smartos-live

Dan McDonald

commit sha 81fcf4f521a9bd3850167c7782c1dfa1376b0904

OS-8250 Create 16gb.img in smartos-live (#965) Actually-authored-by: Pedro Palazón Candel <pedro@joyent.com> Actually-reviewed-by: Dan McDonald <danmcd@joyent.com> Approved by: Mike Zeller <mike.zeller@joyent.com>

view details

push time in 24 minutes

PR merged joyent/smartos-live

OS-8250 Create 16gb.img in smartos-live integration-approval

Subject says it all.

+6 -1

1 comment

1 changed file

danmcd

pr closed time in 24 minutes

Pull request review commentjoyent/smartos-live

RFD176 branch

 refresh_or_disable_pool() { 		err "Pool $pool is not bootable, and cannot be disabled or refreshed"  	if [[ "$flag" == "-d" ]]; then+		if [[ "$TRITON_HN" == "yes" ]]; then+			# NOTE: Disabling a Head Node's boot pool may+			# This might be where we call sdc-usbkey with+			# a forcing-flag to seek a stick!  Or at least to+			# scan for alternate bootable pools.

I just mean that the comment itself doesn't read properly. In particular, line 1114 seems like it can be entirely removed? Or there's a whole line (or more?) missing. Lines 1115-1117 are ok, but 1114 is missing something.

danmcd

comment created time in 43 minutes

Pull request review commentjoyent/smartos-live

RFD176 branch

 update_CN() { 	update_boot_sectors "$pool" "$bootfs" } +bringup_HN() {+	# One last reality check...+	if [[ "$pool" == "$TRITON_HN_BOOTPOOL" ]]; then+		err "Enabling pool we just booted from."+	fi++	# If we reach here, we've checked for the already-bootable+	# case, checked for the can-be-bootable case, and have a+	# $bootfs ready to go.  For the head node, we will be extra+	# cautious and remove all of its contents first.  NOTE: rm(1)+	# will complain because you'll get EBUSY for the mountpoint+	# itself.+	vecho "Cleaning up $bootfs"+	/bin/rm -rf /"$bootfs" >& /dev/null+	cd /"$bootfs"++	# Mount the Triton USB key (even if it's a virtual one...).+	stickmount=$(sdc-usbkey mount)+	vecho "Mounted USB key on $stickmount"++	# NOTE:  BAIL ON VERSION 1 STICKS FOR NOW+	version=$(sdc-usbkey status -j | json version)+	if [[ "$version" != "2" ]]; then+		# Unmount on version-mismatch...+		sdc-usbkey unmount+		err "USB key must be Version 2 (loader) to install on a pool."+	fi++	# Copy over the whole thing to ${bootfs}+	vecho "Copying over USB key contents to /$bootfs"+	tar -cf - -C "$stickmount" . | tar -xf - || \+		err "Problem copying USB key on $stickmount to /$bootfs"++	# Add both fstype="ufs" to loader.conf.+	vecho "Modifying loader.conf for pool-based Triton Head Node boot"+	grep -q 'fstype="ufs"' ./boot/loader.conf || \+		echo 'fstype="ufs"' >> ./boot/loader.conf

OK, then we're probably fine I think.

danmcd

comment created time in an hour

push eventjoyent/illumos-joyent

Toomas Soome

commit sha 63f9f2ff473e9cb7f455f032fe3d04a95ec4b537

13332 loader: iterate consoles to draw loader menu screen Reviewed by: Andy Fiddaman <andy@omnios.org> Approved by: Dan McDonald <danmcd@joyent.com>

view details

Robert Mustacchi

commit sha 7b4214534ccdf6f8aa6e566d7501aab328c72e84

13324 struct dk_minfo_ext size differences trigger SSP in libfdisk Reviewed by: Jason King <jason.brian.king@gmail.com> Reviewed by: Andy Fiddaman <andy@omniosce.org> Reviewed by: Toomas Soome <tsoome@me.com> Approved by: Joshua Clulow <josh@sysmgr.org>

view details

Dan McDonald

commit sha d79b46fa6a6b38bd45268af896a043dde714b38a

[illumos-gate merge] commit 7b4214534ccdf6f8aa6e566d7501aab328c72e84 13324 struct dk_minfo_ext size differences trigger SSP in libfdisk commit 63f9f2ff473e9cb7f455f032fe3d04a95ec4b537 13332 loader: iterate consoles to draw loader menu screen Conflicts: usr/src/boot/sys/boot/forth/support.4th usr/src/boot/sys/boot/forth/Makefile.inc

view details

push time in 3 hours

Pull request review commentjoyent/illumos-joyent

OS-7754 Ubuntu 18.04 in lx needs different resolver configuration

 safe_dir /etc/resolvconf/resolv.conf.d safe_dir /etc/network safe_dir /etc/network/interfaces.d safe_dir /etc/network/interfaces.d/smartos--# Populate resolve.conf setup files-zonecfg -z $ZONENAME info attr name=resolvers | awk '-BEGIN {-	print("# AUTOMATIC ZONE CONFIG")-}-$1 == "value:" {-	nres = split($2, resolvers, ",");-	for (i = 1; i <= nres; i++) {-		print("nameserver", resolvers[i]);-	}-}-' > $tmpfile-zonecfg -z $ZONENAME info attr name=dns-domain | awk '-$1 == "value:" {-	dom = $2-}-END {-	print("search", dom);-}-' >> $tmpfile-fnm=$ZONEROOT/etc/resolvconf/resolv.conf.d/tail-if [[ -f $fnm || -h $fnm || ! -e $fnm ]]; then-	mv -f $tmpfile $fnm+safe_dir /etc/systemd++# Populate resolv.conf setup files IFF we have resolvers information.+resolvers=`zone_attr resolvers`+if [[ $? == 0 ]]; then++    echo "# AUTOMATIC ZONE CONFIG" > $tmpfile+    _IFS=$IFS; IFS=,; for r in $resolvers; do+        echo "nameserver $r"+    done >> $tmpfile+    IFS=$_IFS+    domain=`zone_attr dns-domain`+    [[ $? == 0 ]] && echo "search $domain" >> $tmpfile++    if [ -f $ZONEROOT/etc/systemd/resolved.conf ]; then+        cf=$ZONEROOT/etc/systemd/resolved.conf+	sed -i -E '/^(DNS|Domains) *=/d' $cf+        echo "DNS=$resolvers" >> $cf+        [[ -n "$domain" ]] && echo "Domains=$domain" >> $cf+        mv -f $tmpfile $ZONEROOT/etc/resolv.conf

OTOH we appear to do this already for other LX zones (see the else case below...).

danmcd

comment created time in 4 hours

push eventtime-rs/time

push time in 13 hours

push eventtime-rs/time

Jacob Pratt

commit sha dcbb0a31fec7aca5b5b0794a1c665b176f30460c

Change Julian day to i32 As the full range of valid values fits within an i32, there is no reason to use an i64.

view details

push time in 13 hours

push eventtime-rs/time

Jacob Pratt

commit sha 3052dea0814f8e38b1e7ba9a86977c691ed9b613

Ungroup quickcheck in CI As quickcheck depends on std, we effectively weren't testing `#![no_std]` compatibility for serde and rand.

view details

push time in 17 hours

push eventtime-rs/time

Jacob Pratt

commit sha df7f2eda112a2f7a39ce5dd82702cf962c6af278

Run doc build concurrently with other items Given that this build should only be used for the current main branch, it seems reasonable to publish even if something else fails. Caching for documentation has also been added.

view details

push time in 17 hours

push eventjoyent/smartos-live

Dan McDonald

commit sha e014758052ccbb425f5e2106647967209f16ba89

Easy fixes from Brian's review. (Hard ones to come later.)

view details

push time in 18 hours

pull request commentjoyent/smartos-live

RFD176 branch

Will push back the easy fixes now. One open question (disable booting pool) and one longer-to-fix one (check usbkey mount status) come later.

danmcd

comment created time in 18 hours

Pull request review commentjoyent/smartos-live

RFD176 branch

 fi  # Determine if we're running on a Triton Compute Node (CN) or not: bootparams | grep -E -q 'smartos=|headnode=' || initialize_as_CN+bootparams | grep -q 'smartos=' || initialize_as_HN

Fair enough. Will fix.

danmcd

comment created time in 18 hours

Pull request review commentjoyent/smartos-live

RFD176 branch

 refresh_or_disable_pool() { 		err "Pool $pool is not bootable, and cannot be disabled or refreshed"  	if [[ "$flag" == "-d" ]]; then+		if [[ "$TRITON_HN" == "yes" ]]; then+			# NOTE: Disabling a Head Node's boot pool may+			# This might be where we call sdc-usbkey with+			# a forcing-flag to seek a stick!  Or at least to+			# scan for alternate bootable pools.

Right now it errors out (read below the comment)... you cannot disable the pool that you booted from. Are you suggesting we allow it, or at least allow-with-safety-belts?

danmcd

comment created time in 18 hours

Pull request review commentjoyent/smartos-live

RFD176 branch

 enablepool() { 	if [[ "$TRITON_CN" == "yes" ]]; then 		bringup_CN 		update_boot_sectors "$pool" "$bootfs"+	elif [[ "$TRITON_HN" == "yes" ]]; then+		bringup_HN+		update_boot_sectors "$pool" "$bootfs"+		echo "NOTE:  Directory $bootfs on pool $pool is now able to be"+		echo "this head node's virtual bootable USB key."+		echo ""+		echo "If this isn't a replacement pool for an existing bootable"+		echo "pool, you should remove the USB key from this headnode"+		echo "and then reboot this headnode from a disk in $pool"+		echo ""+		echo "The USB key (even if it's another pool's bootfs) is"+		echo "mounted in" $(sdc-usbkey mount) "and will remain so,"+		echo "in case one needs to inspect before-and-after."

That'll be a slower-fix, but probably a good idea.

Will fix (but not as quickly as the other ones).

danmcd

comment created time in 18 hours

Pull request review commentjoyent/smartos-live

RFD176 branch

 update_CN() { 	update_boot_sectors "$pool" "$bootfs" } +bringup_HN() {+	# One last reality check...+	if [[ "$pool" == "$TRITON_HN_BOOTPOOL" ]]; then+		err "Enabling pool we just booted from."+	fi++	# If we reach here, we've checked for the already-bootable+	# case, checked for the can-be-bootable case, and have a+	# $bootfs ready to go.  For the head node, we will be extra+	# cautious and remove all of its contents first.  NOTE: rm(1)+	# will complain because you'll get EBUSY for the mountpoint+	# itself.+	vecho "Cleaning up $bootfs"+	/bin/rm -rf /"$bootfs" >& /dev/null+	cd /"$bootfs"++	# Mount the Triton USB key (even if it's a virtual one...).+	stickmount=$(sdc-usbkey mount)+	vecho "Mounted USB key on $stickmount"++	# NOTE:  BAIL ON VERSION 1 STICKS FOR NOW+	version=$(sdc-usbkey status -j | json version)+	if [[ "$version" != "2" ]]; then+		# Unmount on version-mismatch...+		sdc-usbkey unmount+		err "USB key must be Version 2 (loader) to install on a pool."+	fi++	# Copy over the whole thing to ${bootfs}+	vecho "Copying over USB key contents to /$bootfs"+	tar -cf - -C "$stickmount" . | tar -xf - || \+		err "Problem copying USB key on $stickmount to /$bootfs"++	# Add both fstype="ufs" to loader.conf.+	vecho "Modifying loader.conf for pool-based Triton Head Node boot"+	grep -q 'fstype="ufs"' ./boot/loader.conf || \+		echo 'fstype="ufs"' >> ./boot/loader.conf+	# Also check triton_bootpool="${pool}" status.  We may be using a+	# "USB Key" that's actually another pool.+	if grep -q 'triton_bootpool=' ./boot/loader.conf; then+		# From another pool's bootfs.  Let's be cautious and use+		# a temp file instead of sed's -i or -I.+		tfile=$(mktemp)+		sed "s/triton_bootpool=.*/triton_bootpool=\"$pool\"/g" \+			< ./boot/loader.conf > $tfile+		mv -f $tfile ./boot/loader.conf+	else+		# From an actual USB key...+		echo "triton_bootpool=\"$pool\"" >> ./boot/loader.conf+	fi++	# (OPTIONAL) Add "from-pool" indicator to boot.4th.++	# 4.) Properly capitalize ${bootfs}/os/ entries.+	vecho "Case-correcting os/ entries."+	cd ./os+	for a in *; do+		mv $a $(tr '[a-z]' '[A-Z]' <<< $a)

I like yours better, but tell me, is that a bash-ism?

Will fix anyway...

danmcd

comment created time in 18 hours

Pull request review commentjoyent/smartos-live

RFD176 branch

 update_CN() { 	update_boot_sectors "$pool" "$bootfs" } +bringup_HN() {+	# One last reality check...+	if [[ "$pool" == "$TRITON_HN_BOOTPOOL" ]]; then+		err "Enabling pool we just booted from."+	fi++	# If we reach here, we've checked for the already-bootable+	# case, checked for the can-be-bootable case, and have a+	# $bootfs ready to go.  For the head node, we will be extra+	# cautious and remove all of its contents first.  NOTE: rm(1)+	# will complain because you'll get EBUSY for the mountpoint+	# itself.+	vecho "Cleaning up $bootfs"+	/bin/rm -rf /"$bootfs" >& /dev/null+	cd /"$bootfs"++	# Mount the Triton USB key (even if it's a virtual one...).+	stickmount=$(sdc-usbkey mount)+	vecho "Mounted USB key on $stickmount"++	# NOTE:  BAIL ON VERSION 1 STICKS FOR NOW+	version=$(sdc-usbkey status -j | json version)+	if [[ "$version" != "2" ]]; then+		# Unmount on version-mismatch...+		sdc-usbkey unmount+		err "USB key must be Version 2 (loader) to install on a pool."+	fi++	# Copy over the whole thing to ${bootfs}+	vecho "Copying over USB key contents to /$bootfs"+	tar -cf - -C "$stickmount" . | tar -xf - || \+		err "Problem copying USB key on $stickmount to /$bootfs"++	# Add both fstype="ufs" to loader.conf.+	vecho "Modifying loader.conf for pool-based Triton Head Node boot"+	grep -q 'fstype="ufs"' ./boot/loader.conf || \+		echo 'fstype="ufs"' >> ./boot/loader.conf

For standalone SmartOS it goes in loader.conf already. Just following prior art here.

danmcd

comment created time in 18 hours

Pull request review commentjoyent/smartos-live

RFD176 branch

 update_CN() { 	update_boot_sectors "$pool" "$bootfs" } +bringup_HN() {+	# One last reality check...+	if [[ "$pool" == "$TRITON_HN_BOOTPOOL" ]]; then+		err "Enabling pool we just booted from."+	fi++	# If we reach here, we've checked for the already-bootable+	# case, checked for the can-be-bootable case, and have a+	# $bootfs ready to go.  For the head node, we will be extra+	# cautious and remove all of its contents first.  NOTE: rm(1)+	# will complain because you'll get EBUSY for the mountpoint+	# itself.+	vecho "Cleaning up $bootfs"+	/bin/rm -rf /"$bootfs" >& /dev/null+	cd /"$bootfs"++	# Mount the Triton USB key (even if it's a virtual one...).+	stickmount=$(sdc-usbkey mount)+	vecho "Mounted USB key on $stickmount"++	# NOTE:  BAIL ON VERSION 1 STICKS FOR NOW

Left as an exercise to the reader. :)

danmcd

comment created time in 18 hours

Pull request review commentjoyent/smartos-live

RFD176 branch

 update_CN() { 	update_boot_sectors "$pool" "$bootfs" } +bringup_HN() {+	# One last reality check...+	if [[ "$pool" == "$TRITON_HN_BOOTPOOL" ]]; then+		err "Enabling pool we just booted from."

Because of the TRITON_HN_BOOTPOOL knowledge we can state we already booted it too. But you're right we should call out $pool:

err "Pool $pool is already bootable, and we just booted it."

danmcd

comment created time in 18 hours

Pull request review commentjoyent/smartos-live

RFD176 branch

 list() { 			# the pool. 			continue 		fi-		if [[ ! -L /$bootfs/platform ]]; then-			corrupt "WARNING: Bootable filesystem $bootfs" \-				"has non-symlink platform"-		fi 		cd "/$bootfs" || fatal "Could not chdir to /$bootfs" 		bootbitsstamp=$(cat etc/version/boot)-		bootstamp=$(cat platform/etc/version/platform)-		mapfile -t pis \-			< <(cd "/$bootfs" || exit; cat platform-*/etc/version/platform)+		if [[ "$TRITON_HN" != "yes" ]]; then+			if [[ ! -L /$bootfs/platform ]]; then

Will fix.

danmcd

comment created time in 18 hours

Pull request review commentjoyent/smartos-live

RFD176 branch

 not_triton_CN() { 	fi } +not_triton_HN() {+	if [[ "$TRITON_HN" == "yes" ]]; then+		eecho "The $1 command cannot be used on a Triton Head Node"

No. It gets passed "something" for "The <something> command cannot be used...". The other one is prior art there.

[root@headnode (coal) ~]# /tmp/piadm install
The install command cannot be used on a Triton Head Node
On a headnode, please use 'sdcadm platform'.
[root@headnode (coal) ~]# 
danmcd

comment created time in 18 hours

push eventtime-rs/time

Jacob Pratt

commit sha 288c942a34e19fa38704bdde5e1d49fc21318be2

Document return value due to soundness issue

view details

Jacob Pratt

commit sha c4360425b662caf0f5d8b56978209f288509327f

Add time component getters

view details

push time in 19 hours

Pull request review commentjoyent/illumos-joyent

OS-7754 Ubuntu 18.04 in lx needs different resolver configuration

 safe_dir /etc/resolvconf/resolv.conf.d safe_dir /etc/network safe_dir /etc/network/interfaces.d safe_dir /etc/network/interfaces.d/smartos--# Populate resolve.conf setup files-zonecfg -z $ZONENAME info attr name=resolvers | awk '-BEGIN {-	print("# AUTOMATIC ZONE CONFIG")-}-$1 == "value:" {-	nres = split($2, resolvers, ",");-	for (i = 1; i <= nres; i++) {-		print("nameserver", resolvers[i]);-	}-}-' > $tmpfile-zonecfg -z $ZONENAME info attr name=dns-domain | awk '-$1 == "value:" {-	dom = $2-}-END {-	print("search", dom);-}-' >> $tmpfile-fnm=$ZONEROOT/etc/resolvconf/resolv.conf.d/tail-if [[ -f $fnm || -h $fnm || ! -e $fnm ]]; then-	mv -f $tmpfile $fnm+safe_dir /etc/systemd++# Populate resolv.conf setup files IFF we have resolvers information.+resolvers=`zone_attr resolvers`+if [[ $? == 0 ]]; then++    echo "# AUTOMATIC ZONE CONFIG" > $tmpfile+    _IFS=$IFS; IFS=,; for r in $resolvers; do+        echo "nameserver $r"+    done >> $tmpfile+    IFS=$_IFS+    domain=`zone_attr dns-domain`+    [[ $? == 0 ]] && echo "search $domain" >> $tmpfile++    if [ -f $ZONEROOT/etc/systemd/resolved.conf ]; then+        cf=$ZONEROOT/etc/systemd/resolved.conf+	sed -i -E '/^(DNS|Domains) *=/d' $cf+        echo "DNS=$resolvers" >> $cf+        [[ -n "$domain" ]] && echo "Domains=$domain" >> $cf+        mv -f $tmpfile $ZONEROOT/etc/resolv.conf

That's how it work in OmniOS, for better or worse. If you define the resolvers and domain in the zone config, then it's regenerated at boot. It might not be right for SmartOS.

danmcd

comment created time in a day

Pull request review commentjoyent/smartos-live

RFD176 branch

 enablepool() { 	if [[ "$TRITON_CN" == "yes" ]]; then 		bringup_CN 		update_boot_sectors "$pool" "$bootfs"+	elif [[ "$TRITON_HN" == "yes" ]]; then+		bringup_HN+		update_boot_sectors "$pool" "$bootfs"+		echo "NOTE:  Directory $bootfs on pool $pool is now able to be"+		echo "this head node's virtual bootable USB key."+		echo ""+		echo "If this isn't a replacement pool for an existing bootable"+		echo "pool, you should remove the USB key from this headnode"+		echo "and then reboot this headnode from a disk in $pool"+		echo ""+		echo "The USB key (even if it's another pool's bootfs) is"+		echo "mounted in" $(sdc-usbkey mount) "and will remain so,"+		echo "in case one needs to inspect before-and-after."

I think we should return the mount status to what it was before. if it was mounted, leave it, if it was unmounted, unmount it. Possibly have a flag to ignore previous state and leave mounted.

danmcd

comment created time in 2 days

Pull request review commentjoyent/smartos-live

RFD176 branch

 refresh_or_disable_pool() { 		err "Pool $pool is not bootable, and cannot be disabled or refreshed"  	if [[ "$flag" == "-d" ]]; then+		if [[ "$TRITON_HN" == "yes" ]]; then+			# NOTE: Disabling a Head Node's boot pool may+			# This might be where we call sdc-usbkey with+			# a forcing-flag to seek a stick!  Or at least to+			# scan for alternate bootable pools.

Needs fixing

danmcd

comment created time in 2 days

Pull request review commentjoyent/smartos-live

RFD176 branch

 fi  # Determine if we're running on a Triton Compute Node (CN) or not: bootparams | grep -E -q 'smartos=|headnode=' || initialize_as_CN+bootparams | grep -q 'smartos=' || initialize_as_HN

I think I'd reverse the logic here.

bootparams | grep -q 'headnode=' && initialize_as_HN

I feel better actively requiring headnode= rather than just looking for the absence of smartos=. It leaves it more flexible for adding different kinds of bootparams if we ever want to do that.

danmcd

comment created time in 2 days

Pull request review commentjoyent/smartos-live

RFD176 branch

 update_CN() { 	update_boot_sectors "$pool" "$bootfs" } +bringup_HN() {+	# One last reality check...+	if [[ "$pool" == "$TRITON_HN_BOOTPOOL" ]]; then+		err "Enabling pool we just booted from."+	fi++	# If we reach here, we've checked for the already-bootable+	# case, checked for the can-be-bootable case, and have a+	# $bootfs ready to go.  For the head node, we will be extra+	# cautious and remove all of its contents first.  NOTE: rm(1)+	# will complain because you'll get EBUSY for the mountpoint+	# itself.+	vecho "Cleaning up $bootfs"+	/bin/rm -rf /"$bootfs" >& /dev/null+	cd /"$bootfs"++	# Mount the Triton USB key (even if it's a virtual one...).+	stickmount=$(sdc-usbkey mount)+	vecho "Mounted USB key on $stickmount"++	# NOTE:  BAIL ON VERSION 1 STICKS FOR NOW+	version=$(sdc-usbkey status -j | json version)+	if [[ "$version" != "2" ]]; then+		# Unmount on version-mismatch...+		sdc-usbkey unmount+		err "USB key must be Version 2 (loader) to install on a pool."+	fi++	# Copy over the whole thing to ${bootfs}+	vecho "Copying over USB key contents to /$bootfs"+	tar -cf - -C "$stickmount" . | tar -xf - || \+		err "Problem copying USB key on $stickmount to /$bootfs"++	# Add both fstype="ufs" to loader.conf.+	vecho "Modifying loader.conf for pool-based Triton Head Node boot"+	grep -q 'fstype="ufs"' ./boot/loader.conf || \+		echo 'fstype="ufs"' >> ./boot/loader.conf+	# Also check triton_bootpool="${pool}" status.  We may be using a+	# "USB Key" that's actually another pool.+	if grep -q 'triton_bootpool=' ./boot/loader.conf; then+		# From another pool's bootfs.  Let's be cautious and use+		# a temp file instead of sed's -i or -I.+		tfile=$(mktemp)+		sed "s/triton_bootpool=.*/triton_bootpool=\"$pool\"/g" \+			< ./boot/loader.conf > $tfile+		mv -f $tfile ./boot/loader.conf+	else+		# From an actual USB key...+		echo "triton_bootpool=\"$pool\"" >> ./boot/loader.conf+	fi++	# (OPTIONAL) Add "from-pool" indicator to boot.4th.++	# 4.) Properly capitalize ${bootfs}/os/ entries.+	vecho "Case-correcting os/ entries."+	cd ./os+	for a in *; do+		mv $a $(tr '[a-z]' '[A-Z]' <<< $a)

You can do this:

mv "$a" "${a^^}"

But it's also ok as-is.

danmcd

comment created time in 2 days

Pull request review commentjoyent/smartos-live

RFD176 branch

 list() { 			# the pool. 			continue 		fi-		if [[ ! -L /$bootfs/platform ]]; then-			corrupt "WARNING: Bootable filesystem $bootfs" \-				"has non-symlink platform"-		fi 		cd "/$bootfs" || fatal "Could not chdir to /$bootfs" 		bootbitsstamp=$(cat etc/version/boot)-		bootstamp=$(cat platform/etc/version/platform)-		mapfile -t pis \-			< <(cd "/$bootfs" || exit; cat platform-*/etc/version/platform)+		if [[ "$TRITON_HN" != "yes" ]]; then+			if [[ ! -L /$bootfs/platform ]]; then

Even knowing what I was looking at, I just read this backward. Can we put a comment at the top of this indicating it's a normal CN to match the one on line 452? It's minor, and silly, and shouldn't be necessary, but it helps when you're skimming through things.

danmcd

comment created time in 2 days

more