Browse Source

minor update

Daniel Tartavel 3 years ago
parent
commit
8cdf11965a

+ 80 - 45
create_arm_img_urpmi.sh

@@ -69,7 +69,7 @@ function help()
69 69
 	echo "--create-image		Create the image of Mageia $MAGEIA_VERSION"
70 70
 	echo "--build-path			Path to the build directory of the image of Mageia $MAGEIA_VERSION"
71 71
 	echo "--target 				target system (for now rpi, odroid)"
72
-	echo "--target-version      version of the taget (0, 1, 2, 3 for rpi, 3 or 4 for odroid)"
72
+	echo "--target-version      version of the taget (0, 1, 2, 3 for rpi, xu3 or xu4 for odroid)"
73 73
 	echo "--config				Path to config files"
74 74
 	echo "--bootfs              filesystem of boot partition (ext4 or vfat) default: etx4"
75 75
 	echo -e "\nFor image size, make sure it fit on physical support. (Default size is 7 Go)"
@@ -279,12 +279,14 @@ EOF" >>"$BUILD_PATH/second_stage_install.sh"
279 279
 
280 280
 
281 281
 	case $TARGET in
282
-		ODROID)
282
+		odroid)
283 283
 			#TEMPORARY CODE
284 284
 			#copying kernel odroid not existing in mageia repos
285
-			info "copying kernel-odroid rpm in $BUILD_PATH/root"
285
+			info "copying kernel-odroid and u-boot rpms in $BUILD_PATH/root"
286 286
 			echo "/bin/cp $SOURCE_PATH/$CONFIG_PATH/kernel-odroid-4.14.y-1.armv7hl.rpm $BUILD_PATH/root/"
287 287
 			/usr/bin/cp "$SOURCE_PATH/$CONFIG_PATH/kernel-odroid-4.14.y-1.armv7hl.rpm" "$BUILD_PATH/root/"
288
+			echo "/bin/cp $SOURCE_PATH/$CONFIG_PATH/u-boot-20180507-3.mga7.armv7hl.rpm $BUILD_PATH/root/"
289
+			/usr/bin/cp "$SOURCE_PATH/$CONFIG_PATH/u-boot-20180507-3.mga7.armv7hl.rpm" "$BUILD_PATH/root/"
288 290
 			if [ $? -ne 0 ];then
289 291
 				error "line $LINENO error copying $SOURCE_PATH/$CONFIG_PATH/kernel-odroid-4.14.y-1.armv7hl.rpm : exiting"
290 292
 				exit 1
@@ -426,8 +428,20 @@ createimage()
426 428
 		error "line $LINENO can't make image at $INSTALL_PATH/$IMAGE : exiting"
427 429
 		exit 1
428 430
 	fi
429
-	info "making partitions"
430 431
 	DEVICE=$(/sbin/losetup -f --show "$INSTALL_PATH/$IMAGE")
432
+	if [ $TARGET = "odroid" ];then
433
+		info "installing blobs"
434
+		pushd "$SOURCE_PATH/$CONFIG_PATH/sd_fuse"
435
+		if [ $? -ne 0 ];then
436
+			error "line $LINENO error directory $SOURCE_PATH/$CONFIG_PATH/sd_fuse does not exists : exiting"
437
+			exit 1
438
+		else
439
+			./sd_fusing.sh "$DEVICE"
440
+		fi
441
+		pushd
442
+	fi
443
+
444
+	info "making partitions"
431 445
 	/sbin/fdisk "$DEVICE" << EOF
432 446
 n
433 447
 p
@@ -511,12 +525,12 @@ copyingsystem()
511 525
 
512 526
 	info "making /etc/fstab"
513 527
 	echo "proc            /proc           proc    defaults        0       0
514
-UUID=$BOOT_UUID  /mnt/rpi_boot   vfat    defaults        0       0
528
+UUID=$BOOT_UUID  /mnt/arm_boot   vfat    defaults        0       0
515 529
 UUID=$ROOT_UUID  /               ext4    defaults        0       0" > "$BUILD_PATH"/etc/fstab
