Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


software:oowow:how-to:oowow-autoinstall-disk

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
software:oowow:how-to:oowow-autoinstall-disk [2023/08/24 06:38]
hyphop
software:oowow:how-to:oowow-autoinstall-disk [2023/08/29 04:42] (current)
hyphop [Custom disk create]
Line 123: Line 123:
  
 ===== Custom disk create ===== ===== Custom disk create =====
- 
-Another way create installation disk by script 
  
 <WRAP important > <WRAP important >
-This way can used only with embeded oowow, and need boot device into oowow mode from SPI flash+This way for installation-disk preparation on user host PC
 </WRAP> </WRAP>
  
- +Another way to create installation disk by script [[gh>/khadas/oowow-scripts-collection]]
- +
-```sh autoinstall-disk-create +
-#!/bin/sh +
- +
-#= USAGE: DISK=/dev/sdX ./autoinstall-disk-create [IMAGE] +
- +
-DISK=${DISK:-/dev/sda} +
-IMAGE=${IMAGE:-$1} +
- +
-FAIL(){ +
-    echo "[fail] $@">&2 +
-    exit 1 +
-+
-CMD(){ +
-    echo "# $@">&+
-    sudo "$@" || FAIL +
-+
- +
-[ -s "$IMAGE" ] || FAIL "image undefined" +
- +
-# create parts +
-cat <<EOF | CMD sfdisk $DISK +
-label: dos +
-1 : start=       24576, size=      106496, type=e +
-2 : start=      131072, type=7 +
-EOF +
- +
-P1=${DISK}1 +
-P2=${DISK}2 +
-# format partiotions +
-CMD mkfs.vfat -n rescue -i DEADBEEF $P1 +
-CMD mkfs.exfat -n dumps $P2 +
- +
-CMD mkdir -p /tmp/dump /tmp/rescue +
-# copy image +
- +
-CMD mount $P2 /tmp/dump +
-CMD cp $IMAGE /tmp/dump +
- +
-ls -l1 /tmp/dump +
- +
-# create config +
-CMD mount $P1 /tmp/rescue +
-C=/tmp/rescue/rescue/config +
-CMD mkdir -p $C +
-echo $IMAGE | CMD tee $C/autoinstall +
- +
-CMD umount $P1 $P2 +
- +
-echo DONE +
-```+
  
Last modified: 2023/08/24 06:38 by hyphop