Browse Source

Cleaned up image creation, made functional installation scripts

Cleaned up build files, resources, scripts.
Made the image use a partition map to fix mmc issues

Signed-off-by: SolidHal <solidhal@users.noreply.github.com>
SolidHal 5 năm trước cách đây
mục cha
commit
d0403b14e3
41 tập tin đã thay đổi với 149 bổ sung89 xóa
  1. 1 4
      .gitignore
  2. 12 14
      README.md
  3. 0 13
      TODO.txt
  4. BIN
      blank_kernel
  5. 4 2
      buildPrawnOS.sh
  6. 0 0
      resources/BuildResources/80disable-recommends
  7. 0 0
      resources/BuildResources/cmdline
  8. 0 0
      resources/BuildResources/config
  9. 0 0
      resources/BuildResources/kernel.its
  10. 0 0
      resources/BuildResources/patches-tested/DTS/0025-ARM-DTSI-rk3288-Add-the-appropriate-clock-references.patch
  11. 0 0
      resources/BuildResources/patches-tested/chromeos-dwc2-glue.patch
  12. 0 0
      resources/BuildResources/patches-tested/kernel/0001-block-partitions-efi-Add-support-for-IGNOREME-GPT-si.patch
  13. 0 0
      resources/BuildResources/patches-tested/kernel/0002-Do-not-force-GUID-partition-with-gpt-command-line-op.patch
  14. 0 0
      resources/BuildResources/patches-tested/kernel/rockchip-dwc2-usb-partial-power-down.patch
  15. 0 0
      resources/BuildResources/patches-untested/DTS/0006-ARM-DTSI-rk3288-Missing-GRF-handles.patch
  16. 0 0
      resources/BuildResources/patches-untested/DTS/0007-RK3288-DTSI-rk3288-Add-missing-SPI2-pinctrl.patch
  17. 0 0
      resources/BuildResources/patches-untested/DTS/0009-ARM-DTSI-rk3288-Adding-cells-addresses-and-size.patch
  18. 0 0
      resources/BuildResources/patches-untested/DTS/0010-ARM-DTSI-rk3288-Adding-missing-EDP-power-domain.patch
  19. 0 0
      resources/BuildResources/patches-untested/DTS/0011-ARM-DTSI-rk3288-Adding-missing-VOPB-registers.patch
  20. 0 0
      resources/BuildResources/patches-untested/DTS/0012-ARM-DTSI-rk3288-Fixed-the-SPDIF-node-address.patch
  21. 0 0
      resources/BuildResources/patches-untested/DTS/for_video/0020-ARM-DTSI-rk3288-Define-the-VPU-services.patch
  22. 0 0
      resources/BuildResources/patches-untested/DTS/for_video/0024-ARM-DTSI-rk3288-veyron-Enable-the-Video-encoding-MMU.patch
  23. 0 0
      resources/BuildResources/patches-untested/kernel/0003-clk-rockchip-rk3288-prefer-vdpu-for-vcodec-clock-sou.patch
  24. 0 0
      resources/BuildResources/patches-untested/kernel/0007-drivers-drm-rockchip-Enable-IRQ-on-unbind.patch
  25. 0 0
      resources/BuildResources/patches-untested/kernel/for_video/0004-Remove-the-dependency-to-the-clk_mali-symbol.patch
  26. 0 0
      resources/BuildResources/patches-untested/kernel/for_video/0006-soc-rockchip-power-domain-export-idle-request.patch
  27. 0 0
      resources/BuildResources/sources.list
  28. 0 0
      resources/InstallResources/50-synaptics.conf
  29. 0 0
      resources/InstallResources/default.pa
  30. 0 0
      resources/InstallResources/default.sh
  31. 0 0
      resources/InstallResources/headphone-acpi-toggle
  32. 9 0
      resources/InstallResources/mmc.partmap
  33. 0 0
      resources/InstallResources/sound.sh
  34. 11 7
      scripts/InstallScripts/InstallPackages.sh
  35. 27 0
      scripts/InstallScripts/InstallToInternal.sh
  36. 5 0
      scripts/InstallScripts/InstallToUSB.sh
  37. 46 0
      scripts/InstallScripts/runonce.sh
  38. 19 39
      scripts/buildDebianFs.sh
  39. 15 10
      scripts/buildKernel.sh
  40. 0 0
      scripts/buildNewKernelIntoFS.sh
  41. 0 0
      scripts/crossmenuconfig.sh

+ 1 - 4
.gitignore

@@ -1,6 +1,3 @@
-devuan-jessie-c201-libre-*GB.img
 linux-*
 linux-*
 open-ath9k-htc-firmware
 open-ath9k-htc-firmware
-debian-stretch-c201-libre-*GB.img
-librean-stretch-c201-libre-*GB.img
-
+PrawnOS-Alpha-c201-libre-2GB.img