516 530
 
517 531
 info "making /boot/extlinux/extlinux.conf"
518 532
 mkdir -p "$BUILD_PATH/boot/extlinux"
519
-sed -e s/\<UUID\>/$ROOT_UUID/g $SOURCE_PATH/$CONFIG_PATH/extlinux.conf >"$BUILD_PATH/boot/extlinux/extlinux.conf"
533
+sed 212!!;n**ù**:;ncq       -e s/\<UUID\>/$ROOT_UUID/g $SOURCE_PATH/$CONFIG_PATH/extlinux.conf >"$BUILD_PATH/boot/extlinux/extlinux.conf"
520 534
 KERNEL_ID=`basename $BUILD_PATH/usr/lib/linux-*`
521 535
 sed -i -e s/\<FDTDIR\>/$KERNEL_ID/g "$BUILD_PATH/boot/extlinux/extlinux.conf"
522 536
 
@@ -531,9 +545,9 @@ snd_bcm2835
531 545
 vc4
532 546
 brcmfmac" >> "$BUILD_PATH"/etc/modules
533 547
 
534
-			RPI_BOOT="$BUILD_PATH/mnt/rpi_boot"
535
-			if ! [ -d "$RPI_BOOT" ];then
536
-				mkdir -p "$RPI_BOOT"
548
+			ARM_BOOT="$BUILD_PATH/mnt/arm_boot"
549
+			if ! [ -d "$ARM_BOOT" ];then
550
+				mkdir -p "$ARM_BOOT"
537 551
 			fi
538 552
 			info "copying modprobe.conf"
539 553
 			/bin/cp -a "$SOURCE_PATH/$CONFIG_PATH/modprobe.conf" "$BUILD_PATH/etc/"
@@ -541,32 +555,32 @@ brcmfmac" >> "$BUILD_PATH"/etc/modules
541 555
 
542 556
 			info "copying firmware, overlays in rpi boot partition"
543 557
 #			cp -a "$BUILD_PATH/usr/lib/linux-"* "$BOOT/dtb"
544
-			cp -av "$FIRMWARE_PATH/$FIRMWARE_DIR/boot/start"* "$RPI_BOOT/"
545
-			cp -av "$FIRMWARE_PATH/$FIRMWARE_DIR/boot/fixup"* "$RPI_BOOT/"
546
-			cp -av "$FIRMWARE_PATH/$FIRMWARE_DIR/boot/bootcode.bin"* "$RPI_BOOT/"
547
-			cp -av "$FIRMWARE_PATH/$FIRMWARE_DIR/boot/overlays" "$RPI_BOOT/"
558
+			cp -av "$FIRMWARE_PATH/$FIRMWARE_DIR/boot/start"* "$ARM_BOOT/"
559
+			cp -av "$FIRMWARE_PATH/$FIRMWARE_DIR/boot/fixup"* "$ARM_BOOT/"
560
+			cp -av "$FIRMWARE_PATH/$FIRMWARE_DIR/boot/bootcode.bin"* "$ARM_BOOT/"
561
+			cp -av "$FIRMWARE_PATH/$FIRMWARE_DIR/boot/overlays" "$ARM_BOOT/"
548 562
 
549
-			info "copying u-boot binary to $RPI_BOOT"
563
+			info "copying u-boot binary to $ARM_BOOT"
550 564
 			case $TARGET_VERSION in
551 565
 				2)
552 566
 					info "copying u-boot for $TARGET 2"
553
-					cp "$BUILD_PATH/usr/lib/u-boot/rpi_2/u-boot.bin" "$RPI_BOOT/kernel7.img"
567
+					cp "$BUILD_PATH/usr/lib/u-boot/rpi_2/u-boot.bin" "$ARM_BOOT/kernel7"
554 568
 					;;
555 569
 				0)
