diff options
author | Daniel Tartavel <contact@librepc.com> | 2018-10-14 21:08:55 +0200 |
---|---|---|
committer | Daniel Tartavel <contact@librepc.com> | 2018-10-14 21:08:55 +0200 |
commit | 1e5184088c8412620c86b81ac2c98d0a18c5cb32 (patch) | |
tree | 43a592a7935c90f4656f096cc7cf56e3b95dae34 /create_arm_img_urpmi.sh | |
parent | 4796b8a6a73c2b3f474e0d8b5e48945e818d733b (diff) | |
download | mageia4arm-1e5184088c8412620c86b81ac2c98d0a18c5cb32.tar mageia4arm-1e5184088c8412620c86b81ac2c98d0a18c5cb32.tar.gz mageia4arm-1e5184088c8412620c86b81ac2c98d0a18c5cb32.tar.bz2 mageia4arm-1e5184088c8412620c86b81ac2c98d0a18c5cb32.tar.xz mageia4arm-1e5184088c8412620c86b81ac2c98d0a18c5cb32.zip |
Added raspberry pi bootstrap in /boot
Diffstat (limited to 'create_arm_img_urpmi.sh')
-rwxr-xr-x | create_arm_img_urpmi.sh | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/create_arm_img_urpmi.sh b/create_arm_img_urpmi.sh index 47c1904..f074ef3 100755 --- a/create_arm_img_urpmi.sh +++ b/create_arm_img_urpmi.sh @@ -59,6 +59,7 @@ function help() echo "$CMDNAME [option] [size of image in Go]" echo "Options:" 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 "--create-chroot Create the chroot directory" echo "--addmedia add mirrors" @@ -67,7 +68,7 @@ function help() 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, xu3, xu4)" +# echo "--target target system (for now rpi, xu3, xu4)" echo "--config Path to config files" echo "--bootfs filesystem of boot partition (ext4 or vfat) default: etx4" echo -e "\nFor image size, make sure it fit on physical support. (Default size is 7 Go)" @@ -161,12 +162,20 @@ function createchroot() fi fi - title "Creating $BUILD_PATH" - /bin/mkdir -p "$BUILD_PATH/usr/bin" "$BUILD_PATH/usr/lib/binfmt.d" - if [ $? -ne 0 ];then - error "line $LINENO can't create $BUILD_PATH : exiting" - exit 1 - fi + + if ! [ -d "$BUILD_PATH" ];then + warning "Build path does not exists, do you want i create it ? [Y|n] " + read yn + if [ -z $yn ] || [ $yn = "Y" ] || [ $yn = "y" ];then + title "Creating $BUILD_PATH" + /bin/mkdir -p "$BUILD_PATH/usr/bin" "$BUILD_PATH/usr/lib/binfmt.d" + if [ $? -ne 0 ];then + error "line $LINENO can't create $BUILD_PATH : exiting" + exit 1 + fi + else + exit 1 + fi /bin/cp /bin/qemu-arm-static "$BUILD_PATH/usr/bin/" if [ $? -ne 0 ];then error "line $LINENO can't copy /bin/qemu-user-static to $BUILD_PATH/usr/bin/ : exiting" @@ -489,8 +498,11 @@ UUID=$ROOT_UUID / ext4 defaults 0 0" > "$BUILD_PA rpi) # info "copying raspberry firmware in /boot" # /bin/rsync -rlptDH "$FIRMWARE_PATH/firmware-stable/boot/" "$BOOT" -# cp -a "$FIRMWARE_PATH/firmware-stable/extra/uname_string" "$BOOT" -# cp -a "$FIRMWARE_PATH/firmware-stable/extra/uname_string7" "$BOOT" +#TODO copy to bootstrap /boot + cp -a "$FIRMWARE_PATH/firmware-stable/boot/start*" "$BOOT" + cp -a "$FIRMWARE_PATH/firmware-stable/boot/fixup*" "$BOOT" + cp -a "$FIRMWARE_PATH/firmware-stable/extra/uname_string" "$BOOT" + cp -a "$FIRMWARE_PATH/firmware-stable/extra/uname_string7" "$BOOT" info "copying config.txt, boot.cmd and 10-vchiq-permissions.rules" cp "$SOURCE_PATH/$CONFIG_PATH/config.txt" "$BOOT" cp "$SOURCE_PATH/$CONFIG_PATH/boot.cmd" "$BOOT" @@ -508,7 +520,6 @@ brcmfmac" >> "$BUILD_PATH"/etc/modules echo "dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait fsck.repair=1" > "$BOOT/cmdline.txt" # info "copying raspberry modules in /lib/modules" # /bin/rsync -rlptDH "$FIRMWARE_PATH/firmware-stable/modules/" "$BUILD_PATH/lib/modules/" - # info "copying raspberry optionals files in opt" # /bin/rsync -rlptDH "$FIRMWARE_PATH/firmware-stable/opt/" "$BUILD_PATH/opt/" @@ -650,6 +661,9 @@ do --) shift break;; + *) + error "Parameter $1 does not exists " + exit 1;; esac done @@ -679,7 +693,7 @@ if [ -d "$SOURCE_PATH/$CONFIG_PATH" ];then if [ -z $yn ] || [ $yn = "Y" ] || [ $yn = "y" ];then /usr/bin/cp "$SOURCE_PATH/mageia4arm.cfg.template" "$SOURCE_PATH/$CONFIG_PATH/mageia4arm.cfg" warning "You need now to modify the config file ($SOURCE_PATH/$CONFIG_PATH/mageia4arm.cfg) and relaunch the script" - exit 1 + exit 2 fi fi else @@ -689,7 +703,7 @@ else /usr/bin/mkdir "$SOURCE_PATH/$CONFIG_PATH/" /usr/bin/cp "$SOURCE_PATH/config.template" "$SOURCE_PATH/$CONFIG_PATH/mageia4arm.cfg" warning "You need now to modify the config file ($SOURCE_PATH/$CONFIG_PATH/mageia4arm.cfg) and relaunch the script" - exit + exit 2 fi fi |