Skip to content

Commit

Permalink
modify js inteerface and add transw command
Browse files Browse the repository at this point in the history
  • Loading branch information
puutaro committed Nov 6, 2023
1 parent e7a26cb commit 713e513
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 14 deletions.
34 changes: 25 additions & 9 deletions app/src/main/assets/ubuntu_setup/support/setup_rootfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,37 @@
# It is assumed that you are root user.
# sudo -su -

export backup_dir_path="${APP_ROOT_PATH}/backup" \
export backup_dir_path="${APP_ROOT_PATH}/ubuntu/backup/temp" \
;export rootfsTarGz="rootfs.tar.gz" \
; cd / \
; sudo apt-get purge \
; apt-get purge \
--auto-remove -y sudo \
; tar -cvpzf ${rootfsTarGz} \
--exclude=/${rootfsTarGz} \
--exclude=/storage \
;mkdir -p "${backup_dir_path}" \
;tar \
-cvpzf "${backup_dir_path}/${rootfsTarGz}" \
--exclude=/sys \
--exclude=/dev \
--exclude=/proc \
--exclude=/data \
--exclude=/mnt \
--exclude=/host-rootfs \
--exclude=/support \
--exclude=/etc/mtab \
--exclude=/storage \
--exclude=/etc/profile.d/userland_profile.sh \
--one-file-system \
/ \
; mkdir -p "${backup_dir_path}" \
; cp -vf ${rootfsTarGz} \
"${backup_dir_path}/"
/
# \
# ; mkdir -p "${backup_dir_path}" \
# ; cp -vf ${rootfsTarGz} \
# "${backup_dir_path}/"

# tar -cvpzf ${rootfsTarGz} \
# --exclude=/${rootfsTarGz} \
# --exclude=/storage \
# --exclude=/host-rootfs \
# --one-file-system \
# /

# export rootfsTarGz="rootfs.tar.gz" \
# ; cd / \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,23 @@ class JsUbuntu(
private val cmdTerminalUrl = "http://127.0.0.1:${UsePort.WEB_SSH_TERM_PORT}"

@JavascriptInterface
fun execScript(
fun execScript(
executeShellPath:String,
tabSepaArgs: String = String(),
): String {
return execScriptF(
executeShellPath,
tabSepaArgs,
2000,
)
}


@JavascriptInterface
fun execScriptF(
executeShellPath:String,
tabSepaArgs: String = String(),
timeMilisec: Int,
): String {
if (
context == null
Expand All @@ -50,7 +64,7 @@ class JsUbuntu(
return Shell2Http.runCmd(
executeShellPath,
tabSepaArgs,
2000,
timeMilisec,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ import com.puutaro.commandclick.BuildConfig
object UbuntuInfo {
val user = "cmdclick"

private const val devFalseInRelease = false
private val createImageSwitchOffInRelease = CreateImageSwitch.off.name
private val buildConfigDebug = BuildConfig.DEBUG

// for development
private const val devFalseInRelease = false
val onForDev = if(
buildConfigDebug
) false
else devFalseInRelease

private val createImageSwitchOffInRelease = CreateImageSwitch.off.name
val createImageSwitch = if(
buildConfigDebug
) CreateImageSwitch.off.name
Expand All @@ -32,7 +32,7 @@ object UbuntuInfo {
-> "https://partner-images.canonical.com/core/jammy/" +
"current/ubuntu-jammy-core-cloudimg-arm64-root.tar.gz"
else
-> "https://github.com/puutaro/CommandClick-Linux/releases/download/v1.1.1/rootfs.tar.gz"
-> "https://github.com/puutaro/CommandClick-Linux/releases/download/v1.1.2/rootfs.tar.gz"
}
}

Expand Down

0 comments on commit 713e513

Please sign in to comment.