From 89849e135325b414da60e86cfa40ff5b5b78f3f1 Mon Sep 17 00:00:00 2001 From: Daniel Tartavel Date: Sun, 22 Jul 2018 14:20:42 +0200 Subject: [PATCH] - First commit of directory common --- common/etc/hostname | 1 + .../etc/sysconfig/network-scripts/ifcfg-eth0 | 16 +++++++++++ create_arm_img_urpmi.sh | 27 ++++++++++--------- 3 files changed, 32 insertions(+), 12 deletions(-) create mode 100644 common/etc/hostname create mode 100755 common/etc/sysconfig/network-scripts/ifcfg-eth0 diff --git a/common/etc/hostname b/common/etc/hostname new file mode 100644 index 0000000..8d1c8b6 --- /dev/null +++ b/common/etc/hostname @@ -0,0 +1 @@ + diff --git a/common/etc/sysconfig/network-scripts/ifcfg-eth0 b/common/etc/sysconfig/network-scripts/ifcfg-eth0 new file mode 100755 index 0000000..d6bf1a6 --- /dev/null +++ b/common/etc/sysconfig/network-scripts/ifcfg-eth0 @@ -0,0 +1,16 @@ +DEVICE=eth0 +BOOTPROTO=dhcp +ONBOOT=yes +METRIC=10 +MII_NOT_SUPPORTED=no +USERCTL=yes +RESOLV_MODS=no +IPV6INIT=no +IPV6TO4INIT=no +ACCOUNTING=no +NM_CONTROLLED=no +DHCP_CLIENT=dhclient +NEEDHOSTNAME=no +PEERDNS=yes +PEERYP=yes +PEERNTPD=no diff --git a/create_arm_img_urpmi.sh b/create_arm_img_urpmi.sh index 03ab716..18680c5 100755 --- a/create_arm_img_urpmi.sh +++ b/create_arm_img_urpmi.sh @@ -409,39 +409,35 @@ EOF info "device $DEVICE" info "partitions list:" info "$(/sbin/partx -v "$INSTALL_PATH/$IMAGE")" + BOOTP="${DEVICE}p1" + ROOTP="${DEVICE}p2" } formatpartitions() { info "Formatting partitions" - info "boot as $1" + info "Boot : $BOOTP as $1" "/sbin/mkfs.$1" "$BOOTP" if [ $? -ne 0 ];then error "line $LINENO error formating $BOOTP : exiting" /sbin/losetup -d "$DEVICE" exit 1 fi - info "root as $2" + info "Root : $ROOTP as $2" "/sbin/mkfs.$2" "$ROOTP" if [ $? -ne 0 ];then error "line $LINENO error formating $ROOTP : exiting" /sbin/losetup -d "$DEVICE" exit 1 fi - BOOTP="${DEVICE}p1" - BOOT_UUID=$(blkid -o value uuid "$BOOTP" | head -n 1) + BOOT_UUID=$(blkid -s UUID -o value UUID "$BOOTP") info "Boot UUID: $BOOT_UUID" - ROOTP="${DEVICE}p2" - ROOT_UUID=$(blkid -o value uuid "$ROOTP" | head -n 1) + ROOT_UUID=$(blkid -s UUID -o value UUID "$ROOTP") info "Root UUID: $ROOT_UUID" } copyingsystem() { - #getting UUID of root partition - #ROOT_ID=`/sbin/blkid -s UUID -o value "${DEVICE}p2"` - #info "blkid -s UUID -o value ${DEVICE}p2" - #info "root partition ID: $ROOT_ID" info "mounting partitions, creating mountpoint if necessary" if ! [ -d "$BOOT" ];then /bin/mkdir "$BOOT" @@ -468,7 +464,7 @@ copyingsystem() exit 1 fi - info "copying Mageia image to root parition" + info "copying Mageia image to root partition" /bin/rsync -a --exclude boot/ --exclude "qemu-arm-static*" "$BUILD_PATH/" "$ROOT/" /bin/rsync -a "$BUILD_PATH/boot/" "$BOOT/" @@ -516,7 +512,7 @@ brcmfmac" >> "$BUILD_PATH"/etc/modules xu3-4) ;; esac - + copyingcommon /usr/bin/sync /usr/bin/umount "$BOOT" "$ROOT" if [ $? -eq 0 ];then @@ -534,6 +530,13 @@ brcmfmac" >> "$BUILD_PATH"/etc/modules warning "You can now burn the image ( $IMAGE ) on SD card" } +# Copying files common to all systems +copyingcommon() +{ + rsync -aP "$SOURCE_PATH/common/" "$ROOT/" + +} + if [ $# == 0 ];then help exit