Commit 5a95e5da authored by Dan Johansen's avatar Dan Johansen

made some changes, so it seems to work now

parent 05f31db7
...@@ -11,24 +11,6 @@ password=manjaro ...@@ -11,24 +11,6 @@ password=manjaro
#imports #imports
source $LIBDIR/functions.sh source $LIBDIR/functions.sh
# Remove '/dev/' from the name
DEV_NAME=`echo "$SDCARD" | cut -d "/" -f 3`
# Set just the name of the device, usually mmcblk0
#DEV_NAME=`echo /sys/block/${PART_NAME} | cut -d "/" -f 4`
# Add /dev/ to device name
# DEV="/dev/${DEV_NAME}"
# Get Number of device as single digit integer
# PART_NUM=`cat /sys/block/${DEV_NAME}/${PART_NAME}/partition`
# Get size of SDCard (final sector)
SECTOR_SIZE=`cat /sys/block/${DEV_NAME}/size`
# Set the ending sector that the partition should be resized too
END_SECTOR=`expr $SECTOR_SIZE - 1`
# Functions # Functions
...@@ -175,8 +157,8 @@ prepare_card () { ...@@ -175,8 +157,8 @@ prepare_card () {
#END_SECTOR=$(expr $START + $SIZE) #END_SECTOR=$(expr $START + $SIZE)
sudo parted -s $SDCARD mkpart primary ext4 "${END_SECTOR}s" 100% sudo parted -s $SDCARD mkpart primary ext4 "${END_SECTOR}s" 100%
sudo partprobe $SDCARD sudo partprobe $SDCARD
sudo mkfs.vfat "${SDCARD}1" sudo mkfs.vfat "${SDCARD}p1"
sudo mkfs.ext4 "${SDCARD}2" sudo mkfs.ext4 "${SDCARD}p2"
#copy rootfs contents over to the FS #copy rootfs contents over to the FS
mkdir -p $TMPDIR/root mkdir -p $TMPDIR/root
...@@ -202,12 +184,12 @@ prepare_card () { ...@@ -202,12 +184,12 @@ prepare_card () {
sudo parted -s $SDCARD mklabel msdos sudo parted -s $SDCARD mklabel msdos
sudo parted -s $SDCARD mkpart primary ext4 0% 100% sudo parted -s $SDCARD mkpart primary ext4 0% 100%
sudo partprobe $SDCARD sudo partprobe $SDCARD
sudo mkfs.ext4 -O ^metadata_csum,^64bit ${SDCARD}p1 sudo mkfs.ext4 -O ^metadata_csum,^64bit ${SDCARD}1
#copy rootfs contents over to the FS #copy rootfs contents over to the FS
mkdir -p $TMPDIR/root mkdir -p $TMPDIR/root
sudo chmod 777 -R $TMPDIR/root sudo chmod 777 -R $TMPDIR/root
sudo mount ${SDCARD}p1 $TMPDIR/root sudo mount ${SDCARD}1 $TMPDIR/root
sudo cp -ra $ROOTFS_IMG/rootfs_$ARCH/* $TMPDIR/root/ sudo cp -ra $ROOTFS_IMG/rootfs_$ARCH/* $TMPDIR/root/
#flash bootloader #flash bootloader
...@@ -217,7 +199,7 @@ prepare_card () { ...@@ -217,7 +199,7 @@ prepare_card () {
#clean up #clean up
sudo umount $TMPDIR/root sudo umount $TMPDIR/root
sudo losetup -d $SDCARD # sudo losetup -d $SDCARD
sudo rm -r $TMPDIR/root sudo rm -r $TMPDIR/root
sudo partprobe $SDCARD sudo partprobe $SDCARD
...@@ -231,12 +213,12 @@ prepare_card () { ...@@ -231,12 +213,12 @@ prepare_card () {
sudo parted -s $SDCARD mklabel msdos sudo parted -s $SDCARD mklabel msdos
sudo parted -s $SDCARD mkpart primary ext4 0% 100% sudo parted -s $SDCARD mkpart primary ext4 0% 100%
sudo partprobe $SDCARD sudo partprobe $SDCARD
sudo mkfs.ext4 -O ^metadata_csum,^64bit ${SDCARD}p1 sudo mkfs.ext4 -O ^metadata_csum,^64bit ${SDCARD}1
#copy rootfs contents over to the FS #copy rootfs contents over to the FS
mkdir -p $TMPDIR/root mkdir -p $TMPDIR/root
sudo chmod 777 -R $TMPDIR/root sudo chmod 777 -R $TMPDIR/root
sudo mount ${SDCARD}p1 $TMPDIR/root sudo mount ${SDCARD}1 $TMPDIR/root
sudo cp -ra $ROOTFS_IMG/rootfs_$ARCH/* $TMPDIR/root/ sudo cp -ra $ROOTFS_IMG/rootfs_$ARCH/* $TMPDIR/root/
#flash bootloader #flash bootloader
...@@ -244,7 +226,7 @@ prepare_card () { ...@@ -244,7 +226,7 @@ prepare_card () {
#clean up #clean up
sudo umount $TMPDIR/root sudo umount $TMPDIR/root
sudo losetup -d $SDCARD #sudo losetup -d $SDCARD
sudo rm -r $TMPDIR/root sudo rm -r $TMPDIR/root
sudo partprobe $SDCARD sudo partprobe $SDCARD
...@@ -258,12 +240,12 @@ prepare_card () { ...@@ -258,12 +240,12 @@ prepare_card () {
sudo parted -s $SDCARD mklabel msdos sudo parted -s $SDCARD mklabel msdos
sudo parted -s $SDCARD mkpart primary ext4 0% 100% sudo parted -s $SDCARD mkpart primary ext4 0% 100%
sudo partprobe $SDCARD sudo partprobe $SDCARD
sudo mkfs.ext4 -O ^metadata_csum,^64bit ${SDCARD}p1 sudo mkfs.ext4 -O ^metadata_csum,^64bit ${SDCARD}1
#copy rootfs contents over to the FS #copy rootfs contents over to the FS
mkdir -p $TMPDIR/root mkdir -p $TMPDIR/root
sudo chmod 777 -R $TMPDIR/root sudo chmod 777 -R $TMPDIR/root
sudo mount ${SDCARD}p1 $TMPDIR/root sudo mount ${SDCARD}1 $TMPDIR/root
sudo cp -ra $ROOTFS_IMG/rootfs_$ARCH/* $TMPDIR/root/ sudo cp -ra $ROOTFS_IMG/rootfs_$ARCH/* $TMPDIR/root/
#flash bootloader #flash bootloader
...@@ -274,7 +256,7 @@ prepare_card () { ...@@ -274,7 +256,7 @@ prepare_card () {
#clean up #clean up
sudo umount $TMPDIR/root sudo umount $TMPDIR/root
sudo losetup -d $SDCARD #sudo losetup -d $SDCARD
sudo rm -r $TMPDIR/root sudo rm -r $TMPDIR/root
sudo partprobe $SDCARD sudo partprobe $SDCARD
else else
...@@ -351,7 +333,7 @@ while getopts "${opt}" arg; do ...@@ -351,7 +333,7 @@ while getopts "${opt}" arg; do
exit 1 exit 1
;; ;;
h|?) h|?)
usage_build_img usage_build_installer
exit 1 exit 1
;; ;;
:) :)
...@@ -376,6 +358,15 @@ PKG_DEVICE=$(grep "^[^#;]" $PROFILES/arm-profiles/devices/$DEVICE | awk '{print ...@@ -376,6 +358,15 @@ PKG_DEVICE=$(grep "^[^#;]" $PROFILES/arm-profiles/devices/$DEVICE | awk '{print
PKG_EDITION=$(grep "^[^#;]" $PROFILES/arm-profiles/editions/$EDITION | awk '{print $1}') PKG_EDITION=$(grep "^[^#;]" $PROFILES/arm-profiles/editions/$EDITION | awk '{print $1}')
SRV_EDITION=$(grep "^[^#;]" $PROFILES/arm-profiles/services/$EDITION | awk '{print $1}') SRV_EDITION=$(grep "^[^#;]" $PROFILES/arm-profiles/services/$EDITION | awk '{print $1}')
# Remove '/dev/' from the name
DEV_NAME=`echo "$SDCARD" | cut -d "/" -f 3`
# Get size of SDCard (final sector)
SECTOR_SIZE=`cat /sys/block/${DEV_NAME}/size`
# Set the ending sector that the partition should be resized too
END_SECTOR=`expr $SECTOR_SIZE - 1`
# Commands # Commands
create_rootfs_installer create_rootfs_installer
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment