1
0

- First commit of directory common

This commit is contained in:
Daniel Tartavel 2018-07-22 14:20:42 +02:00
parent 49d9c6c5cd
commit 89849e1353
3 changed files with 32 additions and 12 deletions

1
common/etc/hostname Normal file
View File

@ -0,0 +1 @@

View File

@ -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

View File

@ -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