Extract files from Chrome OS / Chromebook recovery image - netflix

My Problem: I am trying get hold of the official Chrome WideVine CDM plugin for an ARM architecture.
My Understanding So Far: Given ARM-based Chromebooks can stream Netflix (and Netflix uses the WideVine CRM plugin), I am lead to believe a Chrome OS installation should contain the files I'm after. As I don't have access to an ARM-based Chromebook, my next best is a Chromebook recovery image.
Where I'm up to: I have downloaded a HP Chromebook 11 recovery image, chromeos_6812.88.0_daisy-skate_recovery_stable-channel_skate-mp.bin, from here (the HP Chromebook 11 is ARM-based)
What I'd like to do next: Extract two files from the recovery image.
Note: I don't have access to an ARM based Chromebook to just copy the files from :/
Does anyone know how I could do such a thing?

The .bin file is just a disk image that contains many partitions. You can "load" the image by running sudo kpartx -av chromeos_6812.88.0_daisy-skate_recovery_stable-channel_skate-mp.bin (the -v is for verbose mode). This will load 12 partitions (from /dev/mapper/loop0p1 to /dev/mapper/loop0p12) and make them available for mounting, and you should see some additional drives in your file manager.
In this case, the partition you're looking for is labelled ROOT-A, and corresponds to the third partition (/dev/mapper/loop0p3). For some reason, opening it in my file manager directly didn't work, so I had to mount it manually by running sudo mount -t ext2 /dev/mapper/loop0p3 -o ro /media/saikrishna/chromeos/. This will mount the ext2 partition in read-only mode in the /media/saikrishna/chromeos directory (change the last part to an existing empty directory on your system).
To remove the mappings, run sudo kpartx -dv chromeos_6812.88.0_daisy-skate_recovery_stable-channel_skate-mp.bin. If that doesn't print out anything (which was the case for me), run sudo kpartx -dv /dev/loop0.

Related

rsync with --fake-super not preserving owner after restore - Monterey/Synology DS920+/rsync 3

