This repository has been archived by the owner on Nov 4, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild_OpenRex_LiveCD.sh
executable file
·83 lines (57 loc) · 3.09 KB
/
build_OpenRex_LiveCD.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash
source "core/00-func.sh"
#--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --
# IMAGE BUILDING --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --
# OVERRIDE SETTINGS
exportdefvar REMOVE_IMG y
exportdefvar FLASH_IMG n
# OVERRIDE INSTALLATION PATH (install_deb_MMC_flasher.sh) & USB-OTG storage (configure_usbotg.sh)
exportdefvar HOST_MMC "/dev/mmcblk3" # 8-bit SD4
exportdefvar DEV_FSTAB_MMC_PREFIX "mmcblk3p" # 8-bit SD4
# RUN SYSROOT BUILDING SCRIPT
source "build_OpenRex.sh"
#--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --
# LIVECD+INSTALLER --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- - --- --
# OVERRIDE SETTINGS
export IMG_MMC_FL="${IMG_NAME}"
export REMOVE_IMG=n
export IMG_SIZE_MB="$((IMG_SIZE_MB+1000))"
export IMG_NAME=$(basename "${IMG_MMC_FL%.*}")"-livecd.img"
#--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --
# LIVECD IMAGE BUILDING --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
source "core/00-init.sh"
#--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --
# BUILD BASE IMAGE
clean_all "${REMOVE_IMG}"
pushd "${COREDIR}"
if ! ( bash "03-create_bootable_img.sh" ) ; then goto_exit 001 ; fi
if ! ( bash "04-mount_img.sh" ) ; then goto_exit 002 ; fi
if ! ( bash "05-sysroot_debian10_base.sh" ) ; then goto_exit 003 ; fi
if ! ( bash "07-install_kernel.sh" ) ; then goto_exit 004 ; fi
if ! ( bash "08-install_uboot.sh" ) ; then goto_exit 005 ; fi
if ! ( bash "09-configure_sysroot.sh" ) ; then goto_exit 006 ; fi
popd
pushd "${USERDIR}"
if ! ( bash "configure_autologin.sh" ) ; then goto_exit 101 ; fi
if ! ( bash "configure_disable_eth.sh" ) ; then goto_exit 102 ; fi
if ! ( bash "install_deb_mtd_uboot.sh" ) ; then goto_exit 103 ; fi
if ! ( bash "install_deb_MMC_flasher.sh" ) ; then goto_exit 104 ; fi
popd
clean_all
#--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --
# MAKE BOOTABLE DRVIE
unset HOST_MMC_BOOT
unset HOST_MMC_SYSROOT
unset DEV_MAKE_STORAGE
unset DEV_STORAGE_FS
unset DEV_FSTAB_MMC_PREFIX
unset DEV_POSTCONFIG # copy all posconfig scripts into LiveCD, then run them through the "install_MMC_flasher.sh"
export HOST_MMC="/dev/sdb"
export FLASH_IMG=y
if [ "${FLASH_IMG}" != "n" ] ; then
if ! ( bash "core/10-flash_image.sh" ) ; then goto_exit 301 ; fi
fi
#--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --
#--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --
show_message "DONE ; target image -- ${IMG_NAME}"
goto_exit 0