+ 12 - 14
README.md

@@ -1,4 +1,4 @@
-# Librean
+# PrawnOS
 
 
 A build system for making blobless debian and mainline kernel for the Asus c201 Chromebook
 A build system for making blobless debian and mainline kernel for the Asus c201 Chromebook
 
 
@@ -8,15 +8,15 @@ No blobs, anywhere.
 Support for Aetheros AR271 usb wifi dongles through the open source firmware
 Support for Aetheros AR271 usb wifi dongles through the open source firmware
 Minimal toolset intended as a based, including tools to setup a wifi connection
 Minimal toolset intended as a based, including tools to setup a wifi connection
 Sources from only main, not contrib or non-free which keeps Debian libre
 Sources from only main, not contrib or non-free which keeps Debian libre
-TODO: basic graphical desktop like xfce
+Currently PrawnOS supports lxqt, with plans to include xfce as an option in the future
 
 
 ### why
 ### why
 
 
-Combined with libreboot,an AR271 wifi dongle, and a libre OS (like Debian, the one built by this) the asus c201 is a fully libre machine with no blobs, or microcode.
+Combined with libreboot, an AR271 wifi dongle, and a libre OS (like Debian, the one built by this) the asus c201 is a fully libre machine with no blobs, or microcode.
 
 
 ### Dependencies
 ### Dependencies
 
 
-Librean has been tested on Debian 9 Stretch (in a vm)
+Building PrawnOS has been tested on Debian 9 Stretch (in a vm)
 These packages are required:
 These packages are required:
 
 
 ```
 ```
@@ -26,7 +26,7 @@ These packages are required:
 	        u-boot-tools \
 	        u-boot-tools \
 		gcc make libc-dev wget g++ cmake \
 		gcc make libc-dev wget g++ cmake \
 		binfmt-support qemu-user-static debootstrap \
 		binfmt-support qemu-user-static debootstrap \
-		lzip libssl-dev libncurses-dev flex bison
+		lzip libssl-dev libncurses-dev flex bison sudo patch
 ```
 ```
 
 
 ### Build
 ### Build
@@ -36,22 +36,20 @@ Run the kernel one then the fs one.
 ### Install
 ### Install
 Write the 2GB image to a flash drive, which contains the full 15GB (acutally 14.7GB) to write to the internal storage. We can do this since the 15GB image is a sparse file. 
 Write the 2GB image to a flash drive, which contains the full 15GB (acutally 14.7GB) to write to the internal storage. We can do this since the 15GB image is a sparse file. 
 ```
 ```
-sudo dd if=debian-stretch-c201-libre-2GB.img of=/dev/$USB_DEVICE bs=50M
+sudo dd if=PrawnOs-Alpha-c201-libre-2GB.img of=/dev/$USB_DEVICE bs=50M
 ```
 ```
 
 
 Now on the C201, login as root. The password is blank. 
 Now on the C201, login as root. The password is blank. 
 Write the 15GB image to the internal storage
 Write the 15GB image to the internal storage
 For me this was /dev/mmcblk2 but it may be /dev/mmcblk1 for you depending on what device it assigns to sdcards
 For me this was /dev/mmcblk2 but it may be /dev/mmcblk1 for you depending on what device it assigns to sdcards
 
 
-```
-dd if=/debian-stretch-c201-libre-2GB.img of=/dev/$DEVICE bs=50M
-```
+WIP
 
 
-Reboot. Run /Install.sh which will install xfce, wicd, and some device configurations. This will reboot one last time when done.
+Reboot. Run /Install.sh which will install lxqt, wicd, and some device configurations. This will reboot one last time when done.
 ```
 ```
 /Install.sh
 /Install.sh
 ```
 ```
-You should now be greeted by the xfce login screen. 
+You should now be greeted by a login screen. 
 
 
 If you just want a basic enviroment without xfce upu can skip running Install.sh but I recommend installing wicd-curses for wifi configuration. 
 If you just want a basic enviroment without xfce upu can skip running Install.sh but I recommend installing wicd-curses for wifi configuration. 
 
 
@@ -69,15 +67,15 @@ Check out the instructions here: https://github.com/SolidHal/AsusC201-usb-wifi-f
 
 
 ### Troubleshooting
 ### Troubleshooting
 
 
-The pulse audio mixer will only run if you are logged in as a non root account. This is an issue (feature?) of pulse audio
+The pulse audio mixer will only run if you are logged in as a non-root account. This is an issue (feature?) of pulse audio
 
 
 ### Credits and Legal Information
 ### Credits and Legal Information
 
 
-Thanks to dimkr for his great devsus scripts, from which Librean took much inspiration
+Thanks to dimkr for his great devsus scripts, from which PrawnOS took much inspiration
 https://github.com/dimkr/devsus
 https://github.com/dimkr/devsus
 
 
 Because of this started as a fork of devsus, much of this repos history can be found at https://github.com/SolidHal/devsus/tree/hybrid_debian
 Because of this started as a fork of devsus, much of this repos history can be found at https://github.com/SolidHal/devsus/tree/hybrid_debian
 
 
-Librean is free and unencumbered software released under the terms of the GNU
+PrawnOS is free and unencumbered software released under the terms of the GNU
 General Public License, version 2; see COPYING for the license text. For a list
 General Public License, version 2; see COPYING for the license text. For a list
 of its authors and contributors, see AUTHORS.
 of its authors and contributors, see AUTHORS.

+ 0 - 13
TODO.txt

@@ -1,13 +0,0 @@
-Investigate CONFIG_DRM_PANEL_LVDS vs CONFIG_DRM_PANEL_SIMPLE
-
-CONFIG_DRM_DW_HDMI_I2S_AUDIO vs CONFIG_DRM_DW_HDMI_AHB_AUDIO
-
- CONFIG_IIO_CROS_EC_SENSORS_CORE vs CONFIG_IIO_CROS_EC_ACCEL_LEGACY
-(probably the first??)
-tried the first, didn't change anything obvious. Further testing required. 
-
-Enable boot logo? Device Drivers->Graphics support->Bootup logo
-
-
-Added:
-better sound support? HDMI support?

BIN
blank_kernel


+ 4 - 2
buildLibrean.sh → buildPrawnOS.sh

@@ -5,6 +5,8 @@
 #Get sudo
 #Get sudo
 sudo echo "Thanks."
 sudo echo "Thanks."
 #Build kernel WITHOUT SUDO, building the kernel with sudo is bad practice
 #Build kernel WITHOUT SUDO, building the kernel with sudo is bad practice
-./buildKernel.sh
+#Once, sometime in the kernel version 2 days building the kernel with sudo broke the
+#The system it was built on
+#./scripts/buildKernel.sh
 #build os WITH sudo, debootstrap requires sudo
 #build os WITH sudo, debootstrap requires sudo
-sudo ./buildDebian.sh
+sudo ./scripts/buildDebianFs.sh

+ 0 - 0
80disable-recommends → resources/BuildResources/80disable-recommends


+ 0 - 0
cmdline → resources/BuildResources/cmdline


+ 0 - 0
config → resources/BuildResources/config


+ 0 - 0
kernel.its → resources/BuildResources/kernel.its


+ 0 - 0
patches-tested/DTS/0025-ARM-DTSI-rk3288-Add-the-appropriate-clock-references.patch → resources/BuildResources/patches-tested/DTS/0025-ARM-DTSI-rk3288-Add-the-appropriate-clock-references.patch


+ 0 - 0
patches-tested/chromeos-dwc2-glue.patch → resources/BuildResources/patches-tested/chromeos-dwc2-glue.patch


+ 0 - 0
patches-tested/kernel/0001-block-partitions-efi-Add-support-for-IGNOREME-GPT-si.patch → resources/BuildResources/patches-tested/kernel/0001-block-partitions-efi-Add-support-for-IGNOREME-GPT-si.patch


+ 0 - 0
patches-tested/kernel/0002-Do-not-force-GUID-partition-with-gpt-command-line-op.patch → resources/BuildResources/patches-tested/kernel/0002-Do-not-force-GUID-partition-with-gpt-command-line-op.patch


+ 0 - 0
patches-tested/kernel/rockchip-dwc2-usb-partial-power-down.patch → resources/BuildResources/patches-tested/kernel/rockchip-dwc2-usb-partial-power-down.patch


+ 0 - 0
patches-untested/DTS/0006-ARM-DTSI-rk3288-Missing-GRF-handles.patch → resources/BuildResources/patches-untested/DTS/0006-ARM-DTSI-rk3288-Missing-GRF-handles.patch


+ 0 - 0
patches-untested/DTS/0007-RK3288-DTSI-rk3288-Add-missing-SPI2-pinctrl.patch → resources/BuildResources/patches-untested/DTS/0007-RK3288-DTSI-rk3288-Add-missing-SPI2-pinctrl.patch


+ 0 - 0
patches-untested/DTS/0009-ARM-DTSI-rk3288-Adding-cells-addresses-and-size.patch → resources/BuildResources/patches-untested/DTS/0009-ARM-DTSI-rk3288-Adding-cells-addresses-and-size.patch


+ 0 - 0
patches-untested/DTS/0010-ARM-DTSI-rk3288-Adding-missing-EDP-power-domain.patch → resources/BuildResources/patches-untested/DTS/0010-ARM-DTSI-rk3288-Adding-missing-EDP-power-domain.patch