556 570
 					info "copying u-boot for $TARGET 0"
557
-					cp "$BUILD_PATH/usr/lib/u-boot/rpi_0_w/u-boot.bin" "$RPI_BOOT/kernel7.img"
571
+					cp "$BUILD_PATH/usr/lib/u-boot/rpi_0_w/u-boot.bin" "$ARM_BOOT/kernel7"
558 572
 					;;
559 573
 				1)
560 574
 					info "copying u-boot for $TARGET 1"
561
-					cp "$BUILD_PATH/usr/lib/u-boot/rpi/u-boot.bin" "$RPI_BOOT/kernel7.img"
575
+					cp "$BUILD_PATH/usr/lib/u-boot/rpi/u-boot.bin" "$ARM_BOOT/kernel7"
562 576
 					;;
563 577
 				3_32)
564 578
 					info "copying u-boot for $TARGET 3 32 bits"
565
-					cp "$BUILD_PATH/usr/lib/u-boot/rpi_3_32b/u-boot.bin" "$RPI_BOOT/kernel7.img"
579
+					cp "$BUILD_PATH/usr/lib/u-boot/rpi_3_32b/u-boot.bin" "$ARM_BOOT/kernel7"
566 580
 					;;
567 581
 				3+)
568 582
 					info "copying u-boot for $TARGET 3b+ 32 bits"
569
-					cp "$BUILD_PATH/usr/lib/u-boot/rpi_3_32b/u-boot.bin" "$RPI_BOOT/kernel7.img"
583
+					cp "$BUILD_PATH/usr/lib/u-boot/rpi_3_32b/u-boot.bin" "$ARM_BOOT/kernel7"
570 584
 					;;
571 585
 			esac
572 586
 
@@ -586,30 +600,36 @@ brcmfmac" >> "$BUILD_PATH"/etc/modules
586 600
 			fi
587 601
 
588 602
 			info "copying Mageia image to root partition"
589
-			/bin/rsync -a --exclude "$RPI_BOOT/" --exclude "qemu-arm-static*" "$BUILD_PATH/" "$ROOT/"
590
-			/bin/rsync -a "$RPI_BOOT/" "$BOOT/"
603
+			/bin/rsync -a --exclude "$ARM_BOOT/" --exclude "qemu-arm-static*" "$BUILD_PATH/" "$ROOT/"
604
+			/bin/rsync -a "$ARM_BOOT/" "$BOOT/"
591 605
 			;;
592 606
 		odroid)
593 607
 			ODROID_BOOT="$BUILD_PATH/mnt/odroid_boot"
594 608
 			if ! [ -d "$ODROID_BOOT" ];then
595 609
 				mkdir -p "$ODROID_BOOT"
596 610
 			fi
611
+			case $TARGET_VERSION in
612
+				xu4)
613
+					info "copying u-boot for $TARGET $TARGET_VERSION"
614
+					cp "$BUILD_PATH/usr/lib/u-boot/$TARGET-$TARGET_VERSION/u-boot.bin" "$ARM_BOOT/"
615
+					;;
616
+			esac
617
+			# temporary code waiting inclusion of xu4 in Mageia kernel and u-boot
618
+
597 619
 			info "Copying extlinux.conf on $ODROID_BOOT"
598 620
 			cp -R "$BUILD_PATH/boot/extlinux" "$ODROID_BOOT/"
599
-			info "copying u-boot to $ODROID_BOOT for $TARGET $TARGET_VERSION"
600
-			cp "$BUILD_PATH/usr/lib/u-boot/$TARGET-$TARGET_VERSION/u-boot.bin" "$ODROID_BOOT/"
601 621
 			info "copying Mageia image to root partition"
602 622
 			/bin/rsync -a --exclude "$ODROID_BOOT/" --exclude "qemu-arm-static*" "$BUILD_PATH/" "$ROOT/"
603 623
 			/bin/rsync -a "$ODROID_BOOT/" "$BOOT/"
604 624
 			;;
605 625
 	esac
606 626
 
607
-	info "copying tools in /usr/local/bin/"
608
-	/bin/cp -a "$SOURCE_PATH/tools/" "$BUILD_PATH/usr/local/bin/"
609
-	if ! [ $? -eq 0 ];then
610
-		error "line $LINENO error copying tools"
611
-		ERRORN=$((ERRORN++))
612
-	fi
627
+#	info "copying tools in /usr/local/bin/"
628
+#	/bin/cp -a "$SOURCE_PATH/tools/" "$BUILD_PATH/usr/local/bin/"
629
+#	if ! [ $? -eq 0 ];then
630
+#		error "line $LINENO error copying tools"
631
+#		ERRORN=$((ERRORN++))
632
+#	fi
613 633
 #	/bin/mkdir "$ROOT/boot"
614 634
 
615 635
 	copyingcommon
@@ -636,7 +656,7 @@ copyingcommon()
636 656
 {
637 657
 	title "Copying common files and configuration"
638 658
 	rsync -aP "$SOURCE_PATH/common/" "$ROOT/"
639
-	rsync -aP "$SOURCE_PATH/tools/*.sh" "$ROOT/usr/local/bin/"
659
+	rsync -aP "$SOURCE_PATH/tools/"*.sh "$ROOT/usr/local/bin/"
640 660
 	chown root:root "$ROOT/usr/local/bin/"
641 661
 }
642 662
 
@@ -669,11 +689,11 @@ do
669 689
 		shift
670 690
 		;;
671 691
 	--size)
672
-		IMAGE_SIZE=$2
692
+		IMAGE_SIZE_P=$2
673 693
 		shift 2
674 694
 		;;
675 695
 	--build-path)
676
-		INSTALL_PATH="$2"
696
+		INSTALL_PATH_P="$2"
677 697
 		shift 2
678 698
 		;;
679 699
 	--chroot)
@@ -714,11 +734,11 @@ do
714 734
 		shift
715 735
 		;;
716 736
 	--target)
717
-		TARGET=$2
737
+		TARGET_P=$2
718 738
 		shift 2
719 739
 		;;
720 740
 	--target-version)
721
-		TARGET_VERSION=$2
741
+		TARGET_VERSION_P=$2
722 742
 		shift 2
723 743
 		;;
724 744
 	--config)
@@ -726,7 +746,7 @@ do
726 746
 		shift 2
727 747
 		;;
728 748
 	--bootfs)
729
-		BOOTFS=$2
749
+		BOOTFS_P=$2
730 750
 		shift 2
731 751
 		;;
732 752
 	--)
@@ -739,19 +759,10 @@ do
739 759
 done
740 760
 
741 761
 
742
-
743
-info "Option: "$OPT
744
-
745
-IMAGE="Mageia-${MAGEIA_VERSION}-$TARGET$TARGET_VERSION.img"
746
-BOOT="/mnt/boot"
747
-ROOT="/mnt/root"
748
-BUILD_PATH="$INSTALL_PATH/build"
749
-ARM_VERSION="armv7hl"
750
-
751 762
 # path of config file
752 763
 if ! [ -d "$SOURCE_PATH/$CONFIG_PATH" ];then
753 764
 	info " Config path does not exists, defaulting to ./$TARGET"
754
-	CONFIG_PATH="$SOURCE_PATH/$TARGET"
765
+	CONFIG_PATH="$TARGET"
755 766
 fi
756 767
 
757 768
 if [ -d "$SOURCE_PATH/$CONFIG_PATH" ];then
@@ -778,6 +789,29 @@ else
778 789
 	fi
779 790
 fi
780 791
 
792
+if ! [ -z "$IMAGE_SIZE_P" ];then
793
+	IMAGE_SIZE=$IMAGE_SIZE_P
794
+fi
795
+if ! [ -z "$INSTALL_PATH_P" ];then
796
+	INSTALL_PATH=$INSTALL_PATH_P
797
+fi
798
+if ! [ -z "$TARGET_P" ];then
799
+	TARGET=$TARGET_P
800
+fi
801
+if ! [ -z "$TARGET_VERSION_P" ];then
802
+	TARGET_VERSION=$TARGET_VERSION_P
803
+fi
804
+if ! [ -z "$BOOTFS_P" ];then
805
+	BOOTFS=$BOOTFS_P
806
+fi
807
+info "Option: "$OPT
808
+
809
+IMAGE="Mageia-${MAGEIA_VERSION}-$TARGET$TARGET_VERSION.img"
810
+BOOT="/mnt/boot"
811
+ROOT="/mnt/root"
812
+BUILD_PATH="$INSTALL_PATH/build"
813
+ARM_VERSION="armv7hl"
814
+
781 815
 # assign function for building image of TARGET ( rpi, odroid )
782 816
 case $TARGET in
783 817
 odroid)
@@ -793,6 +827,7 @@ rpi)
793 827
 esac
794 828
 
795 829
 info "target : $TARGET"
830
+info "target_version : $TARGET_VERSION"
796 831
 info "source path: $SOURCE_PATH"
797 832
 info "Install path: $INSTALL_PATH"
798 833
 info "Build path: $BUILD_PATH"

+ 5 - 5
mageia4arm.cfg.template

@@ -21,10 +21,10 @@ MAGEIA_VERSION=""
21 21
 # TO MODIFY
22 22
 ARM_VERSION=""
23 23
 
24
-# Target plateform (xu or rpi)
24
+# Target plateform (odroid or rpi)
25 25
 # TO MODIFY
26 26
 TARGET=""
27
-# Target version (0,2,3 for raspi, 3or 4 for odroid)
27
+# Target version (0,2,3 for raspi, 3 or 4 for odroid)
28 28
 #TO MODIFY
29 29
 TARGET_VERSION=""
30 30
 
@@ -53,8 +53,8 @@ PASSWORD="user password"
53 53
 #root password
54 54
 ROOT_PWD="root password"
55 55
 
56
-#Hostname 
57
-HOSTNAME="$TARGET.$ID_USER" 
56
+#Hostname
57
+HOSTNAME="$TARGET.$ID_USER"
58 58
 
59 59
 #Filesystem of boot partitions (default ext4 raspberry pi need vfat)
60 60
 #BOOTFS=ext4
@@ -62,5 +62,5 @@ HOSTNAME="$TARGET.$ID_USER"
62 62
 #kernel package to install (just needed for odroid)
63 63
 #KERNEL=kernel-odroid
64 64
 
65
-#Path where the raspberry pi firmware is/will be installed
65
+#Path where the raspberry pi firmware is/will be installed ( just needed for raspberry pi )
66 66
 FIRMWARE_PATH="$INSTALL_PATH/"

+ 1 - 1
xu4/second_stage_install.sh

@@ -24,7 +24,7 @@
24 24
 
25 25
 /usr/sbin/urpmi --auto --no-verify-rpm /root/kernel-odroid-4.14.y-1.armv7hl.rpm basesystem chrony rng-tools man openssh-server rfkill wireless-tools bluez wpa_supplicant make dracut u-boot-tools rsync kernel-desktop-latest
26 26
 #/usr/sbin/urpmi --urpmi-root "$BUILD_PATH"  --ignorearch --no-verify-rpm --auto --split-level 200 --split-length 200
27
-
27
+/usr/sbin/urpmi --auto --no-verify-rpm /root/u-boot-20180507-3.mga7.armv7hl.rpm
28 28
 /usr/bin/chown :chrony -R /etc/chrony.keys /var/log/chrony
29 29
 /usr/bin/chown :daemon /etc/wpa_supplicant.conf
30 30
 /usr/bin/chown :tty /bin/write /bin/wall

BIN
xu4/u-boot-20180507-3.mga7.armv7hl.rpm