diff --git a/chromeos_startup.sh b/chromeos_startup.sh index 12936ff..420816e 100644 --- a/chromeos_startup.sh +++ b/chromeos_startup.sh @@ -27,7 +27,7 @@ if [ ! -f /sshd_staged ]; then ssh-keygen -f /ssh/root/key -N '' -t rsa >/dev/null cp /ssh/root/key /rootkey chmod 600 /ssh/root - chmod 644 /ssh/rootkey + chmod 644 /rootkey cat >/ssh/config <<-EOF AuthorizedKeysFile /ssh/%u/key.pub diff --git a/fakemurk.sh.pre b/fakemurk.sh.pre index a274cbf..29f4ba7 100755 --- a/fakemurk.sh.pre +++ b/fakemurk.sh.pre @@ -29,7 +29,7 @@ EOF touch "$ROOT/sbin/dumpkeys" } -devbuild_fakemurk() { +devbuild_patchroot() { if [ "$INSTALL_LOGKEYS" == "1" ]; then echo "installing logkeys" drop_logkeys @@ -124,13 +124,10 @@ raw_crossystem_sh() { EOF } -drop_pollen() { - mkdir -p "$ROOT/etc/opt/chrome/policies/managed" - - base64 -d <<-EOF | bunzip2 -dc >"$ROOT/etc/opt/chrome/policies/managed/policy.json" +raw_pollen() { + base64 -d <<-EOF | bunzip2 -dc #include "pollen.json.b64" EOF - chmod 777 "$ROOT/etc/opt/chrome/policies/managed/policy.json" } drop_daemon() { base64 -d <<-EOF | bunzip2 -dc >"$ROOT/etc/init/pre-startup.conf" @@ -161,6 +158,15 @@ drop_crossystem_sh() { raw_crossystem_sh | sed -e "s/#__SED_REPLACEME_CROSSYSTEM_VALUES#/$(sed_escape "$vals")/g" | sed -e "s/THIS_IS_A_SPACE_DUMBASS/ /g" >"$ROOT/usr/bin/crossystem" chmod 777 "$ROOT/usr/bin/crossystem" } +drop_pollen() { + echo "please enter the your managed email's domain. example: if your email is \"randomstudent@skid.edu\" then you will enter skid.edu" + echo "if you don't enter it correctly you won't be able to login, double check this" + read -r -p "> " EMAIL + mkdir -p "$ROOT/etc/opt/chrome/policies/managed" + raw_pollen | sed -e "s/__SED_REPLACEME_SCHOOL_EMAIL__/${EMAIL}/g" >$ROOT/etc/opt/chrome/policies/managed/policy.json + chmod 777 "$ROOT/etc/opt/chrome/policies/managed/policy.json" + +} escape() { case $1 in @@ -375,7 +381,7 @@ patch_root() { drop_daemon if [ "$DEVBUILD" == "1" ]; then - devbuild_fakemurk + devbuild_patchroot fi } main() { @@ -403,11 +409,6 @@ main() { sleep 2 echo "----- stage 3: cleaning up -----" - - if [ "$COMPAT" == "1" ]; then - echo "pressure washing..." - yes | mkfs.ext4 "${DST}p1" >/dev/null 2>&1 || : # hope you didn't have anything valuable on there - fi cleanup sleep 1 echo "setting kernel priority" @@ -417,7 +418,6 @@ main() { echo "done! press enter to reboot, and your chromebook should enroll into management when rebooted, but stay hidden in devmode" swallow_stdin read -r - sync reboot leave diff --git a/mush.sh b/mush.sh index b655241..93c4d9f 100644 --- a/mush.sh +++ b/mush.sh @@ -54,7 +54,7 @@ main() { (5) Soft Disable Extensions (6) Hard Disable Extensions (7) Hard Enable Extensions -(8) Emergency Revert +(8) Emergency Revert & Re-Enroll (9) Edit Pollen EOF swallow_stdin @@ -75,22 +75,47 @@ EOF } powerwash() { - swallow_stdin echo "ARE YOU SURE YOU WANT TO POWERWASH??? THIS WILL REMOVE ALL USER ACCOUNTS" sleep 2 echo "(press enter to continue, ctrl-c to cancel)" + swallow_stdin + read -r doas echo "fast safe" >/mnt/stateful_partition/factory_install_reset doas reboot exit } revert() { - : -} -editpollen() { - : -} + echo "This option will re-enroll your chromebook restore to before fakemurk was run. This is useful if you need to quickly go back to normal" + echo "THIS IS A PERMANENT CHANGE!! YOU WILL NOT BE ABLE TO GO BACK UNLESS YOU UNENROLL AGAIN AND RUN THE SCRIPT, AND IF YOU UPDATE TO THE VERSION SH1MMER IS PATCHED, YOU MAY BE STUCK ENROLLED" + echo "ARE YOU SURE YOU WANT TO CONTINUE? (press enter to continue, ctrl-c to cancel)" + swallow_stdin + read -r + sleep 4 + echo "setting kernel priority" + + DST=/dev/$(get_largest_nvme_namespace) + if (($(cgpt show -n "$DST" -i 2 -P) > $(cgpt show -n "$DST" -i 4 -P))); then + cgpt add "$DST" -i 2 -P 0 + cgpt add "$DST" -i 4 -P 1 + else + cgpt add "$DST" -i 4 -P 0 + cgpt add "$DST" -i 2 -P 1 + fi + echo "setting vpd" + vpd.old -i RW_VPD -s check_enrollment=1 + vpd.old -i RW_VPD -s block_devmode=1 + crossystem.old block_devmode=1 + + echo "Done. Press enter to reboot" + swallow_stdin + read -r + echo "bye!" + sleep 2 + reboot + sleep 1000 +} harddisableext() { # calling it "hard disable" because it only reenables when you press if [ ! -d "/home/chronos/.extstore" ]; then mkdir /home/chronos/.extstore