+ 0 - 0
patches-untested/DTS/0011-ARM-DTSI-rk3288-Adding-missing-VOPB-registers.patch → resources/BuildResources/patches-untested/DTS/0011-ARM-DTSI-rk3288-Adding-missing-VOPB-registers.patch


+ 0 - 0
patches-untested/DTS/0012-ARM-DTSI-rk3288-Fixed-the-SPDIF-node-address.patch → resources/BuildResources/patches-untested/DTS/0012-ARM-DTSI-rk3288-Fixed-the-SPDIF-node-address.patch


+ 0 - 0
patches-untested/DTS/for_video/0020-ARM-DTSI-rk3288-Define-the-VPU-services.patch → resources/BuildResources/patches-untested/DTS/for_video/0020-ARM-DTSI-rk3288-Define-the-VPU-services.patch


+ 0 - 0
patches-untested/DTS/for_video/0024-ARM-DTSI-rk3288-veyron-Enable-the-Video-encoding-MMU.patch → resources/BuildResources/patches-untested/DTS/for_video/0024-ARM-DTSI-rk3288-veyron-Enable-the-Video-encoding-MMU.patch


+ 0 - 0
patches-untested/kernel/0003-clk-rockchip-rk3288-prefer-vdpu-for-vcodec-clock-sou.patch → resources/BuildResources/patches-untested/kernel/0003-clk-rockchip-rk3288-prefer-vdpu-for-vcodec-clock-sou.patch


+ 0 - 0
patches-untested/kernel/0007-drivers-drm-rockchip-Enable-IRQ-on-unbind.patch → resources/BuildResources/patches-untested/kernel/0007-drivers-drm-rockchip-Enable-IRQ-on-unbind.patch


+ 0 - 0
patches-untested/kernel/for_video/0004-Remove-the-dependency-to-the-clk_mali-symbol.patch → resources/BuildResources/patches-untested/kernel/for_video/0004-Remove-the-dependency-to-the-clk_mali-symbol.patch


+ 0 - 0
patches-untested/kernel/for_video/0006-soc-rockchip-power-domain-export-idle-request.patch → resources/BuildResources/patches-untested/kernel/for_video/0006-soc-rockchip-power-domain-export-idle-request.patch


+ 0 - 0
sources.list → resources/BuildResources/sources.list


+ 0 - 0
os_configs/50-synaptics.conf → resources/InstallResources/50-synaptics.conf


+ 0 - 0
os_configs/default.pa → resources/InstallResources/default.pa


+ 0 - 0
os_configs/default.sh → resources/InstallResources/default.sh


+ 0 - 0
os_configs/headphone-acpi-toggle → resources/InstallResources/headphone-acpi-toggle


+ 9 - 0
resources/InstallResources/mmc.partmap

@@ -0,0 +1,9 @@
+label: gpt
+label-id: EBA5A923-2F33-7C4E-AC9A-1555FD600D19
+device: /dev/mmcblk2
+unit: sectors
+first-lba: 34
+last-lba: 30785502
+
+/dev/mmcblk2p1 : start=       20480, size=       65536, type=FE3A2A5D-4F32-41A7-B725-ACCC3285A309, uuid=89B31CDB-1147-5241-8271-C1ADBB9BBB44, name="Kernel", attrs="GUID:49,51,52,54,56"
+/dev/mmcblk2p2 : start=       86016, size=    30699486, type=EBD0A0A2-B9E5-4433-87C0-68B6B72699C7, uuid=63DB8E49-63C4-984E-90A0-8AC3222C4771, name="Root"

+ 0 - 0
os_configs/sound.sh → resources/InstallResources/sound.sh


+ 11 - 7
Install.sh → scripts/InstallScripts/InstallPackages.sh

@@ -1,19 +1,23 @@
 #!/bin/sh -xe
 #!/bin/sh -xe
 
 
-#Setup locales
+DIR=/InstallResources
+
+#Setup locales, crda
 apt install -y locales
 apt install -y locales
-#Install xfce, wicd
+dpkg-reconfigure locale
+apt install -y crda
+locale-gen
+#Install lxqt, wicd
 apt install -y xorg acpi-support lightdm tasksel dpkg librsvg2-common xorg xserver-xorg-input-libinput alsa-utils anacron avahi-daemon eject iw libnss-mdns xdg-utils lxqt wicd-daemon wicd wicd-curses wicd-gtk xserver-xorg-input-synaptics
 apt install -y xorg acpi-support lightdm tasksel dpkg librsvg2-common xorg xserver-xorg-input-libinput alsa-utils anacron avahi-daemon eject iw libnss-mdns xdg-utils lxqt wicd-daemon wicd wicd-curses wicd-gtk xserver-xorg-input-synaptics
 #Copy in acpi, pulse audio, trackpad settings, funtion key settings
 #Copy in acpi, pulse audio, trackpad settings, funtion key settings
-cp -rf /os_configs/default.pa /etc/pulse/default.pa
+cp -rf $DIR/default.pa /etc/pulse/default.pa
 mkdir /etc/acpi
 mkdir /etc/acpi
-cp -rf /os_configs/sound.sh /etc/acpi/sound.sh
+cp -rf $DIR/sound.sh /etc/acpi/sound.sh
 mkdir /etc/acpi/events
 mkdir /etc/acpi/events
-cp -rf /os_configs/headphone-acpi-toggle /etc/acpi/events/headphone-acpi-toggle
+cp -rf $DIR/headphone-acpi-toggle /etc/acpi/events/headphone-acpi-toggle
 mkdir /etc/X11/xorg.conf.d/
 mkdir /etc/X11/xorg.conf.d/
-cp -rf /os_configs/50-synaptics.conf /etc/X11/xorg.conf.d/
+cp -rf $DIR/50-synaptics.conf /etc/X11/xorg.conf.d/
 
 
-locale-gen
 
 
 echo " Enter new username: "
 echo " Enter new username: "
 read username
 read username

+ 27 - 0
scripts/InstallScripts/InstallToInternal.sh

@@ -0,0 +1,27 @@
+#!/bin/bash
+
+#Install PrawnOS to the internal emmc, this will partition the internal emmc
+#and erase ALL data on it
+
+
+RESOURCES=/InstallResources
+
+read -p "This will ERASE ALL DATA ON THE INTERNAL STORAGE (EMMC) and reboot when finished, do you want to continue? [Y/n]" -n 1 -r
+echo 
+if [[ $REPLY =~ ^[Yy]$ ]]
+then
+    echo Writing partition map
+    sfdisk /dev/mmcblk2 < $RESOURCES/mmc.partmap
+    echo Writing kernel partition
+    dd if=/dev/sda1 of=/dev/mmcblk2p1
+    echo Writing Filesystem, this will take a moment...
+    #Set the post install script to run after reboot
+    ./$RESOURCES/runonce.sh $RESOURCES/InstallPackages.sh
+    dd if=/dev/sda2 of=/dev/mmcblk2p2 bs=50M
+    echo Expanding Filesystem
+    e2fsck -p /dev/mmcblk2p2
+    resize2fs /dev/mmcblk2p2
+    echo Rebooting... Please remove the usb drive once shutdown is complete
+fi
+
+echo Exiting

+ 5 - 0
scripts/InstallScripts/InstallToUSB.sh

@@ -0,0 +1,5 @@
+
+#!/bin/bash
+
+#Install PrawnOS to an external device, the first usb by default
+

+ 46 - 0
scripts/InstallScripts/runonce.sh

@@ -0,0 +1,46 @@
+#!/bin/bash
+
+if [[ $# -eq 0 ]]; then
+    echo "Schedules a command to be run after the next reboot."
+    echo "Usage: $(basename $0) <command>"
+    echo "       $(basename $0) -p <path> <command>"
+    echo "       $(basename $0) -r <command>"
+else
+    REMOVE=0
+    COMMAND=${!#}
+    SCRIPTPATH=$PATH
+
+    while getopts ":r:p:" optionName; do
+        case "$optionName" in
+            r) REMOVE=1; COMMAND=$OPTARG;;
+            p) SCRIPTPATH=$OPTARG;;
+        esac
+    done
+
+    SCRIPT="${HOME}/.$(basename $0)_$(echo $COMMAND | sed 's/[^a-zA-Z0-9_]/_/g')"
+
+    if [[ ! -f $SCRIPT ]]; then
+        echo "PATH=$SCRIPTPATH" >> $SCRIPT
+        echo "cd $(pwd)"        >> $SCRIPT
+        echo "logger -t $(basename $0) -p local3.info \"COMMAND=$COMMAND ; USER=\$(whoami) ($(logname)) ; PWD=$(pwd) ; PATH=\$PATH\"" >> $SCRIPT
+        echo "$COMMAND | logger -t $(basename $0) -p local3.info" >> $SCRIPT
+        echo "$0 -r \"$(echo $COMMAND | sed 's/\"/\\\"/g')\""     >> $SCRIPT
+        chmod +x $SCRIPT
+    fi
+
+    CRONTAB="${HOME}/.$(basename $0)_temp_crontab_$RANDOM"
+    ENTRY="@reboot $SCRIPT"
+
+    echo "$(crontab -l 2>/dev/null)" | grep -v "$ENTRY" | grep -v "^# DO NOT EDIT THIS FILE - edit the master and reinstall.$" | grep -v "^# ([^ ]* installed on [^)]*)$" | grep -v "^# (Cron version [^$]*\$[^$]*\$)$" > $CRONTAB
+
+    if [[ $REMOVE -eq 0 ]]; then
+        echo "$ENTRY" >> $CRONTAB
+    fi
+
+    crontab $CRONTAB
+    rm $CRONTAB
+
+    if [[ $REMOVE -ne 0 ]]; then
+        rm $SCRIPT
+    fi
+fi

+ 19 - 39
buildDebianFs.sh → scripts/buildDebianFs.sh

@@ -6,37 +6,31 @@
 KVER=4.17.2
 KVER=4.17.2
 
 
 #Ensure Sudo
 #Ensure Sudo
-if [[ $UID != 0 ]]; then
-    echo "Please run this script with sudo:"
+if [ ! $UID = "0" ]
+then
+    echo "Please run this script with sudo, or as root:"
     echo "sudo $0 $*"
     echo "sudo $0 $*"
     exit 1
     exit 1
 fi
 fi
 
 
 outmnt=$(mktemp -d -p `pwd`)
 outmnt=$(mktemp -d -p `pwd`)
-inmnt=$(mktemp -d -p `pwd`)
 
 
 outdev=/dev/loop4
 outdev=/dev/loop4
-indev=/dev/loop5
+
+install_resources=resources/InstallResources
+build_resources=resources/BuildResources
 
 
 #A hacky way to ensure the loops are properly unmounted and the temp files are properly deleted.
 #A hacky way to ensure the loops are properly unmounted and the temp files are properly deleted.
 #Without this, a reboot is sometimes required to properly clean the loop devices and ensure a clean build 
 #Without this, a reboot is sometimes required to properly clean the loop devices and ensure a clean build 
 cleanup() {
 cleanup() {
   set +e
   set +e
 
 
-  umount -l $inmnt > /dev/null 2>&1
-  rmdir $inmnt > /dev/null 2>&1
-  losetup -d $indev > /dev/null 2>&1
-
   umount -l $outmnt > /dev/null 2>&1
   umount -l $outmnt > /dev/null 2>&1
   rmdir $outmnt > /dev/null 2>&1
   rmdir $outmnt > /dev/null 2>&1
   losetup -d $outdev > /dev/null 2>&1
   losetup -d $outdev > /dev/null 2>&1
 
 
   set +e
   set +e
 
 
-  umount -l $inmnt > /dev/null 2>&1
-  rmdir $inmnt > /dev/null 2>&1
-  losetup -d $indev > /dev/null 2>&1
-
   umount -l $outmnt > /dev/null 2>&1
   umount -l $outmnt > /dev/null 2>&1
   rmdir $outmnt > /dev/null 2>&1
   rmdir $outmnt > /dev/null 2>&1
   losetup -d $outdev > /dev/null 2>&1
   losetup -d $outdev > /dev/null 2>&1
@@ -64,7 +58,7 @@ create_image() {
 }
 }
 
 
 # create a 2GB image with the Chrome OS partition layout
 # create a 2GB image with the Chrome OS partition layout
-create_image librean-stretch-c201-libre-2GB.img $outdev 50M 40 $outmnt
+create_image PrawnOS-Alpha-c201-libre-2GB.img $outdev 50M 40 $outmnt
 
 
 # install Debian on it
 # install Debian on it
 export LC_ALL="en_US.UTF-8" #Change this as necessary if not US
 export LC_ALL="en_US.UTF-8" #Change this as necessary if not US
@@ -73,18 +67,18 @@ qemu-debootstrap --arch armhf stretch --include locales,init $outmnt http://deb.
 chroot $outmnt passwd -d root
 chroot $outmnt passwd -d root
 
 
 #Place the config files and installer script and give them the proper permissions
 #Place the config files and installer script and give them the proper permissions
-echo -n librean > $outmnt/etc/hostname
-cp -R os_configs/ $outmnt/os_configs/
-cp Install.sh $outmnt/Install.sh
-chmod +x $outmnt/os_configs/sound.sh
-chmod +x $outmnt/Install.sh
+echo -n PrawnOS-Alpha > $outmnt/etc/hostname
+cp -R $install_resources/ $outmnt/InstallResources/
+cp scripts/InstallScripts/* $outmnt/InstallResources/
+cp scripts/InstallScripts/InstallToInternal.sh $outmnt/
+chmod +x $outmnt/*.sh
 
 
-#install -D -m 644 80disable-recommends $outmnt/etc/apt/apt.conf.d/80disable-recommends #This should fix the issue of crda being installed but unconfigured causing regulatory.db firmware loading errors in dmesg
+install -D -m 644 $build_resources/80disable-recommends $outmnt/etc/apt/apt.conf.d/80disable-recommends #This should fix the issue of crda being installed but unconfigured causing regulatory.db firmware loading errors in dmesg
 
 
 #Setup the chroot for apt 
 #Setup the chroot for apt 
 #This is what https://wiki.debian.org/EmDebian/CrossDebootstrap suggests
 #This is what https://wiki.debian.org/EmDebian/CrossDebootstrap suggests
 cp /etc/hosts $outmnt/etc/
 cp /etc/hosts $outmnt/etc/
-cp sources.list $outmount/etc/apt/sources.list
+cp $build_resources/sources.list $outmount/etc/apt/sources.list
 
 
 #Setup the locale
 #Setup the locale
 cp /etc/locale.gen $outmnt/etc/
 cp /etc/locale.gen $outmnt/etc/
@@ -98,33 +92,19 @@ chroot $outmnt apt-get autoremove --purge
 chroot $outmnt apt-get clean
 chroot $outmnt apt-get clean
 
 
 #Download the packages to be installed by Install.sh: TODO: potentially dpkg-reconfigure locales?
 #Download the packages to be installed by Install.sh: TODO: potentially dpkg-reconfigure locales?
-chroot $outmnt apt-get install -y -d xorg acpi-support lightdm tasksel dpkg librsvg2-common xorg xserver-xorg-input-libinput alsa-utils anacron avahi-daemon eject iw libnss-mdns xdg-utils lxqt wicd-daemon wicd wicd-curses wicd-gtk xserver-xorg-input-synaptics
+chroot $outmnt apt-get install -y -d xorg acpi-support lightdm tasksel dpkg librsvg2-common xorg xserver-xorg-input-libinput alsa-utils anacron avahi-daemon eject iw libnss-mdns xdg-utils lxqt wicd-daemon wicd wicd-curses wicd-gtk xserver-xorg-input-synaptics crda
 
 
 #Cleanup hosts
 #Cleanup hosts
 rm -rf $outmnt/etc/hosts #This is what https://wiki.debian.org/EmDebian/CrossDebootstrap suggests
 rm -rf $outmnt/etc/hosts #This is what https://wiki.debian.org/EmDebian/CrossDebootstrap suggests
-echo -n "127.0.0.1        librean" > $outmnt/etc/hosts
+echo -n "127.0.0.1        PrawnOS-Alpha" > $outmnt/etc/hosts
 
 
 # put the kernel in the kernel partition, modules in /lib/modules and AR9271
 # put the kernel in the kernel partition, modules in /lib/modules and AR9271
 # firmware in /lib/firmware
 # firmware in /lib/firmware
-dd if=linux-$KVER/vmlinux.kpart of=${outdev}p1 conv=notrunc
-make -C linux-$KVER ARCH=arm INSTALL_MOD_PATH=$outmnt modules_install
+dd if=build/linux-$KVER/vmlinux.kpart of=${outdev}p1 conv=notrunc
+make -C build/linux-$KVER ARCH=arm INSTALL_MOD_PATH=$outmnt modules_install
 rm -f $outmnt/lib/modules/3.14.0/{build,source}
 rm -f $outmnt/lib/modules/3.14.0/{build,source}
-install -D -m 644 open-ath9k-htc-firmware/target_firmware/htc_9271.fw $outmnt/lib/firmware/ath9k_htc/htc_9271-1.4.0.fw
-
-# create a 15GB image
-create_image librean-stretch-c201-libre-15GB.img $indev 512 30777343 $inmnt
-
-# copy the kernel and / of the 2GB image to the 15GB one
-dd if=${outdev}p1 of=${indev}p1 conv=notrunc
-cp -a $outmnt/* $inmnt/
-
-#Cleanup the 15GB image
-umount -l $inmnt
-rmdir $inmnt
-losetup -d $indev
+install -D -m 644 build/open-ath9k-htc-firmware/target_firmware/htc_9271.fw $outmnt/lib/firmware/ath9k_htc/htc_9271-1.4.0.fw
 
 
-# move the 15GB image inside the 2GB one
-cp -f librean-stretch-c201-libre-15GB.img $outmnt/
 echo "DONE!"
 echo "DONE!"
 cleanup
 cleanup
 
 

+ 15 - 10
buildKernel.sh → scripts/buildKernel.sh

@@ -6,6 +6,10 @@
 KVER=4.17.2
 KVER=4.17.2
 TEST_PATCHES=false
 TEST_PATCHES=false
 
 
+ROOT_DIR=`pwd`
+RESOURCES=$ROOT_DIR/resources/BuildResources
+
+cd build
 # build Linux-libre, with ath9k_htc, dwc2 from Chrome OS and without many useless drivers
 # build Linux-libre, with ath9k_htc, dwc2 from Chrome OS and without many useless drivers
 [ ! -f linux-libre-$KVER-gnu.tar.lz ] && wget https://www.linux-libre.fsfla.org/pub/linux-libre/releases/$KVER-gnu/linux-libre-$KVER-gnu.tar.lz
 [ ! -f linux-libre-$KVER-gnu.tar.lz ] && wget https://www.linux-libre.fsfla.org/pub/linux-libre/releases/$KVER-gnu/linux-libre-$KVER-gnu.tar.lz
 [ ! -d linux-$KVER ] && tar --lzip -xvf linux-libre-$KVER-gnu.tar.lz && FRESH=true
 [ ! -d linux-$KVER ] && tar --lzip -xvf linux-libre-$KVER-gnu.tar.lz && FRESH=true
@@ -13,18 +17,18 @@ cd linux-$KVER
 make clean
 make clean
 make mrproper
 make mrproper
 #Apply the usb and mmc patches if unapplied
 #Apply the usb and mmc patches if unapplied
-[ "$FRESH" = true ] && for i in ../patches-tested/*.patch; do patch -p1 < $i; done
-[ "$FRESH" = true ] && for i in ../patches-tested/DTS/*.patch; do patch -p1 < $i; done
-[ "$FRESH" = true ] && for i in ../patches-tested/kernel/*.patch; do patch -p1 < $i; done
+[ "$FRESH" = true ] && for i in $RESOURCES/patches-tested/*.patch; do patch -p1 < $i; done
+[ "$FRESH" = true ] && for i in $RESOURCES/patches-tested/DTS/*.patch; do patch -p1 < $i; done
+[ "$FRESH" = true ] && for i in $RESOURCES/patches-tested/kernel/*.patch; do patch -p1 < $i; done
 #Apply all of the rockMyy patches that make sense
 #Apply all of the rockMyy patches that make sense
-[ "$TEST_PATCHES" = true ] && for i in ../patches-untested/kernel/*.patch; do patch -p1 < $i; done
-[ "$TEST_PATCHES" = true ] && for i in ../patches-untested/DTS/*.patch; do patch -p1 < $i; done
+[ "$TEST_PATCHES" = true ] && for i in $RESOURCES/patches-untested/kernel/*.patch; do patch -p1 < $i; done
+[ "$TEST_PATCHES" = true ] && for i in $RESOURCES/patches-untested/DTS/*.patch; do patch -p1 < $i; done
 # reset the minor version number, so out-of-tree drivers continue to work after
 # reset the minor version number, so out-of-tree drivers continue to work after
-# a kernel upgrade
-sed s/'SUBLEVEL = .*'/'SUBLEVEL = 0'/ -i Makefile
-cp ../config .config
+# a kernel upgrade **TODO - is this needed?
+# sed s/'SUBLEVEL = .*'/'SUBLEVEL = 0'/ -i Makefile
+cp $RESOURCES/config .config
 make -j `grep ^processor /proc/cpuinfo  | wc -l`  CROSS_COMPILE=arm-none-eabi- ARCH=arm zImage modules dtbs
 make -j `grep ^processor /proc/cpuinfo  | wc -l`  CROSS_COMPILE=arm-none-eabi- ARCH=arm zImage modules dtbs
-[ ! -h kernel.its ] && ln -s ../kernel.its .
+[ ! -h kernel.its ] && ln -s $RESOURCES/kernel.its .
 mkimage -D "-I dts -O dtb -p 2048" -f kernel.its vmlinux.uimg
 mkimage -D "-I dts -O dtb -p 2048" -f kernel.its vmlinux.uimg
 dd if=/dev/zero of=bootloader.bin bs=512 count=1
 dd if=/dev/zero of=bootloader.bin bs=512 count=1
 vbutil_kernel --pack vmlinux.kpart \
 vbutil_kernel --pack vmlinux.kpart \
@@ -33,7 +37,7 @@ vbutil_kernel --pack vmlinux.kpart \
               --arch arm \
               --arch arm \
               --keyblock /usr/share/vboot/devkeys/kernel.keyblock \
               --keyblock /usr/share/vboot/devkeys/kernel.keyblock \
               --signprivate /usr/share/vboot/devkeys/kernel_data_key.vbprivk \
               --signprivate /usr/share/vboot/devkeys/kernel_data_key.vbprivk \
-              --config ../cmdline \
+              --config $RESOURCES/cmdline \
               --bootloader bootloader.bin
               --bootloader bootloader.bin
 cd ..
 cd ..
 
 
@@ -44,3 +48,4 @@ cd open-ath9k-htc-firmware
 make toolchain
 make toolchain
 make -C target_firmware
 make -C target_firmware
 cd ..
 cd ..
+cd $ROOT_DIR

+ 0 - 0
buildNewKernelIntoFS.sh → scripts/buildNewKernelIntoFS.sh


+ 0 - 0
crossmenuconfig.sh → scripts/crossmenuconfig.sh