Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Compatibility with ubase #5

Closed
wants to merge 3 commits into from
Closed

Conversation

a-schaefers
Copy link
Contributor

@a-schaefers a-schaefers commented Jan 8, 2020

Here is what I had to do to make ubase compatible busybox. If we are interested in being able to swap ubase/sbase/etc. for busybox some day, this is how I did in our init scripts.

Note: I'm not saying ubase is the be all end all or that is should have the last say about anything.

Not sure if this should be merged or not. But init works for me when using these changes.

@@ -117,7 +117,7 @@ main() {
}

log "Mounting all local filesystems..."; {
mount -at nosysfs,nonfs,nonfs4,nosmbfs,nocifs -O no_netdev ||
mount -a ||
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be fine. 👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message above should be changed to Mounting all filesystems... as the removal of these flags will cause mount to attempt to mount network partitions. I've never actually seen this use-case so we should be fine here.

@@ -16,20 +16,18 @@ main() {
dd count=1 bs=512 if=/dev/random of=/var/random.seed
}

halt -w
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

halt tells the system to cease all CPU activity though I'm unsure if it is needed as we send TERM regardless. I'm also fine with this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ubase halt only has -p and -r switches

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine to remove regardless as we only used halt to write the wtmp record.

-> halt --help
BusyBox v1.31.1 (2019-10-25 20:52:45 EEST) multi-call binary.

Usage: halt [-d DELAY] [-n] [-f] [-w]

Halt the system

        -d SEC  Delay interval
        -n      Do not sync
        -f      Force (don't go through init)
        -w      Only write a wtmp record

We really "halt" the machine ourselves below.

}

log "Unmounting filesystems and disabling swap..."; {
swapoff -a
umount -rat nosysfs,noproc,nodevtmpfs,notmpfs
umount -a
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine.

Comment on lines 20 to 25
killall5 TERM
sleep 1
}

log "Sending KILL signal to all processes..."; {
killall5 -KILL
killall5 KILL
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does killall5 work without - in busybox as well. Might need to investigate here.

Copy link
Contributor Author

@a-schaefers a-schaefers Jan 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure. I'm a little busy atm.

@dylanaraps dylanaraps closed this in e5d15a1 Jan 8, 2020
@a-schaefers a-schaefers changed the title Compatibility with ubase? Compatibility with ubase Mar 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants