dnschneid / crouton

Chromium OS Universal Chroot Environment
https://goo.gl/fd3zc?si=1
BSD 3-Clause "New" or "Revised" License
8.56k stars 1.24k forks source link

Unable to open /tmp file on bootstrap download #4864

Closed j4m35700 closed 1 year ago

j4m35700 commented 1 year ago
Please paste the output of the following command here: sudo edit-chroot -all

command not found

Please describe your issue:

sudo crouton -d -f /media/removable/Cruzer128/X/Linux/xenial -r xenial Downloading xenial-amd64 bootstrap to /media/removable/Cruzer128/X/Linux/xenial Downloading bootstrap files... /tmp/crouton-installer-cache/crouton: 95: /tmp/crouton-installer-cache/crouton.ZQ2/installer/ubuntu/bootstrap: /tmp/crouton.5by/debootstrap: Permission denied debootstrap error log: tail: cannot open '/tmp/crouton.5by/xenial-amd64/debootstrap/debootstrap.log' for reading: No such file or directory

If known, describe the steps to reproduce the issue:

sudo crouton -d -f /media/removable/Cruzer128/X/Linux/xenial -r xenial

TomTravis commented 1 year ago

update to the latest version of crouton fixes non-exec mount Permission denied

j4m35700 commented 1 year ago

update to the latest version of crouton fixes non-exec mount Permission denied

This is confusing advice to me. Every time you run crouton, it downloads the most recent installer. Nevertheless, I deleted the current executable, then downloaded it from github, installed it according to instructions, and got the same results as before.

TomTravis commented 1 year ago

sudo mount -o remount,symfollow -o exec /tmp will change the status of the mount to exec

TomTravis commented 1 year ago

google is mounting all drive noexec this is the issue the instructions are not current

j4m35700 commented 1 year ago

sudo mount -o remount,symfollow -o exec /tmp will change the status of the mount to exec

It's still not working. I've read other reports on Reddit who also tried the remount who said it didn't work.

I'm not trying to be argumentative, and I appreciate your feedback. I just want to help solve this.

-=-=-=-=-=-=-

sudo mount -o remount,symfollow -o exec /tmp chronos@localhost / $ sudo crouton -d -f /media/removable/Cruzer128/X/Linux/xenial -r xenial Downloading xenial-amd64 bootstrap to /media/removable/Cruzer128/X/Linux/xenial Downloading bootstrap files... /tmp/crouton-installer-cache/crouton: 95: /tmp/crouton-installer-cache/crouton.7Eh/installer/ubuntu/bootstrap: /tmp/crouton.6s3/debootstrap: Permission denied debootstrap error log: tail: cannot open '/tmp/crouton.6s3/xenial-amd64/debootstrap/debootstrap.log' for reading: No such file or directory Failed to run debootstrap.

TomTravis commented 1 year ago

sudo mount -o remount,symfollow -o exec /media/removable/sd200 chronos@localhost / $ your will be sudo mount -o remount,symfollow -o exec /media/removable/Cruzer128/X/Linux/xenial my install are different also

sudo bpfix -p /media/removable/sd200/ -r kali-rolling -t xiwi -n kr -p is the install path not -f sudo crouton -d -f /media/removable/Cruzer128/X/Linux/xenial -r xenial Available targets: audio Support audio playback via Chromium OS's audio system. Requires: core chrome Google Chrome browser, stable channel. Requires: x11 chrome-beta Google Chrome browser, beta channel. Requires: x11 chrome-dev Google Chrome browser, dev channel. Requires: x11 chromium Chromium browser. Uses the distro's version, which may be old. Requires: x11 cli-extra Basic CLI tools such as ssh. Requires: core core Performs core system configuration. Most users would want this. e17 Installs the enlightenment desktop environment. (Approx. 50MB) Requires: gtk-extra extension Clipboard synchronization and URL handling with Chromium OS. Requires: x11 gnome Installs the GNOME desktop environment. (Approx. 400MB) Requires: gtk-extra gnome-desktop Installs GNOME along with common applications. (Approx. 1100MB) Requires: gnome gtk-extra GTK-based tools including gdebi and a simple browser. Requires: x11 kde Installs a minimal KDE desktop environment. (Approx. 600MB) Requires: x11 kde-desktop Installs KDE along with common applications. (Approx. 1000MB) Requires: kde keyboard Adds support for Chromebook keyboard special keys. Requires: x11 kodi Installs the KODI media player. (Approx. 200MB) Requires: x11 lxde Installs the LXDE desktop environment. (Approx. 200MB) Requires: gtk-extra lxde-desktop Installs LXDE along with common applications. (Approx. 800MB) Requires: lxde touch Touchscreen and limited generic gesture support. Requires: x11 unity Installs the Unity desktop environment. (Approx. 700MB) Requires: gtk-extra unity-desktop Installs Unity along with common applications. (Approx. 1100MB) Requires: unity x11 X11 via autodetected backend. Does not install any desktop environment. xfce Installs the Xfce desktop environment. (Approx. 250MB) Requires: gtk-extra xfce-desktop Installs Xfce along with common applications. (Approx. 1200MB) Requires: xfce xiwi X.org X11 backend running unaccelerated in a Chromium OS window. Requires: audio extension xorg X.Org X11 backend. Enables GPU acceleration on supported platforms. Requires: audio chronos@localhost / $ you have no targets also it look now like the install cmd is not correct

TomTravis commented 1 year ago

your -d -f -r cmds donot install a chroot No such file or directory Failed to run debootstrap. this is a no file found message not permissions the -d and -f command together make sense to you please explain

-d is a bootstrap of a tarball -d Downloads the bootstrap tarball but does not prepare the chroot. -f is a -f TARBALL The bootstrap or backup tarball to use, or to download to (-d). When using an existing tarball, -a and -r are ignored.

sudo crouton -p install path -r release -t target -p PREFIX The root directory in which to install the bin and chroot subdirectories and data.

Constructs a chroot for running a more standard userspace alongside Chromium OS.

If run with -f, where the tarball is a backup previously made using edit-chroot, the chroot is restored and relevant scripts installed.

If run with -d, a bootstrap tarball is created to speed up chroot creation in the future. You can use bootstrap tarballs generated this way by passing them to -f the next time you create a chroot with the same architecture and release.

bpfix must be run as root unless -d is specified AND fakeroot is installed AND /tmp is mounted exec and dev.

It is highly recommended to run this from a crosh shell (Ctrl+Alt+T), not VT2.

Options: -a ARCH The architecture to prepare a new chroot or bootstrap for. Default: autodetected for the current chroot or system. -b Restore crouton scripts in PREFIX/bin, as required by the chroots currently installed in PREFIX/chroots. -d Downloads the bootstrap tarball but does not prepare the chroot. -e Encrypt the chroot with ecryptfs using a passphrase. If specified twice, prompt to change the encryption passphrase. -f TARBALL The bootstrap or backup tarball to use, or to download to (-d). When using an existing tarball, -a and -r are ignored. -k KEYFILE File or directory to store the (encrypted) encryption keys in. If unspecified, the keys will be stored in the chroot if doing a first encryption, or auto-detected on existing chroots. -m MIRROR Mirror to use for bootstrapping and package installation. Default depends on the release chosen. Can only be specified during chroot creation and forced updates (-u -u). After installation, the mirror can be modified using the distribution's recommended way. -M MIRROR2 A secondary mirror, often used for security updates. Can only be specified alongside -m. -n NAME Name of the chroot. Default is the release name. Cannot contain any slash (/). -p PREFIX The root directory in which to install the bin and chroot subdirectories and data. Default: /usr/local, with /usr/local/chroots linked to /mnt/stateful_partition/crouton/chroots. -P PROXY Set an HTTP proxy for the chroot; effectively sets http_proxy. Specify an empty string to remove a proxy when updating. -r RELEASE Name of the distribution release. Default: xenial, or auto-detected if upgrading a chroot and -n is specified. Specify 'help' or 'list' to print out recognized releases. -t TARGETS Comma-separated list of environment targets to install. Specify 'help' or 'list' to print out potential targets. -T TARGETFILE Path to a custom target definition file that gets applied to the chroot as if it were a target in the bpfix bundle. -u If the chroot exists, runs the preparation step again. You can use this to install new targets or update old ones. Passing this parameter twice will force an update even if the specified release does not match the one already installed. -V Prints the version of the installer to stdout.

Be aware that dev mode is inherently insecure, even if you have a strong password in your chroot! Anyone can simply switch VTs and gain root access unless you've permanently assigned a Chromium OS root password. Encrypted chroots require you to set a Chromium OS root password, but are still only as secure as the passphrases you assign to them.

j4m35700 commented 1 year ago

I'm being misunderstood. I'm not trying to install a tarball, I'm trying to download one and save it to external USB. I'm also not trying to install crouton to an external USB. My chroots will be located at

/mnt/stateful_partition/crouton/chroots/

So, forget about the tarball. Let's just do a "normal" install. It still doesn't work. I'm pretty experienced with crouton. Thanks for the feedback. Here's what I'm getting:

sudo mount -o remount,symfollow -o exec /tmp chronos@localhost / $ sudo crouton -r xenial -t core,audio,cli-extra Downloading latest crouton installer... ############################################################################################# 100.0% WARNING: USB booting is enabled; consider disabling it. WARNING: Legacy booting is enabled; consider disabling it. WARNING: Signed boot verification is disabled; consider enabling it. You can use the following command: sudo crossystem dev_boot_usb=0 dev_boot_altfw=0 dev_boot_signed_only=1 Installing xenial-amd64 chroot to /usr/local/chroots/xenial Downloading bootstrap files... /tmp/crouton-installer-cache/crouton: 95: /tmp/crouton-installer-cache/crouton.L2N/installer/ubuntu/bootstrap: /tmp/crouton.SK9/debootstrap: Permission denied debootstrap error log: tail: cannot open '/tmp/crouton.SK9/xenial-amd64/debootstrap/debootstrap.log' for reading: No such file or directory Failed to run debootstrap.

TomTravis commented 1 year ago

yes something is happening you have the device mounted exec correct the flag -d -f are in conflict -r is ignored the warning are just that warning you want this just as it is

for the install the /tmp dir is not exec this is the message tmp/crouton-installer-cache/crouton: 95: /tmp/crouton-installer-cache/crouton.L2N/installer/ubuntu/bootstrap: /tmp/crouton.SK9/debootstrap: Permission denied then the installer debootstrap quit no file in /tmp tail: cannot open '/tmp/crouton.SK9/xenial-amd64/debootstrap/debootstrap.log' for reading: No such file or directory Failed to run debootstrap.

if your tar file exist you should be able to see it using chromeOS file manager -d and -f are in conflict

j4m35700 commented 1 year ago

In my last attempt, I didn't use a tarball. I installed directly from crouton:

sudo crouton -r xenial -t core,audio,cli-extra

As I said, it still doesn't work. I have nothing further to add.

TomTravis commented 1 year ago

crosh> shell chronos@localhost / $ sudo mount -o remount,symfollow -o exec /tmp Password: chronos@localhost / $ sudo mount -o remount,symfollow -o exec /media/removable/sd200 chronos@localhost / $ sudo bpfix -p /media/removable/sd200/ -r kali-rolling -t xiwi -n kr1
Installing kali-rolling-arm64 chroot to /media/removable/sd200/chroots/kr1 Downloading bootstrap files... W: Cannot check Release signature; keyring file not available /usr/share/keyrings/kali-archive-keyring.gpg I: Retrieving InRelease I: Retrieving Packages ^CE: Interrupt caught ... exiting chronos@localhost / $ ^C chronos@localhost / $ it is working here so the log bpfix is my fork

TomTravis commented 1 year ago

Installing xenial-amd64 chroot to /usr/local/chroots/xenial this cannot happen

j4m35700 commented 1 year ago

Installing xenial-amd64 chroot to /usr/local/chroots/xenial this cannot happen

/usr/local/chroots is nothing more than a symbolic link to /mnt/stateful_partition/crouton/chroots/ and yes, it can happen and does happen, I've don't it hundreds of times. But right now it's not working.

TomTravis commented 1 year ago

yes virtual dev,( mnt) the log is cut paste edit . The script has never show this, usr.local install for a OS the file system is in memory so the device is a location in memory. You know how to capture crosh shell history so create a file and show us?

i have seen the log before so please show the log file from crosh
if the device is not built yet .mnt Then the script will not install

you have a bootstrap error really ? tar file error

TomTravis commented 1 year ago

here is my file system I see loop devices_ crosh> shell Screenshot 2022-11-04 10 00 15 PM

chronos@localhost / $

TomTravis commented 1 year ago

Screenshot from 2022-11-04 22-17-59 kali is doing fine

j4m35700 commented 1 year ago

You gave me a great idea: simplify. I disconnected all my external devices and tried again. Here is my file system:

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT loop0 7:0 0 44K 1 loop /run/chromeos-config/private loop1 7:1 0 7.3G 0 loop -encstateful 254:1 0 7.3G 0 dm /mnt/stateful_partition/encrypted loop2 7:2 0 444.2M 1 loop /opt/google/containers/android/rootfs/root loop3 7:3 0 4K 1 loop /opt/google/containers/arc-sdcard/mountpoints/container-root loop4 7:4 0 4K 1 loop /opt/google/containers/arc-obb-mounter/mountpoints/container loop5 7:5 0 97.3M 1 loop /usr/share/chromeos-assets/speech_synthesis/patts loop6 7:6 0 9.2M 1 loop /usr/share/chromeos-assets/quickoffice/_platform_specific loop7 7:7 0 2.2M 1 loop /usr/share/cros-camera/libfs mmcblk1 179:0 0 29.1G 0 disk |-mmcblk1p1 179:1 0 25G 0 part /mnt/stateful_partition |-mmcblk1p2 179:2 0 16M 0 part |-mmcblk1p3 179:3 0 2G 0 part |-mmcblk1p4 179:4 0 16M 0 part |-mmcblk1p5 179:5 0 2G 0 part |-mmcblk1p6 179:6 0 512B 0 part |-mmcblk1p7 179:7 0 512B 0 part |-mmcblk1p8 179:8 0 16M 0 part /usr/share/oem |-mmcblk1p9 179:9 0 512B 0 part |-mmcblk1p10 179:10 0 512B 0 part |-mmcblk1p11 179:11 0 8M 0 part -mmcblk1p12 179:12 0 32M 0 part mmcblk1boot0 179:16 0 4M 1 disk mmcblk1boot1 179:32 0 4M 1 disk zram0 253:0 0 5.5G 0 disk [SWAP]

Just what comes with the Chromebook. It still doesn't work.

j4m35700 commented 1 year ago

How do I find the log you're asking me for? What is bpfix? You mentioned a fork...

TomTravis commented 1 year ago

yes bpfix is my update to crouton my fork is a copy or the crouton repo im making a tar file now local sudo tar -czf /media/removable/sd200/kr.tar.gz ./kr you have a invite to the project systemD in chroot i sent it maybe 1hr ago https://chromium.googlesource.com/chromiumos/platform2/+/HEAD/crosh/README.md the install can be captured via sudo crouton or bpfix.... |tee > ~/Downloads/cap.txt the cap.txt file will show the install log

TomTravis commented 1 year ago

tar file was created new dir made restored and booted was kr now kr1 no problems

chronos@localhost //media/removable/sd200/z/chroots $ sudo mount -o remount,symfollow -o exec /tmp chronos@localhost //media/removable/sd200/z/chroots $ sudo mount -o remount,symfollow -o exec /media/removable/sd200 chronos@localhost //media/removable/sd200/z/chroots $ sudo enter-chroot -c /media/removable/sd200/z/chroots/ -n kr1 Entering /media/removable/sd200/z/chroots/kr1... dbus[15147]: Unknown username "systemd-timesync" in message bus configuration file dbus[15147]: Unknown username "systemd-oom" in message bus configuration file dbus[15147]: Unknown username "systemd-resolve" in message bus configuration file (kr1)z@localhost:~$

Screenshot 2022-11-05 9 59 51 AM crochshell.txt

create tar, restore tar on sdcard 200gb work just fine

TomTravis commented 1 year ago

bpfix https://drive.google.com/uc?export=download&id=1YJ3bHWQRfhMrUMn66a2uUuZYDuSr7B7Q get a sdcard much faster then USB please show the status of /mnt/stateful_partition |-mmcblk1 179:0 0 29.1G 0 disk |-mmcblk1p1 179:1 0 25G 0 part /mnt/stateful_partition |-mmcblk1p2 179:2 0 16M 0 part |-mmcblk1p3 179:3 0 2G 0 part |-mmcblk1p4 179:4 0 16M 0 part |-mmcblk1p5 179:5 0 2G 0 part |-mmcblk1p6 179:6 0 512B 0 part |-mmcblk1p7 179:7 0 512B 0 part |-mmcblk1p8 179:8 0 16M 0 part /usr/share/oem |-mmcblk1p9 179:9 0 512B 0 part |-mmcblk1p10 179:10 0 512B 0 part |-mmcblk1p11 179:11 0 8M 0 part -mmcblk1p12 179:12 0 32M 0 part |-mmcblk1boot0 179:16 0 4M 1 disk |-mmcblk1boot1 179:32 0 4M 1 disk |-zram0 253:0 0 5.5G 0 disk [SWAP]

j4m35700 commented 1 year ago

I hate to sound like a retard, but I'm not quite sure how to execute bpfix. It's supposed to unarchive itself, right? Do I need to put my removable storage back in place, and extract to there?

Using sudo sh ~/Downloads/bpfix gives me the usual Refusing to exec /home/chronos/user/Downloads/bpfix from noexec mount. I tried to remount the ~/Downloads directory, but this didn't work.

Thank you, Tom. My name is James

TomTravis commented 1 year ago

if the same as crouton just rename same deal down load and install or sudo cp ~/Downloads/bpfix /usr/local/bin/ chmod 755 /usr/local/bin/bpfix sudo bpfix -p -r -t -n

the lsblk -f |tee ~/Downloads/dd.txt is attached dd.txt chronos@localhost / $ lsblk -f |tee ~/Downloads/dd.txt

TomTravis commented 1 year ago

if you using a guest account on the CB this can cause permission issues the exec mount are no that difficult to do something is not correct maybe powerwash the CB and start over

j4m35700 commented 1 year ago

First, I power washed my Chromebook.

Next, I downloaded bpfix (Blood Pressure Fix? hahaha), renamed it to crouton, and executed:

sudo install -Dt /usr/local/bin -m 755 ~/Downloads/crouton

and then this is what happened:

sudo crouton -r xenial -t core /usr/local/bin/crouton: 99: .: Refusing to exec /tmp/crouton.n1E/installer/main.sh from noexec mount; see https://chromium.googlesource.com/chromiumos/docs/+/master/security/noexec_shell_scripts.md

I need to give this a rest. Thanks, I've learned a lot. With your permission, I'll close out this issue.

TomTravis commented 1 year ago

yes the chrome book need to be in developer mode which likely is is not if you in shell you are in dev mode search developer mode on your device so you mounts are still not exec you need to issue the command every time the device boot this is every time the device power cycles sudo mount -o remount,symfollow -o exec /tmp sudo mount -o remount,symfollow -o exec /whatever***

bp is i cannot remember backports BP for new develpment from 2016 this was deleted load focal or kali-rolling

TomTravis commented 1 year ago

please join the systemd team we really need people learning this linux chroot chromebook fun stuff you have a invite and the same task startup bootstrap

j4m35700 commented 1 year ago

Ai yi yi --- yeah, I didn't remount /tmp. However, remounting /tmp did not help.

Your bpfix works just like crouton. This is all very strange. We never had to remount /tmp before.

I'll consider your invitation. Thank you!

TomTravis commented 1 year ago

you have to exec every power cycle google did this new OS updates this is /tmp rwx everyone chronos@localhost / $ ls -la tmp total 244 drwxrwxrwt. 10 root root 1000 Nov 5 12:52 . drwxr-xr-x. 19 root root 36864 Oct 14 00:18 .. please post you tmp log ls -la / tmp

you can have root privs all the time if needed sudo passwd root this sets up the root acc to login via su cmd su is super user with low blood pressue

j4m35700 commented 1 year ago

For practical reasons, I am closing out this issue. It has not yet been solved, AFAIC.

The Chromebook is a tinkerer's delight! I've had more fun on a computer than ever before. Crouton has been part of this. But occasionally, I actually want to get something accomplished, and having Crouton break several times a year is a drag.

Many thanks to dschneider (sp?), drinkcat, TomTravis, and others who have contributed.

j4m35700 commented 1 year ago

Bye ya'll

TomTravis commented 1 year ago

join chroot systemd project more fun they ever protobuf now go lang

TomTravis commented 1 year ago

https://github.com/dnschneid/crouton/issues/4884 Screenshot 2022-11-17 7 17 16 PM Screenshot 2022-11-17 7 27 59 PM