This repository has been archived by the owner on Apr 17, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add command to install to internal storage and fix user not being added
- Loading branch information
1 parent
156ba96
commit b131f5f
Showing
4 changed files
with
48 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,5 @@ disable=SC2046 | |
disable=SC2164 | ||
disable=SC2103 | ||
disable=SC1091 | ||
disable=SC2155 | ||
disable=SC2155 | ||
disable=SC2002 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
|
||
echo "What drive would you like to install to? (e.g. /dev/mmcblk0)" | ||
read -r USB | ||
export USB | ||
|
||
# Format the USB with GPT | ||
sudo parted $USB mklabel gpt | ||
echo "Writing sotrage, will take a few minutes" | ||
sync | ||
|
||
# Create a 65 Mb kernel partition | ||
# Our kernels are only ~10 Mb though | ||
sudo parted -a optimal $USB unit mib mkpart Kernel 1 65 | ||
|
||
# Add a root partition | ||
sudo parted -a optimal $USB unit mib mkpart Root 65 100% | ||
|
||
# Make depthcharge know that this is a real kernel partition | ||
sudo cgpt add -i 1 -t kernel -S 1 -T 5 -P 15 $USB | ||
|
||
# Format the root partition as ext4 and mount it to /mnt | ||
sudo mkfs.ext4 ${USB}p2 | ||
|
||
echo "Writing sotrage, will take a few minutes" | ||
sync | ||
|
||
sudo mount ${USB}p2 /mnt | ||
|
||
# Copy all files from the USB to the internal storage drive | ||
sudo rsync -a --info=progress2 / /mnt --exclude proc --exclude sys --exclude dev --exclude mnt --exclude media | ||
echo "Writing sotrage, will take a few minutes" | ||
sync | ||
|
||
bash <(curl -s https://raw.githubusercontent.com/MilkyDeveloper/cb-linux/main/kernel/kernel.emmc.flags.sh) > cmdline | ||
|
||
# Repack the kernel | ||
futility vbutil_kernel --repack bzImage.signed --keyblock /usr/share/vboot/devkeys/kernel.keyblock --signprivate /usr/share/vboot/devkeys/kernel_data_key.vbprivk --oldblob bzImage --config cmdline | ||
|
||
# Flash the kernel to the partition | ||
sudo dd if=bzImage.signed of=${USB}p1 | ||
|
||
echo "Done! Use CTRL+D to boot from the internal storage next time." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters