Update and fix cubox.sh
This commit is contained in:
38
cubox.sh
38
cubox.sh
@@ -9,8 +9,10 @@
|
||||
|
||||
# Hardware model
|
||||
hw_model=${hw_model:-"cubox"}
|
||||
|
||||
# Architecture (arm64, armhf, armel)
|
||||
architecture=${architecture:-"armhf"}
|
||||
|
||||
# Desktop manager (xfce, gnome, i3, kde, lxde, mate, e17 or none)
|
||||
desktop=${desktop:-"xfce"}
|
||||
|
||||
@@ -26,6 +28,7 @@ include third_stage
|
||||
|
||||
# Clean system
|
||||
include clean_system
|
||||
|
||||
# We need an older cross compiler due to kernel age
|
||||
cd "${base_dir}"
|
||||
git clone --depth 1 https://gitlab.com/kalilinux/packages/gcc-arm-linux-gnueabihf-4-7.git gcc-arm-linux-gnueabihf-4.7
|
||||
@@ -34,9 +37,9 @@ git clone --depth 1 https://gitlab.com/kalilinux/packages/gcc-arm-linux-gnueabih
|
||||
# them in this section
|
||||
git clone --depth 1 https://github.com/rabeeh/linux.git ${work_dir}/usr/src/kernel
|
||||
cd ${work_dir}/usr/src/kernel
|
||||
git rev-parse HEAD > ${work_dir}/usr/src/kernel-at-commit
|
||||
patch -p1 --no-backup-if-mismatch < ${repo_dir}/patches/mac80211.patch
|
||||
patch -p1 --no-backup-if-mismatch < ${repo_dir}/patches/remove-defined-from-timeconst.patch
|
||||
git rev-parse HEAD >${work_dir}/usr/src/kernel-at-commit
|
||||
patch -p1 --no-backup-if-mismatch <${repo_dir}/patches/mac80211.patch
|
||||
patch -p1 --no-backup-if-mismatch <${repo_dir}/patches/remove-defined-from-timeconst.patch
|
||||
touch .scmversion
|
||||
export ARCH=arm
|
||||
export CROSS_COMPILE="${base_dir}"/gcc-arm-linux-gnueabihf-4.7/bin/arm-linux-gnueabihf-
|
||||
@@ -61,33 +64,38 @@ ln -s /usr/src/kernel source
|
||||
cd "${base_dir}"
|
||||
|
||||
# Create boot.txt file
|
||||
cat << EOF > ${work_dir}/boot/boot.txt
|
||||
cat <<EOF >${work_dir}/boot/boot.txt
|
||||
echo "== Executing \${directory}\${bootscript} on \${device_name} partition \${partition} =="
|
||||
|
||||
setenv unit_no 0
|
||||
setenv root_device ?
|
||||
|
||||
if itest.s \${device_name} -eq usb; then
|
||||
itest.s \$root_device -eq ? && ext3ls usb 0:1 /dev && setenv root_device /dev/sda1 && setenv unit_no 0
|
||||
itest.s \$root_device -eq ? && ext3ls usb 1:1 /dev && setenv root_device /dev/sda1 && setenv unit_no 1
|
||||
itest.s \$root_device -eq ? && ext3ls usb 0:1 /dev && setenv root_device /dev/sda1 && setenv unit_no 0
|
||||
itest.s \$root_device -eq ? && ext3ls usb 1:1 /dev && setenv root_device /dev/sda1 && setenv unit_no 1
|
||||
|
||||
fi
|
||||
|
||||
if itest.s \${device_name} -eq mmc; then
|
||||
itest.s \$root_device -eq ? && ext3ls mmc 0:2 /dev && setenv root_device /dev/mmcblk0p2
|
||||
itest.s \$root_device -eq ? && ext3ls mmc 0:1 /dev && setenv root_device /dev/mmcblk0p1
|
||||
itest.s \$root_device -eq ? && ext3ls mmc 0:2 /dev && setenv root_device /dev/mmcblk0p2
|
||||
itest.s \$root_device -eq ? && ext3ls mmc 0:1 /dev && setenv root_device /dev/mmcblk0p1
|
||||
|
||||
fi
|
||||
|
||||
if itest.s \${device_name} -eq ide; then
|
||||
itest.s \$root_device -eq ? && ext3ls ide 0:1 /dev && setenv root_device /dev/sda1
|
||||
itest.s \$root_device -eq ? && ext3ls ide 0:1 /dev && setenv root_device /dev/sda1
|
||||
|
||||
fi
|
||||
|
||||
if itest.s \$root_device -ne ?; then
|
||||
setenv bootargs "console=ttyS0,115200n8 vmalloc=448M video=dovefb:lcd0:1920x1080-32@60-edid clcd.lcd0_enable=1 clcd.lcd1_enable=0 root=\${root_device} rootfstype=$fstype rw net.ifnames=0"
|
||||
setenv loadimage "\${fstype}load \${device_name} \${unit_no}:\${partition} 0x00200000 \${directory}\${image_name}"
|
||||
\$loadimage && bootm 0x00200000
|
||||
setenv bootargs "console=ttyS0,115200n8 vmalloc=448M video=dovefb:lcd0:1920x1080-32@60-edid clcd.lcd0_enable=1 clcd.lcd1_enable=0 root=\${root_device} rootfstype=$fstype rw net.ifnames=0"
|
||||
setenv loadimage "\${fstype}load \${device_name} \${unit_no}:\${partition} 0x00200000 \${directory}\${image_name}"
|
||||
\$loadimage && bootm 0x00200000
|
||||
|
||||
echo "!! Unable to load \${directory}\${image_name} from \${device_name} \${unit_no}:\${partition} !!"
|
||||
|
||||
exit
|
||||
|
||||
echo "!! Unable to load \${directory}\${image_name} from \${device_name} \${unit_no}:\${partition} !!"
|
||||
exit
|
||||
fi
|
||||
|
||||
echo "!! Unable to locate root partition on \${device_name} !!"
|
||||
@@ -107,8 +115,10 @@ parted -s -a minimal "${image_dir}/${image_name}.img" mkpart primary $fstype 1Mi
|
||||
|
||||
# Set the partition variables
|
||||
make_loop
|
||||
|
||||
# Create file systems
|
||||
mkfs_partitions
|
||||
|
||||
# Make fstab.
|
||||
make_fstab
|
||||
|
||||
|
||||
Reference in New Issue
Block a user