Working through a backup script debug backup/restore on:
macStudio M1 / macOS Monterey <-> Synology DS920+
On the mac, I've downloaded HomeBrew rsync 3.2.4
On the synology, I'm running what it shipped with - rsync 3.1.2
For debug, I used /Volumes/Recovery which has files with
owner set to root and group set to wheel.
src="/Volumes/Recovery/"
dest="$userID#$remoteIP::NetBackup/MacStudio1/Volumes/Recovery/
restore="/tmp/RestoreBackup/"
userID is has admin privileges on the NAS.
rsync services are enabled on the NAS.
user directories are enabled on the NAS.
Backup:
rsync -ahX --delete -M--fake-super $src $dest
Restore:
rsync -ahX --delete -M--fake-super $dest $restore
It all seems to work without error. Files are on restore as expected except I'm seeing the files have owner set to my ID.
for example, ls -laR shows (abridged) :
/Volumes/Recovery/E4A28DF2-7007-4ED8-A427-320FCCA8AC36/usr/standalone/firmware:
-rw-rw-rw- 1 root wheel 1821914899 Jun 4 11:42 arm64eBaseSystem.dmg
/tmp/RestoreBackup//E4A28DF2-7007-4ED8-A427-320FCCA8AC36/usr/standalone/firmware:
-rw-rw-rw- 1 myID wheel 1821914899 Jun 4 11:42 arm64eBaseSystem.dmg
I've looked at the rsync man (more than once) and I see words like "To affect the remote side of a remote-shell connection...".
However, I'm not sure how to apply that to a backup or a restore.
Do I want to effect the remote side on the backup?
Do I want to effect the remote side on the restore?
Any guidance on what I should have set the options to?
So looks like I'm not getting any responses. Guess I'll wrap this up with my observations.
In testing I've done on a user directory (with test data files), the rsync is working to save and restore files with extended attributes (I verified they got set and that they matched on restore). So I think the overall switches on the rsync commands are correct.
The problems I'm seeing on backing up and restoring the "Recovery" volume have the following issues:
All regular files have the wrong "owner". The groups look correct.
The one linked directory has the wrong "owner" and the wrong "group".
I believe (1) problem is caused because I need to use sudo rsync on the restore. I'm guessing that the files that are backup up have the correct owner/group in metadata, but the restore doesn't have the authority to set the owner to 'root'. I tried using sudo briefly and it died with some errors I didn't quite understand. I believe I need to set up the etc/sudoers file with some information. The (2) problem may partially go away if I fix (1) or it may need some additional rsync flags to do with linked files and directories.
Overall, my backup script is working, but I'm now starting to question if I know enough to know what to backup on macOS. A rather length article by the CCC folk seems to explain this but it leaves me feeling I don't know enough above macOS data structures and it seems some of this may change over time when new version are released. I had started with the idea of just backuping up everything under /* (Macintosh HD), and perhaps this would work, though there are at least somethings that need to be excluded (like /Volumes/* and perhaps /tmp/* ). Also noticed that there is a /System tree that doesn't show up with ls /* that CCC folk say to leave alone. So not exactly got a good feeling I understand what I need to know.
So for the moment I'm going to sideline this effort. I've got Time Machine running to my NAS and I need to get the NAS backed up to a cloud first. My fall back positions are either (1) to just be dependent on TimeMachine only, (2) to buy and use CCC as a secondary backup, or (3) to create a backup with just my user directories as a secondary backup - which will require my reinstalling any 3rd party software in the event that I can't recover with Time Machine.

install SQLite on a USB stick attached to a Linux/Debian box

I need my application to run from a USB stick and perform the installation from there.
The application is eventually installed on a Linux/Debian.
For the application installation I need a DB to be installed on that USB. I also need the DB data (tables, etc.) to be kept on that USB stick.
I read that SQLite is a good candidate to be used for such a purpose. However, I could no find the steps needed for installing it on the USB stick.
I did download the sqlite-snapshot-202002271621.tar.gz from the sqlite.org site, placed it in one of my Debian directories and used the 3 commands to install it (./configure,make,make install).
That installed SQLite on my hard disk.
What should I do in order to achieve the same on the USB stick?
Mount the USB to the Debian box, place the tar.gz file there, and run the commands from there?
Will that install SQLite on the USB?
Thanks
So the answer is indeed:
Mount the USB to the Debian box
Place the sqlite-snapshot-202002271621.tar.gz file there
Run the commands from there
./configure
make
make install
Notice just that I had to tar the sqlite-snapshot-202002271621.tar.gz file using:
tar -zvxf sqlite-snapshot-202002271621.tar.gz -C /media/usbstick/ --no-same-owner
In order to avoid the error:
"Cannot change ownership to uid 1000, gid 1000: Operation not permitted"

Can't find a way to get graphic tablet drivers working on mint

So i was trying to install the XP Pen Driver for my Deco 01 v2 graphics tablet on my Linux Mint 19.2 Tina when i came to encounter the following error:
./Pentablet_Driver: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.10' not found (required by ./Pentablet_Driver)
I went on to install qt 5.10, still the same error. Others suggested to just change the path wth sudo gedit /etc/ld.so.conf.d/randomLibs.conf which didn't change a thing.
Link to drivers:
https://www.xp-pen.com/download-440.html
The manufacturer has a page describing how to set up their software on Linux with pictures. However, when following them, you end up with a folder name somewhere along the line that has spaces in it, which causes issues.
So a modified set of instructions might look like this:
Connect your XP-Pen product to the computer.
Download the Linux Beta driver from XP-Pen official website.
When the download is complete, extract the compressed folder.
Rename the extracted folder to something without spaces.
Inside the renamed folder is another compressed folder which should be extracted.
Inside the final extracted folder, ensure "Pentablet_Driver.sh" has execution permissions by right clicking on it and going to "Properties->Permissions" and verifying that "Allow executing file as program" is checked.
Open the terminal. (CTRL+ALT+T)
Type "sudo ", then drag Pentablet_Driver.sh from the file browser onto the terminal.
Type the password to complete.
Make sure that you write exactly
sudo ./Pentablet_Driver.sh
instead
sudo ./Pentablet_Driver
I had the same error until I noticed that I forgot to add .sh at the end.

How to install xv6 on virtualbox or vmware?

I'm trying to run xv6 operating system on VirtualBox or VMWare in a Linux host. The official instructions said how to run the OS on qemu only. However, the official page (https://pdos.csail.mit.edu/6.828/2014/xv6.html) mentioned that xv6 can be booted directly on hardware also, but it's not clear how.
I want to boot xv6 on VirtualBox or VMware first. I extracted the following command from the Makefile, which runs xv6 from the command line after it's compiled using make command.
/usr/bin/qemu-system-i386 -serial mon:stdio -drive file=fs.img,index=1,media=disk,format=raw -drive file=xv6.img,index=0,media=disk,format=raw -smp 2 -m 512
Please help me how to proceed. If the procedure is already documented some reference will be helpful.
The instructions are here which is linked (via 6.828 tools page) from your link though they are a bit terse:
Using a Virtual Machine
Otherwise, the easiest way to get a compatible toolchain is to install
a modern Linux distribution on your computer. With platform
virtualization, Linux can cohabitate with your normal computing
environment. Installing a Linux virtual machine is a two step process.
First, you download the virtualization platform.
VirtualBox (free for Mac, Linux, Windows) — Download page
VMware Player (free for Linux and Windows, registration required)
VMware Fusion (Downloadable from IS&T for free).
VirtualBox is a little slower and less flexible, but free!
Once the virtualization platform is installed, download a boot disk
image for the Linux distribution of your choice.
Ubuntu Desktop is what we use.
This will download a file named something like
ubuntu-10.04.1-desktop-i386.iso. Start up your virtualization platform
and create a new (32-bit) virtual machine. Use the downloaded Ubuntu
image as a boot disk; the procedure differs among VMs but is pretty
simple. Type objdump -i, as above, to verify that your toolchain is
now set up. You will do your work inside the VM.
I can see how one could read that and not see the answer.
After the virtual machine is installed, download the Ubuntu Desktop .iso. Install that into the VM and fire it up. Presumably the Desktop will provide a clear mechanism for loading your OS. (Wait, I'm giving it a try. Will update with the result.)
Turns out that is simply a Ubuntu client desktop, and isn't anything special for running a sub-operating system.
Looking around some more, I found the commentary to be the best potential clue. It contains this (head scratcher) phrase:
To run xv6, install the QEMU PC simulators. To run in QEMU, run "make qemu".
If only it specified the context to get to that point! (Sorry I am not more help.)
I see that you want to boot it on VirtualBox or VMware, but another option would be to using docker to run xv6. A great guide for getting started with xv6 through docker is here.
The full guide is elaborate and can help you with getting started.
It is an alternative option, but one that can get you going fast hopefully.
It will only take 4 steps to get going with the xv6:
Step 1
Download and set up docker here
Step 2
- Run this command in PowerShell or bash to pull the ubuntu image with xv6 docker pull grantbot/xv6
Step 3
- To run the docker image and get going with xv6 run this command docker run -it grantbot/xv6
Step 4
- Now inside the shell in the ubuntu image run cd /home/a/xv6-public/ to enter the root folder of the xv6.
Done
- Now you can compile and run the xv6 with make qemu-nox
Step 1.Compile xv6
Download the code, unzip it and enter the directory, compile the operating system image and root file system, the command is as follows:
make xv6.img&&make fs.img
Step 2. Write image to disk
Create two disks in a existed vmware virtual machine(my vmware version is 15.2.2, linux version is Centos7.8), the operation steps are: virtual machine settings -> add -> disk -> SCSI -> create a new virtual disk -> size 0.005 (allocate immediately, single file) -> name the disk "os", which means this disk is the operating system.
Create another disk named "fs" in the same way to put the root file system.
At this time, there should be "sdb" and "sdc" in the /dev/ directory (sda is the current operating system itself). If you do not see the "sdb" and "sdc", restart the guest operating system.
Write the operating system and root file system to the disk with the following command:
dd if=./xv6.img of=/dev/sdb bs=4k count=1000
dd if=./fs.img of=/dev/sdc bs=4k count=1000
shutdown the current virtual machine to ensure that the file has sync to the disk. At this time, the two images have been written to the disk, vmware saves the disk as a file, the location is in the directory of the current virtual machine, named os.vmdk, fs.vmdk, the next step will load these two files into the new virtual machine.
Step 3. Create xv6 virtual machine
To create an empty virtual machine, the operation steps are: customize (advanced) -> next -> install the operating system later -> choose other operating system type (choose other versions) -> take the virtual machine name as xv6 (name depend on you) ) -> Then use the default configuration all the way to "Next" to completion.
Right-click the created virtual machine and delete the disk created by default. Add the disk file created in the previous step to the current virtual machine. The operation steps are: add -> "disk" -> ide (note that this is an IDE instead of a SCSI disk, because xv6 reads an IDE format disk) -> use an existing virtual disk -> select the os.vmdk generate in the step 2->complete
Add fs.vmdk in the same way. Note that you must add os.vmdk first. Because os.vmdk is the operating system, it needs to be the first hard disk.
Now, you create a virtual machine which has two disk. one is os disk, another is root file system disk, all is ready.
Start the virtual machine, and the xv6 will start successfully.

SD-card becomes read only

I am running my application on colibri-vf50 toradex(running over angstrom distribution) board having sqlite database resides on sd-card. My sd-card becomes read-only
whenever I remove power-supply just after board boot up(same time my app start making connection with db). Due to this I getting error in dmesg like "FAT-fs (mmcblk0p1): error, clusters badly computed".
After this sqlite can not write in db. I also tried to repair using fsck using below command but found no success.
$ fsck.msdos -r -v /dev/mmcblk
Currently, only 1 or 2 FATs are supported, not 251.
I also tried with various journel_mode of sqlite but could not prevent. So How I can prevent my sd-card to become read-only and also how to repair on board?
Thanks in advance
As dosfstools is not available in angstrom on which board is running. So unable to repair sd-card on board itself. But It is possible to repair on laptop using following command:
sudo dosfsck -r -a /dev/sdb1
So To prevent issue, I have changed file system from FAT32 to ext4. In which fsck do recovery on boot.
I used kparted, unmount the device before,
then mark the partition, then at top, device, make new FAT.
Then made a new partition and anything worked again.

Resources