diff options
author | Daniel Tartavel <contact@librepc.com> | 2019-05-08 14:59:04 +0200 |
---|---|---|
committer | Daniel Tartavel <contact@librepc.com> | 2019-05-08 14:59:04 +0200 |
commit | 22115e7251b4526913948ab0b8780c8419cb6682 (patch) | |
tree | 548f1e3abeab19d5ac681ede794474c62cc4e369 /create_arm_img_urpmi.sh | |
parent | 84b5df020bfecc1a816a9775a7638cdb745b41f8 (diff) | |
download | mageia4arm-22115e7251b4526913948ab0b8780c8419cb6682.tar mageia4arm-22115e7251b4526913948ab0b8780c8419cb6682.tar.gz mageia4arm-22115e7251b4526913948ab0b8780c8419cb6682.tar.bz2 mageia4arm-22115e7251b4526913948ab0b8780c8419cb6682.tar.xz mageia4arm-22115e7251b4526913948ab0b8780c8419cb6682.zip |
prise en charge du 3b+ et ajustements mineurs
Diffstat (limited to 'create_arm_img_urpmi.sh')
-rwxr-xr-x | create_arm_img_urpmi.sh | 69 |
1 files changed, 50 insertions, 19 deletions
diff --git a/create_arm_img_urpmi.sh b/create_arm_img_urpmi.sh index a42c05b..84a10e3 100755 --- a/create_arm_img_urpmi.sh +++ b/create_arm_img_urpmi.sh @@ -62,17 +62,21 @@ function help() echo "--all create ready to burn image of Mageia $MAGEIA_VERSION" echo "--clean Clean all (suppress all) to make a new image" echo "--size size of image default: 7Go" + echo "--build-path Path to the build directory of the image of Mageia $MAGEIA_VERSION" + echo "--target target system (for now rpi, odroid)" + echo "--target-version version of the target (0, 1, 2, 3 for rpi, 3 or 4 for odroid)" + echo "--config Path to config files" + echo "--bootfs filesystem of boot partition (ext4 or vfat) default: ext4" + echo "--nonfree activate nonfree repos" + echo "--tainted activate tainted repos" + echo "\nBuild levels:" echo "--create-chroot Create the chroot directory" echo "--addmedia add mirrors" echo "--update-mirror update urpmi database" echo "--install-basesystem install base system" echo "--chroot chroot to arm directory and launch packages installation" echo "--create-image Create the image of Mageia $MAGEIA_VERSION" - echo "--build-path Path to the build directory of the image of Mageia $MAGEIA_VERSION" - echo "--target target system (for now rpi, odroid)" - echo "--target-version version of the target (0, 1, 2, 3 for rpi, 3 or 4 for odroid)" - echo "--config Path to config files" - echo "--bootfs filesystem of boot partition (ext4 or vfat) default: ext4" + echo -e "\nFor image size, make sure it fit on physical support. (Default size is 7 Go)" } @@ -182,12 +186,23 @@ function addmedia() error "line $LINENO error $err - can't add medias from $MIRROR : exiting" exit 1 fi - title "activating non-free and tainted" - /sbin/urpmi.update --urpmi-root "$BUILD_PATH" --no-ignore Nonfree\ Release Nonfree\ Updates Tainted\ Release Tainted\ Updates - err=$? - if [ $err -ne 0 ];then - error "line $LINENO error $err - can't activate medias : exiting" - exit 1 + if [ $NONFREE -eq 1 ];then + title "activating non-free repos" + /sbin/urpmi.update --urpmi-root "$BUILD_PATH" --no-ignore Nonfree\ Release Nonfree\ Updates + err=$? + if [ $err -ne 0 ];then + error "line $LINENO error $err - can't activate medias nonfree : exiting" + exit 1 + fi + fi + if [ $TAINTED -eq 1 ];then + title "activating tainted repos" + /sbin/urpmi.update --urpmi-root "$BUILD_PATH" --no-ignore Tainted\ Release Tainted\ Updates + err=$? + if [ $err -ne 0 ];then + error "line $LINENO error $err - can't activate medias tainted : exiting" + exit 1 + fi fi } @@ -536,12 +551,15 @@ copyingsystem() UUID=$BOOT_UUID /mnt/arm_boot vfat defaults 0 0 UUID=$ROOT_UUID / ext4 defaults 0 0" > "$BUILD_PATH"/etc/fstab -info "making /boot/extlinux/extlinux.conf" -mkdir -p "$BUILD_PATH/boot/extlinux" -sed -e s/\<UUID\>/$ROOT_UUID/g $SOURCE_PATH/$CONFIG_PATH/extlinux.conf >"$BUILD_PATH/boot/extlinux/extlinux.conf" -KERNEL_ID=`basename $BUILD_PATH/usr/lib/linux-*` -sed -i -e s/\<FDTDIR\>/$KERNEL_ID/g "$BUILD_PATH/boot/extlinux/extlinux.conf" - + if [ ! -d "$BUILD_PATH/boot/extlinux" ];then + info "making /boot/extlinux/extlinux.conf" + mkdir -p "$BUILD_PATH/boot/extlinux" + fi + if [ ! -f "$BUILD_PATH/boot/extlinux/extlinux.conf" ];then + sed -e s/\<UUID\>/$ROOT_UUID/g $SOURCE_PATH/$CONFIG_PATH/extlinux.conf >"$BUILD_PATH/boot/extlinux/extlinux.conf" + KERNEL_ID=`basename $BUILD_PATH/usr/lib/linux-*` + sed -i -e s/\<FDTDIR\>/$KERNEL_ID/g "$BUILD_PATH/boot/extlinux/extlinux.conf" + fi case $TARGET in rpi) @@ -566,7 +584,7 @@ brcmfmac" >> "$BUILD_PATH"/etc/modules cp -v --preserve=mode "$FIRMWARE_PATH/$FIRMWARE_DIR/boot/start"* "$ARM_BOOT/" cp -v --preserve=mode "$FIRMWARE_PATH/$FIRMWARE_DIR/boot/fixup"* "$ARM_BOOT/" cp -v --preserve=mode "$FIRMWARE_PATH/$FIRMWARE_DIR/boot/bootcode.bin"* "$ARM_BOOT/" - cp -v --preserve=mode "$FIRMWARE_PATH/$FIRMWARE_DIR/boot/overlays" "$ARM_BOOT/" + cp -vR --preserve=mode "$FIRMWARE_PATH/$FIRMWARE_DIR/boot/overlays" "$ARM_BOOT/" info "copying u-boot binary to $ARM_BOOT" case $TARGET_VERSION in @@ -675,7 +693,7 @@ fi # parsing commandline -TEMP=$(getopt -o h,a --long all,help,clean,create-chroot,addmedia,create-image,,config:,target:,target-version:,chroot,bootfs:,install-basesystem,update-mirror,build-path:,size: -n $CMDNAME -- "$@") +TEMP=$(getopt -o h,a --long all,help,clean,create-chroot,addmedia,create-image,,config:,target:,target-version:,chroot,bootfs:,install-basesystem,update-mirror,build-path:,size:,nonfree,tainted -n $CMDNAME -- "$@") if [ $? -ne 0 ] ; then error "line $LINENO Failed parsing options." >&2 ; exit 1 ; fi eval set -- "$TEMP" @@ -757,6 +775,12 @@ do BOOTFS_P=$2 shift 2 ;; + --nonfree) + NONFREE_P=1 + ;; + --tainted) + TAINTED_P=1 + ;; --) shift break;; @@ -812,6 +836,13 @@ fi if ! [ -z "$BOOTFS_P" ];then BOOTFS=$BOOTFS_P fi +if ! [ -z "$NONFREE_P" ];then + NONFREE=$NONFREE_P +fi +if ! [ -z "$TAINTED_P" ];then + TAINTED=$TAINTED_P +fi + info "Option: "$OPT IMAGE="Mageia-${MAGEIA_VERSION}-$TARGET$TARGET_VERSION.img" |